1#!/usr/bin/env php
2<?php
3if (!version_compare(PHP_VERSION, PHP_VERSION, '=')) {
4    fwrite(
5        STDERR,
6        sprintf(
7            '%s declares an invalid value for PHP_VERSION.' . PHP_EOL .
8            'This breaks fundamental functionality such as version_compare().' . PHP_EOL .
9            'Please use a different PHP interpreter.' . PHP_EOL,
10
11            PHP_BINARY
12        )
13    );
14
15    die(1);
16}
17
18if (version_compare('7.3.0', PHP_VERSION, '>')) {
19    fwrite(
20        STDERR,
21        sprintf(
22            'PHPUnit 9.5.10 by Sebastian Bergmann and contributors.' . PHP_EOL . PHP_EOL .
23            'This version of PHPUnit requires PHP >= 7.3.' . PHP_EOL .
24            'You are using PHP %s (%s).' . PHP_EOL,
25            PHP_VERSION,
26            PHP_BINARY
27        )
28    );
29
30    die(1);
31}
32
33foreach (['dom', 'json', 'libxml', 'mbstring', 'tokenizer', 'xml', 'xmlwriter'] as $extension) {
34    if (extension_loaded($extension)) {
35        continue;
36    }
37
38    fwrite(
39        STDERR,
40        sprintf(
41            'PHPUnit requires the "%s" extension.' . PHP_EOL,
42            $extension
43        )
44    );
45
46    die(1);
47}
48
49if (__FILE__ === realpath($_SERVER['SCRIPT_NAME'])) {
50    $execute = true;
51} else {
52    $execute = false;
53}
54
55$options = getopt('', array('prepend:', 'manifest'));
56
57if (isset($options['prepend'])) {
58    require $options['prepend'];
59}
60
61if (isset($options['manifest'])) {
62    $printManifest = true;
63}
64
65unset($options);
66
67define('__PHPUNIT_PHAR__', str_replace(DIRECTORY_SEPARATOR, '/', __FILE__));
68define('__PHPUNIT_PHAR_ROOT__', 'phar://phpunit-9.5.10.phar');
69
70Phar::mapPhar('phpunit-9.5.10.phar');
71
72spl_autoload_register(
73    function ($class) {
74        static $classes = null;
75
76        if ($classes === null) {
77            $classes = ['PHPUnit\\DeepCopy\\DeepCopy' => '/myclabs-deep-copy/DeepCopy/DeepCopy.php',
78                'PHPUnit\\DeepCopy\\Exception\\CloneException' => '/myclabs-deep-copy/DeepCopy/Exception/CloneException.php',
79                'PHPUnit\\DeepCopy\\Exception\\PropertyException' => '/myclabs-deep-copy/DeepCopy/Exception/PropertyException.php',
80                'PHPUnit\\DeepCopy\\Filter\\Doctrine\\DoctrineCollectionFilter' => '/myclabs-deep-copy/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php',
81                'PHPUnit\\DeepCopy\\Filter\\Doctrine\\DoctrineEmptyCollectionFilter' => '/myclabs-deep-copy/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php',
82                'PHPUnit\\DeepCopy\\Filter\\Doctrine\\DoctrineProxyFilter' => '/myclabs-deep-copy/DeepCopy/Filter/Doctrine/DoctrineProxyFilter.php',
83                'PHPUnit\\DeepCopy\\Filter\\Filter' => '/myclabs-deep-copy/DeepCopy/Filter/Filter.php',
84                'PHPUnit\\DeepCopy\\Filter\\KeepFilter' => '/myclabs-deep-copy/DeepCopy/Filter/KeepFilter.php',
85                'PHPUnit\\DeepCopy\\Filter\\ReplaceFilter' => '/myclabs-deep-copy/DeepCopy/Filter/ReplaceFilter.php',
86                'PHPUnit\\DeepCopy\\Filter\\SetNullFilter' => '/myclabs-deep-copy/DeepCopy/Filter/SetNullFilter.php',
87                'PHPUnit\\DeepCopy\\Matcher\\Doctrine\\DoctrineProxyMatcher' => '/myclabs-deep-copy/DeepCopy/Matcher/Doctrine/DoctrineProxyMatcher.php',
88                'PHPUnit\\DeepCopy\\Matcher\\Matcher' => '/myclabs-deep-copy/DeepCopy/Matcher/Matcher.php',
89                'PHPUnit\\DeepCopy\\Matcher\\PropertyMatcher' => '/myclabs-deep-copy/DeepCopy/Matcher/PropertyMatcher.php',
90                'PHPUnit\\DeepCopy\\Matcher\\PropertyNameMatcher' => '/myclabs-deep-copy/DeepCopy/Matcher/PropertyNameMatcher.php',
91                'PHPUnit\\DeepCopy\\Matcher\\PropertyTypeMatcher' => '/myclabs-deep-copy/DeepCopy/Matcher/PropertyTypeMatcher.php',
92                'PHPUnit\\DeepCopy\\Reflection\\ReflectionHelper' => '/myclabs-deep-copy/DeepCopy/Reflection/ReflectionHelper.php',
93                'PHPUnit\\DeepCopy\\TypeFilter\\Date\\DateIntervalFilter' => '/myclabs-deep-copy/DeepCopy/TypeFilter/Date/DateIntervalFilter.php',
94                'PHPUnit\\DeepCopy\\TypeFilter\\ReplaceFilter' => '/myclabs-deep-copy/DeepCopy/TypeFilter/ReplaceFilter.php',
95                'PHPUnit\\DeepCopy\\TypeFilter\\ShallowCopyFilter' => '/myclabs-deep-copy/DeepCopy/TypeFilter/ShallowCopyFilter.php',
96                'PHPUnit\\DeepCopy\\TypeFilter\\Spl\\ArrayObjectFilter' => '/myclabs-deep-copy/DeepCopy/TypeFilter/Spl/ArrayObjectFilter.php',
97                'PHPUnit\\DeepCopy\\TypeFilter\\Spl\\SplDoublyLinkedList' => '/myclabs-deep-copy/DeepCopy/TypeFilter/Spl/SplDoublyLinkedList.php',
98                'PHPUnit\\DeepCopy\\TypeFilter\\Spl\\SplDoublyLinkedListFilter' => '/myclabs-deep-copy/DeepCopy/TypeFilter/Spl/SplDoublyLinkedListFilter.php',
99                'PHPUnit\\DeepCopy\\TypeFilter\\TypeFilter' => '/myclabs-deep-copy/DeepCopy/TypeFilter/TypeFilter.php',
100                'PHPUnit\\DeepCopy\\TypeMatcher\\TypeMatcher' => '/myclabs-deep-copy/DeepCopy/TypeMatcher/TypeMatcher.php',
101                'PHPUnit\\Doctrine\\Instantiator\\Exception\\ExceptionInterface' => '/doctrine-instantiator/Doctrine/Instantiator/Exception/ExceptionInterface.php',
102                'PHPUnit\\Doctrine\\Instantiator\\Exception\\InvalidArgumentException' => '/doctrine-instantiator/Doctrine/Instantiator/Exception/InvalidArgumentException.php',
103                'PHPUnit\\Doctrine\\Instantiator\\Exception\\UnexpectedValueException' => '/doctrine-instantiator/Doctrine/Instantiator/Exception/UnexpectedValueException.php',
104                'PHPUnit\\Doctrine\\Instantiator\\Instantiator' => '/doctrine-instantiator/Doctrine/Instantiator/Instantiator.php',
105                'PHPUnit\\Doctrine\\Instantiator\\InstantiatorInterface' => '/doctrine-instantiator/Doctrine/Instantiator/InstantiatorInterface.php',
106                'PHPUnit\\Exception' => '/phpunit/Exception.php',
107                'PHPUnit\\Framework\\ActualValueIsNotAnObjectException' => '/phpunit/Framework/Exception/ActualValueIsNotAnObjectException.php',
108                'PHPUnit\\Framework\\Assert' => '/phpunit/Framework/Assert.php',
109                'PHPUnit\\Framework\\AssertionFailedError' => '/phpunit/Framework/Exception/AssertionFailedError.php',
110                'PHPUnit\\Framework\\CodeCoverageException' => '/phpunit/Framework/Exception/CodeCoverageException.php',
111                'PHPUnit\\Framework\\ComparisonMethodDoesNotAcceptParameterTypeException' => '/phpunit/Framework/Exception/ComparisonMethodDoesNotAcceptParameterTypeException.php',
112                'PHPUnit\\Framework\\ComparisonMethodDoesNotDeclareBoolReturnTypeException' => '/phpunit/Framework/Exception/ComparisonMethodDoesNotDeclareBoolReturnTypeException.php',
113                'PHPUnit\\Framework\\ComparisonMethodDoesNotDeclareExactlyOneParameterException' => '/phpunit/Framework/Exception/ComparisonMethodDoesNotDeclareExactlyOneParameterException.php',
114                'PHPUnit\\Framework\\ComparisonMethodDoesNotDeclareParameterTypeException' => '/phpunit/Framework/Exception/ComparisonMethodDoesNotDeclareParameterTypeException.php',
115                'PHPUnit\\Framework\\ComparisonMethodDoesNotExistException' => '/phpunit/Framework/Exception/ComparisonMethodDoesNotExistException.php',
116                'PHPUnit\\Framework\\Constraint\\ArrayHasKey' => '/phpunit/Framework/Constraint/Traversable/ArrayHasKey.php',
117                'PHPUnit\\Framework\\Constraint\\BinaryOperator' => '/phpunit/Framework/Constraint/Operator/BinaryOperator.php',
118                'PHPUnit\\Framework\\Constraint\\Callback' => '/phpunit/Framework/Constraint/Callback.php',
119                'PHPUnit\\Framework\\Constraint\\ClassHasAttribute' => '/phpunit/Framework/Constraint/Object/ClassHasAttribute.php',
120                'PHPUnit\\Framework\\Constraint\\ClassHasStaticAttribute' => '/phpunit/Framework/Constraint/Object/ClassHasStaticAttribute.php',
121                'PHPUnit\\Framework\\Constraint\\Constraint' => '/phpunit/Framework/Constraint/Constraint.php',
122                'PHPUnit\\Framework\\Constraint\\Count' => '/phpunit/Framework/Constraint/Cardinality/Count.php',
123                'PHPUnit\\Framework\\Constraint\\DirectoryExists' => '/phpunit/Framework/Constraint/Filesystem/DirectoryExists.php',
124                'PHPUnit\\Framework\\Constraint\\Exception' => '/phpunit/Framework/Constraint/Exception/Exception.php',
125                'PHPUnit\\Framework\\Constraint\\ExceptionCode' => '/phpunit/Framework/Constraint/Exception/ExceptionCode.php',
126                'PHPUnit\\Framework\\Constraint\\ExceptionMessage' => '/phpunit/Framework/Constraint/Exception/ExceptionMessage.php',
127                'PHPUnit\\Framework\\Constraint\\ExceptionMessageRegularExpression' => '/phpunit/Framework/Constraint/Exception/ExceptionMessageRegularExpression.php',
128                'PHPUnit\\Framework\\Constraint\\FileExists' => '/phpunit/Framework/Constraint/Filesystem/FileExists.php',
129                'PHPUnit\\Framework\\Constraint\\GreaterThan' => '/phpunit/Framework/Constraint/Cardinality/GreaterThan.php',
130                'PHPUnit\\Framework\\Constraint\\IsAnything' => '/phpunit/Framework/Constraint/IsAnything.php',
131                'PHPUnit\\Framework\\Constraint\\IsEmpty' => '/phpunit/Framework/Constraint/Cardinality/IsEmpty.php',
132                'PHPUnit\\Framework\\Constraint\\IsEqual' => '/phpunit/Framework/Constraint/Equality/IsEqual.php',
133                'PHPUnit\\Framework\\Constraint\\IsEqualCanonicalizing' => '/phpunit/Framework/Constraint/Equality/IsEqualCanonicalizing.php',
134                'PHPUnit\\Framework\\Constraint\\IsEqualIgnoringCase' => '/phpunit/Framework/Constraint/Equality/IsEqualIgnoringCase.php',
135                'PHPUnit\\Framework\\Constraint\\IsEqualWithDelta' => '/phpunit/Framework/Constraint/Equality/IsEqualWithDelta.php',
136                'PHPUnit\\Framework\\Constraint\\IsFalse' => '/phpunit/Framework/Constraint/Boolean/IsFalse.php',
137                'PHPUnit\\Framework\\Constraint\\IsFinite' => '/phpunit/Framework/Constraint/Math/IsFinite.php',
138                'PHPUnit\\Framework\\Constraint\\IsIdentical' => '/phpunit/Framework/Constraint/IsIdentical.php',
139                'PHPUnit\\Framework\\Constraint\\IsInfinite' => '/phpunit/Framework/Constraint/Math/IsInfinite.php',
140                'PHPUnit\\Framework\\Constraint\\IsInstanceOf' => '/phpunit/Framework/Constraint/Type/IsInstanceOf.php',
141                'PHPUnit\\Framework\\Constraint\\IsJson' => '/phpunit/Framework/Constraint/String/IsJson.php',
142                'PHPUnit\\Framework\\Constraint\\IsNan' => '/phpunit/Framework/Constraint/Math/IsNan.php',
143                'PHPUnit\\Framework\\Constraint\\IsNull' => '/phpunit/Framework/Constraint/Type/IsNull.php',
144                'PHPUnit\\Framework\\Constraint\\IsReadable' => '/phpunit/Framework/Constraint/Filesystem/IsReadable.php',
145                'PHPUnit\\Framework\\Constraint\\IsTrue' => '/phpunit/Framework/Constraint/Boolean/IsTrue.php',
146                'PHPUnit\\Framework\\Constraint\\IsType' => '/phpunit/Framework/Constraint/Type/IsType.php',
147                'PHPUnit\\Framework\\Constraint\\IsWritable' => '/phpunit/Framework/Constraint/Filesystem/IsWritable.php',
148                'PHPUnit\\Framework\\Constraint\\JsonMatches' => '/phpunit/Framework/Constraint/JsonMatches.php',
149                'PHPUnit\\Framework\\Constraint\\JsonMatchesErrorMessageProvider' => '/phpunit/Framework/Constraint/JsonMatchesErrorMessageProvider.php',
150                'PHPUnit\\Framework\\Constraint\\LessThan' => '/phpunit/Framework/Constraint/Cardinality/LessThan.php',
151                'PHPUnit\\Framework\\Constraint\\LogicalAnd' => '/phpunit/Framework/Constraint/Operator/LogicalAnd.php',
152                'PHPUnit\\Framework\\Constraint\\LogicalNot' => '/phpunit/Framework/Constraint/Operator/LogicalNot.php',
153                'PHPUnit\\Framework\\Constraint\\LogicalOr' => '/phpunit/Framework/Constraint/Operator/LogicalOr.php',
154                'PHPUnit\\Framework\\Constraint\\LogicalXor' => '/phpunit/Framework/Constraint/Operator/LogicalXor.php',
155                'PHPUnit\\Framework\\Constraint\\ObjectEquals' => '/phpunit/Framework/Constraint/Object/ObjectEquals.php',
156                'PHPUnit\\Framework\\Constraint\\ObjectHasAttribute' => '/phpunit/Framework/Constraint/Object/ObjectHasAttribute.php',
157                'PHPUnit\\Framework\\Constraint\\Operator' => '/phpunit/Framework/Constraint/Operator/Operator.php',
158                'PHPUnit\\Framework\\Constraint\\RegularExpression' => '/phpunit/Framework/Constraint/String/RegularExpression.php',
159                'PHPUnit\\Framework\\Constraint\\SameSize' => '/phpunit/Framework/Constraint/Cardinality/SameSize.php',
160                'PHPUnit\\Framework\\Constraint\\StringContains' => '/phpunit/Framework/Constraint/String/StringContains.php',
161                'PHPUnit\\Framework\\Constraint\\StringEndsWith' => '/phpunit/Framework/Constraint/String/StringEndsWith.php',
162                'PHPUnit\\Framework\\Constraint\\StringMatchesFormatDescription' => '/phpunit/Framework/Constraint/String/StringMatchesFormatDescription.php',
163                'PHPUnit\\Framework\\Constraint\\StringStartsWith' => '/phpunit/Framework/Constraint/String/StringStartsWith.php',
164                'PHPUnit\\Framework\\Constraint\\TraversableContains' => '/phpunit/Framework/Constraint/Traversable/TraversableContains.php',
165                'PHPUnit\\Framework\\Constraint\\TraversableContainsEqual' => '/phpunit/Framework/Constraint/Traversable/TraversableContainsEqual.php',
166                'PHPUnit\\Framework\\Constraint\\TraversableContainsIdentical' => '/phpunit/Framework/Constraint/Traversable/TraversableContainsIdentical.php',
167                'PHPUnit\\Framework\\Constraint\\TraversableContainsOnly' => '/phpunit/Framework/Constraint/Traversable/TraversableContainsOnly.php',
168                'PHPUnit\\Framework\\Constraint\\UnaryOperator' => '/phpunit/Framework/Constraint/Operator/UnaryOperator.php',
169                'PHPUnit\\Framework\\CoveredCodeNotExecutedException' => '/phpunit/Framework/Exception/CoveredCodeNotExecutedException.php',
170                'PHPUnit\\Framework\\DataProviderTestSuite' => '/phpunit/Framework/DataProviderTestSuite.php',
171                'PHPUnit\\Framework\\Error' => '/phpunit/Framework/Exception/Error.php',
172                'PHPUnit\\Framework\\ErrorTestCase' => '/phpunit/Framework/ErrorTestCase.php',
173                'PHPUnit\\Framework\\Error\\Deprecated' => '/phpunit/Framework/Error/Deprecated.php',
174                'PHPUnit\\Framework\\Error\\Error' => '/phpunit/Framework/Error/Error.php',
175                'PHPUnit\\Framework\\Error\\Notice' => '/phpunit/Framework/Error/Notice.php',
176                'PHPUnit\\Framework\\Error\\Warning' => '/phpunit/Framework/Error/Warning.php',
177                'PHPUnit\\Framework\\Exception' => '/phpunit/Framework/Exception/Exception.php',
178                'PHPUnit\\Framework\\ExceptionWrapper' => '/phpunit/Framework/ExceptionWrapper.php',
179                'PHPUnit\\Framework\\ExecutionOrderDependency' => '/phpunit/Framework/ExecutionOrderDependency.php',
180                'PHPUnit\\Framework\\ExpectationFailedException' => '/phpunit/Framework/Exception/ExpectationFailedException.php',
181                'PHPUnit\\Framework\\IncompleteTest' => '/phpunit/Framework/IncompleteTest.php',
182                'PHPUnit\\Framework\\IncompleteTestCase' => '/phpunit/Framework/IncompleteTestCase.php',
183                'PHPUnit\\Framework\\IncompleteTestError' => '/phpunit/Framework/Exception/IncompleteTestError.php',
184                'PHPUnit\\Framework\\InvalidArgumentException' => '/phpunit/Framework/Exception/InvalidArgumentException.php',
185                'PHPUnit\\Framework\\InvalidCoversTargetException' => '/phpunit/Framework/Exception/InvalidCoversTargetException.php',
186                'PHPUnit\\Framework\\InvalidDataProviderException' => '/phpunit/Framework/Exception/InvalidDataProviderException.php',
187                'PHPUnit\\Framework\\InvalidParameterGroupException' => '/phpunit/Framework/InvalidParameterGroupException.php',
188                'PHPUnit\\Framework\\MissingCoversAnnotationException' => '/phpunit/Framework/Exception/MissingCoversAnnotationException.php',
189                'PHPUnit\\Framework\\MockObject\\Api' => '/phpunit/Framework/MockObject/Api/Api.php',
190                'PHPUnit\\Framework\\MockObject\\BadMethodCallException' => '/phpunit/Framework/MockObject/Exception/BadMethodCallException.php',
191                'PHPUnit\\Framework\\MockObject\\Builder\\Identity' => '/phpunit/Framework/MockObject/Builder/Identity.php',
192                'PHPUnit\\Framework\\MockObject\\Builder\\InvocationMocker' => '/phpunit/Framework/MockObject/Builder/InvocationMocker.php',
193                'PHPUnit\\Framework\\MockObject\\Builder\\InvocationStubber' => '/phpunit/Framework/MockObject/Builder/InvocationStubber.php',
194                'PHPUnit\\Framework\\MockObject\\Builder\\MethodNameMatch' => '/phpunit/Framework/MockObject/Builder/MethodNameMatch.php',
195                'PHPUnit\\Framework\\MockObject\\Builder\\ParametersMatch' => '/phpunit/Framework/MockObject/Builder/ParametersMatch.php',
196                'PHPUnit\\Framework\\MockObject\\Builder\\Stub' => '/phpunit/Framework/MockObject/Builder/Stub.php',
197                'PHPUnit\\Framework\\MockObject\\CannotUseAddMethodsException' => '/phpunit/Framework/MockObject/Exception/CannotUseAddMethodsException.php',
198                'PHPUnit\\Framework\\MockObject\\CannotUseOnlyMethodsException' => '/phpunit/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php',
199                'PHPUnit\\Framework\\MockObject\\ClassAlreadyExistsException' => '/phpunit/Framework/MockObject/Exception/ClassAlreadyExistsException.php',
200                'PHPUnit\\Framework\\MockObject\\ClassIsFinalException' => '/phpunit/Framework/MockObject/Exception/ClassIsFinalException.php',
201                'PHPUnit\\Framework\\MockObject\\ConfigurableMethod' => '/phpunit/Framework/MockObject/ConfigurableMethod.php',
202                'PHPUnit\\Framework\\MockObject\\ConfigurableMethodsAlreadyInitializedException' => '/phpunit/Framework/MockObject/Exception/ConfigurableMethodsAlreadyInitializedException.php',
203                'PHPUnit\\Framework\\MockObject\\DuplicateMethodException' => '/phpunit/Framework/MockObject/Exception/DuplicateMethodException.php',
204                'PHPUnit\\Framework\\MockObject\\Exception' => '/phpunit/Framework/MockObject/Exception/Exception.php',
205                'PHPUnit\\Framework\\MockObject\\Generator' => '/phpunit/Framework/MockObject/Generator.php',
206                'PHPUnit\\Framework\\MockObject\\IncompatibleReturnValueException' => '/phpunit/Framework/MockObject/Exception/IncompatibleReturnValueException.php',
207                'PHPUnit\\Framework\\MockObject\\InvalidMethodNameException' => '/phpunit/Framework/MockObject/Exception/InvalidMethodNameException.php',
208                'PHPUnit\\Framework\\MockObject\\Invocation' => '/phpunit/Framework/MockObject/Invocation.php',
209                'PHPUnit\\Framework\\MockObject\\InvocationHandler' => '/phpunit/Framework/MockObject/InvocationHandler.php',
210                'PHPUnit\\Framework\\MockObject\\MatchBuilderNotFoundException' => '/phpunit/Framework/MockObject/Exception/MatchBuilderNotFoundException.php',
211                'PHPUnit\\Framework\\MockObject\\Matcher' => '/phpunit/Framework/MockObject/Matcher.php',
212                'PHPUnit\\Framework\\MockObject\\MatcherAlreadyRegisteredException' => '/phpunit/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.php',
213                'PHPUnit\\Framework\\MockObject\\Method' => '/phpunit/Framework/MockObject/Api/Method.php',
214                'PHPUnit\\Framework\\MockObject\\MethodCannotBeConfiguredException' => '/phpunit/Framework/MockObject/Exception/MethodCannotBeConfiguredException.php',
215                'PHPUnit\\Framework\\MockObject\\MethodNameAlreadyConfiguredException' => '/phpunit/Framework/MockObject/Exception/MethodNameAlreadyConfiguredException.php',
216                'PHPUnit\\Framework\\MockObject\\MethodNameConstraint' => '/phpunit/Framework/MockObject/MethodNameConstraint.php',
217                'PHPUnit\\Framework\\MockObject\\MethodNameNotConfiguredException' => '/phpunit/Framework/MockObject/Exception/MethodNameNotConfiguredException.php',
218                'PHPUnit\\Framework\\MockObject\\MethodParametersAlreadyConfiguredException' => '/phpunit/Framework/MockObject/Exception/MethodParametersAlreadyConfiguredException.php',
219                'PHPUnit\\Framework\\MockObject\\MockBuilder' => '/phpunit/Framework/MockObject/MockBuilder.php',
220                'PHPUnit\\Framework\\MockObject\\MockClass' => '/phpunit/Framework/MockObject/MockClass.php',
221                'PHPUnit\\Framework\\MockObject\\MockMethod' => '/phpunit/Framework/MockObject/MockMethod.php',
222                'PHPUnit\\Framework\\MockObject\\MockMethodSet' => '/phpunit/Framework/MockObject/MockMethodSet.php',
223                'PHPUnit\\Framework\\MockObject\\MockObject' => '/phpunit/Framework/MockObject/MockObject.php',
224                'PHPUnit\\Framework\\MockObject\\MockTrait' => '/phpunit/Framework/MockObject/MockTrait.php',
225                'PHPUnit\\Framework\\MockObject\\MockType' => '/phpunit/Framework/MockObject/MockType.php',
226                'PHPUnit\\Framework\\MockObject\\MockedCloneMethod' => '/phpunit/Framework/MockObject/Api/MockedCloneMethod.php',
227                'PHPUnit\\Framework\\MockObject\\OriginalConstructorInvocationRequiredException' => '/phpunit/Framework/MockObject/Exception/OriginalConstructorInvocationRequiredException.php',
228                'PHPUnit\\Framework\\MockObject\\ReflectionException' => '/phpunit/Framework/MockObject/Exception/ReflectionException.php',
229                'PHPUnit\\Framework\\MockObject\\ReturnValueNotConfiguredException' => '/phpunit/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php',
230                'PHPUnit\\Framework\\MockObject\\Rule\\AnyInvokedCount' => '/phpunit/Framework/MockObject/Rule/AnyInvokedCount.php',
231                'PHPUnit\\Framework\\MockObject\\Rule\\AnyParameters' => '/phpunit/Framework/MockObject/Rule/AnyParameters.php',
232                'PHPUnit\\Framework\\MockObject\\Rule\\ConsecutiveParameters' => '/phpunit/Framework/MockObject/Rule/ConsecutiveParameters.php',
233                'PHPUnit\\Framework\\MockObject\\Rule\\InvocationOrder' => '/phpunit/Framework/MockObject/Rule/InvocationOrder.php',
234                'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtIndex' => '/phpunit/Framework/MockObject/Rule/InvokedAtIndex.php',
235                'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtLeastCount' => '/phpunit/Framework/MockObject/Rule/InvokedAtLeastCount.php',
236                'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtLeastOnce' => '/phpunit/Framework/MockObject/Rule/InvokedAtLeastOnce.php',
237                'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtMostCount' => '/phpunit/Framework/MockObject/Rule/InvokedAtMostCount.php',
238                'PHPUnit\\Framework\\MockObject\\Rule\\InvokedCount' => '/phpunit/Framework/MockObject/Rule/InvokedCount.php',
239                'PHPUnit\\Framework\\MockObject\\Rule\\MethodName' => '/phpunit/Framework/MockObject/Rule/MethodName.php',
240                'PHPUnit\\Framework\\MockObject\\Rule\\Parameters' => '/phpunit/Framework/MockObject/Rule/Parameters.php',
241                'PHPUnit\\Framework\\MockObject\\Rule\\ParametersRule' => '/phpunit/Framework/MockObject/Rule/ParametersRule.php',
242                'PHPUnit\\Framework\\MockObject\\RuntimeException' => '/phpunit/Framework/MockObject/Exception/RuntimeException.php',
243                'PHPUnit\\Framework\\MockObject\\SoapExtensionNotAvailableException' => '/phpunit/Framework/MockObject/Exception/SoapExtensionNotAvailableException.php',
244                'PHPUnit\\Framework\\MockObject\\Stub' => '/phpunit/Framework/MockObject/Stub.php',
245                'PHPUnit\\Framework\\MockObject\\Stub\\ConsecutiveCalls' => '/phpunit/Framework/MockObject/Stub/ConsecutiveCalls.php',
246                'PHPUnit\\Framework\\MockObject\\Stub\\Exception' => '/phpunit/Framework/MockObject/Stub/Exception.php',
247                'PHPUnit\\Framework\\MockObject\\Stub\\ReturnArgument' => '/phpunit/Framework/MockObject/Stub/ReturnArgument.php',
248                'PHPUnit\\Framework\\MockObject\\Stub\\ReturnCallback' => '/phpunit/Framework/MockObject/Stub/ReturnCallback.php',
249                'PHPUnit\\Framework\\MockObject\\Stub\\ReturnReference' => '/phpunit/Framework/MockObject/Stub/ReturnReference.php',
250                'PHPUnit\\Framework\\MockObject\\Stub\\ReturnSelf' => '/phpunit/Framework/MockObject/Stub/ReturnSelf.php',
251                'PHPUnit\\Framework\\MockObject\\Stub\\ReturnStub' => '/phpunit/Framework/MockObject/Stub/ReturnStub.php',
252                'PHPUnit\\Framework\\MockObject\\Stub\\ReturnValueMap' => '/phpunit/Framework/MockObject/Stub/ReturnValueMap.php',
253                'PHPUnit\\Framework\\MockObject\\Stub\\Stub' => '/phpunit/Framework/MockObject/Stub/Stub.php',
254                'PHPUnit\\Framework\\MockObject\\UnknownClassException' => '/phpunit/Framework/MockObject/Exception/UnknownClassException.php',
255                'PHPUnit\\Framework\\MockObject\\UnknownTraitException' => '/phpunit/Framework/MockObject/Exception/UnknownTraitException.php',
256                'PHPUnit\\Framework\\MockObject\\UnknownTypeException' => '/phpunit/Framework/MockObject/Exception/UnknownTypeException.php',
257                'PHPUnit\\Framework\\MockObject\\UnmockedCloneMethod' => '/phpunit/Framework/MockObject/Api/UnmockedCloneMethod.php',
258                'PHPUnit\\Framework\\MockObject\\Verifiable' => '/phpunit/Framework/MockObject/Verifiable.php',
259                'PHPUnit\\Framework\\NoChildTestSuiteException' => '/phpunit/Framework/Exception/NoChildTestSuiteException.php',
260                'PHPUnit\\Framework\\OutputError' => '/phpunit/Framework/Exception/OutputError.php',
261                'PHPUnit\\Framework\\PHPTAssertionFailedError' => '/phpunit/Framework/Exception/PHPTAssertionFailedError.php',
262                'PHPUnit\\Framework\\Reorderable' => '/phpunit/Framework/Reorderable.php',
263                'PHPUnit\\Framework\\RiskyTestError' => '/phpunit/Framework/Exception/RiskyTestError.php',
264                'PHPUnit\\Framework\\SelfDescribing' => '/phpunit/Framework/SelfDescribing.php',
265                'PHPUnit\\Framework\\SkippedTest' => '/phpunit/Framework/SkippedTest.php',
266                'PHPUnit\\Framework\\SkippedTestCase' => '/phpunit/Framework/SkippedTestCase.php',
267                'PHPUnit\\Framework\\SkippedTestError' => '/phpunit/Framework/Exception/SkippedTestError.php',
268                'PHPUnit\\Framework\\SkippedTestSuiteError' => '/phpunit/Framework/Exception/SkippedTestSuiteError.php',
269                'PHPUnit\\Framework\\SyntheticError' => '/phpunit/Framework/Exception/SyntheticError.php',
270                'PHPUnit\\Framework\\SyntheticSkippedError' => '/phpunit/Framework/Exception/SyntheticSkippedError.php',
271                'PHPUnit\\Framework\\Test' => '/phpunit/Framework/Test.php',
272                'PHPUnit\\Framework\\TestBuilder' => '/phpunit/Framework/TestBuilder.php',
273                'PHPUnit\\Framework\\TestCase' => '/phpunit/Framework/TestCase.php',
274                'PHPUnit\\Framework\\TestFailure' => '/phpunit/Framework/TestFailure.php',
275                'PHPUnit\\Framework\\TestListener' => '/phpunit/Framework/TestListener.php',
276                'PHPUnit\\Framework\\TestListenerDefaultImplementation' => '/phpunit/Framework/TestListenerDefaultImplementation.php',
277                'PHPUnit\\Framework\\TestResult' => '/phpunit/Framework/TestResult.php',
278                'PHPUnit\\Framework\\TestSuite' => '/phpunit/Framework/TestSuite.php',
279                'PHPUnit\\Framework\\TestSuiteIterator' => '/phpunit/Framework/TestSuiteIterator.php',
280                'PHPUnit\\Framework\\UnintentionallyCoveredCodeError' => '/phpunit/Framework/Exception/UnintentionallyCoveredCodeError.php',
281                'PHPUnit\\Framework\\Warning' => '/phpunit/Framework/Exception/Warning.php',
282                'PHPUnit\\Framework\\WarningTestCase' => '/phpunit/Framework/WarningTestCase.php',
283                'PHPUnit\\PharIo\\Manifest\\Application' => '/phar-io-manifest/values/Application.php',
284                'PHPUnit\\PharIo\\Manifest\\ApplicationName' => '/phar-io-manifest/values/ApplicationName.php',
285                'PHPUnit\\PharIo\\Manifest\\Author' => '/phar-io-manifest/values/Author.php',
286                'PHPUnit\\PharIo\\Manifest\\AuthorCollection' => '/phar-io-manifest/values/AuthorCollection.php',
287                'PHPUnit\\PharIo\\Manifest\\AuthorCollectionIterator' => '/phar-io-manifest/values/AuthorCollectionIterator.php',
288                'PHPUnit\\PharIo\\Manifest\\AuthorElement' => '/phar-io-manifest/xml/AuthorElement.php',
289                'PHPUnit\\PharIo\\Manifest\\AuthorElementCollection' => '/phar-io-manifest/xml/AuthorElementCollection.php',
290                'PHPUnit\\PharIo\\Manifest\\BundledComponent' => '/phar-io-manifest/values/BundledComponent.php',
291                'PHPUnit\\PharIo\\Manifest\\BundledComponentCollection' => '/phar-io-manifest/values/BundledComponentCollection.php',
292                'PHPUnit\\PharIo\\Manifest\\BundledComponentCollectionIterator' => '/phar-io-manifest/values/BundledComponentCollectionIterator.php',
293                'PHPUnit\\PharIo\\Manifest\\BundlesElement' => '/phar-io-manifest/xml/BundlesElement.php',
294                'PHPUnit\\PharIo\\Manifest\\ComponentElement' => '/phar-io-manifest/xml/ComponentElement.php',
295                'PHPUnit\\PharIo\\Manifest\\ComponentElementCollection' => '/phar-io-manifest/xml/ComponentElementCollection.php',
296                'PHPUnit\\PharIo\\Manifest\\ContainsElement' => '/phar-io-manifest/xml/ContainsElement.php',
297                'PHPUnit\\PharIo\\Manifest\\CopyrightElement' => '/phar-io-manifest/xml/CopyrightElement.php',
298                'PHPUnit\\PharIo\\Manifest\\CopyrightInformation' => '/phar-io-manifest/values/CopyrightInformation.php',
299                'PHPUnit\\PharIo\\Manifest\\ElementCollection' => '/phar-io-manifest/xml/ElementCollection.php',
300                'PHPUnit\\PharIo\\Manifest\\ElementCollectionException' => '/phar-io-manifest/exceptions/ElementCollectionException.php',
301                'PHPUnit\\PharIo\\Manifest\\Email' => '/phar-io-manifest/values/Email.php',
302                'PHPUnit\\PharIo\\Manifest\\Exception' => '/phar-io-manifest/exceptions/Exception.php',
303                'PHPUnit\\PharIo\\Manifest\\ExtElement' => '/phar-io-manifest/xml/ExtElement.php',
304                'PHPUnit\\PharIo\\Manifest\\ExtElementCollection' => '/phar-io-manifest/xml/ExtElementCollection.php',
305                'PHPUnit\\PharIo\\Manifest\\Extension' => '/phar-io-manifest/values/Extension.php',
306                'PHPUnit\\PharIo\\Manifest\\ExtensionElement' => '/phar-io-manifest/xml/ExtensionElement.php',
307                'PHPUnit\\PharIo\\Manifest\\InvalidApplicationNameException' => '/phar-io-manifest/exceptions/InvalidApplicationNameException.php',
308                'PHPUnit\\PharIo\\Manifest\\InvalidEmailException' => '/phar-io-manifest/exceptions/InvalidEmailException.php',
309                'PHPUnit\\PharIo\\Manifest\\InvalidUrlException' => '/phar-io-manifest/exceptions/InvalidUrlException.php',
310                'PHPUnit\\PharIo\\Manifest\\Library' => '/phar-io-manifest/values/Library.php',
311                'PHPUnit\\PharIo\\Manifest\\License' => '/phar-io-manifest/values/License.php',
312                'PHPUnit\\PharIo\\Manifest\\LicenseElement' => '/phar-io-manifest/xml/LicenseElement.php',
313                'PHPUnit\\PharIo\\Manifest\\Manifest' => '/phar-io-manifest/values/Manifest.php',
314                'PHPUnit\\PharIo\\Manifest\\ManifestDocument' => '/phar-io-manifest/xml/ManifestDocument.php',
315                'PHPUnit\\PharIo\\Manifest\\ManifestDocumentException' => '/phar-io-manifest/exceptions/ManifestDocumentException.php',
316                'PHPUnit\\PharIo\\Manifest\\ManifestDocumentLoadingException' => '/phar-io-manifest/exceptions/ManifestDocumentLoadingException.php',
317                'PHPUnit\\PharIo\\Manifest\\ManifestDocumentMapper' => '/phar-io-manifest/ManifestDocumentMapper.php',
318                'PHPUnit\\PharIo\\Manifest\\ManifestDocumentMapperException' => '/phar-io-manifest/exceptions/ManifestDocumentMapperException.php',
319                'PHPUnit\\PharIo\\Manifest\\ManifestElement' => '/phar-io-manifest/xml/ManifestElement.php',
320                'PHPUnit\\PharIo\\Manifest\\ManifestElementException' => '/phar-io-manifest/exceptions/ManifestElementException.php',
321                'PHPUnit\\PharIo\\Manifest\\ManifestLoader' => '/phar-io-manifest/ManifestLoader.php',
322                'PHPUnit\\PharIo\\Manifest\\ManifestLoaderException' => '/phar-io-manifest/exceptions/ManifestLoaderException.php',
323                'PHPUnit\\PharIo\\Manifest\\ManifestSerializer' => '/phar-io-manifest/ManifestSerializer.php',
324                'PHPUnit\\PharIo\\Manifest\\PhpElement' => '/phar-io-manifest/xml/PhpElement.php',
325                'PHPUnit\\PharIo\\Manifest\\PhpExtensionRequirement' => '/phar-io-manifest/values/PhpExtensionRequirement.php',
326                'PHPUnit\\PharIo\\Manifest\\PhpVersionRequirement' => '/phar-io-manifest/values/PhpVersionRequirement.php',
327                'PHPUnit\\PharIo\\Manifest\\Requirement' => '/phar-io-manifest/values/Requirement.php',
328                'PHPUnit\\PharIo\\Manifest\\RequirementCollection' => '/phar-io-manifest/values/RequirementCollection.php',
329                'PHPUnit\\PharIo\\Manifest\\RequirementCollectionIterator' => '/phar-io-manifest/values/RequirementCollectionIterator.php',
330                'PHPUnit\\PharIo\\Manifest\\RequiresElement' => '/phar-io-manifest/xml/RequiresElement.php',
331                'PHPUnit\\PharIo\\Manifest\\Type' => '/phar-io-manifest/values/Type.php',
332                'PHPUnit\\PharIo\\Manifest\\Url' => '/phar-io-manifest/values/Url.php',
333                'PHPUnit\\PharIo\\Version\\AbstractVersionConstraint' => '/phar-io-version/constraints/AbstractVersionConstraint.php',
334                'PHPUnit\\PharIo\\Version\\AndVersionConstraintGroup' => '/phar-io-version/constraints/AndVersionConstraintGroup.php',
335                'PHPUnit\\PharIo\\Version\\AnyVersionConstraint' => '/phar-io-version/constraints/AnyVersionConstraint.php',
336                'PHPUnit\\PharIo\\Version\\ExactVersionConstraint' => '/phar-io-version/constraints/ExactVersionConstraint.php',
337                'PHPUnit\\PharIo\\Version\\Exception' => '/phar-io-version/exceptions/Exception.php',
338                'PHPUnit\\PharIo\\Version\\GreaterThanOrEqualToVersionConstraint' => '/phar-io-version/constraints/GreaterThanOrEqualToVersionConstraint.php',
339                'PHPUnit\\PharIo\\Version\\InvalidPreReleaseSuffixException' => '/phar-io-version/exceptions/InvalidPreReleaseSuffixException.php',
340                'PHPUnit\\PharIo\\Version\\InvalidVersionException' => '/phar-io-version/exceptions/InvalidVersionException.php',
341                'PHPUnit\\PharIo\\Version\\NoPreReleaseSuffixException' => '/phar-io-version/exceptions/NoPreReleaseSuffixException.php',
342                'PHPUnit\\PharIo\\Version\\OrVersionConstraintGroup' => '/phar-io-version/constraints/OrVersionConstraintGroup.php',
343                'PHPUnit\\PharIo\\Version\\PreReleaseSuffix' => '/phar-io-version/PreReleaseSuffix.php',
344                'PHPUnit\\PharIo\\Version\\SpecificMajorAndMinorVersionConstraint' => '/phar-io-version/constraints/SpecificMajorAndMinorVersionConstraint.php',
345                'PHPUnit\\PharIo\\Version\\SpecificMajorVersionConstraint' => '/phar-io-version/constraints/SpecificMajorVersionConstraint.php',
346                'PHPUnit\\PharIo\\Version\\UnsupportedVersionConstraintException' => '/phar-io-version/exceptions/UnsupportedVersionConstraintException.php',
347                'PHPUnit\\PharIo\\Version\\Version' => '/phar-io-version/Version.php',
348                'PHPUnit\\PharIo\\Version\\VersionConstraint' => '/phar-io-version/constraints/VersionConstraint.php',
349                'PHPUnit\\PharIo\\Version\\VersionConstraintParser' => '/phar-io-version/VersionConstraintParser.php',
350                'PHPUnit\\PharIo\\Version\\VersionConstraintValue' => '/phar-io-version/VersionConstraintValue.php',
351                'PHPUnit\\PharIo\\Version\\VersionNumber' => '/phar-io-version/VersionNumber.php',
352                'PHPUnit\\PhpParser\\Builder' => '/nikic-php-parser/PhpParser/Builder.php',
353                'PHPUnit\\PhpParser\\BuilderFactory' => '/nikic-php-parser/PhpParser/BuilderFactory.php',
354                'PHPUnit\\PhpParser\\BuilderHelpers' => '/nikic-php-parser/PhpParser/BuilderHelpers.php',
355                'PHPUnit\\PhpParser\\Builder\\ClassConst' => '/nikic-php-parser/PhpParser/Builder/ClassConst.php',
356                'PHPUnit\\PhpParser\\Builder\\Class_' => '/nikic-php-parser/PhpParser/Builder/Class_.php',
357                'PHPUnit\\PhpParser\\Builder\\Declaration' => '/nikic-php-parser/PhpParser/Builder/Declaration.php',
358                'PHPUnit\\PhpParser\\Builder\\FunctionLike' => '/nikic-php-parser/PhpParser/Builder/FunctionLike.php',
359                'PHPUnit\\PhpParser\\Builder\\Function_' => '/nikic-php-parser/PhpParser/Builder/Function_.php',
360                'PHPUnit\\PhpParser\\Builder\\Interface_' => '/nikic-php-parser/PhpParser/Builder/Interface_.php',
361                'PHPUnit\\PhpParser\\Builder\\Method' => '/nikic-php-parser/PhpParser/Builder/Method.php',
362                'PHPUnit\\PhpParser\\Builder\\Namespace_' => '/nikic-php-parser/PhpParser/Builder/Namespace_.php',
363                'PHPUnit\\PhpParser\\Builder\\Param' => '/nikic-php-parser/PhpParser/Builder/Param.php',
364                'PHPUnit\\PhpParser\\Builder\\Property' => '/nikic-php-parser/PhpParser/Builder/Property.php',
365                'PHPUnit\\PhpParser\\Builder\\TraitUse' => '/nikic-php-parser/PhpParser/Builder/TraitUse.php',
366                'PHPUnit\\PhpParser\\Builder\\TraitUseAdaptation' => '/nikic-php-parser/PhpParser/Builder/TraitUseAdaptation.php',
367                'PHPUnit\\PhpParser\\Builder\\Trait_' => '/nikic-php-parser/PhpParser/Builder/Trait_.php',
368                'PHPUnit\\PhpParser\\Builder\\Use_' => '/nikic-php-parser/PhpParser/Builder/Use_.php',
369                'PHPUnit\\PhpParser\\Comment' => '/nikic-php-parser/PhpParser/Comment.php',
370                'PHPUnit\\PhpParser\\Comment\\Doc' => '/nikic-php-parser/PhpParser/Comment/Doc.php',
371                'PHPUnit\\PhpParser\\ConstExprEvaluationException' => '/nikic-php-parser/PhpParser/ConstExprEvaluationException.php',
372                'PHPUnit\\PhpParser\\ConstExprEvaluator' => '/nikic-php-parser/PhpParser/ConstExprEvaluator.php',
373                'PHPUnit\\PhpParser\\Error' => '/nikic-php-parser/PhpParser/Error.php',
374                'PHPUnit\\PhpParser\\ErrorHandler' => '/nikic-php-parser/PhpParser/ErrorHandler.php',
375                'PHPUnit\\PhpParser\\ErrorHandler\\Collecting' => '/nikic-php-parser/PhpParser/ErrorHandler/Collecting.php',
376                'PHPUnit\\PhpParser\\ErrorHandler\\Throwing' => '/nikic-php-parser/PhpParser/ErrorHandler/Throwing.php',
377                'PHPUnit\\PhpParser\\Internal\\DiffElem' => '/nikic-php-parser/PhpParser/Internal/DiffElem.php',
378                'PHPUnit\\PhpParser\\Internal\\Differ' => '/nikic-php-parser/PhpParser/Internal/Differ.php',
379                'PHPUnit\\PhpParser\\Internal\\PrintableNewAnonClassNode' => '/nikic-php-parser/PhpParser/Internal/PrintableNewAnonClassNode.php',
380                'PHPUnit\\PhpParser\\Internal\\TokenStream' => '/nikic-php-parser/PhpParser/Internal/TokenStream.php',
381                'PHPUnit\\PhpParser\\JsonDecoder' => '/nikic-php-parser/PhpParser/JsonDecoder.php',
382                'PHPUnit\\PhpParser\\Lexer' => '/nikic-php-parser/PhpParser/Lexer.php',
383                'PHPUnit\\PhpParser\\Lexer\\Emulative' => '/nikic-php-parser/PhpParser/Lexer/Emulative.php',
384                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\AttributeEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php',
385                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\CoaleseEqualTokenEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php',
386                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\EnumTokenEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php',
387                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\ExplicitOctalEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php',
388                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\FlexibleDocStringEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php',
389                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\FnTokenEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php',
390                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\KeywordEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php',
391                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\MatchTokenEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php',
392                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\NullsafeTokenEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php',
393                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\NumericLiteralSeparatorEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php',
394                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\ReadonlyTokenEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php',
395                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\ReverseEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php',
396                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\TokenEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/TokenEmulator.php',
397                'PHPUnit\\PhpParser\\NameContext' => '/nikic-php-parser/PhpParser/NameContext.php',
398                'PHPUnit\\PhpParser\\Node' => '/nikic-php-parser/PhpParser/Node.php',
399                'PHPUnit\\PhpParser\\NodeAbstract' => '/nikic-php-parser/PhpParser/NodeAbstract.php',
400                'PHPUnit\\PhpParser\\NodeDumper' => '/nikic-php-parser/PhpParser/NodeDumper.php',
401                'PHPUnit\\PhpParser\\NodeFinder' => '/nikic-php-parser/PhpParser/NodeFinder.php',
402                'PHPUnit\\PhpParser\\NodeTraverser' => '/nikic-php-parser/PhpParser/NodeTraverser.php',
403                'PHPUnit\\PhpParser\\NodeTraverserInterface' => '/nikic-php-parser/PhpParser/NodeTraverserInterface.php',
404                'PHPUnit\\PhpParser\\NodeVisitor' => '/nikic-php-parser/PhpParser/NodeVisitor.php',
405                'PHPUnit\\PhpParser\\NodeVisitorAbstract' => '/nikic-php-parser/PhpParser/NodeVisitorAbstract.php',
406                'PHPUnit\\PhpParser\\NodeVisitor\\CloningVisitor' => '/nikic-php-parser/PhpParser/NodeVisitor/CloningVisitor.php',
407                'PHPUnit\\PhpParser\\NodeVisitor\\FindingVisitor' => '/nikic-php-parser/PhpParser/NodeVisitor/FindingVisitor.php',
408                'PHPUnit\\PhpParser\\NodeVisitor\\FirstFindingVisitor' => '/nikic-php-parser/PhpParser/NodeVisitor/FirstFindingVisitor.php',
409                'PHPUnit\\PhpParser\\NodeVisitor\\NameResolver' => '/nikic-php-parser/PhpParser/NodeVisitor/NameResolver.php',
410                'PHPUnit\\PhpParser\\NodeVisitor\\NodeConnectingVisitor' => '/nikic-php-parser/PhpParser/NodeVisitor/NodeConnectingVisitor.php',
411                'PHPUnit\\PhpParser\\NodeVisitor\\ParentConnectingVisitor' => '/nikic-php-parser/PhpParser/NodeVisitor/ParentConnectingVisitor.php',
412                'PHPUnit\\PhpParser\\Node\\Arg' => '/nikic-php-parser/PhpParser/Node/Arg.php',
413                'PHPUnit\\PhpParser\\Node\\Attribute' => '/nikic-php-parser/PhpParser/Node/Attribute.php',
414                'PHPUnit\\PhpParser\\Node\\AttributeGroup' => '/nikic-php-parser/PhpParser/Node/AttributeGroup.php',
415                'PHPUnit\\PhpParser\\Node\\ComplexType' => '/nikic-php-parser/PhpParser/Node/ComplexType.php',
416                'PHPUnit\\PhpParser\\Node\\Const_' => '/nikic-php-parser/PhpParser/Node/Const_.php',
417                'PHPUnit\\PhpParser\\Node\\Expr' => '/nikic-php-parser/PhpParser/Node/Expr.php',
418                'PHPUnit\\PhpParser\\Node\\Expr\\ArrayDimFetch' => '/nikic-php-parser/PhpParser/Node/Expr/ArrayDimFetch.php',
419                'PHPUnit\\PhpParser\\Node\\Expr\\ArrayItem' => '/nikic-php-parser/PhpParser/Node/Expr/ArrayItem.php',
420                'PHPUnit\\PhpParser\\Node\\Expr\\Array_' => '/nikic-php-parser/PhpParser/Node/Expr/Array_.php',
421                'PHPUnit\\PhpParser\\Node\\Expr\\ArrowFunction' => '/nikic-php-parser/PhpParser/Node/Expr/ArrowFunction.php',
422                'PHPUnit\\PhpParser\\Node\\Expr\\Assign' => '/nikic-php-parser/PhpParser/Node/Expr/Assign.php',
423                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp.php',
424                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\BitwiseAnd' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php',
425                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\BitwiseOr' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/BitwiseOr.php',
426                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\BitwiseXor' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/BitwiseXor.php',
427                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\Coalesce' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/Coalesce.php',
428                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\Concat' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/Concat.php',
429                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\Div' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/Div.php',
430                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\Minus' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/Minus.php',
431                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\Mod' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/Mod.php',
432                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\Mul' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/Mul.php',
433                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\Plus' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/Plus.php',
434                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\Pow' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/Pow.php',
435                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\ShiftLeft' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/ShiftLeft.php',
436                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\ShiftRight' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/ShiftRight.php',
437                'PHPUnit\\PhpParser\\Node\\Expr\\AssignRef' => '/nikic-php-parser/PhpParser/Node/Expr/AssignRef.php',
438                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp.php',
439                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\BitwiseAnd' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php',
440                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\BitwiseOr' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php',
441                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\BitwiseXor' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php',
442                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\BooleanAnd' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php',
443                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\BooleanOr' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/BooleanOr.php',
444                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Coalesce' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Coalesce.php',
445                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Concat' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Concat.php',
446                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Div' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Div.php',
447                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Equal' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Equal.php',
448                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Greater' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Greater.php',
449                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\GreaterOrEqual' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php',
450                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Identical' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Identical.php',
451                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\LogicalAnd' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php',
452                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\LogicalOr' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/LogicalOr.php',
453                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\LogicalXor' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/LogicalXor.php',
454                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Minus' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Minus.php',
455                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Mod' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Mod.php',
456                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Mul' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Mul.php',
457                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\NotEqual' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/NotEqual.php',
458                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\NotIdentical' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/NotIdentical.php',
459                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Plus' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Plus.php',
460                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Pow' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Pow.php',
461                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\ShiftLeft' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php',
462                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\ShiftRight' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/ShiftRight.php',
463                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Smaller' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Smaller.php',
464                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\SmallerOrEqual' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php',
465                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Spaceship' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Spaceship.php',
466                'PHPUnit\\PhpParser\\Node\\Expr\\BitwiseNot' => '/nikic-php-parser/PhpParser/Node/Expr/BitwiseNot.php',
467                'PHPUnit\\PhpParser\\Node\\Expr\\BooleanNot' => '/nikic-php-parser/PhpParser/Node/Expr/BooleanNot.php',
468                'PHPUnit\\PhpParser\\Node\\Expr\\CallLike' => '/nikic-php-parser/PhpParser/Node/Expr/CallLike.php',
469                'PHPUnit\\PhpParser\\Node\\Expr\\Cast' => '/nikic-php-parser/PhpParser/Node/Expr/Cast.php',
470                'PHPUnit\\PhpParser\\Node\\Expr\\Cast\\Array_' => '/nikic-php-parser/PhpParser/Node/Expr/Cast/Array_.php',
471                'PHPUnit\\PhpParser\\Node\\Expr\\Cast\\Bool_' => '/nikic-php-parser/PhpParser/Node/Expr/Cast/Bool_.php',
472                'PHPUnit\\PhpParser\\Node\\Expr\\Cast\\Double' => '/nikic-php-parser/PhpParser/Node/Expr/Cast/Double.php',
473                'PHPUnit\\PhpParser\\Node\\Expr\\Cast\\Int_' => '/nikic-php-parser/PhpParser/Node/Expr/Cast/Int_.php',
474                'PHPUnit\\PhpParser\\Node\\Expr\\Cast\\Object_' => '/nikic-php-parser/PhpParser/Node/Expr/Cast/Object_.php',
475                'PHPUnit\\PhpParser\\Node\\Expr\\Cast\\String_' => '/nikic-php-parser/PhpParser/Node/Expr/Cast/String_.php',
476                'PHPUnit\\PhpParser\\Node\\Expr\\Cast\\Unset_' => '/nikic-php-parser/PhpParser/Node/Expr/Cast/Unset_.php',
477                'PHPUnit\\PhpParser\\Node\\Expr\\ClassConstFetch' => '/nikic-php-parser/PhpParser/Node/Expr/ClassConstFetch.php',
478                'PHPUnit\\PhpParser\\Node\\Expr\\Clone_' => '/nikic-php-parser/PhpParser/Node/Expr/Clone_.php',
479                'PHPUnit\\PhpParser\\Node\\Expr\\Closure' => '/nikic-php-parser/PhpParser/Node/Expr/Closure.php',
480                'PHPUnit\\PhpParser\\Node\\Expr\\ClosureUse' => '/nikic-php-parser/PhpParser/Node/Expr/ClosureUse.php',
481                'PHPUnit\\PhpParser\\Node\\Expr\\ConstFetch' => '/nikic-php-parser/PhpParser/Node/Expr/ConstFetch.php',
482                'PHPUnit\\PhpParser\\Node\\Expr\\Empty_' => '/nikic-php-parser/PhpParser/Node/Expr/Empty_.php',
483                'PHPUnit\\PhpParser\\Node\\Expr\\Error' => '/nikic-php-parser/PhpParser/Node/Expr/Error.php',
484                'PHPUnit\\PhpParser\\Node\\Expr\\ErrorSuppress' => '/nikic-php-parser/PhpParser/Node/Expr/ErrorSuppress.php',
485                'PHPUnit\\PhpParser\\Node\\Expr\\Eval_' => '/nikic-php-parser/PhpParser/Node/Expr/Eval_.php',
486                'PHPUnit\\PhpParser\\Node\\Expr\\Exit_' => '/nikic-php-parser/PhpParser/Node/Expr/Exit_.php',
487                'PHPUnit\\PhpParser\\Node\\Expr\\FuncCall' => '/nikic-php-parser/PhpParser/Node/Expr/FuncCall.php',
488                'PHPUnit\\PhpParser\\Node\\Expr\\Include_' => '/nikic-php-parser/PhpParser/Node/Expr/Include_.php',
489                'PHPUnit\\PhpParser\\Node\\Expr\\Instanceof_' => '/nikic-php-parser/PhpParser/Node/Expr/Instanceof_.php',
490                'PHPUnit\\PhpParser\\Node\\Expr\\Isset_' => '/nikic-php-parser/PhpParser/Node/Expr/Isset_.php',
491                'PHPUnit\\PhpParser\\Node\\Expr\\List_' => '/nikic-php-parser/PhpParser/Node/Expr/List_.php',
492                'PHPUnit\\PhpParser\\Node\\Expr\\Match_' => '/nikic-php-parser/PhpParser/Node/Expr/Match_.php',
493                'PHPUnit\\PhpParser\\Node\\Expr\\MethodCall' => '/nikic-php-parser/PhpParser/Node/Expr/MethodCall.php',
494                'PHPUnit\\PhpParser\\Node\\Expr\\New_' => '/nikic-php-parser/PhpParser/Node/Expr/New_.php',
495                'PHPUnit\\PhpParser\\Node\\Expr\\NullsafeMethodCall' => '/nikic-php-parser/PhpParser/Node/Expr/NullsafeMethodCall.php',
496                'PHPUnit\\PhpParser\\Node\\Expr\\NullsafePropertyFetch' => '/nikic-php-parser/PhpParser/Node/Expr/NullsafePropertyFetch.php',
497                'PHPUnit\\PhpParser\\Node\\Expr\\PostDec' => '/nikic-php-parser/PhpParser/Node/Expr/PostDec.php',
498                'PHPUnit\\PhpParser\\Node\\Expr\\PostInc' => '/nikic-php-parser/PhpParser/Node/Expr/PostInc.php',
499                'PHPUnit\\PhpParser\\Node\\Expr\\PreDec' => '/nikic-php-parser/PhpParser/Node/Expr/PreDec.php',
500                'PHPUnit\\PhpParser\\Node\\Expr\\PreInc' => '/nikic-php-parser/PhpParser/Node/Expr/PreInc.php',
501                'PHPUnit\\PhpParser\\Node\\Expr\\Print_' => '/nikic-php-parser/PhpParser/Node/Expr/Print_.php',
502                'PHPUnit\\PhpParser\\Node\\Expr\\PropertyFetch' => '/nikic-php-parser/PhpParser/Node/Expr/PropertyFetch.php',
503                'PHPUnit\\PhpParser\\Node\\Expr\\ShellExec' => '/nikic-php-parser/PhpParser/Node/Expr/ShellExec.php',
504                'PHPUnit\\PhpParser\\Node\\Expr\\StaticCall' => '/nikic-php-parser/PhpParser/Node/Expr/StaticCall.php',
505                'PHPUnit\\PhpParser\\Node\\Expr\\StaticPropertyFetch' => '/nikic-php-parser/PhpParser/Node/Expr/StaticPropertyFetch.php',
506                'PHPUnit\\PhpParser\\Node\\Expr\\Ternary' => '/nikic-php-parser/PhpParser/Node/Expr/Ternary.php',
507                'PHPUnit\\PhpParser\\Node\\Expr\\Throw_' => '/nikic-php-parser/PhpParser/Node/Expr/Throw_.php',
508                'PHPUnit\\PhpParser\\Node\\Expr\\UnaryMinus' => '/nikic-php-parser/PhpParser/Node/Expr/UnaryMinus.php',
509                'PHPUnit\\PhpParser\\Node\\Expr\\UnaryPlus' => '/nikic-php-parser/PhpParser/Node/Expr/UnaryPlus.php',
510                'PHPUnit\\PhpParser\\Node\\Expr\\Variable' => '/nikic-php-parser/PhpParser/Node/Expr/Variable.php',
511                'PHPUnit\\PhpParser\\Node\\Expr\\YieldFrom' => '/nikic-php-parser/PhpParser/Node/Expr/YieldFrom.php',
512                'PHPUnit\\PhpParser\\Node\\Expr\\Yield_' => '/nikic-php-parser/PhpParser/Node/Expr/Yield_.php',
513                'PHPUnit\\PhpParser\\Node\\FunctionLike' => '/nikic-php-parser/PhpParser/Node/FunctionLike.php',
514                'PHPUnit\\PhpParser\\Node\\Identifier' => '/nikic-php-parser/PhpParser/Node/Identifier.php',
515                'PHPUnit\\PhpParser\\Node\\IntersectionType' => '/nikic-php-parser/PhpParser/Node/IntersectionType.php',
516                'PHPUnit\\PhpParser\\Node\\MatchArm' => '/nikic-php-parser/PhpParser/Node/MatchArm.php',
517                'PHPUnit\\PhpParser\\Node\\Name' => '/nikic-php-parser/PhpParser/Node/Name.php',
518                'PHPUnit\\PhpParser\\Node\\Name\\FullyQualified' => '/nikic-php-parser/PhpParser/Node/Name/FullyQualified.php',
519                'PHPUnit\\PhpParser\\Node\\Name\\Relative' => '/nikic-php-parser/PhpParser/Node/Name/Relative.php',
520                'PHPUnit\\PhpParser\\Node\\NullableType' => '/nikic-php-parser/PhpParser/Node/NullableType.php',
521                'PHPUnit\\PhpParser\\Node\\Param' => '/nikic-php-parser/PhpParser/Node/Param.php',
522                'PHPUnit\\PhpParser\\Node\\Scalar' => '/nikic-php-parser/PhpParser/Node/Scalar.php',
523                'PHPUnit\\PhpParser\\Node\\Scalar\\DNumber' => '/nikic-php-parser/PhpParser/Node/Scalar/DNumber.php',
524                'PHPUnit\\PhpParser\\Node\\Scalar\\Encapsed' => '/nikic-php-parser/PhpParser/Node/Scalar/Encapsed.php',
525                'PHPUnit\\PhpParser\\Node\\Scalar\\EncapsedStringPart' => '/nikic-php-parser/PhpParser/Node/Scalar/EncapsedStringPart.php',
526                'PHPUnit\\PhpParser\\Node\\Scalar\\LNumber' => '/nikic-php-parser/PhpParser/Node/Scalar/LNumber.php',
527                'PHPUnit\\PhpParser\\Node\\Scalar\\MagicConst' => '/nikic-php-parser/PhpParser/Node/Scalar/MagicConst.php',
528                'PHPUnit\\PhpParser\\Node\\Scalar\\MagicConst\\Class_' => '/nikic-php-parser/PhpParser/Node/Scalar/MagicConst/Class_.php',
529                'PHPUnit\\PhpParser\\Node\\Scalar\\MagicConst\\Dir' => '/nikic-php-parser/PhpParser/Node/Scalar/MagicConst/Dir.php',
530                'PHPUnit\\PhpParser\\Node\\Scalar\\MagicConst\\File' => '/nikic-php-parser/PhpParser/Node/Scalar/MagicConst/File.php',
531                'PHPUnit\\PhpParser\\Node\\Scalar\\MagicConst\\Function_' => '/nikic-php-parser/PhpParser/Node/Scalar/MagicConst/Function_.php',
532                'PHPUnit\\PhpParser\\Node\\Scalar\\MagicConst\\Line' => '/nikic-php-parser/PhpParser/Node/Scalar/MagicConst/Line.php',
533                'PHPUnit\\PhpParser\\Node\\Scalar\\MagicConst\\Method' => '/nikic-php-parser/PhpParser/Node/Scalar/MagicConst/Method.php',
534                'PHPUnit\\PhpParser\\Node\\Scalar\\MagicConst\\Namespace_' => '/nikic-php-parser/PhpParser/Node/Scalar/MagicConst/Namespace_.php',
535                'PHPUnit\\PhpParser\\Node\\Scalar\\MagicConst\\Trait_' => '/nikic-php-parser/PhpParser/Node/Scalar/MagicConst/Trait_.php',
536                'PHPUnit\\PhpParser\\Node\\Scalar\\String_' => '/nikic-php-parser/PhpParser/Node/Scalar/String_.php',
537                'PHPUnit\\PhpParser\\Node\\Stmt' => '/nikic-php-parser/PhpParser/Node/Stmt.php',
538                'PHPUnit\\PhpParser\\Node\\Stmt\\Break_' => '/nikic-php-parser/PhpParser/Node/Stmt/Break_.php',
539                'PHPUnit\\PhpParser\\Node\\Stmt\\Case_' => '/nikic-php-parser/PhpParser/Node/Stmt/Case_.php',
540                'PHPUnit\\PhpParser\\Node\\Stmt\\Catch_' => '/nikic-php-parser/PhpParser/Node/Stmt/Catch_.php',
541                'PHPUnit\\PhpParser\\Node\\Stmt\\ClassConst' => '/nikic-php-parser/PhpParser/Node/Stmt/ClassConst.php',
542                'PHPUnit\\PhpParser\\Node\\Stmt\\ClassLike' => '/nikic-php-parser/PhpParser/Node/Stmt/ClassLike.php',
543                'PHPUnit\\PhpParser\\Node\\Stmt\\ClassMethod' => '/nikic-php-parser/PhpParser/Node/Stmt/ClassMethod.php',
544                'PHPUnit\\PhpParser\\Node\\Stmt\\Class_' => '/nikic-php-parser/PhpParser/Node/Stmt/Class_.php',
545                'PHPUnit\\PhpParser\\Node\\Stmt\\Const_' => '/nikic-php-parser/PhpParser/Node/Stmt/Const_.php',
546                'PHPUnit\\PhpParser\\Node\\Stmt\\Continue_' => '/nikic-php-parser/PhpParser/Node/Stmt/Continue_.php',
547                'PHPUnit\\PhpParser\\Node\\Stmt\\DeclareDeclare' => '/nikic-php-parser/PhpParser/Node/Stmt/DeclareDeclare.php',
548                'PHPUnit\\PhpParser\\Node\\Stmt\\Declare_' => '/nikic-php-parser/PhpParser/Node/Stmt/Declare_.php',
549                'PHPUnit\\PhpParser\\Node\\Stmt\\Do_' => '/nikic-php-parser/PhpParser/Node/Stmt/Do_.php',
550                'PHPUnit\\PhpParser\\Node\\Stmt\\Echo_' => '/nikic-php-parser/PhpParser/Node/Stmt/Echo_.php',
551                'PHPUnit\\PhpParser\\Node\\Stmt\\ElseIf_' => '/nikic-php-parser/PhpParser/Node/Stmt/ElseIf_.php',
552                'PHPUnit\\PhpParser\\Node\\Stmt\\Else_' => '/nikic-php-parser/PhpParser/Node/Stmt/Else_.php',
553                'PHPUnit\\PhpParser\\Node\\Stmt\\EnumCase' => '/nikic-php-parser/PhpParser/Node/Stmt/EnumCase.php',
554                'PHPUnit\\PhpParser\\Node\\Stmt\\Enum_' => '/nikic-php-parser/PhpParser/Node/Stmt/Enum_.php',
555                'PHPUnit\\PhpParser\\Node\\Stmt\\Expression' => '/nikic-php-parser/PhpParser/Node/Stmt/Expression.php',
556                'PHPUnit\\PhpParser\\Node\\Stmt\\Finally_' => '/nikic-php-parser/PhpParser/Node/Stmt/Finally_.php',
557                'PHPUnit\\PhpParser\\Node\\Stmt\\For_' => '/nikic-php-parser/PhpParser/Node/Stmt/For_.php',
558                'PHPUnit\\PhpParser\\Node\\Stmt\\Foreach_' => '/nikic-php-parser/PhpParser/Node/Stmt/Foreach_.php',
559                'PHPUnit\\PhpParser\\Node\\Stmt\\Function_' => '/nikic-php-parser/PhpParser/Node/Stmt/Function_.php',
560                'PHPUnit\\PhpParser\\Node\\Stmt\\Global_' => '/nikic-php-parser/PhpParser/Node/Stmt/Global_.php',
561                'PHPUnit\\PhpParser\\Node\\Stmt\\Goto_' => '/nikic-php-parser/PhpParser/Node/Stmt/Goto_.php',
562                'PHPUnit\\PhpParser\\Node\\Stmt\\GroupUse' => '/nikic-php-parser/PhpParser/Node/Stmt/GroupUse.php',
563                'PHPUnit\\PhpParser\\Node\\Stmt\\HaltCompiler' => '/nikic-php-parser/PhpParser/Node/Stmt/HaltCompiler.php',
564                'PHPUnit\\PhpParser\\Node\\Stmt\\If_' => '/nikic-php-parser/PhpParser/Node/Stmt/If_.php',
565                'PHPUnit\\PhpParser\\Node\\Stmt\\InlineHTML' => '/nikic-php-parser/PhpParser/Node/Stmt/InlineHTML.php',
566                'PHPUnit\\PhpParser\\Node\\Stmt\\Interface_' => '/nikic-php-parser/PhpParser/Node/Stmt/Interface_.php',
567                'PHPUnit\\PhpParser\\Node\\Stmt\\Label' => '/nikic-php-parser/PhpParser/Node/Stmt/Label.php',
568                'PHPUnit\\PhpParser\\Node\\Stmt\\Namespace_' => '/nikic-php-parser/PhpParser/Node/Stmt/Namespace_.php',
569                'PHPUnit\\PhpParser\\Node\\Stmt\\Nop' => '/nikic-php-parser/PhpParser/Node/Stmt/Nop.php',
570                'PHPUnit\\PhpParser\\Node\\Stmt\\Property' => '/nikic-php-parser/PhpParser/Node/Stmt/Property.php',
571                'PHPUnit\\PhpParser\\Node\\Stmt\\PropertyProperty' => '/nikic-php-parser/PhpParser/Node/Stmt/PropertyProperty.php',
572                'PHPUnit\\PhpParser\\Node\\Stmt\\Return_' => '/nikic-php-parser/PhpParser/Node/Stmt/Return_.php',
573                'PHPUnit\\PhpParser\\Node\\Stmt\\StaticVar' => '/nikic-php-parser/PhpParser/Node/Stmt/StaticVar.php',
574                'PHPUnit\\PhpParser\\Node\\Stmt\\Static_' => '/nikic-php-parser/PhpParser/Node/Stmt/Static_.php',
575                'PHPUnit\\PhpParser\\Node\\Stmt\\Switch_' => '/nikic-php-parser/PhpParser/Node/Stmt/Switch_.php',
576                'PHPUnit\\PhpParser\\Node\\Stmt\\Throw_' => '/nikic-php-parser/PhpParser/Node/Stmt/Throw_.php',
577                'PHPUnit\\PhpParser\\Node\\Stmt\\TraitUse' => '/nikic-php-parser/PhpParser/Node/Stmt/TraitUse.php',
578                'PHPUnit\\PhpParser\\Node\\Stmt\\TraitUseAdaptation' => '/nikic-php-parser/PhpParser/Node/Stmt/TraitUseAdaptation.php',
579                'PHPUnit\\PhpParser\\Node\\Stmt\\TraitUseAdaptation\\Alias' => '/nikic-php-parser/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php',
580                'PHPUnit\\PhpParser\\Node\\Stmt\\TraitUseAdaptation\\Precedence' => '/nikic-php-parser/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php',
581                'PHPUnit\\PhpParser\\Node\\Stmt\\Trait_' => '/nikic-php-parser/PhpParser/Node/Stmt/Trait_.php',
582                'PHPUnit\\PhpParser\\Node\\Stmt\\TryCatch' => '/nikic-php-parser/PhpParser/Node/Stmt/TryCatch.php',
583                'PHPUnit\\PhpParser\\Node\\Stmt\\Unset_' => '/nikic-php-parser/PhpParser/Node/Stmt/Unset_.php',
584                'PHPUnit\\PhpParser\\Node\\Stmt\\UseUse' => '/nikic-php-parser/PhpParser/Node/Stmt/UseUse.php',
585                'PHPUnit\\PhpParser\\Node\\Stmt\\Use_' => '/nikic-php-parser/PhpParser/Node/Stmt/Use_.php',
586                'PHPUnit\\PhpParser\\Node\\Stmt\\While_' => '/nikic-php-parser/PhpParser/Node/Stmt/While_.php',
587                'PHPUnit\\PhpParser\\Node\\UnionType' => '/nikic-php-parser/PhpParser/Node/UnionType.php',
588                'PHPUnit\\PhpParser\\Node\\VarLikeIdentifier' => '/nikic-php-parser/PhpParser/Node/VarLikeIdentifier.php',
589                'PHPUnit\\PhpParser\\Node\\VariadicPlaceholder' => '/nikic-php-parser/PhpParser/Node/VariadicPlaceholder.php',
590                'PHPUnit\\PhpParser\\Parser' => '/nikic-php-parser/PhpParser/Parser.php',
591                'PHPUnit\\PhpParser\\ParserAbstract' => '/nikic-php-parser/PhpParser/ParserAbstract.php',
592                'PHPUnit\\PhpParser\\ParserFactory' => '/nikic-php-parser/PhpParser/ParserFactory.php',
593                'PHPUnit\\PhpParser\\Parser\\Multiple' => '/nikic-php-parser/PhpParser/Parser/Multiple.php',
594                'PHPUnit\\PhpParser\\Parser\\Php5' => '/nikic-php-parser/PhpParser/Parser/Php5.php',
595                'PHPUnit\\PhpParser\\Parser\\Php7' => '/nikic-php-parser/PhpParser/Parser/Php7.php',
596                'PHPUnit\\PhpParser\\Parser\\Tokens' => '/nikic-php-parser/PhpParser/Parser/Tokens.php',
597                'PHPUnit\\PhpParser\\PrettyPrinterAbstract' => '/nikic-php-parser/PhpParser/PrettyPrinterAbstract.php',
598                'PHPUnit\\PhpParser\\PrettyPrinter\\Standard' => '/nikic-php-parser/PhpParser/PrettyPrinter/Standard.php',
599                'PHPUnit\\Runner\\AfterIncompleteTestHook' => '/phpunit/Runner/Hook/AfterIncompleteTestHook.php',
600                'PHPUnit\\Runner\\AfterLastTestHook' => '/phpunit/Runner/Hook/AfterLastTestHook.php',
601                'PHPUnit\\Runner\\AfterRiskyTestHook' => '/phpunit/Runner/Hook/AfterRiskyTestHook.php',
602                'PHPUnit\\Runner\\AfterSkippedTestHook' => '/phpunit/Runner/Hook/AfterSkippedTestHook.php',
603                'PHPUnit\\Runner\\AfterSuccessfulTestHook' => '/phpunit/Runner/Hook/AfterSuccessfulTestHook.php',
604                'PHPUnit\\Runner\\AfterTestErrorHook' => '/phpunit/Runner/Hook/AfterTestErrorHook.php',
605                'PHPUnit\\Runner\\AfterTestFailureHook' => '/phpunit/Runner/Hook/AfterTestFailureHook.php',
606                'PHPUnit\\Runner\\AfterTestHook' => '/phpunit/Runner/Hook/AfterTestHook.php',
607                'PHPUnit\\Runner\\AfterTestWarningHook' => '/phpunit/Runner/Hook/AfterTestWarningHook.php',
608                'PHPUnit\\Runner\\BaseTestRunner' => '/phpunit/Runner/BaseTestRunner.php',
609                'PHPUnit\\Runner\\BeforeFirstTestHook' => '/phpunit/Runner/Hook/BeforeFirstTestHook.php',
610                'PHPUnit\\Runner\\BeforeTestHook' => '/phpunit/Runner/Hook/BeforeTestHook.php',
611                'PHPUnit\\Runner\\DefaultTestResultCache' => '/phpunit/Runner/DefaultTestResultCache.php',
612                'PHPUnit\\Runner\\Exception' => '/phpunit/Runner/Exception.php',
613                'PHPUnit\\Runner\\Extension\\ExtensionHandler' => '/phpunit/Runner/Extension/ExtensionHandler.php',
614                'PHPUnit\\Runner\\Extension\\PharLoader' => '/phpunit/Runner/Extension/PharLoader.php',
615                'PHPUnit\\Runner\\Filter\\ExcludeGroupFilterIterator' => '/phpunit/Runner/Filter/ExcludeGroupFilterIterator.php',
616                'PHPUnit\\Runner\\Filter\\Factory' => '/phpunit/Runner/Filter/Factory.php',
617                'PHPUnit\\Runner\\Filter\\GroupFilterIterator' => '/phpunit/Runner/Filter/GroupFilterIterator.php',
618                'PHPUnit\\Runner\\Filter\\IncludeGroupFilterIterator' => '/phpunit/Runner/Filter/IncludeGroupFilterIterator.php',
619                'PHPUnit\\Runner\\Filter\\NameFilterIterator' => '/phpunit/Runner/Filter/NameFilterIterator.php',
620                'PHPUnit\\Runner\\Hook' => '/phpunit/Runner/Hook/Hook.php',
621                'PHPUnit\\Runner\\NullTestResultCache' => '/phpunit/Runner/NullTestResultCache.php',
622                'PHPUnit\\Runner\\PhptTestCase' => '/phpunit/Runner/PhptTestCase.php',
623                'PHPUnit\\Runner\\ResultCacheExtension' => '/phpunit/Runner/ResultCacheExtension.php',
624                'PHPUnit\\Runner\\StandardTestSuiteLoader' => '/phpunit/Runner/StandardTestSuiteLoader.php',
625                'PHPUnit\\Runner\\TestHook' => '/phpunit/Runner/Hook/TestHook.php',
626                'PHPUnit\\Runner\\TestListenerAdapter' => '/phpunit/Runner/Hook/TestListenerAdapter.php',
627                'PHPUnit\\Runner\\TestResultCache' => '/phpunit/Runner/TestResultCache.php',
628                'PHPUnit\\Runner\\TestSuiteLoader' => '/phpunit/Runner/TestSuiteLoader.php',
629                'PHPUnit\\Runner\\TestSuiteSorter' => '/phpunit/Runner/TestSuiteSorter.php',
630                'PHPUnit\\Runner\\Version' => '/phpunit/Runner/Version.php',
631                'PHPUnit\\SebastianBergmann\\CliParser\\AmbiguousOptionException' => '/sebastian-cli-parser/exceptions/AmbiguousOptionException.php',
632                'PHPUnit\\SebastianBergmann\\CliParser\\Exception' => '/sebastian-cli-parser/exceptions/Exception.php',
633                'PHPUnit\\SebastianBergmann\\CliParser\\OptionDoesNotAllowArgumentException' => '/sebastian-cli-parser/exceptions/OptionDoesNotAllowArgumentException.php',
634                'PHPUnit\\SebastianBergmann\\CliParser\\Parser' => '/sebastian-cli-parser/Parser.php',
635                'PHPUnit\\SebastianBergmann\\CliParser\\RequiredOptionArgumentMissingException' => '/sebastian-cli-parser/exceptions/RequiredOptionArgumentMissingException.php',
636                'PHPUnit\\SebastianBergmann\\CliParser\\UnknownOptionException' => '/sebastian-cli-parser/exceptions/UnknownOptionException.php',
637                'PHPUnit\\SebastianBergmann\\CodeCoverage\\BranchAndPathCoverageNotSupportedException' => '/php-code-coverage/Exception/BranchAndPathCoverageNotSupportedException.php',
638                'PHPUnit\\SebastianBergmann\\CodeCoverage\\CodeCoverage' => '/php-code-coverage/CodeCoverage.php',
639                'PHPUnit\\SebastianBergmann\\CodeCoverage\\CrapIndex' => '/php-code-coverage/CrapIndex.php',
640                'PHPUnit\\SebastianBergmann\\CodeCoverage\\DeadCodeDetectionNotSupportedException' => '/php-code-coverage/Exception/DeadCodeDetectionNotSupportedException.php',
641                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Directory' => '/php-code-coverage/Directory.php',
642                'PHPUnit\\SebastianBergmann\\CodeCoverage\\DirectoryCouldNotBeCreatedException' => '/php-code-coverage/Exception/DirectoryCouldNotBeCreatedException.php',
643                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\Driver' => '/php-code-coverage/Driver/Driver.php',
644                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\PathExistsButIsNotDirectoryException' => '/php-code-coverage/Exception/PathExistsButIsNotDirectoryException.php',
645                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\PcovDriver' => '/php-code-coverage/Driver/PcovDriver.php',
646                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\PcovNotAvailableException' => '/php-code-coverage/Exception/PcovNotAvailableException.php',
647                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\PhpdbgDriver' => '/php-code-coverage/Driver/PhpdbgDriver.php',
648                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\PhpdbgNotAvailableException' => '/php-code-coverage/Exception/PhpdbgNotAvailableException.php',
649                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\Selector' => '/php-code-coverage/Driver/Selector.php',
650                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\WriteOperationFailedException' => '/php-code-coverage/Exception/WriteOperationFailedException.php',
651                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\WrongXdebugVersionException' => '/php-code-coverage/Exception/WrongXdebugVersionException.php',
652                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\Xdebug2Driver' => '/php-code-coverage/Driver/Xdebug2Driver.php',
653                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\Xdebug2NotEnabledException' => '/php-code-coverage/Exception/Xdebug2NotEnabledException.php',
654                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\Xdebug3Driver' => '/php-code-coverage/Driver/Xdebug3Driver.php',
655                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\Xdebug3NotEnabledException' => '/php-code-coverage/Exception/Xdebug3NotEnabledException.php',
656                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\XdebugNotAvailableException' => '/php-code-coverage/Exception/XdebugNotAvailableException.php',
657                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Exception' => '/php-code-coverage/Exception/Exception.php',
658                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Filter' => '/php-code-coverage/Filter.php',
659                'PHPUnit\\SebastianBergmann\\CodeCoverage\\InvalidArgumentException' => '/php-code-coverage/Exception/InvalidArgumentException.php',
660                'PHPUnit\\SebastianBergmann\\CodeCoverage\\NoCodeCoverageDriverAvailableException' => '/php-code-coverage/Exception/NoCodeCoverageDriverAvailableException.php',
661                'PHPUnit\\SebastianBergmann\\CodeCoverage\\NoCodeCoverageDriverWithPathCoverageSupportAvailableException' => '/php-code-coverage/Exception/NoCodeCoverageDriverWithPathCoverageSupportAvailableException.php',
662                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Node\\AbstractNode' => '/php-code-coverage/Node/AbstractNode.php',
663                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Node\\Builder' => '/php-code-coverage/Node/Builder.php',
664                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Node\\Directory' => '/php-code-coverage/Node/Directory.php',
665                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Node\\File' => '/php-code-coverage/Node/File.php',
666                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Node\\Iterator' => '/php-code-coverage/Node/Iterator.php',
667                'PHPUnit\\SebastianBergmann\\CodeCoverage\\ParserException' => '/php-code-coverage/Exception/ParserException.php',
668                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Percentage' => '/php-code-coverage/Percentage.php',
669                'PHPUnit\\SebastianBergmann\\CodeCoverage\\ProcessedCodeCoverageData' => '/php-code-coverage/ProcessedCodeCoverageData.php',
670                'PHPUnit\\SebastianBergmann\\CodeCoverage\\RawCodeCoverageData' => '/php-code-coverage/RawCodeCoverageData.php',
671                'PHPUnit\\SebastianBergmann\\CodeCoverage\\ReflectionException' => '/php-code-coverage/Exception/ReflectionException.php',
672                'PHPUnit\\SebastianBergmann\\CodeCoverage\\ReportAlreadyFinalizedException' => '/php-code-coverage/Exception/ReportAlreadyFinalizedException.php',
673                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Clover' => '/php-code-coverage/Report/Clover.php',
674                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Cobertura' => '/php-code-coverage/Report/Cobertura.php',
675                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Crap4j' => '/php-code-coverage/Report/Crap4j.php',
676                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Html\\Dashboard' => '/php-code-coverage/Report/Html/Renderer/Dashboard.php',
677                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Html\\Directory' => '/php-code-coverage/Report/Html/Renderer/Directory.php',
678                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Html\\Facade' => '/php-code-coverage/Report/Html/Facade.php',
679                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Html\\File' => '/php-code-coverage/Report/Html/Renderer/File.php',
680                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Html\\Renderer' => '/php-code-coverage/Report/Html/Renderer.php',
681                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\PHP' => '/php-code-coverage/Report/PHP.php',
682                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Text' => '/php-code-coverage/Report/Text.php',
683                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\BuildInformation' => '/php-code-coverage/Report/Xml/BuildInformation.php',
684                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\Coverage' => '/php-code-coverage/Report/Xml/Coverage.php',
685                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\Directory' => '/php-code-coverage/Report/Xml/Directory.php',
686                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\Facade' => '/php-code-coverage/Report/Xml/Facade.php',
687                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\File' => '/php-code-coverage/Report/Xml/File.php',
688                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\Method' => '/php-code-coverage/Report/Xml/Method.php',
689                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\Node' => '/php-code-coverage/Report/Xml/Node.php',
690                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\Project' => '/php-code-coverage/Report/Xml/Project.php',
691                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\Report' => '/php-code-coverage/Report/Xml/Report.php',
692                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\Source' => '/php-code-coverage/Report/Xml/Source.php',
693                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\Tests' => '/php-code-coverage/Report/Xml/Tests.php',
694                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\Totals' => '/php-code-coverage/Report/Xml/Totals.php',
695                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\Unit' => '/php-code-coverage/Report/Xml/Unit.php',
696                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysisCacheNotConfiguredException' => '/php-code-coverage/Exception/StaticAnalysisCacheNotConfiguredException.php',
697                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysis\\Cache' => '/php-code-coverage/StaticAnalysis/Cache.php',
698                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysis\\CacheWarmer' => '/php-code-coverage/StaticAnalysis/CacheWarmer.php',
699                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysis\\CachingCoveredFileAnalyser' => '/php-code-coverage/StaticAnalysis/CachingCoveredFileAnalyser.php',
700                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysis\\CachingUncoveredFileAnalyser' => '/php-code-coverage/StaticAnalysis/CachingUncoveredFileAnalyser.php',
701                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysis\\CodeUnitFindingVisitor' => '/php-code-coverage/StaticAnalysis/CodeUnitFindingVisitor.php',
702                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysis\\CoveredFileAnalyser' => '/php-code-coverage/StaticAnalysis/CoveredFileAnalyser.php',
703                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysis\\ExecutableLinesFindingVisitor' => '/php-code-coverage/StaticAnalysis/ExecutableLinesFindingVisitor.php',
704                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysis\\IgnoredLinesFindingVisitor' => '/php-code-coverage/StaticAnalysis/IgnoredLinesFindingVisitor.php',
705                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysis\\ParsingCoveredFileAnalyser' => '/php-code-coverage/StaticAnalysis/ParsingCoveredFileAnalyser.php',
706                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysis\\ParsingUncoveredFileAnalyser' => '/php-code-coverage/StaticAnalysis/ParsingUncoveredFileAnalyser.php',
707                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysis\\UncoveredFileAnalyser' => '/php-code-coverage/StaticAnalysis/UncoveredFileAnalyser.php',
708                'PHPUnit\\SebastianBergmann\\CodeCoverage\\TestIdMissingException' => '/php-code-coverage/Exception/TestIdMissingException.php',
709                'PHPUnit\\SebastianBergmann\\CodeCoverage\\UnintentionallyCoveredCodeException' => '/php-code-coverage/Exception/UnintentionallyCoveredCodeException.php',
710                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Version' => '/php-code-coverage/Version.php',
711                'PHPUnit\\SebastianBergmann\\CodeCoverage\\XmlException' => '/php-code-coverage/Exception/XmlException.php',
712                'PHPUnit\\SebastianBergmann\\CodeUnitReverseLookup\\Wizard' => '/sebastian-code-unit-reverse-lookup/Wizard.php',
713                'PHPUnit\\SebastianBergmann\\CodeUnit\\ClassMethodUnit' => '/sebastian-code-unit/ClassMethodUnit.php',
714                'PHPUnit\\SebastianBergmann\\CodeUnit\\ClassUnit' => '/sebastian-code-unit/ClassUnit.php',
715                'PHPUnit\\SebastianBergmann\\CodeUnit\\CodeUnit' => '/sebastian-code-unit/CodeUnit.php',
716                'PHPUnit\\SebastianBergmann\\CodeUnit\\CodeUnitCollection' => '/sebastian-code-unit/CodeUnitCollection.php',
717                'PHPUnit\\SebastianBergmann\\CodeUnit\\CodeUnitCollectionIterator' => '/sebastian-code-unit/CodeUnitCollectionIterator.php',
718                'PHPUnit\\SebastianBergmann\\CodeUnit\\Exception' => '/sebastian-code-unit/exceptions/Exception.php',
719                'PHPUnit\\SebastianBergmann\\CodeUnit\\FunctionUnit' => '/sebastian-code-unit/FunctionUnit.php',
720                'PHPUnit\\SebastianBergmann\\CodeUnit\\InterfaceMethodUnit' => '/sebastian-code-unit/InterfaceMethodUnit.php',
721                'PHPUnit\\SebastianBergmann\\CodeUnit\\InterfaceUnit' => '/sebastian-code-unit/InterfaceUnit.php',
722                'PHPUnit\\SebastianBergmann\\CodeUnit\\InvalidCodeUnitException' => '/sebastian-code-unit/exceptions/InvalidCodeUnitException.php',
723                'PHPUnit\\SebastianBergmann\\CodeUnit\\Mapper' => '/sebastian-code-unit/Mapper.php',
724                'PHPUnit\\SebastianBergmann\\CodeUnit\\NoTraitException' => '/sebastian-code-unit/exceptions/NoTraitException.php',
725                'PHPUnit\\SebastianBergmann\\CodeUnit\\ReflectionException' => '/sebastian-code-unit/exceptions/ReflectionException.php',
726                'PHPUnit\\SebastianBergmann\\CodeUnit\\TraitMethodUnit' => '/sebastian-code-unit/TraitMethodUnit.php',
727                'PHPUnit\\SebastianBergmann\\CodeUnit\\TraitUnit' => '/sebastian-code-unit/TraitUnit.php',
728                'PHPUnit\\SebastianBergmann\\Comparator\\ArrayComparator' => '/sebastian-comparator/ArrayComparator.php',
729                'PHPUnit\\SebastianBergmann\\Comparator\\Comparator' => '/sebastian-comparator/Comparator.php',
730                'PHPUnit\\SebastianBergmann\\Comparator\\ComparisonFailure' => '/sebastian-comparator/ComparisonFailure.php',
731                'PHPUnit\\SebastianBergmann\\Comparator\\DOMNodeComparator' => '/sebastian-comparator/DOMNodeComparator.php',
732                'PHPUnit\\SebastianBergmann\\Comparator\\DateTimeComparator' => '/sebastian-comparator/DateTimeComparator.php',
733                'PHPUnit\\SebastianBergmann\\Comparator\\DoubleComparator' => '/sebastian-comparator/DoubleComparator.php',
734                'PHPUnit\\SebastianBergmann\\Comparator\\Exception' => '/sebastian-comparator/exceptions/Exception.php',
735                'PHPUnit\\SebastianBergmann\\Comparator\\ExceptionComparator' => '/sebastian-comparator/ExceptionComparator.php',
736                'PHPUnit\\SebastianBergmann\\Comparator\\Factory' => '/sebastian-comparator/Factory.php',
737                'PHPUnit\\SebastianBergmann\\Comparator\\MockObjectComparator' => '/sebastian-comparator/MockObjectComparator.php',
738                'PHPUnit\\SebastianBergmann\\Comparator\\NumericComparator' => '/sebastian-comparator/NumericComparator.php',
739                'PHPUnit\\SebastianBergmann\\Comparator\\ObjectComparator' => '/sebastian-comparator/ObjectComparator.php',
740                'PHPUnit\\SebastianBergmann\\Comparator\\ResourceComparator' => '/sebastian-comparator/ResourceComparator.php',
741                'PHPUnit\\SebastianBergmann\\Comparator\\RuntimeException' => '/sebastian-comparator/exceptions/RuntimeException.php',
742                'PHPUnit\\SebastianBergmann\\Comparator\\ScalarComparator' => '/sebastian-comparator/ScalarComparator.php',
743                'PHPUnit\\SebastianBergmann\\Comparator\\SplObjectStorageComparator' => '/sebastian-comparator/SplObjectStorageComparator.php',
744                'PHPUnit\\SebastianBergmann\\Comparator\\TypeComparator' => '/sebastian-comparator/TypeComparator.php',
745                'PHPUnit\\SebastianBergmann\\Complexity\\Calculator' => '/sebastian-complexity/Calculator.php',
746                'PHPUnit\\SebastianBergmann\\Complexity\\Complexity' => '/sebastian-complexity/Complexity/Complexity.php',
747                'PHPUnit\\SebastianBergmann\\Complexity\\ComplexityCalculatingVisitor' => '/sebastian-complexity/Visitor/ComplexityCalculatingVisitor.php',
748                'PHPUnit\\SebastianBergmann\\Complexity\\ComplexityCollection' => '/sebastian-complexity/Complexity/ComplexityCollection.php',
749                'PHPUnit\\SebastianBergmann\\Complexity\\ComplexityCollectionIterator' => '/sebastian-complexity/Complexity/ComplexityCollectionIterator.php',
750                'PHPUnit\\SebastianBergmann\\Complexity\\CyclomaticComplexityCalculatingVisitor' => '/sebastian-complexity/Visitor/CyclomaticComplexityCalculatingVisitor.php',
751                'PHPUnit\\SebastianBergmann\\Complexity\\Exception' => '/sebastian-complexity/Exception/Exception.php',
752                'PHPUnit\\SebastianBergmann\\Complexity\\RuntimeException' => '/sebastian-complexity/Exception/RuntimeException.php',
753                'PHPUnit\\SebastianBergmann\\Diff\\Chunk' => '/sebastian-diff/Chunk.php',
754                'PHPUnit\\SebastianBergmann\\Diff\\ConfigurationException' => '/sebastian-diff/Exception/ConfigurationException.php',
755                'PHPUnit\\SebastianBergmann\\Diff\\Diff' => '/sebastian-diff/Diff.php',
756                'PHPUnit\\SebastianBergmann\\Diff\\Differ' => '/sebastian-diff/Differ.php',
757                'PHPUnit\\SebastianBergmann\\Diff\\Exception' => '/sebastian-diff/Exception/Exception.php',
758                'PHPUnit\\SebastianBergmann\\Diff\\InvalidArgumentException' => '/sebastian-diff/Exception/InvalidArgumentException.php',
759                'PHPUnit\\SebastianBergmann\\Diff\\Line' => '/sebastian-diff/Line.php',
760                'PHPUnit\\SebastianBergmann\\Diff\\LongestCommonSubsequenceCalculator' => '/sebastian-diff/LongestCommonSubsequenceCalculator.php',
761                'PHPUnit\\SebastianBergmann\\Diff\\MemoryEfficientLongestCommonSubsequenceCalculator' => '/sebastian-diff/MemoryEfficientLongestCommonSubsequenceCalculator.php',
762                'PHPUnit\\SebastianBergmann\\Diff\\Output\\AbstractChunkOutputBuilder' => '/sebastian-diff/Output/AbstractChunkOutputBuilder.php',
763                'PHPUnit\\SebastianBergmann\\Diff\\Output\\DiffOnlyOutputBuilder' => '/sebastian-diff/Output/DiffOnlyOutputBuilder.php',
764                'PHPUnit\\SebastianBergmann\\Diff\\Output\\DiffOutputBuilderInterface' => '/sebastian-diff/Output/DiffOutputBuilderInterface.php',
765                'PHPUnit\\SebastianBergmann\\Diff\\Output\\StrictUnifiedDiffOutputBuilder' => '/sebastian-diff/Output/StrictUnifiedDiffOutputBuilder.php',
766                'PHPUnit\\SebastianBergmann\\Diff\\Output\\UnifiedDiffOutputBuilder' => '/sebastian-diff/Output/UnifiedDiffOutputBuilder.php',
767                'PHPUnit\\SebastianBergmann\\Diff\\Parser' => '/sebastian-diff/Parser.php',
768                'PHPUnit\\SebastianBergmann\\Diff\\TimeEfficientLongestCommonSubsequenceCalculator' => '/sebastian-diff/TimeEfficientLongestCommonSubsequenceCalculator.php',
769                'PHPUnit\\SebastianBergmann\\Environment\\Console' => '/sebastian-environment/Console.php',
770                'PHPUnit\\SebastianBergmann\\Environment\\OperatingSystem' => '/sebastian-environment/OperatingSystem.php',
771                'PHPUnit\\SebastianBergmann\\Environment\\Runtime' => '/sebastian-environment/Runtime.php',
772                'PHPUnit\\SebastianBergmann\\Exporter\\Exporter' => '/sebastian-exporter/Exporter.php',
773                'PHPUnit\\SebastianBergmann\\FileIterator\\Facade' => '/php-file-iterator/Facade.php',
774                'PHPUnit\\SebastianBergmann\\FileIterator\\Factory' => '/php-file-iterator/Factory.php',
775                'PHPUnit\\SebastianBergmann\\FileIterator\\Iterator' => '/php-file-iterator/Iterator.php',
776                'PHPUnit\\SebastianBergmann\\GlobalState\\CodeExporter' => '/sebastian-global-state/CodeExporter.php',
777                'PHPUnit\\SebastianBergmann\\GlobalState\\Exception' => '/sebastian-global-state/exceptions/Exception.php',
778                'PHPUnit\\SebastianBergmann\\GlobalState\\ExcludeList' => '/sebastian-global-state/ExcludeList.php',
779                'PHPUnit\\SebastianBergmann\\GlobalState\\Restorer' => '/sebastian-global-state/Restorer.php',
780                'PHPUnit\\SebastianBergmann\\GlobalState\\RuntimeException' => '/sebastian-global-state/exceptions/RuntimeException.php',
781                'PHPUnit\\SebastianBergmann\\GlobalState\\Snapshot' => '/sebastian-global-state/Snapshot.php',
782                'PHPUnit\\SebastianBergmann\\Invoker\\Exception' => '/php-invoker/exceptions/Exception.php',
783                'PHPUnit\\SebastianBergmann\\Invoker\\Invoker' => '/php-invoker/Invoker.php',
784                'PHPUnit\\SebastianBergmann\\Invoker\\ProcessControlExtensionNotLoadedException' => '/php-invoker/exceptions/ProcessControlExtensionNotLoadedException.php',
785                'PHPUnit\\SebastianBergmann\\Invoker\\TimeoutException' => '/php-invoker/exceptions/TimeoutException.php',
786                'PHPUnit\\SebastianBergmann\\LinesOfCode\\Counter' => '/sebastian-lines-of-code/Counter.php',
787                'PHPUnit\\SebastianBergmann\\LinesOfCode\\Exception' => '/sebastian-lines-of-code/Exception/Exception.php',
788                'PHPUnit\\SebastianBergmann\\LinesOfCode\\IllogicalValuesException' => '/sebastian-lines-of-code/Exception/IllogicalValuesException.php',
789                'PHPUnit\\SebastianBergmann\\LinesOfCode\\LineCountingVisitor' => '/sebastian-lines-of-code/LineCountingVisitor.php',
790                'PHPUnit\\SebastianBergmann\\LinesOfCode\\LinesOfCode' => '/sebastian-lines-of-code/LinesOfCode.php',
791                'PHPUnit\\SebastianBergmann\\LinesOfCode\\NegativeValueException' => '/sebastian-lines-of-code/Exception/NegativeValueException.php',
792                'PHPUnit\\SebastianBergmann\\LinesOfCode\\RuntimeException' => '/sebastian-lines-of-code/Exception/RuntimeException.php',
793                'PHPUnit\\SebastianBergmann\\ObjectEnumerator\\Enumerator' => '/sebastian-object-enumerator/Enumerator.php',
794                'PHPUnit\\SebastianBergmann\\ObjectEnumerator\\Exception' => '/sebastian-object-enumerator/Exception.php',
795                'PHPUnit\\SebastianBergmann\\ObjectEnumerator\\InvalidArgumentException' => '/sebastian-object-enumerator/InvalidArgumentException.php',
796                'PHPUnit\\SebastianBergmann\\ObjectReflector\\Exception' => '/sebastian-object-reflector/Exception.php',
797                'PHPUnit\\SebastianBergmann\\ObjectReflector\\InvalidArgumentException' => '/sebastian-object-reflector/InvalidArgumentException.php',
798                'PHPUnit\\SebastianBergmann\\ObjectReflector\\ObjectReflector' => '/sebastian-object-reflector/ObjectReflector.php',
799                'PHPUnit\\SebastianBergmann\\RecursionContext\\Context' => '/sebastian-recursion-context/Context.php',
800                'PHPUnit\\SebastianBergmann\\RecursionContext\\Exception' => '/sebastian-recursion-context/Exception.php',
801                'PHPUnit\\SebastianBergmann\\RecursionContext\\InvalidArgumentException' => '/sebastian-recursion-context/InvalidArgumentException.php',
802                'PHPUnit\\SebastianBergmann\\ResourceOperations\\ResourceOperations' => '/sebastian-resource-operations/ResourceOperations.php',
803                'PHPUnit\\SebastianBergmann\\Template\\Exception' => '/php-text-template/exceptions/Exception.php',
804                'PHPUnit\\SebastianBergmann\\Template\\InvalidArgumentException' => '/php-text-template/exceptions/InvalidArgumentException.php',
805                'PHPUnit\\SebastianBergmann\\Template\\RuntimeException' => '/php-text-template/exceptions/RuntimeException.php',
806                'PHPUnit\\SebastianBergmann\\Template\\Template' => '/php-text-template/Template.php',
807                'PHPUnit\\SebastianBergmann\\Timer\\Duration' => '/php-timer/Duration.php',
808                'PHPUnit\\SebastianBergmann\\Timer\\Exception' => '/php-timer/exceptions/Exception.php',
809                'PHPUnit\\SebastianBergmann\\Timer\\NoActiveTimerException' => '/php-timer/exceptions/NoActiveTimerException.php',
810                'PHPUnit\\SebastianBergmann\\Timer\\ResourceUsageFormatter' => '/php-timer/ResourceUsageFormatter.php',
811                'PHPUnit\\SebastianBergmann\\Timer\\TimeSinceStartOfRequestNotAvailableException' => '/php-timer/exceptions/TimeSinceStartOfRequestNotAvailableException.php',
812                'PHPUnit\\SebastianBergmann\\Timer\\Timer' => '/php-timer/Timer.php',
813                'PHPUnit\\SebastianBergmann\\Type\\CallableType' => '/sebastian-type/CallableType.php',
814                'PHPUnit\\SebastianBergmann\\Type\\Exception' => '/sebastian-type/exception/Exception.php',
815                'PHPUnit\\SebastianBergmann\\Type\\FalseType' => '/sebastian-type/FalseType.php',
816                'PHPUnit\\SebastianBergmann\\Type\\GenericObjectType' => '/sebastian-type/GenericObjectType.php',
817                'PHPUnit\\SebastianBergmann\\Type\\IterableType' => '/sebastian-type/IterableType.php',
818                'PHPUnit\\SebastianBergmann\\Type\\LogicException' => '/sebastian-type/exception/LogicException.php',
819                'PHPUnit\\SebastianBergmann\\Type\\MixedType' => '/sebastian-type/MixedType.php',
820                'PHPUnit\\SebastianBergmann\\Type\\NullType' => '/sebastian-type/NullType.php',
821                'PHPUnit\\SebastianBergmann\\Type\\ObjectType' => '/sebastian-type/ObjectType.php',
822                'PHPUnit\\SebastianBergmann\\Type\\ReflectionMapper' => '/sebastian-type/ReflectionMapper.php',
823                'PHPUnit\\SebastianBergmann\\Type\\RuntimeException' => '/sebastian-type/exception/RuntimeException.php',
824                'PHPUnit\\SebastianBergmann\\Type\\SimpleType' => '/sebastian-type/SimpleType.php',
825                'PHPUnit\\SebastianBergmann\\Type\\StaticType' => '/sebastian-type/StaticType.php',
826                'PHPUnit\\SebastianBergmann\\Type\\Type' => '/sebastian-type/Type.php',
827                'PHPUnit\\SebastianBergmann\\Type\\TypeName' => '/sebastian-type/TypeName.php',
828                'PHPUnit\\SebastianBergmann\\Type\\UnionType' => '/sebastian-type/UnionType.php',
829                'PHPUnit\\SebastianBergmann\\Type\\UnknownType' => '/sebastian-type/UnknownType.php',
830                'PHPUnit\\SebastianBergmann\\Type\\VoidType' => '/sebastian-type/VoidType.php',
831                'PHPUnit\\SebastianBergmann\\Version' => '/sebastian-version/Version.php',
832                'PHPUnit\\Symfony\\Polyfill\\Ctype\\Ctype' => '/symfony-polyfill-ctype/Ctype.php',
833                'PHPUnit\\TextUI\\CliArguments\\Builder' => '/phpunit/TextUI/CliArguments/Builder.php',
834                'PHPUnit\\TextUI\\CliArguments\\Configuration' => '/phpunit/TextUI/CliArguments/Configuration.php',
835                'PHPUnit\\TextUI\\CliArguments\\Exception' => '/phpunit/TextUI/CliArguments/Exception.php',
836                'PHPUnit\\TextUI\\CliArguments\\Mapper' => '/phpunit/TextUI/CliArguments/Mapper.php',
837                'PHPUnit\\TextUI\\Command' => '/phpunit/TextUI/Command.php',
838                'PHPUnit\\TextUI\\DefaultResultPrinter' => '/phpunit/TextUI/DefaultResultPrinter.php',
839                'PHPUnit\\TextUI\\Exception' => '/phpunit/TextUI/Exception/Exception.php',
840                'PHPUnit\\TextUI\\Help' => '/phpunit/TextUI/Help.php',
841                'PHPUnit\\TextUI\\ReflectionException' => '/phpunit/TextUI/Exception/ReflectionException.php',
842                'PHPUnit\\TextUI\\ResultPrinter' => '/phpunit/TextUI/ResultPrinter.php',
843                'PHPUnit\\TextUI\\RuntimeException' => '/phpunit/TextUI/Exception/RuntimeException.php',
844                'PHPUnit\\TextUI\\TestDirectoryNotFoundException' => '/phpunit/TextUI/Exception/TestDirectoryNotFoundException.php',
845                'PHPUnit\\TextUI\\TestFileNotFoundException' => '/phpunit/TextUI/Exception/TestFileNotFoundException.php',
846                'PHPUnit\\TextUI\\TestRunner' => '/phpunit/TextUI/TestRunner.php',
847                'PHPUnit\\TextUI\\TestSuiteMapper' => '/phpunit/TextUI/TestSuiteMapper.php',
848                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\CodeCoverage' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/CodeCoverage.php',
849                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\FilterMapper' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/FilterMapper.php',
850                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Filter\\Directory' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/Filter/Directory.php',
851                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Filter\\DirectoryCollection' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/Filter/DirectoryCollection.php',
852                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Filter\\DirectoryCollectionIterator' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/Filter/DirectoryCollectionIterator.php',
853                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Clover' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/Report/Clover.php',
854                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Cobertura' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/Report/Cobertura.php',
855                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Crap4j' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/Report/Crap4j.php',
856                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Html' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/Report/Html.php',
857                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Php' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/Report/Php.php',
858                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Text' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/Report/Text.php',
859                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Xml' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/Report/Xml.php',
860                'PHPUnit\\TextUI\\XmlConfiguration\\Configuration' => '/phpunit/TextUI/XmlConfiguration/Configuration.php',
861                'PHPUnit\\TextUI\\XmlConfiguration\\Constant' => '/phpunit/TextUI/XmlConfiguration/PHP/Constant.php',
862                'PHPUnit\\TextUI\\XmlConfiguration\\ConstantCollection' => '/phpunit/TextUI/XmlConfiguration/PHP/ConstantCollection.php',
863                'PHPUnit\\TextUI\\XmlConfiguration\\ConstantCollectionIterator' => '/phpunit/TextUI/XmlConfiguration/PHP/ConstantCollectionIterator.php',
864                'PHPUnit\\TextUI\\XmlConfiguration\\ConvertLogTypes' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/ConvertLogTypes.php',
865                'PHPUnit\\TextUI\\XmlConfiguration\\CoverageCloverToReport' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/CoverageCloverToReport.php',
866                'PHPUnit\\TextUI\\XmlConfiguration\\CoverageCrap4jToReport' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/CoverageCrap4jToReport.php',
867                'PHPUnit\\TextUI\\XmlConfiguration\\CoverageHtmlToReport' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/CoverageHtmlToReport.php',
868                'PHPUnit\\TextUI\\XmlConfiguration\\CoveragePhpToReport' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/CoveragePhpToReport.php',
869                'PHPUnit\\TextUI\\XmlConfiguration\\CoverageTextToReport' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/CoverageTextToReport.php',
870                'PHPUnit\\TextUI\\XmlConfiguration\\CoverageXmlToReport' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/CoverageXmlToReport.php',
871                'PHPUnit\\TextUI\\XmlConfiguration\\Directory' => '/phpunit/TextUI/XmlConfiguration/Filesystem/Directory.php',
872                'PHPUnit\\TextUI\\XmlConfiguration\\DirectoryCollection' => '/phpunit/TextUI/XmlConfiguration/Filesystem/DirectoryCollection.php',
873                'PHPUnit\\TextUI\\XmlConfiguration\\DirectoryCollectionIterator' => '/phpunit/TextUI/XmlConfiguration/Filesystem/DirectoryCollectionIterator.php',
874                'PHPUnit\\TextUI\\XmlConfiguration\\Exception' => '/phpunit/TextUI/XmlConfiguration/Exception.php',
875                'PHPUnit\\TextUI\\XmlConfiguration\\Extension' => '/phpunit/TextUI/XmlConfiguration/PHPUnit/Extension.php',
876                'PHPUnit\\TextUI\\XmlConfiguration\\ExtensionCollection' => '/phpunit/TextUI/XmlConfiguration/PHPUnit/ExtensionCollection.php',
877                'PHPUnit\\TextUI\\XmlConfiguration\\ExtensionCollectionIterator' => '/phpunit/TextUI/XmlConfiguration/PHPUnit/ExtensionCollectionIterator.php',
878                'PHPUnit\\TextUI\\XmlConfiguration\\File' => '/phpunit/TextUI/XmlConfiguration/Filesystem/File.php',
879                'PHPUnit\\TextUI\\XmlConfiguration\\FileCollection' => '/phpunit/TextUI/XmlConfiguration/Filesystem/FileCollection.php',
880                'PHPUnit\\TextUI\\XmlConfiguration\\FileCollectionIterator' => '/phpunit/TextUI/XmlConfiguration/Filesystem/FileCollectionIterator.php',
881                'PHPUnit\\TextUI\\XmlConfiguration\\Generator' => '/phpunit/TextUI/XmlConfiguration/Generator.php',
882                'PHPUnit\\TextUI\\XmlConfiguration\\Group' => '/phpunit/TextUI/XmlConfiguration/Group/Group.php',
883                'PHPUnit\\TextUI\\XmlConfiguration\\GroupCollection' => '/phpunit/TextUI/XmlConfiguration/Group/GroupCollection.php',
884                'PHPUnit\\TextUI\\XmlConfiguration\\GroupCollectionIterator' => '/phpunit/TextUI/XmlConfiguration/Group/GroupCollectionIterator.php',
885                'PHPUnit\\TextUI\\XmlConfiguration\\Groups' => '/phpunit/TextUI/XmlConfiguration/Group/Groups.php',
886                'PHPUnit\\TextUI\\XmlConfiguration\\IniSetting' => '/phpunit/TextUI/XmlConfiguration/PHP/IniSetting.php',
887                'PHPUnit\\TextUI\\XmlConfiguration\\IniSettingCollection' => '/phpunit/TextUI/XmlConfiguration/PHP/IniSettingCollection.php',
888                'PHPUnit\\TextUI\\XmlConfiguration\\IniSettingCollectionIterator' => '/phpunit/TextUI/XmlConfiguration/PHP/IniSettingCollectionIterator.php',
889                'PHPUnit\\TextUI\\XmlConfiguration\\IntroduceCoverageElement' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/IntroduceCoverageElement.php',
890                'PHPUnit\\TextUI\\XmlConfiguration\\Loader' => '/phpunit/TextUI/XmlConfiguration/Loader.php',
891                'PHPUnit\\TextUI\\XmlConfiguration\\LogToReportMigration' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/LogToReportMigration.php',
892                'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\Junit' => '/phpunit/TextUI/XmlConfiguration/Logging/Junit.php',
893                'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\Logging' => '/phpunit/TextUI/XmlConfiguration/Logging/Logging.php',
894                'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\TeamCity' => '/phpunit/TextUI/XmlConfiguration/Logging/TeamCity.php',
895                'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\TestDox\\Html' => '/phpunit/TextUI/XmlConfiguration/Logging/TestDox/Html.php',
896                'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\TestDox\\Text' => '/phpunit/TextUI/XmlConfiguration/Logging/TestDox/Text.php',
897                'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\TestDox\\Xml' => '/phpunit/TextUI/XmlConfiguration/Logging/TestDox/Xml.php',
898                'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\Text' => '/phpunit/TextUI/XmlConfiguration/Logging/Text.php',
899                'PHPUnit\\TextUI\\XmlConfiguration\\Migration' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/Migration.php',
900                'PHPUnit\\TextUI\\XmlConfiguration\\MigrationBuilder' => '/phpunit/TextUI/XmlConfiguration/Migration/MigrationBuilder.php',
901                'PHPUnit\\TextUI\\XmlConfiguration\\MigrationBuilderException' => '/phpunit/TextUI/XmlConfiguration/Migration/MigrationBuilderException.php',
902                'PHPUnit\\TextUI\\XmlConfiguration\\MigrationException' => '/phpunit/TextUI/XmlConfiguration/Migration/MigrationException.php',
903                'PHPUnit\\TextUI\\XmlConfiguration\\Migrator' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrator.php',
904                'PHPUnit\\TextUI\\XmlConfiguration\\MoveAttributesFromFilterWhitelistToCoverage' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromFilterWhitelistToCoverage.php',
905                'PHPUnit\\TextUI\\XmlConfiguration\\MoveAttributesFromRootToCoverage' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromRootToCoverage.php',
906                'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistDirectoriesToCoverage' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistDirectoriesToCoverage.php',
907                'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistExcludesToCoverage' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistExcludesToCoverage.php',
908                'PHPUnit\\TextUI\\XmlConfiguration\\PHPUnit' => '/phpunit/TextUI/XmlConfiguration/PHPUnit/PHPUnit.php',
909                'PHPUnit\\TextUI\\XmlConfiguration\\Php' => '/phpunit/TextUI/XmlConfiguration/PHP/Php.php',
910                'PHPUnit\\TextUI\\XmlConfiguration\\PhpHandler' => '/phpunit/TextUI/XmlConfiguration/PHP/PhpHandler.php',
911                'PHPUnit\\TextUI\\XmlConfiguration\\RemoveCacheTokensAttribute' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/RemoveCacheTokensAttribute.php',
912                'PHPUnit\\TextUI\\XmlConfiguration\\RemoveEmptyFilter' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/RemoveEmptyFilter.php',
913                'PHPUnit\\TextUI\\XmlConfiguration\\RemoveLogTypes' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/RemoveLogTypes.php',
914                'PHPUnit\\TextUI\\XmlConfiguration\\TestDirectory' => '/phpunit/TextUI/XmlConfiguration/TestSuite/TestDirectory.php',
915                'PHPUnit\\TextUI\\XmlConfiguration\\TestDirectoryCollection' => '/phpunit/TextUI/XmlConfiguration/TestSuite/TestDirectoryCollection.php',
916                'PHPUnit\\TextUI\\XmlConfiguration\\TestDirectoryCollectionIterator' => '/phpunit/TextUI/XmlConfiguration/TestSuite/TestDirectoryCollectionIterator.php',
917                'PHPUnit\\TextUI\\XmlConfiguration\\TestFile' => '/phpunit/TextUI/XmlConfiguration/TestSuite/TestFile.php',
918                'PHPUnit\\TextUI\\XmlConfiguration\\TestFileCollection' => '/phpunit/TextUI/XmlConfiguration/TestSuite/TestFileCollection.php',
919                'PHPUnit\\TextUI\\XmlConfiguration\\TestFileCollectionIterator' => '/phpunit/TextUI/XmlConfiguration/TestSuite/TestFileCollectionIterator.php',
920                'PHPUnit\\TextUI\\XmlConfiguration\\TestSuite' => '/phpunit/TextUI/XmlConfiguration/TestSuite/TestSuite.php',
921                'PHPUnit\\TextUI\\XmlConfiguration\\TestSuiteCollection' => '/phpunit/TextUI/XmlConfiguration/TestSuite/TestSuiteCollection.php',
922                'PHPUnit\\TextUI\\XmlConfiguration\\TestSuiteCollectionIterator' => '/phpunit/TextUI/XmlConfiguration/TestSuite/TestSuiteCollectionIterator.php',
923                'PHPUnit\\TextUI\\XmlConfiguration\\UpdateSchemaLocationTo93' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/UpdateSchemaLocationTo93.php',
924                'PHPUnit\\TextUI\\XmlConfiguration\\Variable' => '/phpunit/TextUI/XmlConfiguration/PHP/Variable.php',
925                'PHPUnit\\TextUI\\XmlConfiguration\\VariableCollection' => '/phpunit/TextUI/XmlConfiguration/PHP/VariableCollection.php',
926                'PHPUnit\\TextUI\\XmlConfiguration\\VariableCollectionIterator' => '/phpunit/TextUI/XmlConfiguration/PHP/VariableCollectionIterator.php',
927                'PHPUnit\\TheSeer\\Tokenizer\\Exception' => '/theseer-tokenizer/Exception.php',
928                'PHPUnit\\TheSeer\\Tokenizer\\NamespaceUri' => '/theseer-tokenizer/NamespaceUri.php',
929                'PHPUnit\\TheSeer\\Tokenizer\\NamespaceUriException' => '/theseer-tokenizer/NamespaceUriException.php',
930                'PHPUnit\\TheSeer\\Tokenizer\\Token' => '/theseer-tokenizer/Token.php',
931                'PHPUnit\\TheSeer\\Tokenizer\\TokenCollection' => '/theseer-tokenizer/TokenCollection.php',
932                'PHPUnit\\TheSeer\\Tokenizer\\TokenCollectionException' => '/theseer-tokenizer/TokenCollectionException.php',
933                'PHPUnit\\TheSeer\\Tokenizer\\Tokenizer' => '/theseer-tokenizer/Tokenizer.php',
934                'PHPUnit\\TheSeer\\Tokenizer\\XMLSerializer' => '/theseer-tokenizer/XMLSerializer.php',
935                'PHPUnit\\Util\\Annotation\\DocBlock' => '/phpunit/Util/Annotation/DocBlock.php',
936                'PHPUnit\\Util\\Annotation\\Registry' => '/phpunit/Util/Annotation/Registry.php',
937                'PHPUnit\\Util\\Blacklist' => '/phpunit/Util/Blacklist.php',
938                'PHPUnit\\Util\\Color' => '/phpunit/Util/Color.php',
939                'PHPUnit\\Util\\ErrorHandler' => '/phpunit/Util/ErrorHandler.php',
940                'PHPUnit\\Util\\Exception' => '/phpunit/Util/Exception.php',
941                'PHPUnit\\Util\\ExcludeList' => '/phpunit/Util/ExcludeList.php',
942                'PHPUnit\\Util\\FileLoader' => '/phpunit/Util/FileLoader.php',
943                'PHPUnit\\Util\\Filesystem' => '/phpunit/Util/Filesystem.php',
944                'PHPUnit\\Util\\Filter' => '/phpunit/Util/Filter.php',
945                'PHPUnit\\Util\\GlobalState' => '/phpunit/Util/GlobalState.php',
946                'PHPUnit\\Util\\InvalidDataSetException' => '/phpunit/Util/InvalidDataSetException.php',
947                'PHPUnit\\Util\\Json' => '/phpunit/Util/Json.php',
948                'PHPUnit\\Util\\Log\\JUnit' => '/phpunit/Util/Log/JUnit.php',
949                'PHPUnit\\Util\\Log\\TeamCity' => '/phpunit/Util/Log/TeamCity.php',
950                'PHPUnit\\Util\\PHP\\AbstractPhpProcess' => '/phpunit/Util/PHP/AbstractPhpProcess.php',
951                'PHPUnit\\Util\\PHP\\DefaultPhpProcess' => '/phpunit/Util/PHP/DefaultPhpProcess.php',
952                'PHPUnit\\Util\\PHP\\WindowsPhpProcess' => '/phpunit/Util/PHP/WindowsPhpProcess.php',
953                'PHPUnit\\Util\\Printer' => '/phpunit/Util/Printer.php',
954                'PHPUnit\\Util\\RegularExpression' => '/phpunit/Util/RegularExpression.php',
955                'PHPUnit\\Util\\Test' => '/phpunit/Util/Test.php',
956                'PHPUnit\\Util\\TestDox\\CliTestDoxPrinter' => '/phpunit/Util/TestDox/CliTestDoxPrinter.php',
957                'PHPUnit\\Util\\TestDox\\HtmlResultPrinter' => '/phpunit/Util/TestDox/HtmlResultPrinter.php',
958                'PHPUnit\\Util\\TestDox\\NamePrettifier' => '/phpunit/Util/TestDox/NamePrettifier.php',
959                'PHPUnit\\Util\\TestDox\\ResultPrinter' => '/phpunit/Util/TestDox/ResultPrinter.php',
960                'PHPUnit\\Util\\TestDox\\TestDoxPrinter' => '/phpunit/Util/TestDox/TestDoxPrinter.php',
961                'PHPUnit\\Util\\TestDox\\TextResultPrinter' => '/phpunit/Util/TestDox/TextResultPrinter.php',
962                'PHPUnit\\Util\\TestDox\\XmlResultPrinter' => '/phpunit/Util/TestDox/XmlResultPrinter.php',
963                'PHPUnit\\Util\\TextTestListRenderer' => '/phpunit/Util/TextTestListRenderer.php',
964                'PHPUnit\\Util\\Type' => '/phpunit/Util/Type.php',
965                'PHPUnit\\Util\\VersionComparisonOperator' => '/phpunit/Util/VersionComparisonOperator.php',
966                'PHPUnit\\Util\\XdebugFilterScriptGenerator' => '/phpunit/Util/XdebugFilterScriptGenerator.php',
967                'PHPUnit\\Util\\Xml' => '/phpunit/Util/Xml.php',
968                'PHPUnit\\Util\\XmlTestListRenderer' => '/phpunit/Util/XmlTestListRenderer.php',
969                'PHPUnit\\Util\\Xml\\Exception' => '/phpunit/Util/Xml/Exception.php',
970                'PHPUnit\\Util\\Xml\\FailedSchemaDetectionResult' => '/phpunit/Util/Xml/FailedSchemaDetectionResult.php',
971                'PHPUnit\\Util\\Xml\\Loader' => '/phpunit/Util/Xml/Loader.php',
972                'PHPUnit\\Util\\Xml\\SchemaDetectionResult' => '/phpunit/Util/Xml/SchemaDetectionResult.php',
973                'PHPUnit\\Util\\Xml\\SchemaDetector' => '/phpunit/Util/Xml/SchemaDetector.php',
974                'PHPUnit\\Util\\Xml\\SchemaFinder' => '/phpunit/Util/Xml/SchemaFinder.php',
975                'PHPUnit\\Util\\Xml\\SnapshotNodeList' => '/phpunit/Util/Xml/SnapshotNodeList.php',
976                'PHPUnit\\Util\\Xml\\SuccessfulSchemaDetectionResult' => '/phpunit/Util/Xml/SuccessfulSchemaDetectionResult.php',
977                'PHPUnit\\Util\\Xml\\ValidationResult' => '/phpunit/Util/Xml/ValidationResult.php',
978                'PHPUnit\\Util\\Xml\\Validator' => '/phpunit/Util/Xml/Validator.php',
979                'PHPUnit\\Webmozart\\Assert\\Assert' => '/webmozart-assert/Assert.php',
980                'PHPUnit\\Webmozart\\Assert\\InvalidArgumentException' => '/webmozart-assert/InvalidArgumentException.php',
981                'PHPUnit\\Webmozart\\Assert\\Mixin' => '/webmozart-assert/Mixin.php',
982                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock' => '/phpdocumentor-reflection-docblock/DocBlock.php',
983                'PHPUnit\\phpDocumentor\\Reflection\\DocBlockFactory' => '/phpdocumentor-reflection-docblock/DocBlockFactory.php',
984                'PHPUnit\\phpDocumentor\\Reflection\\DocBlockFactoryInterface' => '/phpdocumentor-reflection-docblock/DocBlockFactoryInterface.php',
985                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Description' => '/phpdocumentor-reflection-docblock/DocBlock/Description.php',
986                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\DescriptionFactory' => '/phpdocumentor-reflection-docblock/DocBlock/DescriptionFactory.php',
987                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\ExampleFinder' => '/phpdocumentor-reflection-docblock/DocBlock/ExampleFinder.php',
988                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Serializer' => '/phpdocumentor-reflection-docblock/DocBlock/Serializer.php',
989                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\StandardTagFactory' => '/phpdocumentor-reflection-docblock/DocBlock/StandardTagFactory.php',
990                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tag' => '/phpdocumentor-reflection-docblock/DocBlock/Tag.php',
991                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\TagFactory' => '/phpdocumentor-reflection-docblock/DocBlock/TagFactory.php',
992                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Author' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Author.php',
993                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\BaseTag' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/BaseTag.php',
994                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Covers' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Covers.php',
995                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Deprecated' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Deprecated.php',
996                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Example' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Example.php',
997                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Factory\\StaticMethod' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Factory/StaticMethod.php',
998                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Formatter' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Formatter.php',
999                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Formatter\\AlignFormatter' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Formatter/AlignFormatter.php',
1000                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Formatter\\PassthroughFormatter' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Formatter/PassthroughFormatter.php',
1001                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Generic' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Generic.php',
1002                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\InvalidTag' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/InvalidTag.php',
1003                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Link' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Link.php',
1004                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Method' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Method.php',
1005                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Param' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Param.php',
1006                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Property' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Property.php',
1007                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\PropertyRead' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/PropertyRead.php',
1008                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\PropertyWrite' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/PropertyWrite.php',
1009                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Reference\\Fqsen' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Reference/Fqsen.php',
1010                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Reference\\Reference' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Reference/Reference.php',
1011                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Reference\\Url' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Reference/Url.php',
1012                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Return_' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Return_.php',
1013                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\See' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/See.php',
1014                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Since' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Since.php',
1015                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Source' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Source.php',
1016                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\TagWithType' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/TagWithType.php',
1017                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Throws' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Throws.php',
1018                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Uses' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Uses.php',
1019                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Var_' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Var_.php',
1020                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Version' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Version.php',
1021                'PHPUnit\\phpDocumentor\\Reflection\\Element' => '/phpdocumentor-reflection-common/Element.php',
1022                'PHPUnit\\phpDocumentor\\Reflection\\Exception\\PcreException' => '/phpdocumentor-reflection-docblock/Exception/PcreException.php',
1023                'PHPUnit\\phpDocumentor\\Reflection\\File' => '/phpdocumentor-reflection-common/File.php',
1024                'PHPUnit\\phpDocumentor\\Reflection\\Fqsen' => '/phpdocumentor-reflection-common/Fqsen.php',
1025                'PHPUnit\\phpDocumentor\\Reflection\\FqsenResolver' => '/phpdocumentor-type-resolver/FqsenResolver.php',
1026                'PHPUnit\\phpDocumentor\\Reflection\\Location' => '/phpdocumentor-reflection-common/Location.php',
1027                'PHPUnit\\phpDocumentor\\Reflection\\Project' => '/phpdocumentor-reflection-common/Project.php',
1028                'PHPUnit\\phpDocumentor\\Reflection\\ProjectFactory' => '/phpdocumentor-reflection-common/ProjectFactory.php',
1029                'PHPUnit\\phpDocumentor\\Reflection\\PseudoType' => '/phpdocumentor-type-resolver/PseudoType.php',
1030                'PHPUnit\\phpDocumentor\\Reflection\\PseudoTypes\\CallableString' => '/phpdocumentor-type-resolver/PseudoTypes/CallableString.php',
1031                'PHPUnit\\phpDocumentor\\Reflection\\PseudoTypes\\False_' => '/phpdocumentor-type-resolver/PseudoTypes/False_.php',
1032                'PHPUnit\\phpDocumentor\\Reflection\\PseudoTypes\\HtmlEscapedString' => '/phpdocumentor-type-resolver/PseudoTypes/HtmlEscapedString.php',
1033                'PHPUnit\\phpDocumentor\\Reflection\\PseudoTypes\\LowercaseString' => '/phpdocumentor-type-resolver/PseudoTypes/LowercaseString.php',
1034                'PHPUnit\\phpDocumentor\\Reflection\\PseudoTypes\\NonEmptyLowercaseString' => '/phpdocumentor-type-resolver/PseudoTypes/NonEmptyLowercaseString.php',
1035                'PHPUnit\\phpDocumentor\\Reflection\\PseudoTypes\\NonEmptyString' => '/phpdocumentor-type-resolver/PseudoTypes/NonEmptyString.php',
1036                'PHPUnit\\phpDocumentor\\Reflection\\PseudoTypes\\NumericString' => '/phpdocumentor-type-resolver/PseudoTypes/NumericString.php',
1037                'PHPUnit\\phpDocumentor\\Reflection\\PseudoTypes\\PositiveInteger' => '/phpdocumentor-type-resolver/PseudoTypes/PositiveInteger.php',
1038                'PHPUnit\\phpDocumentor\\Reflection\\PseudoTypes\\TraitString' => '/phpdocumentor-type-resolver/PseudoTypes/TraitString.php',
1039                'PHPUnit\\phpDocumentor\\Reflection\\PseudoTypes\\True_' => '/phpdocumentor-type-resolver/PseudoTypes/True_.php',
1040                'PHPUnit\\phpDocumentor\\Reflection\\Type' => '/phpdocumentor-type-resolver/Type.php',
1041                'PHPUnit\\phpDocumentor\\Reflection\\TypeResolver' => '/phpdocumentor-type-resolver/TypeResolver.php',
1042                'PHPUnit\\phpDocumentor\\Reflection\\Types\\AbstractList' => '/phpdocumentor-type-resolver/Types/AbstractList.php',
1043                'PHPUnit\\phpDocumentor\\Reflection\\Types\\AggregatedType' => '/phpdocumentor-type-resolver/Types/AggregatedType.php',
1044                'PHPUnit\\phpDocumentor\\Reflection\\Types\\ArrayKey' => '/phpdocumentor-type-resolver/Types/ArrayKey.php',
1045                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Array_' => '/phpdocumentor-type-resolver/Types/Array_.php',
1046                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Boolean' => '/phpdocumentor-type-resolver/Types/Boolean.php',
1047                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Callable_' => '/phpdocumentor-type-resolver/Types/Callable_.php',
1048                'PHPUnit\\phpDocumentor\\Reflection\\Types\\ClassString' => '/phpdocumentor-type-resolver/Types/ClassString.php',
1049                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Collection' => '/phpdocumentor-type-resolver/Types/Collection.php',
1050                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Compound' => '/phpdocumentor-type-resolver/Types/Compound.php',
1051                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Context' => '/phpdocumentor-type-resolver/Types/Context.php',
1052                'PHPUnit\\phpDocumentor\\Reflection\\Types\\ContextFactory' => '/phpdocumentor-type-resolver/Types/ContextFactory.php',
1053                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Expression' => '/phpdocumentor-type-resolver/Types/Expression.php',
1054                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Float_' => '/phpdocumentor-type-resolver/Types/Float_.php',
1055                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Integer' => '/phpdocumentor-type-resolver/Types/Integer.php',
1056                'PHPUnit\\phpDocumentor\\Reflection\\Types\\InterfaceString' => '/phpdocumentor-type-resolver/Types/InterfaceString.php',
1057                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Intersection' => '/phpdocumentor-type-resolver/Types/Intersection.php',
1058                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Iterable_' => '/phpdocumentor-type-resolver/Types/Iterable_.php',
1059                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Mixed_' => '/phpdocumentor-type-resolver/Types/Mixed_.php',
1060                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Never_' => '/phpdocumentor-type-resolver/Types/Never_.php',
1061                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Null_' => '/phpdocumentor-type-resolver/Types/Null_.php',
1062                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Nullable' => '/phpdocumentor-type-resolver/Types/Nullable.php',
1063                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Object_' => '/phpdocumentor-type-resolver/Types/Object_.php',
1064                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Parent_' => '/phpdocumentor-type-resolver/Types/Parent_.php',
1065                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Resource_' => '/phpdocumentor-type-resolver/Types/Resource_.php',
1066                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Scalar' => '/phpdocumentor-type-resolver/Types/Scalar.php',
1067                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Self_' => '/phpdocumentor-type-resolver/Types/Self_.php',
1068                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Static_' => '/phpdocumentor-type-resolver/Types/Static_.php',
1069                'PHPUnit\\phpDocumentor\\Reflection\\Types\\String_' => '/phpdocumentor-type-resolver/Types/String_.php',
1070                'PHPUnit\\phpDocumentor\\Reflection\\Types\\This' => '/phpdocumentor-type-resolver/Types/This.php',
1071                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Void_' => '/phpdocumentor-type-resolver/Types/Void_.php',
1072                'PHPUnit\\phpDocumentor\\Reflection\\Utils' => '/phpdocumentor-reflection-docblock/Utils.php',
1073                'Prophecy\\Argument' => '/phpspec-prophecy/Prophecy/Argument.php',
1074                'Prophecy\\Argument\\ArgumentsWildcard' => '/phpspec-prophecy/Prophecy/Argument/ArgumentsWildcard.php',
1075                'Prophecy\\Argument\\Token\\AnyValueToken' => '/phpspec-prophecy/Prophecy/Argument/Token/AnyValueToken.php',
1076                'Prophecy\\Argument\\Token\\AnyValuesToken' => '/phpspec-prophecy/Prophecy/Argument/Token/AnyValuesToken.php',
1077                'Prophecy\\Argument\\Token\\ApproximateValueToken' => '/phpspec-prophecy/Prophecy/Argument/Token/ApproximateValueToken.php',
1078                'Prophecy\\Argument\\Token\\ArrayCountToken' => '/phpspec-prophecy/Prophecy/Argument/Token/ArrayCountToken.php',
1079                'Prophecy\\Argument\\Token\\ArrayEntryToken' => '/phpspec-prophecy/Prophecy/Argument/Token/ArrayEntryToken.php',
1080                'Prophecy\\Argument\\Token\\ArrayEveryEntryToken' => '/phpspec-prophecy/Prophecy/Argument/Token/ArrayEveryEntryToken.php',
1081                'Prophecy\\Argument\\Token\\CallbackToken' => '/phpspec-prophecy/Prophecy/Argument/Token/CallbackToken.php',
1082                'Prophecy\\Argument\\Token\\ExactValueToken' => '/phpspec-prophecy/Prophecy/Argument/Token/ExactValueToken.php',
1083                'Prophecy\\Argument\\Token\\IdenticalValueToken' => '/phpspec-prophecy/Prophecy/Argument/Token/IdenticalValueToken.php',
1084                'Prophecy\\Argument\\Token\\InArrayToken' => '/phpspec-prophecy/Prophecy/Argument/Token/InArrayToken.php',
1085                'Prophecy\\Argument\\Token\\LogicalAndToken' => '/phpspec-prophecy/Prophecy/Argument/Token/LogicalAndToken.php',
1086                'Prophecy\\Argument\\Token\\LogicalNotToken' => '/phpspec-prophecy/Prophecy/Argument/Token/LogicalNotToken.php',
1087                'Prophecy\\Argument\\Token\\NotInArrayToken' => '/phpspec-prophecy/Prophecy/Argument/Token/NotInArrayToken.php',
1088                'Prophecy\\Argument\\Token\\ObjectStateToken' => '/phpspec-prophecy/Prophecy/Argument/Token/ObjectStateToken.php',
1089                'Prophecy\\Argument\\Token\\StringContainsToken' => '/phpspec-prophecy/Prophecy/Argument/Token/StringContainsToken.php',
1090                'Prophecy\\Argument\\Token\\TokenInterface' => '/phpspec-prophecy/Prophecy/Argument/Token/TokenInterface.php',
1091                'Prophecy\\Argument\\Token\\TypeToken' => '/phpspec-prophecy/Prophecy/Argument/Token/TypeToken.php',
1092                'Prophecy\\Call\\Call' => '/phpspec-prophecy/Prophecy/Call/Call.php',
1093                'Prophecy\\Call\\CallCenter' => '/phpspec-prophecy/Prophecy/Call/CallCenter.php',
1094                'Prophecy\\Comparator\\ClosureComparator' => '/phpspec-prophecy/Prophecy/Comparator/ClosureComparator.php',
1095                'Prophecy\\Comparator\\Factory' => '/phpspec-prophecy/Prophecy/Comparator/Factory.php',
1096                'Prophecy\\Comparator\\ProphecyComparator' => '/phpspec-prophecy/Prophecy/Comparator/ProphecyComparator.php',
1097                'Prophecy\\Doubler\\CachedDoubler' => '/phpspec-prophecy/Prophecy/Doubler/CachedDoubler.php',
1098                'Prophecy\\Doubler\\ClassPatch\\ClassPatchInterface' => '/phpspec-prophecy/Prophecy/Doubler/ClassPatch/ClassPatchInterface.php',
1099                'Prophecy\\Doubler\\ClassPatch\\DisableConstructorPatch' => '/phpspec-prophecy/Prophecy/Doubler/ClassPatch/DisableConstructorPatch.php',
1100                'Prophecy\\Doubler\\ClassPatch\\HhvmExceptionPatch' => '/phpspec-prophecy/Prophecy/Doubler/ClassPatch/HhvmExceptionPatch.php',
1101                'Prophecy\\Doubler\\ClassPatch\\KeywordPatch' => '/phpspec-prophecy/Prophecy/Doubler/ClassPatch/KeywordPatch.php',
1102                'Prophecy\\Doubler\\ClassPatch\\MagicCallPatch' => '/phpspec-prophecy/Prophecy/Doubler/ClassPatch/MagicCallPatch.php',
1103                'Prophecy\\Doubler\\ClassPatch\\ProphecySubjectPatch' => '/phpspec-prophecy/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php',
1104                'Prophecy\\Doubler\\ClassPatch\\ReflectionClassNewInstancePatch' => '/phpspec-prophecy/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatch.php',
1105                'Prophecy\\Doubler\\ClassPatch\\SplFileInfoPatch' => '/phpspec-prophecy/Prophecy/Doubler/ClassPatch/SplFileInfoPatch.php',
1106                'Prophecy\\Doubler\\ClassPatch\\ThrowablePatch' => '/phpspec-prophecy/Prophecy/Doubler/ClassPatch/ThrowablePatch.php',
1107                'Prophecy\\Doubler\\ClassPatch\\TraversablePatch' => '/phpspec-prophecy/Prophecy/Doubler/ClassPatch/TraversablePatch.php',
1108                'Prophecy\\Doubler\\DoubleInterface' => '/phpspec-prophecy/Prophecy/Doubler/DoubleInterface.php',
1109                'Prophecy\\Doubler\\Doubler' => '/phpspec-prophecy/Prophecy/Doubler/Doubler.php',
1110                'Prophecy\\Doubler\\Generator\\ClassCodeGenerator' => '/phpspec-prophecy/Prophecy/Doubler/Generator/ClassCodeGenerator.php',
1111                'Prophecy\\Doubler\\Generator\\ClassCreator' => '/phpspec-prophecy/Prophecy/Doubler/Generator/ClassCreator.php',
1112                'Prophecy\\Doubler\\Generator\\ClassMirror' => '/phpspec-prophecy/Prophecy/Doubler/Generator/ClassMirror.php',
1113                'Prophecy\\Doubler\\Generator\\Node\\ArgumentNode' => '/phpspec-prophecy/Prophecy/Doubler/Generator/Node/ArgumentNode.php',
1114                'Prophecy\\Doubler\\Generator\\Node\\ArgumentTypeNode' => '/phpspec-prophecy/Prophecy/Doubler/Generator/Node/ArgumentTypeNode.php',
1115                'Prophecy\\Doubler\\Generator\\Node\\ClassNode' => '/phpspec-prophecy/Prophecy/Doubler/Generator/Node/ClassNode.php',
1116                'Prophecy\\Doubler\\Generator\\Node\\MethodNode' => '/phpspec-prophecy/Prophecy/Doubler/Generator/Node/MethodNode.php',
1117                'Prophecy\\Doubler\\Generator\\Node\\ReturnTypeNode' => '/phpspec-prophecy/Prophecy/Doubler/Generator/Node/ReturnTypeNode.php',
1118                'Prophecy\\Doubler\\Generator\\Node\\TypeNodeAbstract' => '/phpspec-prophecy/Prophecy/Doubler/Generator/Node/TypeNodeAbstract.php',
1119                'Prophecy\\Doubler\\Generator\\ReflectionInterface' => '/phpspec-prophecy/Prophecy/Doubler/Generator/ReflectionInterface.php',
1120                'Prophecy\\Doubler\\Generator\\TypeHintReference' => '/phpspec-prophecy/Prophecy/Doubler/Generator/TypeHintReference.php',
1121                'Prophecy\\Doubler\\LazyDouble' => '/phpspec-prophecy/Prophecy/Doubler/LazyDouble.php',
1122                'Prophecy\\Doubler\\NameGenerator' => '/phpspec-prophecy/Prophecy/Doubler/NameGenerator.php',
1123                'Prophecy\\Exception\\Call\\UnexpectedCallException' => '/phpspec-prophecy/Prophecy/Exception/Call/UnexpectedCallException.php',
1124                'Prophecy\\Exception\\Doubler\\ClassCreatorException' => '/phpspec-prophecy/Prophecy/Exception/Doubler/ClassCreatorException.php',
1125                'Prophecy\\Exception\\Doubler\\ClassMirrorException' => '/phpspec-prophecy/Prophecy/Exception/Doubler/ClassMirrorException.php',
1126                'Prophecy\\Exception\\Doubler\\ClassNotFoundException' => '/phpspec-prophecy/Prophecy/Exception/Doubler/ClassNotFoundException.php',
1127                'Prophecy\\Exception\\Doubler\\DoubleException' => '/phpspec-prophecy/Prophecy/Exception/Doubler/DoubleException.php',
1128                'Prophecy\\Exception\\Doubler\\DoublerException' => '/phpspec-prophecy/Prophecy/Exception/Doubler/DoublerException.php',
1129                'Prophecy\\Exception\\Doubler\\InterfaceNotFoundException' => '/phpspec-prophecy/Prophecy/Exception/Doubler/InterfaceNotFoundException.php',
1130                'Prophecy\\Exception\\Doubler\\MethodNotExtendableException' => '/phpspec-prophecy/Prophecy/Exception/Doubler/MethodNotExtendableException.php',
1131                'Prophecy\\Exception\\Doubler\\MethodNotFoundException' => '/phpspec-prophecy/Prophecy/Exception/Doubler/MethodNotFoundException.php',
1132                'Prophecy\\Exception\\Doubler\\ReturnByReferenceException' => '/phpspec-prophecy/Prophecy/Exception/Doubler/ReturnByReferenceException.php',
1133                'Prophecy\\Exception\\Exception' => '/phpspec-prophecy/Prophecy/Exception/Exception.php',
1134                'Prophecy\\Exception\\InvalidArgumentException' => '/phpspec-prophecy/Prophecy/Exception/InvalidArgumentException.php',
1135                'Prophecy\\Exception\\Prediction\\AggregateException' => '/phpspec-prophecy/Prophecy/Exception/Prediction/AggregateException.php',
1136                'Prophecy\\Exception\\Prediction\\FailedPredictionException' => '/phpspec-prophecy/Prophecy/Exception/Prediction/FailedPredictionException.php',
1137                'Prophecy\\Exception\\Prediction\\NoCallsException' => '/phpspec-prophecy/Prophecy/Exception/Prediction/NoCallsException.php',
1138                'Prophecy\\Exception\\Prediction\\PredictionException' => '/phpspec-prophecy/Prophecy/Exception/Prediction/PredictionException.php',
1139                'Prophecy\\Exception\\Prediction\\UnexpectedCallsCountException' => '/phpspec-prophecy/Prophecy/Exception/Prediction/UnexpectedCallsCountException.php',
1140                'Prophecy\\Exception\\Prediction\\UnexpectedCallsException' => '/phpspec-prophecy/Prophecy/Exception/Prediction/UnexpectedCallsException.php',
1141                'Prophecy\\Exception\\Prophecy\\MethodProphecyException' => '/phpspec-prophecy/Prophecy/Exception/Prophecy/MethodProphecyException.php',
1142                'Prophecy\\Exception\\Prophecy\\ObjectProphecyException' => '/phpspec-prophecy/Prophecy/Exception/Prophecy/ObjectProphecyException.php',
1143                'Prophecy\\Exception\\Prophecy\\ProphecyException' => '/phpspec-prophecy/Prophecy/Exception/Prophecy/ProphecyException.php',
1144                'Prophecy\\PhpDocumentor\\ClassAndInterfaceTagRetriever' => '/phpspec-prophecy/Prophecy/PhpDocumentor/ClassAndInterfaceTagRetriever.php',
1145                'Prophecy\\PhpDocumentor\\ClassTagRetriever' => '/phpspec-prophecy/Prophecy/PhpDocumentor/ClassTagRetriever.php',
1146                'Prophecy\\PhpDocumentor\\LegacyClassTagRetriever' => '/phpspec-prophecy/Prophecy/PhpDocumentor/LegacyClassTagRetriever.php',
1147                'Prophecy\\PhpDocumentor\\MethodTagRetrieverInterface' => '/phpspec-prophecy/Prophecy/PhpDocumentor/MethodTagRetrieverInterface.php',
1148                'Prophecy\\Prediction\\CallPrediction' => '/phpspec-prophecy/Prophecy/Prediction/CallPrediction.php',
1149                'Prophecy\\Prediction\\CallTimesPrediction' => '/phpspec-prophecy/Prophecy/Prediction/CallTimesPrediction.php',
1150                'Prophecy\\Prediction\\CallbackPrediction' => '/phpspec-prophecy/Prophecy/Prediction/CallbackPrediction.php',
1151                'Prophecy\\Prediction\\NoCallsPrediction' => '/phpspec-prophecy/Prophecy/Prediction/NoCallsPrediction.php',
1152                'Prophecy\\Prediction\\PredictionInterface' => '/phpspec-prophecy/Prophecy/Prediction/PredictionInterface.php',
1153                'Prophecy\\Promise\\CallbackPromise' => '/phpspec-prophecy/Prophecy/Promise/CallbackPromise.php',
1154                'Prophecy\\Promise\\PromiseInterface' => '/phpspec-prophecy/Prophecy/Promise/PromiseInterface.php',
1155                'Prophecy\\Promise\\ReturnArgumentPromise' => '/phpspec-prophecy/Prophecy/Promise/ReturnArgumentPromise.php',
1156                'Prophecy\\Promise\\ReturnPromise' => '/phpspec-prophecy/Prophecy/Promise/ReturnPromise.php',
1157                'Prophecy\\Promise\\ThrowPromise' => '/phpspec-prophecy/Prophecy/Promise/ThrowPromise.php',
1158                'Prophecy\\Prophecy\\MethodProphecy' => '/phpspec-prophecy/Prophecy/Prophecy/MethodProphecy.php',
1159                'Prophecy\\Prophecy\\ObjectProphecy' => '/phpspec-prophecy/Prophecy/Prophecy/ObjectProphecy.php',
1160                'Prophecy\\Prophecy\\ProphecyInterface' => '/phpspec-prophecy/Prophecy/Prophecy/ProphecyInterface.php',
1161                'Prophecy\\Prophecy\\ProphecySubjectInterface' => '/phpspec-prophecy/Prophecy/Prophecy/ProphecySubjectInterface.php',
1162                'Prophecy\\Prophecy\\Revealer' => '/phpspec-prophecy/Prophecy/Prophecy/Revealer.php',
1163                'Prophecy\\Prophecy\\RevealerInterface' => '/phpspec-prophecy/Prophecy/Prophecy/RevealerInterface.php',
1164                'Prophecy\\Prophet' => '/phpspec-prophecy/Prophecy/Prophet.php',
1165                'Prophecy\\Util\\ExportUtil' => '/phpspec-prophecy/Prophecy/Util/ExportUtil.php',
1166                'Prophecy\\Util\\StringUtil' => '/phpspec-prophecy/Prophecy/Util/StringUtil.php'];
1167        }
1168
1169        if (isset($classes[$class])) {
1170            require_once 'phar://phpunit-9.5.10.phar' . $classes[$class];
1171        }
1172    },
1173    true,
1174    false
1175);
1176
1177foreach (['PHPUnit\\DeepCopy\\DeepCopy' => '/myclabs-deep-copy/DeepCopy/DeepCopy.php',
1178                'PHPUnit\\DeepCopy\\Exception\\CloneException' => '/myclabs-deep-copy/DeepCopy/Exception/CloneException.php',
1179                'PHPUnit\\DeepCopy\\Exception\\PropertyException' => '/myclabs-deep-copy/DeepCopy/Exception/PropertyException.php',
1180                'PHPUnit\\DeepCopy\\Filter\\Doctrine\\DoctrineCollectionFilter' => '/myclabs-deep-copy/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php',
1181                'PHPUnit\\DeepCopy\\Filter\\Doctrine\\DoctrineEmptyCollectionFilter' => '/myclabs-deep-copy/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php',
1182                'PHPUnit\\DeepCopy\\Filter\\Doctrine\\DoctrineProxyFilter' => '/myclabs-deep-copy/DeepCopy/Filter/Doctrine/DoctrineProxyFilter.php',
1183                'PHPUnit\\DeepCopy\\Filter\\Filter' => '/myclabs-deep-copy/DeepCopy/Filter/Filter.php',
1184                'PHPUnit\\DeepCopy\\Filter\\KeepFilter' => '/myclabs-deep-copy/DeepCopy/Filter/KeepFilter.php',
1185                'PHPUnit\\DeepCopy\\Filter\\ReplaceFilter' => '/myclabs-deep-copy/DeepCopy/Filter/ReplaceFilter.php',
1186                'PHPUnit\\DeepCopy\\Filter\\SetNullFilter' => '/myclabs-deep-copy/DeepCopy/Filter/SetNullFilter.php',
1187                'PHPUnit\\DeepCopy\\Matcher\\Doctrine\\DoctrineProxyMatcher' => '/myclabs-deep-copy/DeepCopy/Matcher/Doctrine/DoctrineProxyMatcher.php',
1188                'PHPUnit\\DeepCopy\\Matcher\\Matcher' => '/myclabs-deep-copy/DeepCopy/Matcher/Matcher.php',
1189                'PHPUnit\\DeepCopy\\Matcher\\PropertyMatcher' => '/myclabs-deep-copy/DeepCopy/Matcher/PropertyMatcher.php',
1190                'PHPUnit\\DeepCopy\\Matcher\\PropertyNameMatcher' => '/myclabs-deep-copy/DeepCopy/Matcher/PropertyNameMatcher.php',
1191                'PHPUnit\\DeepCopy\\Matcher\\PropertyTypeMatcher' => '/myclabs-deep-copy/DeepCopy/Matcher/PropertyTypeMatcher.php',
1192                'PHPUnit\\DeepCopy\\Reflection\\ReflectionHelper' => '/myclabs-deep-copy/DeepCopy/Reflection/ReflectionHelper.php',
1193                'PHPUnit\\DeepCopy\\TypeFilter\\Date\\DateIntervalFilter' => '/myclabs-deep-copy/DeepCopy/TypeFilter/Date/DateIntervalFilter.php',
1194                'PHPUnit\\DeepCopy\\TypeFilter\\ReplaceFilter' => '/myclabs-deep-copy/DeepCopy/TypeFilter/ReplaceFilter.php',
1195                'PHPUnit\\DeepCopy\\TypeFilter\\ShallowCopyFilter' => '/myclabs-deep-copy/DeepCopy/TypeFilter/ShallowCopyFilter.php',
1196                'PHPUnit\\DeepCopy\\TypeFilter\\Spl\\ArrayObjectFilter' => '/myclabs-deep-copy/DeepCopy/TypeFilter/Spl/ArrayObjectFilter.php',
1197                'PHPUnit\\DeepCopy\\TypeFilter\\Spl\\SplDoublyLinkedList' => '/myclabs-deep-copy/DeepCopy/TypeFilter/Spl/SplDoublyLinkedList.php',
1198                'PHPUnit\\DeepCopy\\TypeFilter\\Spl\\SplDoublyLinkedListFilter' => '/myclabs-deep-copy/DeepCopy/TypeFilter/Spl/SplDoublyLinkedListFilter.php',
1199                'PHPUnit\\DeepCopy\\TypeFilter\\TypeFilter' => '/myclabs-deep-copy/DeepCopy/TypeFilter/TypeFilter.php',
1200                'PHPUnit\\DeepCopy\\TypeMatcher\\TypeMatcher' => '/myclabs-deep-copy/DeepCopy/TypeMatcher/TypeMatcher.php',
1201                'PHPUnit\\Doctrine\\Instantiator\\Exception\\ExceptionInterface' => '/doctrine-instantiator/Doctrine/Instantiator/Exception/ExceptionInterface.php',
1202                'PHPUnit\\Doctrine\\Instantiator\\Exception\\InvalidArgumentException' => '/doctrine-instantiator/Doctrine/Instantiator/Exception/InvalidArgumentException.php',
1203                'PHPUnit\\Doctrine\\Instantiator\\Exception\\UnexpectedValueException' => '/doctrine-instantiator/Doctrine/Instantiator/Exception/UnexpectedValueException.php',
1204                'PHPUnit\\Doctrine\\Instantiator\\Instantiator' => '/doctrine-instantiator/Doctrine/Instantiator/Instantiator.php',
1205                'PHPUnit\\Doctrine\\Instantiator\\InstantiatorInterface' => '/doctrine-instantiator/Doctrine/Instantiator/InstantiatorInterface.php',
1206                'PHPUnit\\Exception' => '/phpunit/Exception.php',
1207                'PHPUnit\\Framework\\ActualValueIsNotAnObjectException' => '/phpunit/Framework/Exception/ActualValueIsNotAnObjectException.php',
1208                'PHPUnit\\Framework\\Assert' => '/phpunit/Framework/Assert.php',
1209                'PHPUnit\\Framework\\AssertionFailedError' => '/phpunit/Framework/Exception/AssertionFailedError.php',
1210                'PHPUnit\\Framework\\CodeCoverageException' => '/phpunit/Framework/Exception/CodeCoverageException.php',
1211                'PHPUnit\\Framework\\ComparisonMethodDoesNotAcceptParameterTypeException' => '/phpunit/Framework/Exception/ComparisonMethodDoesNotAcceptParameterTypeException.php',
1212                'PHPUnit\\Framework\\ComparisonMethodDoesNotDeclareBoolReturnTypeException' => '/phpunit/Framework/Exception/ComparisonMethodDoesNotDeclareBoolReturnTypeException.php',
1213                'PHPUnit\\Framework\\ComparisonMethodDoesNotDeclareExactlyOneParameterException' => '/phpunit/Framework/Exception/ComparisonMethodDoesNotDeclareExactlyOneParameterException.php',
1214                'PHPUnit\\Framework\\ComparisonMethodDoesNotDeclareParameterTypeException' => '/phpunit/Framework/Exception/ComparisonMethodDoesNotDeclareParameterTypeException.php',
1215                'PHPUnit\\Framework\\ComparisonMethodDoesNotExistException' => '/phpunit/Framework/Exception/ComparisonMethodDoesNotExistException.php',
1216                'PHPUnit\\Framework\\Constraint\\ArrayHasKey' => '/phpunit/Framework/Constraint/Traversable/ArrayHasKey.php',
1217                'PHPUnit\\Framework\\Constraint\\BinaryOperator' => '/phpunit/Framework/Constraint/Operator/BinaryOperator.php',
1218                'PHPUnit\\Framework\\Constraint\\Callback' => '/phpunit/Framework/Constraint/Callback.php',
1219                'PHPUnit\\Framework\\Constraint\\ClassHasAttribute' => '/phpunit/Framework/Constraint/Object/ClassHasAttribute.php',
1220                'PHPUnit\\Framework\\Constraint\\ClassHasStaticAttribute' => '/phpunit/Framework/Constraint/Object/ClassHasStaticAttribute.php',
1221                'PHPUnit\\Framework\\Constraint\\Constraint' => '/phpunit/Framework/Constraint/Constraint.php',
1222                'PHPUnit\\Framework\\Constraint\\Count' => '/phpunit/Framework/Constraint/Cardinality/Count.php',
1223                'PHPUnit\\Framework\\Constraint\\DirectoryExists' => '/phpunit/Framework/Constraint/Filesystem/DirectoryExists.php',
1224                'PHPUnit\\Framework\\Constraint\\Exception' => '/phpunit/Framework/Constraint/Exception/Exception.php',
1225                'PHPUnit\\Framework\\Constraint\\ExceptionCode' => '/phpunit/Framework/Constraint/Exception/ExceptionCode.php',
1226                'PHPUnit\\Framework\\Constraint\\ExceptionMessage' => '/phpunit/Framework/Constraint/Exception/ExceptionMessage.php',
1227                'PHPUnit\\Framework\\Constraint\\ExceptionMessageRegularExpression' => '/phpunit/Framework/Constraint/Exception/ExceptionMessageRegularExpression.php',
1228                'PHPUnit\\Framework\\Constraint\\FileExists' => '/phpunit/Framework/Constraint/Filesystem/FileExists.php',
1229                'PHPUnit\\Framework\\Constraint\\GreaterThan' => '/phpunit/Framework/Constraint/Cardinality/GreaterThan.php',
1230                'PHPUnit\\Framework\\Constraint\\IsAnything' => '/phpunit/Framework/Constraint/IsAnything.php',
1231                'PHPUnit\\Framework\\Constraint\\IsEmpty' => '/phpunit/Framework/Constraint/Cardinality/IsEmpty.php',
1232                'PHPUnit\\Framework\\Constraint\\IsEqual' => '/phpunit/Framework/Constraint/Equality/IsEqual.php',
1233                'PHPUnit\\Framework\\Constraint\\IsEqualCanonicalizing' => '/phpunit/Framework/Constraint/Equality/IsEqualCanonicalizing.php',
1234                'PHPUnit\\Framework\\Constraint\\IsEqualIgnoringCase' => '/phpunit/Framework/Constraint/Equality/IsEqualIgnoringCase.php',
1235                'PHPUnit\\Framework\\Constraint\\IsEqualWithDelta' => '/phpunit/Framework/Constraint/Equality/IsEqualWithDelta.php',
1236                'PHPUnit\\Framework\\Constraint\\IsFalse' => '/phpunit/Framework/Constraint/Boolean/IsFalse.php',
1237                'PHPUnit\\Framework\\Constraint\\IsFinite' => '/phpunit/Framework/Constraint/Math/IsFinite.php',
1238                'PHPUnit\\Framework\\Constraint\\IsIdentical' => '/phpunit/Framework/Constraint/IsIdentical.php',
1239                'PHPUnit\\Framework\\Constraint\\IsInfinite' => '/phpunit/Framework/Constraint/Math/IsInfinite.php',
1240                'PHPUnit\\Framework\\Constraint\\IsInstanceOf' => '/phpunit/Framework/Constraint/Type/IsInstanceOf.php',
1241                'PHPUnit\\Framework\\Constraint\\IsJson' => '/phpunit/Framework/Constraint/String/IsJson.php',
1242                'PHPUnit\\Framework\\Constraint\\IsNan' => '/phpunit/Framework/Constraint/Math/IsNan.php',
1243                'PHPUnit\\Framework\\Constraint\\IsNull' => '/phpunit/Framework/Constraint/Type/IsNull.php',
1244                'PHPUnit\\Framework\\Constraint\\IsReadable' => '/phpunit/Framework/Constraint/Filesystem/IsReadable.php',
1245                'PHPUnit\\Framework\\Constraint\\IsTrue' => '/phpunit/Framework/Constraint/Boolean/IsTrue.php',
1246                'PHPUnit\\Framework\\Constraint\\IsType' => '/phpunit/Framework/Constraint/Type/IsType.php',
1247                'PHPUnit\\Framework\\Constraint\\IsWritable' => '/phpunit/Framework/Constraint/Filesystem/IsWritable.php',
1248                'PHPUnit\\Framework\\Constraint\\JsonMatches' => '/phpunit/Framework/Constraint/JsonMatches.php',
1249                'PHPUnit\\Framework\\Constraint\\JsonMatchesErrorMessageProvider' => '/phpunit/Framework/Constraint/JsonMatchesErrorMessageProvider.php',
1250                'PHPUnit\\Framework\\Constraint\\LessThan' => '/phpunit/Framework/Constraint/Cardinality/LessThan.php',
1251                'PHPUnit\\Framework\\Constraint\\LogicalAnd' => '/phpunit/Framework/Constraint/Operator/LogicalAnd.php',
1252                'PHPUnit\\Framework\\Constraint\\LogicalNot' => '/phpunit/Framework/Constraint/Operator/LogicalNot.php',
1253                'PHPUnit\\Framework\\Constraint\\LogicalOr' => '/phpunit/Framework/Constraint/Operator/LogicalOr.php',
1254                'PHPUnit\\Framework\\Constraint\\LogicalXor' => '/phpunit/Framework/Constraint/Operator/LogicalXor.php',
1255                'PHPUnit\\Framework\\Constraint\\ObjectEquals' => '/phpunit/Framework/Constraint/Object/ObjectEquals.php',
1256                'PHPUnit\\Framework\\Constraint\\ObjectHasAttribute' => '/phpunit/Framework/Constraint/Object/ObjectHasAttribute.php',
1257                'PHPUnit\\Framework\\Constraint\\Operator' => '/phpunit/Framework/Constraint/Operator/Operator.php',
1258                'PHPUnit\\Framework\\Constraint\\RegularExpression' => '/phpunit/Framework/Constraint/String/RegularExpression.php',
1259                'PHPUnit\\Framework\\Constraint\\SameSize' => '/phpunit/Framework/Constraint/Cardinality/SameSize.php',
1260                'PHPUnit\\Framework\\Constraint\\StringContains' => '/phpunit/Framework/Constraint/String/StringContains.php',
1261                'PHPUnit\\Framework\\Constraint\\StringEndsWith' => '/phpunit/Framework/Constraint/String/StringEndsWith.php',
1262                'PHPUnit\\Framework\\Constraint\\StringMatchesFormatDescription' => '/phpunit/Framework/Constraint/String/StringMatchesFormatDescription.php',
1263                'PHPUnit\\Framework\\Constraint\\StringStartsWith' => '/phpunit/Framework/Constraint/String/StringStartsWith.php',
1264                'PHPUnit\\Framework\\Constraint\\TraversableContains' => '/phpunit/Framework/Constraint/Traversable/TraversableContains.php',
1265                'PHPUnit\\Framework\\Constraint\\TraversableContainsEqual' => '/phpunit/Framework/Constraint/Traversable/TraversableContainsEqual.php',
1266                'PHPUnit\\Framework\\Constraint\\TraversableContainsIdentical' => '/phpunit/Framework/Constraint/Traversable/TraversableContainsIdentical.php',
1267                'PHPUnit\\Framework\\Constraint\\TraversableContainsOnly' => '/phpunit/Framework/Constraint/Traversable/TraversableContainsOnly.php',
1268                'PHPUnit\\Framework\\Constraint\\UnaryOperator' => '/phpunit/Framework/Constraint/Operator/UnaryOperator.php',
1269                'PHPUnit\\Framework\\CoveredCodeNotExecutedException' => '/phpunit/Framework/Exception/CoveredCodeNotExecutedException.php',
1270                'PHPUnit\\Framework\\DataProviderTestSuite' => '/phpunit/Framework/DataProviderTestSuite.php',
1271                'PHPUnit\\Framework\\Error' => '/phpunit/Framework/Exception/Error.php',
1272                'PHPUnit\\Framework\\ErrorTestCase' => '/phpunit/Framework/ErrorTestCase.php',
1273                'PHPUnit\\Framework\\Error\\Deprecated' => '/phpunit/Framework/Error/Deprecated.php',
1274                'PHPUnit\\Framework\\Error\\Error' => '/phpunit/Framework/Error/Error.php',
1275                'PHPUnit\\Framework\\Error\\Notice' => '/phpunit/Framework/Error/Notice.php',
1276                'PHPUnit\\Framework\\Error\\Warning' => '/phpunit/Framework/Error/Warning.php',
1277                'PHPUnit\\Framework\\Exception' => '/phpunit/Framework/Exception/Exception.php',
1278                'PHPUnit\\Framework\\ExceptionWrapper' => '/phpunit/Framework/ExceptionWrapper.php',
1279                'PHPUnit\\Framework\\ExecutionOrderDependency' => '/phpunit/Framework/ExecutionOrderDependency.php',
1280                'PHPUnit\\Framework\\ExpectationFailedException' => '/phpunit/Framework/Exception/ExpectationFailedException.php',
1281                'PHPUnit\\Framework\\IncompleteTest' => '/phpunit/Framework/IncompleteTest.php',
1282                'PHPUnit\\Framework\\IncompleteTestCase' => '/phpunit/Framework/IncompleteTestCase.php',
1283                'PHPUnit\\Framework\\IncompleteTestError' => '/phpunit/Framework/Exception/IncompleteTestError.php',
1284                'PHPUnit\\Framework\\InvalidArgumentException' => '/phpunit/Framework/Exception/InvalidArgumentException.php',
1285                'PHPUnit\\Framework\\InvalidCoversTargetException' => '/phpunit/Framework/Exception/InvalidCoversTargetException.php',
1286                'PHPUnit\\Framework\\InvalidDataProviderException' => '/phpunit/Framework/Exception/InvalidDataProviderException.php',
1287                'PHPUnit\\Framework\\InvalidParameterGroupException' => '/phpunit/Framework/InvalidParameterGroupException.php',
1288                'PHPUnit\\Framework\\MissingCoversAnnotationException' => '/phpunit/Framework/Exception/MissingCoversAnnotationException.php',
1289                'PHPUnit\\Framework\\MockObject\\Api' => '/phpunit/Framework/MockObject/Api/Api.php',
1290                'PHPUnit\\Framework\\MockObject\\BadMethodCallException' => '/phpunit/Framework/MockObject/Exception/BadMethodCallException.php',
1291                'PHPUnit\\Framework\\MockObject\\Builder\\Identity' => '/phpunit/Framework/MockObject/Builder/Identity.php',
1292                'PHPUnit\\Framework\\MockObject\\Builder\\InvocationMocker' => '/phpunit/Framework/MockObject/Builder/InvocationMocker.php',
1293                'PHPUnit\\Framework\\MockObject\\Builder\\InvocationStubber' => '/phpunit/Framework/MockObject/Builder/InvocationStubber.php',
1294                'PHPUnit\\Framework\\MockObject\\Builder\\MethodNameMatch' => '/phpunit/Framework/MockObject/Builder/MethodNameMatch.php',
1295                'PHPUnit\\Framework\\MockObject\\Builder\\ParametersMatch' => '/phpunit/Framework/MockObject/Builder/ParametersMatch.php',
1296                'PHPUnit\\Framework\\MockObject\\Builder\\Stub' => '/phpunit/Framework/MockObject/Builder/Stub.php',
1297                'PHPUnit\\Framework\\MockObject\\CannotUseAddMethodsException' => '/phpunit/Framework/MockObject/Exception/CannotUseAddMethodsException.php',
1298                'PHPUnit\\Framework\\MockObject\\CannotUseOnlyMethodsException' => '/phpunit/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php',
1299                'PHPUnit\\Framework\\MockObject\\ClassAlreadyExistsException' => '/phpunit/Framework/MockObject/Exception/ClassAlreadyExistsException.php',
1300                'PHPUnit\\Framework\\MockObject\\ClassIsFinalException' => '/phpunit/Framework/MockObject/Exception/ClassIsFinalException.php',
1301                'PHPUnit\\Framework\\MockObject\\ConfigurableMethod' => '/phpunit/Framework/MockObject/ConfigurableMethod.php',
1302                'PHPUnit\\Framework\\MockObject\\ConfigurableMethodsAlreadyInitializedException' => '/phpunit/Framework/MockObject/Exception/ConfigurableMethodsAlreadyInitializedException.php',
1303                'PHPUnit\\Framework\\MockObject\\DuplicateMethodException' => '/phpunit/Framework/MockObject/Exception/DuplicateMethodException.php',
1304                'PHPUnit\\Framework\\MockObject\\Exception' => '/phpunit/Framework/MockObject/Exception/Exception.php',
1305                'PHPUnit\\Framework\\MockObject\\Generator' => '/phpunit/Framework/MockObject/Generator.php',
1306                'PHPUnit\\Framework\\MockObject\\IncompatibleReturnValueException' => '/phpunit/Framework/MockObject/Exception/IncompatibleReturnValueException.php',
1307                'PHPUnit\\Framework\\MockObject\\InvalidMethodNameException' => '/phpunit/Framework/MockObject/Exception/InvalidMethodNameException.php',
1308                'PHPUnit\\Framework\\MockObject\\Invocation' => '/phpunit/Framework/MockObject/Invocation.php',
1309                'PHPUnit\\Framework\\MockObject\\InvocationHandler' => '/phpunit/Framework/MockObject/InvocationHandler.php',
1310                'PHPUnit\\Framework\\MockObject\\MatchBuilderNotFoundException' => '/phpunit/Framework/MockObject/Exception/MatchBuilderNotFoundException.php',
1311                'PHPUnit\\Framework\\MockObject\\Matcher' => '/phpunit/Framework/MockObject/Matcher.php',
1312                'PHPUnit\\Framework\\MockObject\\MatcherAlreadyRegisteredException' => '/phpunit/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.php',
1313                'PHPUnit\\Framework\\MockObject\\Method' => '/phpunit/Framework/MockObject/Api/Method.php',
1314                'PHPUnit\\Framework\\MockObject\\MethodCannotBeConfiguredException' => '/phpunit/Framework/MockObject/Exception/MethodCannotBeConfiguredException.php',
1315                'PHPUnit\\Framework\\MockObject\\MethodNameAlreadyConfiguredException' => '/phpunit/Framework/MockObject/Exception/MethodNameAlreadyConfiguredException.php',
1316                'PHPUnit\\Framework\\MockObject\\MethodNameConstraint' => '/phpunit/Framework/MockObject/MethodNameConstraint.php',
1317                'PHPUnit\\Framework\\MockObject\\MethodNameNotConfiguredException' => '/phpunit/Framework/MockObject/Exception/MethodNameNotConfiguredException.php',
1318                'PHPUnit\\Framework\\MockObject\\MethodParametersAlreadyConfiguredException' => '/phpunit/Framework/MockObject/Exception/MethodParametersAlreadyConfiguredException.php',
1319                'PHPUnit\\Framework\\MockObject\\MockBuilder' => '/phpunit/Framework/MockObject/MockBuilder.php',
1320                'PHPUnit\\Framework\\MockObject\\MockClass' => '/phpunit/Framework/MockObject/MockClass.php',
1321                'PHPUnit\\Framework\\MockObject\\MockMethod' => '/phpunit/Framework/MockObject/MockMethod.php',
1322                'PHPUnit\\Framework\\MockObject\\MockMethodSet' => '/phpunit/Framework/MockObject/MockMethodSet.php',
1323                'PHPUnit\\Framework\\MockObject\\MockObject' => '/phpunit/Framework/MockObject/MockObject.php',
1324                'PHPUnit\\Framework\\MockObject\\MockTrait' => '/phpunit/Framework/MockObject/MockTrait.php',
1325                'PHPUnit\\Framework\\MockObject\\MockType' => '/phpunit/Framework/MockObject/MockType.php',
1326                'PHPUnit\\Framework\\MockObject\\MockedCloneMethod' => '/phpunit/Framework/MockObject/Api/MockedCloneMethod.php',
1327                'PHPUnit\\Framework\\MockObject\\OriginalConstructorInvocationRequiredException' => '/phpunit/Framework/MockObject/Exception/OriginalConstructorInvocationRequiredException.php',
1328                'PHPUnit\\Framework\\MockObject\\ReflectionException' => '/phpunit/Framework/MockObject/Exception/ReflectionException.php',
1329                'PHPUnit\\Framework\\MockObject\\ReturnValueNotConfiguredException' => '/phpunit/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php',
1330                'PHPUnit\\Framework\\MockObject\\Rule\\AnyInvokedCount' => '/phpunit/Framework/MockObject/Rule/AnyInvokedCount.php',
1331                'PHPUnit\\Framework\\MockObject\\Rule\\AnyParameters' => '/phpunit/Framework/MockObject/Rule/AnyParameters.php',
1332                'PHPUnit\\Framework\\MockObject\\Rule\\ConsecutiveParameters' => '/phpunit/Framework/MockObject/Rule/ConsecutiveParameters.php',
1333                'PHPUnit\\Framework\\MockObject\\Rule\\InvocationOrder' => '/phpunit/Framework/MockObject/Rule/InvocationOrder.php',
1334                'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtIndex' => '/phpunit/Framework/MockObject/Rule/InvokedAtIndex.php',
1335                'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtLeastCount' => '/phpunit/Framework/MockObject/Rule/InvokedAtLeastCount.php',
1336                'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtLeastOnce' => '/phpunit/Framework/MockObject/Rule/InvokedAtLeastOnce.php',
1337                'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtMostCount' => '/phpunit/Framework/MockObject/Rule/InvokedAtMostCount.php',
1338                'PHPUnit\\Framework\\MockObject\\Rule\\InvokedCount' => '/phpunit/Framework/MockObject/Rule/InvokedCount.php',
1339                'PHPUnit\\Framework\\MockObject\\Rule\\MethodName' => '/phpunit/Framework/MockObject/Rule/MethodName.php',
1340                'PHPUnit\\Framework\\MockObject\\Rule\\Parameters' => '/phpunit/Framework/MockObject/Rule/Parameters.php',
1341                'PHPUnit\\Framework\\MockObject\\Rule\\ParametersRule' => '/phpunit/Framework/MockObject/Rule/ParametersRule.php',
1342                'PHPUnit\\Framework\\MockObject\\RuntimeException' => '/phpunit/Framework/MockObject/Exception/RuntimeException.php',
1343                'PHPUnit\\Framework\\MockObject\\SoapExtensionNotAvailableException' => '/phpunit/Framework/MockObject/Exception/SoapExtensionNotAvailableException.php',
1344                'PHPUnit\\Framework\\MockObject\\Stub' => '/phpunit/Framework/MockObject/Stub.php',
1345                'PHPUnit\\Framework\\MockObject\\Stub\\ConsecutiveCalls' => '/phpunit/Framework/MockObject/Stub/ConsecutiveCalls.php',
1346                'PHPUnit\\Framework\\MockObject\\Stub\\Exception' => '/phpunit/Framework/MockObject/Stub/Exception.php',
1347                'PHPUnit\\Framework\\MockObject\\Stub\\ReturnArgument' => '/phpunit/Framework/MockObject/Stub/ReturnArgument.php',
1348                'PHPUnit\\Framework\\MockObject\\Stub\\ReturnCallback' => '/phpunit/Framework/MockObject/Stub/ReturnCallback.php',
1349                'PHPUnit\\Framework\\MockObject\\Stub\\ReturnReference' => '/phpunit/Framework/MockObject/Stub/ReturnReference.php',
1350                'PHPUnit\\Framework\\MockObject\\Stub\\ReturnSelf' => '/phpunit/Framework/MockObject/Stub/ReturnSelf.php',
1351                'PHPUnit\\Framework\\MockObject\\Stub\\ReturnStub' => '/phpunit/Framework/MockObject/Stub/ReturnStub.php',
1352                'PHPUnit\\Framework\\MockObject\\Stub\\ReturnValueMap' => '/phpunit/Framework/MockObject/Stub/ReturnValueMap.php',
1353                'PHPUnit\\Framework\\MockObject\\Stub\\Stub' => '/phpunit/Framework/MockObject/Stub/Stub.php',
1354                'PHPUnit\\Framework\\MockObject\\UnknownClassException' => '/phpunit/Framework/MockObject/Exception/UnknownClassException.php',
1355                'PHPUnit\\Framework\\MockObject\\UnknownTraitException' => '/phpunit/Framework/MockObject/Exception/UnknownTraitException.php',
1356                'PHPUnit\\Framework\\MockObject\\UnknownTypeException' => '/phpunit/Framework/MockObject/Exception/UnknownTypeException.php',
1357                'PHPUnit\\Framework\\MockObject\\UnmockedCloneMethod' => '/phpunit/Framework/MockObject/Api/UnmockedCloneMethod.php',
1358                'PHPUnit\\Framework\\MockObject\\Verifiable' => '/phpunit/Framework/MockObject/Verifiable.php',
1359                'PHPUnit\\Framework\\NoChildTestSuiteException' => '/phpunit/Framework/Exception/NoChildTestSuiteException.php',
1360                'PHPUnit\\Framework\\OutputError' => '/phpunit/Framework/Exception/OutputError.php',
1361                'PHPUnit\\Framework\\PHPTAssertionFailedError' => '/phpunit/Framework/Exception/PHPTAssertionFailedError.php',
1362                'PHPUnit\\Framework\\Reorderable' => '/phpunit/Framework/Reorderable.php',
1363                'PHPUnit\\Framework\\RiskyTestError' => '/phpunit/Framework/Exception/RiskyTestError.php',
1364                'PHPUnit\\Framework\\SelfDescribing' => '/phpunit/Framework/SelfDescribing.php',
1365                'PHPUnit\\Framework\\SkippedTest' => '/phpunit/Framework/SkippedTest.php',
1366                'PHPUnit\\Framework\\SkippedTestCase' => '/phpunit/Framework/SkippedTestCase.php',
1367                'PHPUnit\\Framework\\SkippedTestError' => '/phpunit/Framework/Exception/SkippedTestError.php',
1368                'PHPUnit\\Framework\\SkippedTestSuiteError' => '/phpunit/Framework/Exception/SkippedTestSuiteError.php',
1369                'PHPUnit\\Framework\\SyntheticError' => '/phpunit/Framework/Exception/SyntheticError.php',
1370                'PHPUnit\\Framework\\SyntheticSkippedError' => '/phpunit/Framework/Exception/SyntheticSkippedError.php',
1371                'PHPUnit\\Framework\\Test' => '/phpunit/Framework/Test.php',
1372                'PHPUnit\\Framework\\TestBuilder' => '/phpunit/Framework/TestBuilder.php',
1373                'PHPUnit\\Framework\\TestCase' => '/phpunit/Framework/TestCase.php',
1374                'PHPUnit\\Framework\\TestFailure' => '/phpunit/Framework/TestFailure.php',
1375                'PHPUnit\\Framework\\TestListener' => '/phpunit/Framework/TestListener.php',
1376                'PHPUnit\\Framework\\TestListenerDefaultImplementation' => '/phpunit/Framework/TestListenerDefaultImplementation.php',
1377                'PHPUnit\\Framework\\TestResult' => '/phpunit/Framework/TestResult.php',
1378                'PHPUnit\\Framework\\TestSuite' => '/phpunit/Framework/TestSuite.php',
1379                'PHPUnit\\Framework\\TestSuiteIterator' => '/phpunit/Framework/TestSuiteIterator.php',
1380                'PHPUnit\\Framework\\UnintentionallyCoveredCodeError' => '/phpunit/Framework/Exception/UnintentionallyCoveredCodeError.php',
1381                'PHPUnit\\Framework\\Warning' => '/phpunit/Framework/Exception/Warning.php',
1382                'PHPUnit\\Framework\\WarningTestCase' => '/phpunit/Framework/WarningTestCase.php',
1383                'PHPUnit\\PharIo\\Manifest\\Application' => '/phar-io-manifest/values/Application.php',
1384                'PHPUnit\\PharIo\\Manifest\\ApplicationName' => '/phar-io-manifest/values/ApplicationName.php',
1385                'PHPUnit\\PharIo\\Manifest\\Author' => '/phar-io-manifest/values/Author.php',
1386                'PHPUnit\\PharIo\\Manifest\\AuthorCollection' => '/phar-io-manifest/values/AuthorCollection.php',
1387                'PHPUnit\\PharIo\\Manifest\\AuthorCollectionIterator' => '/phar-io-manifest/values/AuthorCollectionIterator.php',
1388                'PHPUnit\\PharIo\\Manifest\\AuthorElement' => '/phar-io-manifest/xml/AuthorElement.php',
1389                'PHPUnit\\PharIo\\Manifest\\AuthorElementCollection' => '/phar-io-manifest/xml/AuthorElementCollection.php',
1390                'PHPUnit\\PharIo\\Manifest\\BundledComponent' => '/phar-io-manifest/values/BundledComponent.php',
1391                'PHPUnit\\PharIo\\Manifest\\BundledComponentCollection' => '/phar-io-manifest/values/BundledComponentCollection.php',
1392                'PHPUnit\\PharIo\\Manifest\\BundledComponentCollectionIterator' => '/phar-io-manifest/values/BundledComponentCollectionIterator.php',
1393                'PHPUnit\\PharIo\\Manifest\\BundlesElement' => '/phar-io-manifest/xml/BundlesElement.php',
1394                'PHPUnit\\PharIo\\Manifest\\ComponentElement' => '/phar-io-manifest/xml/ComponentElement.php',
1395                'PHPUnit\\PharIo\\Manifest\\ComponentElementCollection' => '/phar-io-manifest/xml/ComponentElementCollection.php',
1396                'PHPUnit\\PharIo\\Manifest\\ContainsElement' => '/phar-io-manifest/xml/ContainsElement.php',
1397                'PHPUnit\\PharIo\\Manifest\\CopyrightElement' => '/phar-io-manifest/xml/CopyrightElement.php',
1398                'PHPUnit\\PharIo\\Manifest\\CopyrightInformation' => '/phar-io-manifest/values/CopyrightInformation.php',
1399                'PHPUnit\\PharIo\\Manifest\\ElementCollection' => '/phar-io-manifest/xml/ElementCollection.php',
1400                'PHPUnit\\PharIo\\Manifest\\ElementCollectionException' => '/phar-io-manifest/exceptions/ElementCollectionException.php',
1401                'PHPUnit\\PharIo\\Manifest\\Email' => '/phar-io-manifest/values/Email.php',
1402                'PHPUnit\\PharIo\\Manifest\\Exception' => '/phar-io-manifest/exceptions/Exception.php',
1403                'PHPUnit\\PharIo\\Manifest\\ExtElement' => '/phar-io-manifest/xml/ExtElement.php',
1404                'PHPUnit\\PharIo\\Manifest\\ExtElementCollection' => '/phar-io-manifest/xml/ExtElementCollection.php',
1405                'PHPUnit\\PharIo\\Manifest\\Extension' => '/phar-io-manifest/values/Extension.php',
1406                'PHPUnit\\PharIo\\Manifest\\ExtensionElement' => '/phar-io-manifest/xml/ExtensionElement.php',
1407                'PHPUnit\\PharIo\\Manifest\\InvalidApplicationNameException' => '/phar-io-manifest/exceptions/InvalidApplicationNameException.php',
1408                'PHPUnit\\PharIo\\Manifest\\InvalidEmailException' => '/phar-io-manifest/exceptions/InvalidEmailException.php',
1409                'PHPUnit\\PharIo\\Manifest\\InvalidUrlException' => '/phar-io-manifest/exceptions/InvalidUrlException.php',
1410                'PHPUnit\\PharIo\\Manifest\\Library' => '/phar-io-manifest/values/Library.php',
1411                'PHPUnit\\PharIo\\Manifest\\License' => '/phar-io-manifest/values/License.php',
1412                'PHPUnit\\PharIo\\Manifest\\LicenseElement' => '/phar-io-manifest/xml/LicenseElement.php',
1413                'PHPUnit\\PharIo\\Manifest\\Manifest' => '/phar-io-manifest/values/Manifest.php',
1414                'PHPUnit\\PharIo\\Manifest\\ManifestDocument' => '/phar-io-manifest/xml/ManifestDocument.php',
1415                'PHPUnit\\PharIo\\Manifest\\ManifestDocumentException' => '/phar-io-manifest/exceptions/ManifestDocumentException.php',
1416                'PHPUnit\\PharIo\\Manifest\\ManifestDocumentLoadingException' => '/phar-io-manifest/exceptions/ManifestDocumentLoadingException.php',
1417                'PHPUnit\\PharIo\\Manifest\\ManifestDocumentMapper' => '/phar-io-manifest/ManifestDocumentMapper.php',
1418                'PHPUnit\\PharIo\\Manifest\\ManifestDocumentMapperException' => '/phar-io-manifest/exceptions/ManifestDocumentMapperException.php',
1419                'PHPUnit\\PharIo\\Manifest\\ManifestElement' => '/phar-io-manifest/xml/ManifestElement.php',
1420                'PHPUnit\\PharIo\\Manifest\\ManifestElementException' => '/phar-io-manifest/exceptions/ManifestElementException.php',
1421                'PHPUnit\\PharIo\\Manifest\\ManifestLoader' => '/phar-io-manifest/ManifestLoader.php',
1422                'PHPUnit\\PharIo\\Manifest\\ManifestLoaderException' => '/phar-io-manifest/exceptions/ManifestLoaderException.php',
1423                'PHPUnit\\PharIo\\Manifest\\ManifestSerializer' => '/phar-io-manifest/ManifestSerializer.php',
1424                'PHPUnit\\PharIo\\Manifest\\PhpElement' => '/phar-io-manifest/xml/PhpElement.php',
1425                'PHPUnit\\PharIo\\Manifest\\PhpExtensionRequirement' => '/phar-io-manifest/values/PhpExtensionRequirement.php',
1426                'PHPUnit\\PharIo\\Manifest\\PhpVersionRequirement' => '/phar-io-manifest/values/PhpVersionRequirement.php',
1427                'PHPUnit\\PharIo\\Manifest\\Requirement' => '/phar-io-manifest/values/Requirement.php',
1428                'PHPUnit\\PharIo\\Manifest\\RequirementCollection' => '/phar-io-manifest/values/RequirementCollection.php',
1429                'PHPUnit\\PharIo\\Manifest\\RequirementCollectionIterator' => '/phar-io-manifest/values/RequirementCollectionIterator.php',
1430                'PHPUnit\\PharIo\\Manifest\\RequiresElement' => '/phar-io-manifest/xml/RequiresElement.php',
1431                'PHPUnit\\PharIo\\Manifest\\Type' => '/phar-io-manifest/values/Type.php',
1432                'PHPUnit\\PharIo\\Manifest\\Url' => '/phar-io-manifest/values/Url.php',
1433                'PHPUnit\\PharIo\\Version\\AbstractVersionConstraint' => '/phar-io-version/constraints/AbstractVersionConstraint.php',
1434                'PHPUnit\\PharIo\\Version\\AndVersionConstraintGroup' => '/phar-io-version/constraints/AndVersionConstraintGroup.php',
1435                'PHPUnit\\PharIo\\Version\\AnyVersionConstraint' => '/phar-io-version/constraints/AnyVersionConstraint.php',
1436                'PHPUnit\\PharIo\\Version\\ExactVersionConstraint' => '/phar-io-version/constraints/ExactVersionConstraint.php',
1437                'PHPUnit\\PharIo\\Version\\Exception' => '/phar-io-version/exceptions/Exception.php',
1438                'PHPUnit\\PharIo\\Version\\GreaterThanOrEqualToVersionConstraint' => '/phar-io-version/constraints/GreaterThanOrEqualToVersionConstraint.php',
1439                'PHPUnit\\PharIo\\Version\\InvalidPreReleaseSuffixException' => '/phar-io-version/exceptions/InvalidPreReleaseSuffixException.php',
1440                'PHPUnit\\PharIo\\Version\\InvalidVersionException' => '/phar-io-version/exceptions/InvalidVersionException.php',
1441                'PHPUnit\\PharIo\\Version\\NoPreReleaseSuffixException' => '/phar-io-version/exceptions/NoPreReleaseSuffixException.php',
1442                'PHPUnit\\PharIo\\Version\\OrVersionConstraintGroup' => '/phar-io-version/constraints/OrVersionConstraintGroup.php',
1443                'PHPUnit\\PharIo\\Version\\PreReleaseSuffix' => '/phar-io-version/PreReleaseSuffix.php',
1444                'PHPUnit\\PharIo\\Version\\SpecificMajorAndMinorVersionConstraint' => '/phar-io-version/constraints/SpecificMajorAndMinorVersionConstraint.php',
1445                'PHPUnit\\PharIo\\Version\\SpecificMajorVersionConstraint' => '/phar-io-version/constraints/SpecificMajorVersionConstraint.php',
1446                'PHPUnit\\PharIo\\Version\\UnsupportedVersionConstraintException' => '/phar-io-version/exceptions/UnsupportedVersionConstraintException.php',
1447                'PHPUnit\\PharIo\\Version\\Version' => '/phar-io-version/Version.php',
1448                'PHPUnit\\PharIo\\Version\\VersionConstraint' => '/phar-io-version/constraints/VersionConstraint.php',
1449                'PHPUnit\\PharIo\\Version\\VersionConstraintParser' => '/phar-io-version/VersionConstraintParser.php',
1450                'PHPUnit\\PharIo\\Version\\VersionConstraintValue' => '/phar-io-version/VersionConstraintValue.php',
1451                'PHPUnit\\PharIo\\Version\\VersionNumber' => '/phar-io-version/VersionNumber.php',
1452                'PHPUnit\\PhpParser\\Builder' => '/nikic-php-parser/PhpParser/Builder.php',
1453                'PHPUnit\\PhpParser\\BuilderFactory' => '/nikic-php-parser/PhpParser/BuilderFactory.php',
1454                'PHPUnit\\PhpParser\\BuilderHelpers' => '/nikic-php-parser/PhpParser/BuilderHelpers.php',
1455                'PHPUnit\\PhpParser\\Builder\\ClassConst' => '/nikic-php-parser/PhpParser/Builder/ClassConst.php',
1456                'PHPUnit\\PhpParser\\Builder\\Class_' => '/nikic-php-parser/PhpParser/Builder/Class_.php',
1457                'PHPUnit\\PhpParser\\Builder\\Declaration' => '/nikic-php-parser/PhpParser/Builder/Declaration.php',
1458                'PHPUnit\\PhpParser\\Builder\\FunctionLike' => '/nikic-php-parser/PhpParser/Builder/FunctionLike.php',
1459                'PHPUnit\\PhpParser\\Builder\\Function_' => '/nikic-php-parser/PhpParser/Builder/Function_.php',
1460                'PHPUnit\\PhpParser\\Builder\\Interface_' => '/nikic-php-parser/PhpParser/Builder/Interface_.php',
1461                'PHPUnit\\PhpParser\\Builder\\Method' => '/nikic-php-parser/PhpParser/Builder/Method.php',
1462                'PHPUnit\\PhpParser\\Builder\\Namespace_' => '/nikic-php-parser/PhpParser/Builder/Namespace_.php',
1463                'PHPUnit\\PhpParser\\Builder\\Param' => '/nikic-php-parser/PhpParser/Builder/Param.php',
1464                'PHPUnit\\PhpParser\\Builder\\Property' => '/nikic-php-parser/PhpParser/Builder/Property.php',
1465                'PHPUnit\\PhpParser\\Builder\\TraitUse' => '/nikic-php-parser/PhpParser/Builder/TraitUse.php',
1466                'PHPUnit\\PhpParser\\Builder\\TraitUseAdaptation' => '/nikic-php-parser/PhpParser/Builder/TraitUseAdaptation.php',
1467                'PHPUnit\\PhpParser\\Builder\\Trait_' => '/nikic-php-parser/PhpParser/Builder/Trait_.php',
1468                'PHPUnit\\PhpParser\\Builder\\Use_' => '/nikic-php-parser/PhpParser/Builder/Use_.php',
1469                'PHPUnit\\PhpParser\\Comment' => '/nikic-php-parser/PhpParser/Comment.php',
1470                'PHPUnit\\PhpParser\\Comment\\Doc' => '/nikic-php-parser/PhpParser/Comment/Doc.php',
1471                'PHPUnit\\PhpParser\\ConstExprEvaluationException' => '/nikic-php-parser/PhpParser/ConstExprEvaluationException.php',
1472                'PHPUnit\\PhpParser\\ConstExprEvaluator' => '/nikic-php-parser/PhpParser/ConstExprEvaluator.php',
1473                'PHPUnit\\PhpParser\\Error' => '/nikic-php-parser/PhpParser/Error.php',
1474                'PHPUnit\\PhpParser\\ErrorHandler' => '/nikic-php-parser/PhpParser/ErrorHandler.php',
1475                'PHPUnit\\PhpParser\\ErrorHandler\\Collecting' => '/nikic-php-parser/PhpParser/ErrorHandler/Collecting.php',
1476                'PHPUnit\\PhpParser\\ErrorHandler\\Throwing' => '/nikic-php-parser/PhpParser/ErrorHandler/Throwing.php',
1477                'PHPUnit\\PhpParser\\Internal\\DiffElem' => '/nikic-php-parser/PhpParser/Internal/DiffElem.php',
1478                'PHPUnit\\PhpParser\\Internal\\Differ' => '/nikic-php-parser/PhpParser/Internal/Differ.php',
1479                'PHPUnit\\PhpParser\\Internal\\PrintableNewAnonClassNode' => '/nikic-php-parser/PhpParser/Internal/PrintableNewAnonClassNode.php',
1480                'PHPUnit\\PhpParser\\Internal\\TokenStream' => '/nikic-php-parser/PhpParser/Internal/TokenStream.php',
1481                'PHPUnit\\PhpParser\\JsonDecoder' => '/nikic-php-parser/PhpParser/JsonDecoder.php',
1482                'PHPUnit\\PhpParser\\Lexer' => '/nikic-php-parser/PhpParser/Lexer.php',
1483                'PHPUnit\\PhpParser\\Lexer\\Emulative' => '/nikic-php-parser/PhpParser/Lexer/Emulative.php',
1484                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\AttributeEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php',
1485                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\CoaleseEqualTokenEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php',
1486                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\EnumTokenEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php',
1487                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\ExplicitOctalEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php',
1488                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\FlexibleDocStringEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php',
1489                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\FnTokenEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php',
1490                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\KeywordEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php',
1491                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\MatchTokenEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php',
1492                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\NullsafeTokenEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php',
1493                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\NumericLiteralSeparatorEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php',
1494                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\ReadonlyTokenEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php',
1495                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\ReverseEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php',
1496                'PHPUnit\\PhpParser\\Lexer\\TokenEmulator\\TokenEmulator' => '/nikic-php-parser/PhpParser/Lexer/TokenEmulator/TokenEmulator.php',
1497                'PHPUnit\\PhpParser\\NameContext' => '/nikic-php-parser/PhpParser/NameContext.php',
1498                'PHPUnit\\PhpParser\\Node' => '/nikic-php-parser/PhpParser/Node.php',
1499                'PHPUnit\\PhpParser\\NodeAbstract' => '/nikic-php-parser/PhpParser/NodeAbstract.php',
1500                'PHPUnit\\PhpParser\\NodeDumper' => '/nikic-php-parser/PhpParser/NodeDumper.php',
1501                'PHPUnit\\PhpParser\\NodeFinder' => '/nikic-php-parser/PhpParser/NodeFinder.php',
1502                'PHPUnit\\PhpParser\\NodeTraverser' => '/nikic-php-parser/PhpParser/NodeTraverser.php',
1503                'PHPUnit\\PhpParser\\NodeTraverserInterface' => '/nikic-php-parser/PhpParser/NodeTraverserInterface.php',
1504                'PHPUnit\\PhpParser\\NodeVisitor' => '/nikic-php-parser/PhpParser/NodeVisitor.php',
1505                'PHPUnit\\PhpParser\\NodeVisitorAbstract' => '/nikic-php-parser/PhpParser/NodeVisitorAbstract.php',
1506                'PHPUnit\\PhpParser\\NodeVisitor\\CloningVisitor' => '/nikic-php-parser/PhpParser/NodeVisitor/CloningVisitor.php',
1507                'PHPUnit\\PhpParser\\NodeVisitor\\FindingVisitor' => '/nikic-php-parser/PhpParser/NodeVisitor/FindingVisitor.php',
1508                'PHPUnit\\PhpParser\\NodeVisitor\\FirstFindingVisitor' => '/nikic-php-parser/PhpParser/NodeVisitor/FirstFindingVisitor.php',
1509                'PHPUnit\\PhpParser\\NodeVisitor\\NameResolver' => '/nikic-php-parser/PhpParser/NodeVisitor/NameResolver.php',
1510                'PHPUnit\\PhpParser\\NodeVisitor\\NodeConnectingVisitor' => '/nikic-php-parser/PhpParser/NodeVisitor/NodeConnectingVisitor.php',
1511                'PHPUnit\\PhpParser\\NodeVisitor\\ParentConnectingVisitor' => '/nikic-php-parser/PhpParser/NodeVisitor/ParentConnectingVisitor.php',
1512                'PHPUnit\\PhpParser\\Node\\Arg' => '/nikic-php-parser/PhpParser/Node/Arg.php',
1513                'PHPUnit\\PhpParser\\Node\\Attribute' => '/nikic-php-parser/PhpParser/Node/Attribute.php',
1514                'PHPUnit\\PhpParser\\Node\\AttributeGroup' => '/nikic-php-parser/PhpParser/Node/AttributeGroup.php',
1515                'PHPUnit\\PhpParser\\Node\\ComplexType' => '/nikic-php-parser/PhpParser/Node/ComplexType.php',
1516                'PHPUnit\\PhpParser\\Node\\Const_' => '/nikic-php-parser/PhpParser/Node/Const_.php',
1517                'PHPUnit\\PhpParser\\Node\\Expr' => '/nikic-php-parser/PhpParser/Node/Expr.php',
1518                'PHPUnit\\PhpParser\\Node\\Expr\\ArrayDimFetch' => '/nikic-php-parser/PhpParser/Node/Expr/ArrayDimFetch.php',
1519                'PHPUnit\\PhpParser\\Node\\Expr\\ArrayItem' => '/nikic-php-parser/PhpParser/Node/Expr/ArrayItem.php',
1520                'PHPUnit\\PhpParser\\Node\\Expr\\Array_' => '/nikic-php-parser/PhpParser/Node/Expr/Array_.php',
1521                'PHPUnit\\PhpParser\\Node\\Expr\\ArrowFunction' => '/nikic-php-parser/PhpParser/Node/Expr/ArrowFunction.php',
1522                'PHPUnit\\PhpParser\\Node\\Expr\\Assign' => '/nikic-php-parser/PhpParser/Node/Expr/Assign.php',
1523                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp.php',
1524                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\BitwiseAnd' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php',
1525                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\BitwiseOr' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/BitwiseOr.php',
1526                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\BitwiseXor' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/BitwiseXor.php',
1527                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\Coalesce' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/Coalesce.php',
1528                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\Concat' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/Concat.php',
1529                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\Div' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/Div.php',
1530                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\Minus' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/Minus.php',
1531                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\Mod' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/Mod.php',
1532                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\Mul' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/Mul.php',
1533                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\Plus' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/Plus.php',
1534                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\Pow' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/Pow.php',
1535                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\ShiftLeft' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/ShiftLeft.php',
1536                'PHPUnit\\PhpParser\\Node\\Expr\\AssignOp\\ShiftRight' => '/nikic-php-parser/PhpParser/Node/Expr/AssignOp/ShiftRight.php',
1537                'PHPUnit\\PhpParser\\Node\\Expr\\AssignRef' => '/nikic-php-parser/PhpParser/Node/Expr/AssignRef.php',
1538                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp.php',
1539                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\BitwiseAnd' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php',
1540                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\BitwiseOr' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php',
1541                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\BitwiseXor' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php',
1542                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\BooleanAnd' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php',
1543                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\BooleanOr' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/BooleanOr.php',
1544                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Coalesce' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Coalesce.php',
1545                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Concat' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Concat.php',
1546                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Div' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Div.php',
1547                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Equal' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Equal.php',
1548                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Greater' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Greater.php',
1549                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\GreaterOrEqual' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php',
1550                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Identical' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Identical.php',
1551                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\LogicalAnd' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php',
1552                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\LogicalOr' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/LogicalOr.php',
1553                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\LogicalXor' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/LogicalXor.php',
1554                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Minus' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Minus.php',
1555                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Mod' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Mod.php',
1556                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Mul' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Mul.php',
1557                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\NotEqual' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/NotEqual.php',
1558                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\NotIdentical' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/NotIdentical.php',
1559                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Plus' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Plus.php',
1560                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Pow' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Pow.php',
1561                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\ShiftLeft' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php',
1562                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\ShiftRight' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/ShiftRight.php',
1563                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Smaller' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Smaller.php',
1564                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\SmallerOrEqual' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php',
1565                'PHPUnit\\PhpParser\\Node\\Expr\\BinaryOp\\Spaceship' => '/nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Spaceship.php',
1566                'PHPUnit\\PhpParser\\Node\\Expr\\BitwiseNot' => '/nikic-php-parser/PhpParser/Node/Expr/BitwiseNot.php',
1567                'PHPUnit\\PhpParser\\Node\\Expr\\BooleanNot' => '/nikic-php-parser/PhpParser/Node/Expr/BooleanNot.php',
1568                'PHPUnit\\PhpParser\\Node\\Expr\\CallLike' => '/nikic-php-parser/PhpParser/Node/Expr/CallLike.php',
1569                'PHPUnit\\PhpParser\\Node\\Expr\\Cast' => '/nikic-php-parser/PhpParser/Node/Expr/Cast.php',
1570                'PHPUnit\\PhpParser\\Node\\Expr\\Cast\\Array_' => '/nikic-php-parser/PhpParser/Node/Expr/Cast/Array_.php',
1571                'PHPUnit\\PhpParser\\Node\\Expr\\Cast\\Bool_' => '/nikic-php-parser/PhpParser/Node/Expr/Cast/Bool_.php',
1572                'PHPUnit\\PhpParser\\Node\\Expr\\Cast\\Double' => '/nikic-php-parser/PhpParser/Node/Expr/Cast/Double.php',
1573                'PHPUnit\\PhpParser\\Node\\Expr\\Cast\\Int_' => '/nikic-php-parser/PhpParser/Node/Expr/Cast/Int_.php',
1574                'PHPUnit\\PhpParser\\Node\\Expr\\Cast\\Object_' => '/nikic-php-parser/PhpParser/Node/Expr/Cast/Object_.php',
1575                'PHPUnit\\PhpParser\\Node\\Expr\\Cast\\String_' => '/nikic-php-parser/PhpParser/Node/Expr/Cast/String_.php',
1576                'PHPUnit\\PhpParser\\Node\\Expr\\Cast\\Unset_' => '/nikic-php-parser/PhpParser/Node/Expr/Cast/Unset_.php',
1577                'PHPUnit\\PhpParser\\Node\\Expr\\ClassConstFetch' => '/nikic-php-parser/PhpParser/Node/Expr/ClassConstFetch.php',
1578                'PHPUnit\\PhpParser\\Node\\Expr\\Clone_' => '/nikic-php-parser/PhpParser/Node/Expr/Clone_.php',
1579                'PHPUnit\\PhpParser\\Node\\Expr\\Closure' => '/nikic-php-parser/PhpParser/Node/Expr/Closure.php',
1580                'PHPUnit\\PhpParser\\Node\\Expr\\ClosureUse' => '/nikic-php-parser/PhpParser/Node/Expr/ClosureUse.php',
1581                'PHPUnit\\PhpParser\\Node\\Expr\\ConstFetch' => '/nikic-php-parser/PhpParser/Node/Expr/ConstFetch.php',
1582                'PHPUnit\\PhpParser\\Node\\Expr\\Empty_' => '/nikic-php-parser/PhpParser/Node/Expr/Empty_.php',
1583                'PHPUnit\\PhpParser\\Node\\Expr\\Error' => '/nikic-php-parser/PhpParser/Node/Expr/Error.php',
1584                'PHPUnit\\PhpParser\\Node\\Expr\\ErrorSuppress' => '/nikic-php-parser/PhpParser/Node/Expr/ErrorSuppress.php',
1585                'PHPUnit\\PhpParser\\Node\\Expr\\Eval_' => '/nikic-php-parser/PhpParser/Node/Expr/Eval_.php',
1586                'PHPUnit\\PhpParser\\Node\\Expr\\Exit_' => '/nikic-php-parser/PhpParser/Node/Expr/Exit_.php',
1587                'PHPUnit\\PhpParser\\Node\\Expr\\FuncCall' => '/nikic-php-parser/PhpParser/Node/Expr/FuncCall.php',
1588                'PHPUnit\\PhpParser\\Node\\Expr\\Include_' => '/nikic-php-parser/PhpParser/Node/Expr/Include_.php',
1589                'PHPUnit\\PhpParser\\Node\\Expr\\Instanceof_' => '/nikic-php-parser/PhpParser/Node/Expr/Instanceof_.php',
1590                'PHPUnit\\PhpParser\\Node\\Expr\\Isset_' => '/nikic-php-parser/PhpParser/Node/Expr/Isset_.php',
1591                'PHPUnit\\PhpParser\\Node\\Expr\\List_' => '/nikic-php-parser/PhpParser/Node/Expr/List_.php',
1592                'PHPUnit\\PhpParser\\Node\\Expr\\Match_' => '/nikic-php-parser/PhpParser/Node/Expr/Match_.php',
1593                'PHPUnit\\PhpParser\\Node\\Expr\\MethodCall' => '/nikic-php-parser/PhpParser/Node/Expr/MethodCall.php',
1594                'PHPUnit\\PhpParser\\Node\\Expr\\New_' => '/nikic-php-parser/PhpParser/Node/Expr/New_.php',
1595                'PHPUnit\\PhpParser\\Node\\Expr\\NullsafeMethodCall' => '/nikic-php-parser/PhpParser/Node/Expr/NullsafeMethodCall.php',
1596                'PHPUnit\\PhpParser\\Node\\Expr\\NullsafePropertyFetch' => '/nikic-php-parser/PhpParser/Node/Expr/NullsafePropertyFetch.php',
1597                'PHPUnit\\PhpParser\\Node\\Expr\\PostDec' => '/nikic-php-parser/PhpParser/Node/Expr/PostDec.php',
1598                'PHPUnit\\PhpParser\\Node\\Expr\\PostInc' => '/nikic-php-parser/PhpParser/Node/Expr/PostInc.php',
1599                'PHPUnit\\PhpParser\\Node\\Expr\\PreDec' => '/nikic-php-parser/PhpParser/Node/Expr/PreDec.php',
1600                'PHPUnit\\PhpParser\\Node\\Expr\\PreInc' => '/nikic-php-parser/PhpParser/Node/Expr/PreInc.php',
1601                'PHPUnit\\PhpParser\\Node\\Expr\\Print_' => '/nikic-php-parser/PhpParser/Node/Expr/Print_.php',
1602                'PHPUnit\\PhpParser\\Node\\Expr\\PropertyFetch' => '/nikic-php-parser/PhpParser/Node/Expr/PropertyFetch.php',
1603                'PHPUnit\\PhpParser\\Node\\Expr\\ShellExec' => '/nikic-php-parser/PhpParser/Node/Expr/ShellExec.php',
1604                'PHPUnit\\PhpParser\\Node\\Expr\\StaticCall' => '/nikic-php-parser/PhpParser/Node/Expr/StaticCall.php',
1605                'PHPUnit\\PhpParser\\Node\\Expr\\StaticPropertyFetch' => '/nikic-php-parser/PhpParser/Node/Expr/StaticPropertyFetch.php',
1606                'PHPUnit\\PhpParser\\Node\\Expr\\Ternary' => '/nikic-php-parser/PhpParser/Node/Expr/Ternary.php',
1607                'PHPUnit\\PhpParser\\Node\\Expr\\Throw_' => '/nikic-php-parser/PhpParser/Node/Expr/Throw_.php',
1608                'PHPUnit\\PhpParser\\Node\\Expr\\UnaryMinus' => '/nikic-php-parser/PhpParser/Node/Expr/UnaryMinus.php',
1609                'PHPUnit\\PhpParser\\Node\\Expr\\UnaryPlus' => '/nikic-php-parser/PhpParser/Node/Expr/UnaryPlus.php',
1610                'PHPUnit\\PhpParser\\Node\\Expr\\Variable' => '/nikic-php-parser/PhpParser/Node/Expr/Variable.php',
1611                'PHPUnit\\PhpParser\\Node\\Expr\\YieldFrom' => '/nikic-php-parser/PhpParser/Node/Expr/YieldFrom.php',
1612                'PHPUnit\\PhpParser\\Node\\Expr\\Yield_' => '/nikic-php-parser/PhpParser/Node/Expr/Yield_.php',
1613                'PHPUnit\\PhpParser\\Node\\FunctionLike' => '/nikic-php-parser/PhpParser/Node/FunctionLike.php',
1614                'PHPUnit\\PhpParser\\Node\\Identifier' => '/nikic-php-parser/PhpParser/Node/Identifier.php',
1615                'PHPUnit\\PhpParser\\Node\\IntersectionType' => '/nikic-php-parser/PhpParser/Node/IntersectionType.php',
1616                'PHPUnit\\PhpParser\\Node\\MatchArm' => '/nikic-php-parser/PhpParser/Node/MatchArm.php',
1617                'PHPUnit\\PhpParser\\Node\\Name' => '/nikic-php-parser/PhpParser/Node/Name.php',
1618                'PHPUnit\\PhpParser\\Node\\Name\\FullyQualified' => '/nikic-php-parser/PhpParser/Node/Name/FullyQualified.php',
1619                'PHPUnit\\PhpParser\\Node\\Name\\Relative' => '/nikic-php-parser/PhpParser/Node/Name/Relative.php',
1620                'PHPUnit\\PhpParser\\Node\\NullableType' => '/nikic-php-parser/PhpParser/Node/NullableType.php',
1621                'PHPUnit\\PhpParser\\Node\\Param' => '/nikic-php-parser/PhpParser/Node/Param.php',
1622                'PHPUnit\\PhpParser\\Node\\Scalar' => '/nikic-php-parser/PhpParser/Node/Scalar.php',
1623                'PHPUnit\\PhpParser\\Node\\Scalar\\DNumber' => '/nikic-php-parser/PhpParser/Node/Scalar/DNumber.php',
1624                'PHPUnit\\PhpParser\\Node\\Scalar\\Encapsed' => '/nikic-php-parser/PhpParser/Node/Scalar/Encapsed.php',
1625                'PHPUnit\\PhpParser\\Node\\Scalar\\EncapsedStringPart' => '/nikic-php-parser/PhpParser/Node/Scalar/EncapsedStringPart.php',
1626                'PHPUnit\\PhpParser\\Node\\Scalar\\LNumber' => '/nikic-php-parser/PhpParser/Node/Scalar/LNumber.php',
1627                'PHPUnit\\PhpParser\\Node\\Scalar\\MagicConst' => '/nikic-php-parser/PhpParser/Node/Scalar/MagicConst.php',
1628                'PHPUnit\\PhpParser\\Node\\Scalar\\MagicConst\\Class_' => '/nikic-php-parser/PhpParser/Node/Scalar/MagicConst/Class_.php',
1629                'PHPUnit\\PhpParser\\Node\\Scalar\\MagicConst\\Dir' => '/nikic-php-parser/PhpParser/Node/Scalar/MagicConst/Dir.php',
1630                'PHPUnit\\PhpParser\\Node\\Scalar\\MagicConst\\File' => '/nikic-php-parser/PhpParser/Node/Scalar/MagicConst/File.php',
1631                'PHPUnit\\PhpParser\\Node\\Scalar\\MagicConst\\Function_' => '/nikic-php-parser/PhpParser/Node/Scalar/MagicConst/Function_.php',
1632                'PHPUnit\\PhpParser\\Node\\Scalar\\MagicConst\\Line' => '/nikic-php-parser/PhpParser/Node/Scalar/MagicConst/Line.php',
1633                'PHPUnit\\PhpParser\\Node\\Scalar\\MagicConst\\Method' => '/nikic-php-parser/PhpParser/Node/Scalar/MagicConst/Method.php',
1634                'PHPUnit\\PhpParser\\Node\\Scalar\\MagicConst\\Namespace_' => '/nikic-php-parser/PhpParser/Node/Scalar/MagicConst/Namespace_.php',
1635                'PHPUnit\\PhpParser\\Node\\Scalar\\MagicConst\\Trait_' => '/nikic-php-parser/PhpParser/Node/Scalar/MagicConst/Trait_.php',
1636                'PHPUnit\\PhpParser\\Node\\Scalar\\String_' => '/nikic-php-parser/PhpParser/Node/Scalar/String_.php',
1637                'PHPUnit\\PhpParser\\Node\\Stmt' => '/nikic-php-parser/PhpParser/Node/Stmt.php',
1638                'PHPUnit\\PhpParser\\Node\\Stmt\\Break_' => '/nikic-php-parser/PhpParser/Node/Stmt/Break_.php',
1639                'PHPUnit\\PhpParser\\Node\\Stmt\\Case_' => '/nikic-php-parser/PhpParser/Node/Stmt/Case_.php',
1640                'PHPUnit\\PhpParser\\Node\\Stmt\\Catch_' => '/nikic-php-parser/PhpParser/Node/Stmt/Catch_.php',
1641                'PHPUnit\\PhpParser\\Node\\Stmt\\ClassConst' => '/nikic-php-parser/PhpParser/Node/Stmt/ClassConst.php',
1642                'PHPUnit\\PhpParser\\Node\\Stmt\\ClassLike' => '/nikic-php-parser/PhpParser/Node/Stmt/ClassLike.php',
1643                'PHPUnit\\PhpParser\\Node\\Stmt\\ClassMethod' => '/nikic-php-parser/PhpParser/Node/Stmt/ClassMethod.php',
1644                'PHPUnit\\PhpParser\\Node\\Stmt\\Class_' => '/nikic-php-parser/PhpParser/Node/Stmt/Class_.php',
1645                'PHPUnit\\PhpParser\\Node\\Stmt\\Const_' => '/nikic-php-parser/PhpParser/Node/Stmt/Const_.php',
1646                'PHPUnit\\PhpParser\\Node\\Stmt\\Continue_' => '/nikic-php-parser/PhpParser/Node/Stmt/Continue_.php',
1647                'PHPUnit\\PhpParser\\Node\\Stmt\\DeclareDeclare' => '/nikic-php-parser/PhpParser/Node/Stmt/DeclareDeclare.php',
1648                'PHPUnit\\PhpParser\\Node\\Stmt\\Declare_' => '/nikic-php-parser/PhpParser/Node/Stmt/Declare_.php',
1649                'PHPUnit\\PhpParser\\Node\\Stmt\\Do_' => '/nikic-php-parser/PhpParser/Node/Stmt/Do_.php',
1650                'PHPUnit\\PhpParser\\Node\\Stmt\\Echo_' => '/nikic-php-parser/PhpParser/Node/Stmt/Echo_.php',
1651                'PHPUnit\\PhpParser\\Node\\Stmt\\ElseIf_' => '/nikic-php-parser/PhpParser/Node/Stmt/ElseIf_.php',
1652                'PHPUnit\\PhpParser\\Node\\Stmt\\Else_' => '/nikic-php-parser/PhpParser/Node/Stmt/Else_.php',
1653                'PHPUnit\\PhpParser\\Node\\Stmt\\EnumCase' => '/nikic-php-parser/PhpParser/Node/Stmt/EnumCase.php',
1654                'PHPUnit\\PhpParser\\Node\\Stmt\\Enum_' => '/nikic-php-parser/PhpParser/Node/Stmt/Enum_.php',
1655                'PHPUnit\\PhpParser\\Node\\Stmt\\Expression' => '/nikic-php-parser/PhpParser/Node/Stmt/Expression.php',
1656                'PHPUnit\\PhpParser\\Node\\Stmt\\Finally_' => '/nikic-php-parser/PhpParser/Node/Stmt/Finally_.php',
1657                'PHPUnit\\PhpParser\\Node\\Stmt\\For_' => '/nikic-php-parser/PhpParser/Node/Stmt/For_.php',
1658                'PHPUnit\\PhpParser\\Node\\Stmt\\Foreach_' => '/nikic-php-parser/PhpParser/Node/Stmt/Foreach_.php',
1659                'PHPUnit\\PhpParser\\Node\\Stmt\\Function_' => '/nikic-php-parser/PhpParser/Node/Stmt/Function_.php',
1660                'PHPUnit\\PhpParser\\Node\\Stmt\\Global_' => '/nikic-php-parser/PhpParser/Node/Stmt/Global_.php',
1661                'PHPUnit\\PhpParser\\Node\\Stmt\\Goto_' => '/nikic-php-parser/PhpParser/Node/Stmt/Goto_.php',
1662                'PHPUnit\\PhpParser\\Node\\Stmt\\GroupUse' => '/nikic-php-parser/PhpParser/Node/Stmt/GroupUse.php',
1663                'PHPUnit\\PhpParser\\Node\\Stmt\\HaltCompiler' => '/nikic-php-parser/PhpParser/Node/Stmt/HaltCompiler.php',
1664                'PHPUnit\\PhpParser\\Node\\Stmt\\If_' => '/nikic-php-parser/PhpParser/Node/Stmt/If_.php',
1665                'PHPUnit\\PhpParser\\Node\\Stmt\\InlineHTML' => '/nikic-php-parser/PhpParser/Node/Stmt/InlineHTML.php',
1666                'PHPUnit\\PhpParser\\Node\\Stmt\\Interface_' => '/nikic-php-parser/PhpParser/Node/Stmt/Interface_.php',
1667                'PHPUnit\\PhpParser\\Node\\Stmt\\Label' => '/nikic-php-parser/PhpParser/Node/Stmt/Label.php',
1668                'PHPUnit\\PhpParser\\Node\\Stmt\\Namespace_' => '/nikic-php-parser/PhpParser/Node/Stmt/Namespace_.php',
1669                'PHPUnit\\PhpParser\\Node\\Stmt\\Nop' => '/nikic-php-parser/PhpParser/Node/Stmt/Nop.php',
1670                'PHPUnit\\PhpParser\\Node\\Stmt\\Property' => '/nikic-php-parser/PhpParser/Node/Stmt/Property.php',
1671                'PHPUnit\\PhpParser\\Node\\Stmt\\PropertyProperty' => '/nikic-php-parser/PhpParser/Node/Stmt/PropertyProperty.php',
1672                'PHPUnit\\PhpParser\\Node\\Stmt\\Return_' => '/nikic-php-parser/PhpParser/Node/Stmt/Return_.php',
1673                'PHPUnit\\PhpParser\\Node\\Stmt\\StaticVar' => '/nikic-php-parser/PhpParser/Node/Stmt/StaticVar.php',
1674                'PHPUnit\\PhpParser\\Node\\Stmt\\Static_' => '/nikic-php-parser/PhpParser/Node/Stmt/Static_.php',
1675                'PHPUnit\\PhpParser\\Node\\Stmt\\Switch_' => '/nikic-php-parser/PhpParser/Node/Stmt/Switch_.php',
1676                'PHPUnit\\PhpParser\\Node\\Stmt\\Throw_' => '/nikic-php-parser/PhpParser/Node/Stmt/Throw_.php',
1677                'PHPUnit\\PhpParser\\Node\\Stmt\\TraitUse' => '/nikic-php-parser/PhpParser/Node/Stmt/TraitUse.php',
1678                'PHPUnit\\PhpParser\\Node\\Stmt\\TraitUseAdaptation' => '/nikic-php-parser/PhpParser/Node/Stmt/TraitUseAdaptation.php',
1679                'PHPUnit\\PhpParser\\Node\\Stmt\\TraitUseAdaptation\\Alias' => '/nikic-php-parser/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php',
1680                'PHPUnit\\PhpParser\\Node\\Stmt\\TraitUseAdaptation\\Precedence' => '/nikic-php-parser/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php',
1681                'PHPUnit\\PhpParser\\Node\\Stmt\\Trait_' => '/nikic-php-parser/PhpParser/Node/Stmt/Trait_.php',
1682                'PHPUnit\\PhpParser\\Node\\Stmt\\TryCatch' => '/nikic-php-parser/PhpParser/Node/Stmt/TryCatch.php',
1683                'PHPUnit\\PhpParser\\Node\\Stmt\\Unset_' => '/nikic-php-parser/PhpParser/Node/Stmt/Unset_.php',
1684                'PHPUnit\\PhpParser\\Node\\Stmt\\UseUse' => '/nikic-php-parser/PhpParser/Node/Stmt/UseUse.php',
1685                'PHPUnit\\PhpParser\\Node\\Stmt\\Use_' => '/nikic-php-parser/PhpParser/Node/Stmt/Use_.php',
1686                'PHPUnit\\PhpParser\\Node\\Stmt\\While_' => '/nikic-php-parser/PhpParser/Node/Stmt/While_.php',
1687                'PHPUnit\\PhpParser\\Node\\UnionType' => '/nikic-php-parser/PhpParser/Node/UnionType.php',
1688                'PHPUnit\\PhpParser\\Node\\VarLikeIdentifier' => '/nikic-php-parser/PhpParser/Node/VarLikeIdentifier.php',
1689                'PHPUnit\\PhpParser\\Node\\VariadicPlaceholder' => '/nikic-php-parser/PhpParser/Node/VariadicPlaceholder.php',
1690                'PHPUnit\\PhpParser\\Parser' => '/nikic-php-parser/PhpParser/Parser.php',
1691                'PHPUnit\\PhpParser\\ParserAbstract' => '/nikic-php-parser/PhpParser/ParserAbstract.php',
1692                'PHPUnit\\PhpParser\\ParserFactory' => '/nikic-php-parser/PhpParser/ParserFactory.php',
1693                'PHPUnit\\PhpParser\\Parser\\Multiple' => '/nikic-php-parser/PhpParser/Parser/Multiple.php',
1694                'PHPUnit\\PhpParser\\Parser\\Php5' => '/nikic-php-parser/PhpParser/Parser/Php5.php',
1695                'PHPUnit\\PhpParser\\Parser\\Php7' => '/nikic-php-parser/PhpParser/Parser/Php7.php',
1696                'PHPUnit\\PhpParser\\Parser\\Tokens' => '/nikic-php-parser/PhpParser/Parser/Tokens.php',
1697                'PHPUnit\\PhpParser\\PrettyPrinterAbstract' => '/nikic-php-parser/PhpParser/PrettyPrinterAbstract.php',
1698                'PHPUnit\\PhpParser\\PrettyPrinter\\Standard' => '/nikic-php-parser/PhpParser/PrettyPrinter/Standard.php',
1699                'PHPUnit\\Runner\\AfterIncompleteTestHook' => '/phpunit/Runner/Hook/AfterIncompleteTestHook.php',
1700                'PHPUnit\\Runner\\AfterLastTestHook' => '/phpunit/Runner/Hook/AfterLastTestHook.php',
1701                'PHPUnit\\Runner\\AfterRiskyTestHook' => '/phpunit/Runner/Hook/AfterRiskyTestHook.php',
1702                'PHPUnit\\Runner\\AfterSkippedTestHook' => '/phpunit/Runner/Hook/AfterSkippedTestHook.php',
1703                'PHPUnit\\Runner\\AfterSuccessfulTestHook' => '/phpunit/Runner/Hook/AfterSuccessfulTestHook.php',
1704                'PHPUnit\\Runner\\AfterTestErrorHook' => '/phpunit/Runner/Hook/AfterTestErrorHook.php',
1705                'PHPUnit\\Runner\\AfterTestFailureHook' => '/phpunit/Runner/Hook/AfterTestFailureHook.php',
1706                'PHPUnit\\Runner\\AfterTestHook' => '/phpunit/Runner/Hook/AfterTestHook.php',
1707                'PHPUnit\\Runner\\AfterTestWarningHook' => '/phpunit/Runner/Hook/AfterTestWarningHook.php',
1708                'PHPUnit\\Runner\\BaseTestRunner' => '/phpunit/Runner/BaseTestRunner.php',
1709                'PHPUnit\\Runner\\BeforeFirstTestHook' => '/phpunit/Runner/Hook/BeforeFirstTestHook.php',
1710                'PHPUnit\\Runner\\BeforeTestHook' => '/phpunit/Runner/Hook/BeforeTestHook.php',
1711                'PHPUnit\\Runner\\DefaultTestResultCache' => '/phpunit/Runner/DefaultTestResultCache.php',
1712                'PHPUnit\\Runner\\Exception' => '/phpunit/Runner/Exception.php',
1713                'PHPUnit\\Runner\\Extension\\ExtensionHandler' => '/phpunit/Runner/Extension/ExtensionHandler.php',
1714                'PHPUnit\\Runner\\Extension\\PharLoader' => '/phpunit/Runner/Extension/PharLoader.php',
1715                'PHPUnit\\Runner\\Filter\\ExcludeGroupFilterIterator' => '/phpunit/Runner/Filter/ExcludeGroupFilterIterator.php',
1716                'PHPUnit\\Runner\\Filter\\Factory' => '/phpunit/Runner/Filter/Factory.php',
1717                'PHPUnit\\Runner\\Filter\\GroupFilterIterator' => '/phpunit/Runner/Filter/GroupFilterIterator.php',
1718                'PHPUnit\\Runner\\Filter\\IncludeGroupFilterIterator' => '/phpunit/Runner/Filter/IncludeGroupFilterIterator.php',
1719                'PHPUnit\\Runner\\Filter\\NameFilterIterator' => '/phpunit/Runner/Filter/NameFilterIterator.php',
1720                'PHPUnit\\Runner\\Hook' => '/phpunit/Runner/Hook/Hook.php',
1721                'PHPUnit\\Runner\\NullTestResultCache' => '/phpunit/Runner/NullTestResultCache.php',
1722                'PHPUnit\\Runner\\PhptTestCase' => '/phpunit/Runner/PhptTestCase.php',
1723                'PHPUnit\\Runner\\ResultCacheExtension' => '/phpunit/Runner/ResultCacheExtension.php',
1724                'PHPUnit\\Runner\\StandardTestSuiteLoader' => '/phpunit/Runner/StandardTestSuiteLoader.php',
1725                'PHPUnit\\Runner\\TestHook' => '/phpunit/Runner/Hook/TestHook.php',
1726                'PHPUnit\\Runner\\TestListenerAdapter' => '/phpunit/Runner/Hook/TestListenerAdapter.php',
1727                'PHPUnit\\Runner\\TestResultCache' => '/phpunit/Runner/TestResultCache.php',
1728                'PHPUnit\\Runner\\TestSuiteLoader' => '/phpunit/Runner/TestSuiteLoader.php',
1729                'PHPUnit\\Runner\\TestSuiteSorter' => '/phpunit/Runner/TestSuiteSorter.php',
1730                'PHPUnit\\Runner\\Version' => '/phpunit/Runner/Version.php',
1731                'PHPUnit\\SebastianBergmann\\CliParser\\AmbiguousOptionException' => '/sebastian-cli-parser/exceptions/AmbiguousOptionException.php',
1732                'PHPUnit\\SebastianBergmann\\CliParser\\Exception' => '/sebastian-cli-parser/exceptions/Exception.php',
1733                'PHPUnit\\SebastianBergmann\\CliParser\\OptionDoesNotAllowArgumentException' => '/sebastian-cli-parser/exceptions/OptionDoesNotAllowArgumentException.php',
1734                'PHPUnit\\SebastianBergmann\\CliParser\\Parser' => '/sebastian-cli-parser/Parser.php',
1735                'PHPUnit\\SebastianBergmann\\CliParser\\RequiredOptionArgumentMissingException' => '/sebastian-cli-parser/exceptions/RequiredOptionArgumentMissingException.php',
1736                'PHPUnit\\SebastianBergmann\\CliParser\\UnknownOptionException' => '/sebastian-cli-parser/exceptions/UnknownOptionException.php',
1737                'PHPUnit\\SebastianBergmann\\CodeCoverage\\BranchAndPathCoverageNotSupportedException' => '/php-code-coverage/Exception/BranchAndPathCoverageNotSupportedException.php',
1738                'PHPUnit\\SebastianBergmann\\CodeCoverage\\CodeCoverage' => '/php-code-coverage/CodeCoverage.php',
1739                'PHPUnit\\SebastianBergmann\\CodeCoverage\\CrapIndex' => '/php-code-coverage/CrapIndex.php',
1740                'PHPUnit\\SebastianBergmann\\CodeCoverage\\DeadCodeDetectionNotSupportedException' => '/php-code-coverage/Exception/DeadCodeDetectionNotSupportedException.php',
1741                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Directory' => '/php-code-coverage/Directory.php',
1742                'PHPUnit\\SebastianBergmann\\CodeCoverage\\DirectoryCouldNotBeCreatedException' => '/php-code-coverage/Exception/DirectoryCouldNotBeCreatedException.php',
1743                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\Driver' => '/php-code-coverage/Driver/Driver.php',
1744                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\PathExistsButIsNotDirectoryException' => '/php-code-coverage/Exception/PathExistsButIsNotDirectoryException.php',
1745                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\PcovDriver' => '/php-code-coverage/Driver/PcovDriver.php',
1746                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\PcovNotAvailableException' => '/php-code-coverage/Exception/PcovNotAvailableException.php',
1747                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\PhpdbgDriver' => '/php-code-coverage/Driver/PhpdbgDriver.php',
1748                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\PhpdbgNotAvailableException' => '/php-code-coverage/Exception/PhpdbgNotAvailableException.php',
1749                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\Selector' => '/php-code-coverage/Driver/Selector.php',
1750                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\WriteOperationFailedException' => '/php-code-coverage/Exception/WriteOperationFailedException.php',
1751                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\WrongXdebugVersionException' => '/php-code-coverage/Exception/WrongXdebugVersionException.php',
1752                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\Xdebug2Driver' => '/php-code-coverage/Driver/Xdebug2Driver.php',
1753                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\Xdebug2NotEnabledException' => '/php-code-coverage/Exception/Xdebug2NotEnabledException.php',
1754                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\Xdebug3Driver' => '/php-code-coverage/Driver/Xdebug3Driver.php',
1755                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\Xdebug3NotEnabledException' => '/php-code-coverage/Exception/Xdebug3NotEnabledException.php',
1756                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Driver\\XdebugNotAvailableException' => '/php-code-coverage/Exception/XdebugNotAvailableException.php',
1757                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Exception' => '/php-code-coverage/Exception/Exception.php',
1758                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Filter' => '/php-code-coverage/Filter.php',
1759                'PHPUnit\\SebastianBergmann\\CodeCoverage\\InvalidArgumentException' => '/php-code-coverage/Exception/InvalidArgumentException.php',
1760                'PHPUnit\\SebastianBergmann\\CodeCoverage\\NoCodeCoverageDriverAvailableException' => '/php-code-coverage/Exception/NoCodeCoverageDriverAvailableException.php',
1761                'PHPUnit\\SebastianBergmann\\CodeCoverage\\NoCodeCoverageDriverWithPathCoverageSupportAvailableException' => '/php-code-coverage/Exception/NoCodeCoverageDriverWithPathCoverageSupportAvailableException.php',
1762                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Node\\AbstractNode' => '/php-code-coverage/Node/AbstractNode.php',
1763                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Node\\Builder' => '/php-code-coverage/Node/Builder.php',
1764                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Node\\Directory' => '/php-code-coverage/Node/Directory.php',
1765                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Node\\File' => '/php-code-coverage/Node/File.php',
1766                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Node\\Iterator' => '/php-code-coverage/Node/Iterator.php',
1767                'PHPUnit\\SebastianBergmann\\CodeCoverage\\ParserException' => '/php-code-coverage/Exception/ParserException.php',
1768                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Percentage' => '/php-code-coverage/Percentage.php',
1769                'PHPUnit\\SebastianBergmann\\CodeCoverage\\ProcessedCodeCoverageData' => '/php-code-coverage/ProcessedCodeCoverageData.php',
1770                'PHPUnit\\SebastianBergmann\\CodeCoverage\\RawCodeCoverageData' => '/php-code-coverage/RawCodeCoverageData.php',
1771                'PHPUnit\\SebastianBergmann\\CodeCoverage\\ReflectionException' => '/php-code-coverage/Exception/ReflectionException.php',
1772                'PHPUnit\\SebastianBergmann\\CodeCoverage\\ReportAlreadyFinalizedException' => '/php-code-coverage/Exception/ReportAlreadyFinalizedException.php',
1773                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Clover' => '/php-code-coverage/Report/Clover.php',
1774                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Cobertura' => '/php-code-coverage/Report/Cobertura.php',
1775                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Crap4j' => '/php-code-coverage/Report/Crap4j.php',
1776                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Html\\Dashboard' => '/php-code-coverage/Report/Html/Renderer/Dashboard.php',
1777                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Html\\Directory' => '/php-code-coverage/Report/Html/Renderer/Directory.php',
1778                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Html\\Facade' => '/php-code-coverage/Report/Html/Facade.php',
1779                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Html\\File' => '/php-code-coverage/Report/Html/Renderer/File.php',
1780                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Html\\Renderer' => '/php-code-coverage/Report/Html/Renderer.php',
1781                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\PHP' => '/php-code-coverage/Report/PHP.php',
1782                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Text' => '/php-code-coverage/Report/Text.php',
1783                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\BuildInformation' => '/php-code-coverage/Report/Xml/BuildInformation.php',
1784                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\Coverage' => '/php-code-coverage/Report/Xml/Coverage.php',
1785                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\Directory' => '/php-code-coverage/Report/Xml/Directory.php',
1786                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\Facade' => '/php-code-coverage/Report/Xml/Facade.php',
1787                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\File' => '/php-code-coverage/Report/Xml/File.php',
1788                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\Method' => '/php-code-coverage/Report/Xml/Method.php',
1789                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\Node' => '/php-code-coverage/Report/Xml/Node.php',
1790                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\Project' => '/php-code-coverage/Report/Xml/Project.php',
1791                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\Report' => '/php-code-coverage/Report/Xml/Report.php',
1792                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\Source' => '/php-code-coverage/Report/Xml/Source.php',
1793                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\Tests' => '/php-code-coverage/Report/Xml/Tests.php',
1794                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\Totals' => '/php-code-coverage/Report/Xml/Totals.php',
1795                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Report\\Xml\\Unit' => '/php-code-coverage/Report/Xml/Unit.php',
1796                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysisCacheNotConfiguredException' => '/php-code-coverage/Exception/StaticAnalysisCacheNotConfiguredException.php',
1797                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysis\\Cache' => '/php-code-coverage/StaticAnalysis/Cache.php',
1798                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysis\\CacheWarmer' => '/php-code-coverage/StaticAnalysis/CacheWarmer.php',
1799                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysis\\CachingCoveredFileAnalyser' => '/php-code-coverage/StaticAnalysis/CachingCoveredFileAnalyser.php',
1800                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysis\\CachingUncoveredFileAnalyser' => '/php-code-coverage/StaticAnalysis/CachingUncoveredFileAnalyser.php',
1801                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysis\\CodeUnitFindingVisitor' => '/php-code-coverage/StaticAnalysis/CodeUnitFindingVisitor.php',
1802                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysis\\CoveredFileAnalyser' => '/php-code-coverage/StaticAnalysis/CoveredFileAnalyser.php',
1803                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysis\\ExecutableLinesFindingVisitor' => '/php-code-coverage/StaticAnalysis/ExecutableLinesFindingVisitor.php',
1804                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysis\\IgnoredLinesFindingVisitor' => '/php-code-coverage/StaticAnalysis/IgnoredLinesFindingVisitor.php',
1805                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysis\\ParsingCoveredFileAnalyser' => '/php-code-coverage/StaticAnalysis/ParsingCoveredFileAnalyser.php',
1806                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysis\\ParsingUncoveredFileAnalyser' => '/php-code-coverage/StaticAnalysis/ParsingUncoveredFileAnalyser.php',
1807                'PHPUnit\\SebastianBergmann\\CodeCoverage\\StaticAnalysis\\UncoveredFileAnalyser' => '/php-code-coverage/StaticAnalysis/UncoveredFileAnalyser.php',
1808                'PHPUnit\\SebastianBergmann\\CodeCoverage\\TestIdMissingException' => '/php-code-coverage/Exception/TestIdMissingException.php',
1809                'PHPUnit\\SebastianBergmann\\CodeCoverage\\UnintentionallyCoveredCodeException' => '/php-code-coverage/Exception/UnintentionallyCoveredCodeException.php',
1810                'PHPUnit\\SebastianBergmann\\CodeCoverage\\Version' => '/php-code-coverage/Version.php',
1811                'PHPUnit\\SebastianBergmann\\CodeCoverage\\XmlException' => '/php-code-coverage/Exception/XmlException.php',
1812                'PHPUnit\\SebastianBergmann\\CodeUnitReverseLookup\\Wizard' => '/sebastian-code-unit-reverse-lookup/Wizard.php',
1813                'PHPUnit\\SebastianBergmann\\CodeUnit\\ClassMethodUnit' => '/sebastian-code-unit/ClassMethodUnit.php',
1814                'PHPUnit\\SebastianBergmann\\CodeUnit\\ClassUnit' => '/sebastian-code-unit/ClassUnit.php',
1815                'PHPUnit\\SebastianBergmann\\CodeUnit\\CodeUnit' => '/sebastian-code-unit/CodeUnit.php',
1816                'PHPUnit\\SebastianBergmann\\CodeUnit\\CodeUnitCollection' => '/sebastian-code-unit/CodeUnitCollection.php',
1817                'PHPUnit\\SebastianBergmann\\CodeUnit\\CodeUnitCollectionIterator' => '/sebastian-code-unit/CodeUnitCollectionIterator.php',
1818                'PHPUnit\\SebastianBergmann\\CodeUnit\\Exception' => '/sebastian-code-unit/exceptions/Exception.php',
1819                'PHPUnit\\SebastianBergmann\\CodeUnit\\FunctionUnit' => '/sebastian-code-unit/FunctionUnit.php',
1820                'PHPUnit\\SebastianBergmann\\CodeUnit\\InterfaceMethodUnit' => '/sebastian-code-unit/InterfaceMethodUnit.php',
1821                'PHPUnit\\SebastianBergmann\\CodeUnit\\InterfaceUnit' => '/sebastian-code-unit/InterfaceUnit.php',
1822                'PHPUnit\\SebastianBergmann\\CodeUnit\\InvalidCodeUnitException' => '/sebastian-code-unit/exceptions/InvalidCodeUnitException.php',
1823                'PHPUnit\\SebastianBergmann\\CodeUnit\\Mapper' => '/sebastian-code-unit/Mapper.php',
1824                'PHPUnit\\SebastianBergmann\\CodeUnit\\NoTraitException' => '/sebastian-code-unit/exceptions/NoTraitException.php',
1825                'PHPUnit\\SebastianBergmann\\CodeUnit\\ReflectionException' => '/sebastian-code-unit/exceptions/ReflectionException.php',
1826                'PHPUnit\\SebastianBergmann\\CodeUnit\\TraitMethodUnit' => '/sebastian-code-unit/TraitMethodUnit.php',
1827                'PHPUnit\\SebastianBergmann\\CodeUnit\\TraitUnit' => '/sebastian-code-unit/TraitUnit.php',
1828                'PHPUnit\\SebastianBergmann\\Comparator\\ArrayComparator' => '/sebastian-comparator/ArrayComparator.php',
1829                'PHPUnit\\SebastianBergmann\\Comparator\\Comparator' => '/sebastian-comparator/Comparator.php',
1830                'PHPUnit\\SebastianBergmann\\Comparator\\ComparisonFailure' => '/sebastian-comparator/ComparisonFailure.php',
1831                'PHPUnit\\SebastianBergmann\\Comparator\\DOMNodeComparator' => '/sebastian-comparator/DOMNodeComparator.php',
1832                'PHPUnit\\SebastianBergmann\\Comparator\\DateTimeComparator' => '/sebastian-comparator/DateTimeComparator.php',
1833                'PHPUnit\\SebastianBergmann\\Comparator\\DoubleComparator' => '/sebastian-comparator/DoubleComparator.php',
1834                'PHPUnit\\SebastianBergmann\\Comparator\\Exception' => '/sebastian-comparator/exceptions/Exception.php',
1835                'PHPUnit\\SebastianBergmann\\Comparator\\ExceptionComparator' => '/sebastian-comparator/ExceptionComparator.php',
1836                'PHPUnit\\SebastianBergmann\\Comparator\\Factory' => '/sebastian-comparator/Factory.php',
1837                'PHPUnit\\SebastianBergmann\\Comparator\\MockObjectComparator' => '/sebastian-comparator/MockObjectComparator.php',
1838                'PHPUnit\\SebastianBergmann\\Comparator\\NumericComparator' => '/sebastian-comparator/NumericComparator.php',
1839                'PHPUnit\\SebastianBergmann\\Comparator\\ObjectComparator' => '/sebastian-comparator/ObjectComparator.php',
1840                'PHPUnit\\SebastianBergmann\\Comparator\\ResourceComparator' => '/sebastian-comparator/ResourceComparator.php',
1841                'PHPUnit\\SebastianBergmann\\Comparator\\RuntimeException' => '/sebastian-comparator/exceptions/RuntimeException.php',
1842                'PHPUnit\\SebastianBergmann\\Comparator\\ScalarComparator' => '/sebastian-comparator/ScalarComparator.php',
1843                'PHPUnit\\SebastianBergmann\\Comparator\\SplObjectStorageComparator' => '/sebastian-comparator/SplObjectStorageComparator.php',
1844                'PHPUnit\\SebastianBergmann\\Comparator\\TypeComparator' => '/sebastian-comparator/TypeComparator.php',
1845                'PHPUnit\\SebastianBergmann\\Complexity\\Calculator' => '/sebastian-complexity/Calculator.php',
1846                'PHPUnit\\SebastianBergmann\\Complexity\\Complexity' => '/sebastian-complexity/Complexity/Complexity.php',
1847                'PHPUnit\\SebastianBergmann\\Complexity\\ComplexityCalculatingVisitor' => '/sebastian-complexity/Visitor/ComplexityCalculatingVisitor.php',
1848                'PHPUnit\\SebastianBergmann\\Complexity\\ComplexityCollection' => '/sebastian-complexity/Complexity/ComplexityCollection.php',
1849                'PHPUnit\\SebastianBergmann\\Complexity\\ComplexityCollectionIterator' => '/sebastian-complexity/Complexity/ComplexityCollectionIterator.php',
1850                'PHPUnit\\SebastianBergmann\\Complexity\\CyclomaticComplexityCalculatingVisitor' => '/sebastian-complexity/Visitor/CyclomaticComplexityCalculatingVisitor.php',
1851                'PHPUnit\\SebastianBergmann\\Complexity\\Exception' => '/sebastian-complexity/Exception/Exception.php',
1852                'PHPUnit\\SebastianBergmann\\Complexity\\RuntimeException' => '/sebastian-complexity/Exception/RuntimeException.php',
1853                'PHPUnit\\SebastianBergmann\\Diff\\Chunk' => '/sebastian-diff/Chunk.php',
1854                'PHPUnit\\SebastianBergmann\\Diff\\ConfigurationException' => '/sebastian-diff/Exception/ConfigurationException.php',
1855                'PHPUnit\\SebastianBergmann\\Diff\\Diff' => '/sebastian-diff/Diff.php',
1856                'PHPUnit\\SebastianBergmann\\Diff\\Differ' => '/sebastian-diff/Differ.php',
1857                'PHPUnit\\SebastianBergmann\\Diff\\Exception' => '/sebastian-diff/Exception/Exception.php',
1858                'PHPUnit\\SebastianBergmann\\Diff\\InvalidArgumentException' => '/sebastian-diff/Exception/InvalidArgumentException.php',
1859                'PHPUnit\\SebastianBergmann\\Diff\\Line' => '/sebastian-diff/Line.php',
1860                'PHPUnit\\SebastianBergmann\\Diff\\LongestCommonSubsequenceCalculator' => '/sebastian-diff/LongestCommonSubsequenceCalculator.php',
1861                'PHPUnit\\SebastianBergmann\\Diff\\MemoryEfficientLongestCommonSubsequenceCalculator' => '/sebastian-diff/MemoryEfficientLongestCommonSubsequenceCalculator.php',
1862                'PHPUnit\\SebastianBergmann\\Diff\\Output\\AbstractChunkOutputBuilder' => '/sebastian-diff/Output/AbstractChunkOutputBuilder.php',
1863                'PHPUnit\\SebastianBergmann\\Diff\\Output\\DiffOnlyOutputBuilder' => '/sebastian-diff/Output/DiffOnlyOutputBuilder.php',
1864                'PHPUnit\\SebastianBergmann\\Diff\\Output\\DiffOutputBuilderInterface' => '/sebastian-diff/Output/DiffOutputBuilderInterface.php',
1865                'PHPUnit\\SebastianBergmann\\Diff\\Output\\StrictUnifiedDiffOutputBuilder' => '/sebastian-diff/Output/StrictUnifiedDiffOutputBuilder.php',
1866                'PHPUnit\\SebastianBergmann\\Diff\\Output\\UnifiedDiffOutputBuilder' => '/sebastian-diff/Output/UnifiedDiffOutputBuilder.php',
1867                'PHPUnit\\SebastianBergmann\\Diff\\Parser' => '/sebastian-diff/Parser.php',
1868                'PHPUnit\\SebastianBergmann\\Diff\\TimeEfficientLongestCommonSubsequenceCalculator' => '/sebastian-diff/TimeEfficientLongestCommonSubsequenceCalculator.php',
1869                'PHPUnit\\SebastianBergmann\\Environment\\Console' => '/sebastian-environment/Console.php',
1870                'PHPUnit\\SebastianBergmann\\Environment\\OperatingSystem' => '/sebastian-environment/OperatingSystem.php',
1871                'PHPUnit\\SebastianBergmann\\Environment\\Runtime' => '/sebastian-environment/Runtime.php',
1872                'PHPUnit\\SebastianBergmann\\Exporter\\Exporter' => '/sebastian-exporter/Exporter.php',
1873                'PHPUnit\\SebastianBergmann\\FileIterator\\Facade' => '/php-file-iterator/Facade.php',
1874                'PHPUnit\\SebastianBergmann\\FileIterator\\Factory' => '/php-file-iterator/Factory.php',
1875                'PHPUnit\\SebastianBergmann\\FileIterator\\Iterator' => '/php-file-iterator/Iterator.php',
1876                'PHPUnit\\SebastianBergmann\\GlobalState\\CodeExporter' => '/sebastian-global-state/CodeExporter.php',
1877                'PHPUnit\\SebastianBergmann\\GlobalState\\Exception' => '/sebastian-global-state/exceptions/Exception.php',
1878                'PHPUnit\\SebastianBergmann\\GlobalState\\ExcludeList' => '/sebastian-global-state/ExcludeList.php',
1879                'PHPUnit\\SebastianBergmann\\GlobalState\\Restorer' => '/sebastian-global-state/Restorer.php',
1880                'PHPUnit\\SebastianBergmann\\GlobalState\\RuntimeException' => '/sebastian-global-state/exceptions/RuntimeException.php',
1881                'PHPUnit\\SebastianBergmann\\GlobalState\\Snapshot' => '/sebastian-global-state/Snapshot.php',
1882                'PHPUnit\\SebastianBergmann\\Invoker\\Exception' => '/php-invoker/exceptions/Exception.php',
1883                'PHPUnit\\SebastianBergmann\\Invoker\\Invoker' => '/php-invoker/Invoker.php',
1884                'PHPUnit\\SebastianBergmann\\Invoker\\ProcessControlExtensionNotLoadedException' => '/php-invoker/exceptions/ProcessControlExtensionNotLoadedException.php',
1885                'PHPUnit\\SebastianBergmann\\Invoker\\TimeoutException' => '/php-invoker/exceptions/TimeoutException.php',
1886                'PHPUnit\\SebastianBergmann\\LinesOfCode\\Counter' => '/sebastian-lines-of-code/Counter.php',
1887                'PHPUnit\\SebastianBergmann\\LinesOfCode\\Exception' => '/sebastian-lines-of-code/Exception/Exception.php',
1888                'PHPUnit\\SebastianBergmann\\LinesOfCode\\IllogicalValuesException' => '/sebastian-lines-of-code/Exception/IllogicalValuesException.php',
1889                'PHPUnit\\SebastianBergmann\\LinesOfCode\\LineCountingVisitor' => '/sebastian-lines-of-code/LineCountingVisitor.php',
1890                'PHPUnit\\SebastianBergmann\\LinesOfCode\\LinesOfCode' => '/sebastian-lines-of-code/LinesOfCode.php',
1891                'PHPUnit\\SebastianBergmann\\LinesOfCode\\NegativeValueException' => '/sebastian-lines-of-code/Exception/NegativeValueException.php',
1892                'PHPUnit\\SebastianBergmann\\LinesOfCode\\RuntimeException' => '/sebastian-lines-of-code/Exception/RuntimeException.php',
1893                'PHPUnit\\SebastianBergmann\\ObjectEnumerator\\Enumerator' => '/sebastian-object-enumerator/Enumerator.php',
1894                'PHPUnit\\SebastianBergmann\\ObjectEnumerator\\Exception' => '/sebastian-object-enumerator/Exception.php',
1895                'PHPUnit\\SebastianBergmann\\ObjectEnumerator\\InvalidArgumentException' => '/sebastian-object-enumerator/InvalidArgumentException.php',
1896                'PHPUnit\\SebastianBergmann\\ObjectReflector\\Exception' => '/sebastian-object-reflector/Exception.php',
1897                'PHPUnit\\SebastianBergmann\\ObjectReflector\\InvalidArgumentException' => '/sebastian-object-reflector/InvalidArgumentException.php',
1898                'PHPUnit\\SebastianBergmann\\ObjectReflector\\ObjectReflector' => '/sebastian-object-reflector/ObjectReflector.php',
1899                'PHPUnit\\SebastianBergmann\\RecursionContext\\Context' => '/sebastian-recursion-context/Context.php',
1900                'PHPUnit\\SebastianBergmann\\RecursionContext\\Exception' => '/sebastian-recursion-context/Exception.php',
1901                'PHPUnit\\SebastianBergmann\\RecursionContext\\InvalidArgumentException' => '/sebastian-recursion-context/InvalidArgumentException.php',
1902                'PHPUnit\\SebastianBergmann\\ResourceOperations\\ResourceOperations' => '/sebastian-resource-operations/ResourceOperations.php',
1903                'PHPUnit\\SebastianBergmann\\Template\\Exception' => '/php-text-template/exceptions/Exception.php',
1904                'PHPUnit\\SebastianBergmann\\Template\\InvalidArgumentException' => '/php-text-template/exceptions/InvalidArgumentException.php',
1905                'PHPUnit\\SebastianBergmann\\Template\\RuntimeException' => '/php-text-template/exceptions/RuntimeException.php',
1906                'PHPUnit\\SebastianBergmann\\Template\\Template' => '/php-text-template/Template.php',
1907                'PHPUnit\\SebastianBergmann\\Timer\\Duration' => '/php-timer/Duration.php',
1908                'PHPUnit\\SebastianBergmann\\Timer\\Exception' => '/php-timer/exceptions/Exception.php',
1909                'PHPUnit\\SebastianBergmann\\Timer\\NoActiveTimerException' => '/php-timer/exceptions/NoActiveTimerException.php',
1910                'PHPUnit\\SebastianBergmann\\Timer\\ResourceUsageFormatter' => '/php-timer/ResourceUsageFormatter.php',
1911                'PHPUnit\\SebastianBergmann\\Timer\\TimeSinceStartOfRequestNotAvailableException' => '/php-timer/exceptions/TimeSinceStartOfRequestNotAvailableException.php',
1912                'PHPUnit\\SebastianBergmann\\Timer\\Timer' => '/php-timer/Timer.php',
1913                'PHPUnit\\SebastianBergmann\\Type\\CallableType' => '/sebastian-type/CallableType.php',
1914                'PHPUnit\\SebastianBergmann\\Type\\Exception' => '/sebastian-type/exception/Exception.php',
1915                'PHPUnit\\SebastianBergmann\\Type\\FalseType' => '/sebastian-type/FalseType.php',
1916                'PHPUnit\\SebastianBergmann\\Type\\GenericObjectType' => '/sebastian-type/GenericObjectType.php',
1917                'PHPUnit\\SebastianBergmann\\Type\\IterableType' => '/sebastian-type/IterableType.php',
1918                'PHPUnit\\SebastianBergmann\\Type\\LogicException' => '/sebastian-type/exception/LogicException.php',
1919                'PHPUnit\\SebastianBergmann\\Type\\MixedType' => '/sebastian-type/MixedType.php',
1920                'PHPUnit\\SebastianBergmann\\Type\\NullType' => '/sebastian-type/NullType.php',
1921                'PHPUnit\\SebastianBergmann\\Type\\ObjectType' => '/sebastian-type/ObjectType.php',
1922                'PHPUnit\\SebastianBergmann\\Type\\ReflectionMapper' => '/sebastian-type/ReflectionMapper.php',
1923                'PHPUnit\\SebastianBergmann\\Type\\RuntimeException' => '/sebastian-type/exception/RuntimeException.php',
1924                'PHPUnit\\SebastianBergmann\\Type\\SimpleType' => '/sebastian-type/SimpleType.php',
1925                'PHPUnit\\SebastianBergmann\\Type\\StaticType' => '/sebastian-type/StaticType.php',
1926                'PHPUnit\\SebastianBergmann\\Type\\Type' => '/sebastian-type/Type.php',
1927                'PHPUnit\\SebastianBergmann\\Type\\TypeName' => '/sebastian-type/TypeName.php',
1928                'PHPUnit\\SebastianBergmann\\Type\\UnionType' => '/sebastian-type/UnionType.php',
1929                'PHPUnit\\SebastianBergmann\\Type\\UnknownType' => '/sebastian-type/UnknownType.php',
1930                'PHPUnit\\SebastianBergmann\\Type\\VoidType' => '/sebastian-type/VoidType.php',
1931                'PHPUnit\\SebastianBergmann\\Version' => '/sebastian-version/Version.php',
1932                'PHPUnit\\Symfony\\Polyfill\\Ctype\\Ctype' => '/symfony-polyfill-ctype/Ctype.php',
1933                'PHPUnit\\TextUI\\CliArguments\\Builder' => '/phpunit/TextUI/CliArguments/Builder.php',
1934                'PHPUnit\\TextUI\\CliArguments\\Configuration' => '/phpunit/TextUI/CliArguments/Configuration.php',
1935                'PHPUnit\\TextUI\\CliArguments\\Exception' => '/phpunit/TextUI/CliArguments/Exception.php',
1936                'PHPUnit\\TextUI\\CliArguments\\Mapper' => '/phpunit/TextUI/CliArguments/Mapper.php',
1937                'PHPUnit\\TextUI\\Command' => '/phpunit/TextUI/Command.php',
1938                'PHPUnit\\TextUI\\DefaultResultPrinter' => '/phpunit/TextUI/DefaultResultPrinter.php',
1939                'PHPUnit\\TextUI\\Exception' => '/phpunit/TextUI/Exception/Exception.php',
1940                'PHPUnit\\TextUI\\Help' => '/phpunit/TextUI/Help.php',
1941                'PHPUnit\\TextUI\\ReflectionException' => '/phpunit/TextUI/Exception/ReflectionException.php',
1942                'PHPUnit\\TextUI\\ResultPrinter' => '/phpunit/TextUI/ResultPrinter.php',
1943                'PHPUnit\\TextUI\\RuntimeException' => '/phpunit/TextUI/Exception/RuntimeException.php',
1944                'PHPUnit\\TextUI\\TestDirectoryNotFoundException' => '/phpunit/TextUI/Exception/TestDirectoryNotFoundException.php',
1945                'PHPUnit\\TextUI\\TestFileNotFoundException' => '/phpunit/TextUI/Exception/TestFileNotFoundException.php',
1946                'PHPUnit\\TextUI\\TestRunner' => '/phpunit/TextUI/TestRunner.php',
1947                'PHPUnit\\TextUI\\TestSuiteMapper' => '/phpunit/TextUI/TestSuiteMapper.php',
1948                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\CodeCoverage' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/CodeCoverage.php',
1949                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\FilterMapper' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/FilterMapper.php',
1950                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Filter\\Directory' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/Filter/Directory.php',
1951                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Filter\\DirectoryCollection' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/Filter/DirectoryCollection.php',
1952                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Filter\\DirectoryCollectionIterator' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/Filter/DirectoryCollectionIterator.php',
1953                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Clover' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/Report/Clover.php',
1954                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Cobertura' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/Report/Cobertura.php',
1955                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Crap4j' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/Report/Crap4j.php',
1956                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Html' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/Report/Html.php',
1957                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Php' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/Report/Php.php',
1958                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Text' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/Report/Text.php',
1959                'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Xml' => '/phpunit/TextUI/XmlConfiguration/CodeCoverage/Report/Xml.php',
1960                'PHPUnit\\TextUI\\XmlConfiguration\\Configuration' => '/phpunit/TextUI/XmlConfiguration/Configuration.php',
1961                'PHPUnit\\TextUI\\XmlConfiguration\\Constant' => '/phpunit/TextUI/XmlConfiguration/PHP/Constant.php',
1962                'PHPUnit\\TextUI\\XmlConfiguration\\ConstantCollection' => '/phpunit/TextUI/XmlConfiguration/PHP/ConstantCollection.php',
1963                'PHPUnit\\TextUI\\XmlConfiguration\\ConstantCollectionIterator' => '/phpunit/TextUI/XmlConfiguration/PHP/ConstantCollectionIterator.php',
1964                'PHPUnit\\TextUI\\XmlConfiguration\\ConvertLogTypes' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/ConvertLogTypes.php',
1965                'PHPUnit\\TextUI\\XmlConfiguration\\CoverageCloverToReport' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/CoverageCloverToReport.php',
1966                'PHPUnit\\TextUI\\XmlConfiguration\\CoverageCrap4jToReport' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/CoverageCrap4jToReport.php',
1967                'PHPUnit\\TextUI\\XmlConfiguration\\CoverageHtmlToReport' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/CoverageHtmlToReport.php',
1968                'PHPUnit\\TextUI\\XmlConfiguration\\CoveragePhpToReport' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/CoveragePhpToReport.php',
1969                'PHPUnit\\TextUI\\XmlConfiguration\\CoverageTextToReport' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/CoverageTextToReport.php',
1970                'PHPUnit\\TextUI\\XmlConfiguration\\CoverageXmlToReport' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/CoverageXmlToReport.php',
1971                'PHPUnit\\TextUI\\XmlConfiguration\\Directory' => '/phpunit/TextUI/XmlConfiguration/Filesystem/Directory.php',
1972                'PHPUnit\\TextUI\\XmlConfiguration\\DirectoryCollection' => '/phpunit/TextUI/XmlConfiguration/Filesystem/DirectoryCollection.php',
1973                'PHPUnit\\TextUI\\XmlConfiguration\\DirectoryCollectionIterator' => '/phpunit/TextUI/XmlConfiguration/Filesystem/DirectoryCollectionIterator.php',
1974                'PHPUnit\\TextUI\\XmlConfiguration\\Exception' => '/phpunit/TextUI/XmlConfiguration/Exception.php',
1975                'PHPUnit\\TextUI\\XmlConfiguration\\Extension' => '/phpunit/TextUI/XmlConfiguration/PHPUnit/Extension.php',
1976                'PHPUnit\\TextUI\\XmlConfiguration\\ExtensionCollection' => '/phpunit/TextUI/XmlConfiguration/PHPUnit/ExtensionCollection.php',
1977                'PHPUnit\\TextUI\\XmlConfiguration\\ExtensionCollectionIterator' => '/phpunit/TextUI/XmlConfiguration/PHPUnit/ExtensionCollectionIterator.php',
1978                'PHPUnit\\TextUI\\XmlConfiguration\\File' => '/phpunit/TextUI/XmlConfiguration/Filesystem/File.php',
1979                'PHPUnit\\TextUI\\XmlConfiguration\\FileCollection' => '/phpunit/TextUI/XmlConfiguration/Filesystem/FileCollection.php',
1980                'PHPUnit\\TextUI\\XmlConfiguration\\FileCollectionIterator' => '/phpunit/TextUI/XmlConfiguration/Filesystem/FileCollectionIterator.php',
1981                'PHPUnit\\TextUI\\XmlConfiguration\\Generator' => '/phpunit/TextUI/XmlConfiguration/Generator.php',
1982                'PHPUnit\\TextUI\\XmlConfiguration\\Group' => '/phpunit/TextUI/XmlConfiguration/Group/Group.php',
1983                'PHPUnit\\TextUI\\XmlConfiguration\\GroupCollection' => '/phpunit/TextUI/XmlConfiguration/Group/GroupCollection.php',
1984                'PHPUnit\\TextUI\\XmlConfiguration\\GroupCollectionIterator' => '/phpunit/TextUI/XmlConfiguration/Group/GroupCollectionIterator.php',
1985                'PHPUnit\\TextUI\\XmlConfiguration\\Groups' => '/phpunit/TextUI/XmlConfiguration/Group/Groups.php',
1986                'PHPUnit\\TextUI\\XmlConfiguration\\IniSetting' => '/phpunit/TextUI/XmlConfiguration/PHP/IniSetting.php',
1987                'PHPUnit\\TextUI\\XmlConfiguration\\IniSettingCollection' => '/phpunit/TextUI/XmlConfiguration/PHP/IniSettingCollection.php',
1988                'PHPUnit\\TextUI\\XmlConfiguration\\IniSettingCollectionIterator' => '/phpunit/TextUI/XmlConfiguration/PHP/IniSettingCollectionIterator.php',
1989                'PHPUnit\\TextUI\\XmlConfiguration\\IntroduceCoverageElement' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/IntroduceCoverageElement.php',
1990                'PHPUnit\\TextUI\\XmlConfiguration\\Loader' => '/phpunit/TextUI/XmlConfiguration/Loader.php',
1991                'PHPUnit\\TextUI\\XmlConfiguration\\LogToReportMigration' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/LogToReportMigration.php',
1992                'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\Junit' => '/phpunit/TextUI/XmlConfiguration/Logging/Junit.php',
1993                'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\Logging' => '/phpunit/TextUI/XmlConfiguration/Logging/Logging.php',
1994                'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\TeamCity' => '/phpunit/TextUI/XmlConfiguration/Logging/TeamCity.php',
1995                'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\TestDox\\Html' => '/phpunit/TextUI/XmlConfiguration/Logging/TestDox/Html.php',
1996                'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\TestDox\\Text' => '/phpunit/TextUI/XmlConfiguration/Logging/TestDox/Text.php',
1997                'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\TestDox\\Xml' => '/phpunit/TextUI/XmlConfiguration/Logging/TestDox/Xml.php',
1998                'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\Text' => '/phpunit/TextUI/XmlConfiguration/Logging/Text.php',
1999                'PHPUnit\\TextUI\\XmlConfiguration\\Migration' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/Migration.php',
2000                'PHPUnit\\TextUI\\XmlConfiguration\\MigrationBuilder' => '/phpunit/TextUI/XmlConfiguration/Migration/MigrationBuilder.php',
2001                'PHPUnit\\TextUI\\XmlConfiguration\\MigrationBuilderException' => '/phpunit/TextUI/XmlConfiguration/Migration/MigrationBuilderException.php',
2002                'PHPUnit\\TextUI\\XmlConfiguration\\MigrationException' => '/phpunit/TextUI/XmlConfiguration/Migration/MigrationException.php',
2003                'PHPUnit\\TextUI\\XmlConfiguration\\Migrator' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrator.php',
2004                'PHPUnit\\TextUI\\XmlConfiguration\\MoveAttributesFromFilterWhitelistToCoverage' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromFilterWhitelistToCoverage.php',
2005                'PHPUnit\\TextUI\\XmlConfiguration\\MoveAttributesFromRootToCoverage' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromRootToCoverage.php',
2006                'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistDirectoriesToCoverage' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistDirectoriesToCoverage.php',
2007                'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistExcludesToCoverage' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistExcludesToCoverage.php',
2008                'PHPUnit\\TextUI\\XmlConfiguration\\PHPUnit' => '/phpunit/TextUI/XmlConfiguration/PHPUnit/PHPUnit.php',
2009                'PHPUnit\\TextUI\\XmlConfiguration\\Php' => '/phpunit/TextUI/XmlConfiguration/PHP/Php.php',
2010                'PHPUnit\\TextUI\\XmlConfiguration\\PhpHandler' => '/phpunit/TextUI/XmlConfiguration/PHP/PhpHandler.php',
2011                'PHPUnit\\TextUI\\XmlConfiguration\\RemoveCacheTokensAttribute' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/RemoveCacheTokensAttribute.php',
2012                'PHPUnit\\TextUI\\XmlConfiguration\\RemoveEmptyFilter' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/RemoveEmptyFilter.php',
2013                'PHPUnit\\TextUI\\XmlConfiguration\\RemoveLogTypes' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/RemoveLogTypes.php',
2014                'PHPUnit\\TextUI\\XmlConfiguration\\TestDirectory' => '/phpunit/TextUI/XmlConfiguration/TestSuite/TestDirectory.php',
2015                'PHPUnit\\TextUI\\XmlConfiguration\\TestDirectoryCollection' => '/phpunit/TextUI/XmlConfiguration/TestSuite/TestDirectoryCollection.php',
2016                'PHPUnit\\TextUI\\XmlConfiguration\\TestDirectoryCollectionIterator' => '/phpunit/TextUI/XmlConfiguration/TestSuite/TestDirectoryCollectionIterator.php',
2017                'PHPUnit\\TextUI\\XmlConfiguration\\TestFile' => '/phpunit/TextUI/XmlConfiguration/TestSuite/TestFile.php',
2018                'PHPUnit\\TextUI\\XmlConfiguration\\TestFileCollection' => '/phpunit/TextUI/XmlConfiguration/TestSuite/TestFileCollection.php',
2019                'PHPUnit\\TextUI\\XmlConfiguration\\TestFileCollectionIterator' => '/phpunit/TextUI/XmlConfiguration/TestSuite/TestFileCollectionIterator.php',
2020                'PHPUnit\\TextUI\\XmlConfiguration\\TestSuite' => '/phpunit/TextUI/XmlConfiguration/TestSuite/TestSuite.php',
2021                'PHPUnit\\TextUI\\XmlConfiguration\\TestSuiteCollection' => '/phpunit/TextUI/XmlConfiguration/TestSuite/TestSuiteCollection.php',
2022                'PHPUnit\\TextUI\\XmlConfiguration\\TestSuiteCollectionIterator' => '/phpunit/TextUI/XmlConfiguration/TestSuite/TestSuiteCollectionIterator.php',
2023                'PHPUnit\\TextUI\\XmlConfiguration\\UpdateSchemaLocationTo93' => '/phpunit/TextUI/XmlConfiguration/Migration/Migrations/UpdateSchemaLocationTo93.php',
2024                'PHPUnit\\TextUI\\XmlConfiguration\\Variable' => '/phpunit/TextUI/XmlConfiguration/PHP/Variable.php',
2025                'PHPUnit\\TextUI\\XmlConfiguration\\VariableCollection' => '/phpunit/TextUI/XmlConfiguration/PHP/VariableCollection.php',
2026                'PHPUnit\\TextUI\\XmlConfiguration\\VariableCollectionIterator' => '/phpunit/TextUI/XmlConfiguration/PHP/VariableCollectionIterator.php',
2027                'PHPUnit\\TheSeer\\Tokenizer\\Exception' => '/theseer-tokenizer/Exception.php',
2028                'PHPUnit\\TheSeer\\Tokenizer\\NamespaceUri' => '/theseer-tokenizer/NamespaceUri.php',
2029                'PHPUnit\\TheSeer\\Tokenizer\\NamespaceUriException' => '/theseer-tokenizer/NamespaceUriException.php',
2030                'PHPUnit\\TheSeer\\Tokenizer\\Token' => '/theseer-tokenizer/Token.php',
2031                'PHPUnit\\TheSeer\\Tokenizer\\TokenCollection' => '/theseer-tokenizer/TokenCollection.php',
2032                'PHPUnit\\TheSeer\\Tokenizer\\TokenCollectionException' => '/theseer-tokenizer/TokenCollectionException.php',
2033                'PHPUnit\\TheSeer\\Tokenizer\\Tokenizer' => '/theseer-tokenizer/Tokenizer.php',
2034                'PHPUnit\\TheSeer\\Tokenizer\\XMLSerializer' => '/theseer-tokenizer/XMLSerializer.php',
2035                'PHPUnit\\Util\\Annotation\\DocBlock' => '/phpunit/Util/Annotation/DocBlock.php',
2036                'PHPUnit\\Util\\Annotation\\Registry' => '/phpunit/Util/Annotation/Registry.php',
2037                'PHPUnit\\Util\\Blacklist' => '/phpunit/Util/Blacklist.php',
2038                'PHPUnit\\Util\\Color' => '/phpunit/Util/Color.php',
2039                'PHPUnit\\Util\\ErrorHandler' => '/phpunit/Util/ErrorHandler.php',
2040                'PHPUnit\\Util\\Exception' => '/phpunit/Util/Exception.php',
2041                'PHPUnit\\Util\\ExcludeList' => '/phpunit/Util/ExcludeList.php',
2042                'PHPUnit\\Util\\FileLoader' => '/phpunit/Util/FileLoader.php',
2043                'PHPUnit\\Util\\Filesystem' => '/phpunit/Util/Filesystem.php',
2044                'PHPUnit\\Util\\Filter' => '/phpunit/Util/Filter.php',
2045                'PHPUnit\\Util\\GlobalState' => '/phpunit/Util/GlobalState.php',
2046                'PHPUnit\\Util\\InvalidDataSetException' => '/phpunit/Util/InvalidDataSetException.php',
2047                'PHPUnit\\Util\\Json' => '/phpunit/Util/Json.php',
2048                'PHPUnit\\Util\\Log\\JUnit' => '/phpunit/Util/Log/JUnit.php',
2049                'PHPUnit\\Util\\Log\\TeamCity' => '/phpunit/Util/Log/TeamCity.php',
2050                'PHPUnit\\Util\\PHP\\AbstractPhpProcess' => '/phpunit/Util/PHP/AbstractPhpProcess.php',
2051                'PHPUnit\\Util\\PHP\\DefaultPhpProcess' => '/phpunit/Util/PHP/DefaultPhpProcess.php',
2052                'PHPUnit\\Util\\PHP\\WindowsPhpProcess' => '/phpunit/Util/PHP/WindowsPhpProcess.php',
2053                'PHPUnit\\Util\\Printer' => '/phpunit/Util/Printer.php',
2054                'PHPUnit\\Util\\RegularExpression' => '/phpunit/Util/RegularExpression.php',
2055                'PHPUnit\\Util\\Test' => '/phpunit/Util/Test.php',
2056                'PHPUnit\\Util\\TestDox\\CliTestDoxPrinter' => '/phpunit/Util/TestDox/CliTestDoxPrinter.php',
2057                'PHPUnit\\Util\\TestDox\\HtmlResultPrinter' => '/phpunit/Util/TestDox/HtmlResultPrinter.php',
2058                'PHPUnit\\Util\\TestDox\\NamePrettifier' => '/phpunit/Util/TestDox/NamePrettifier.php',
2059                'PHPUnit\\Util\\TestDox\\ResultPrinter' => '/phpunit/Util/TestDox/ResultPrinter.php',
2060                'PHPUnit\\Util\\TestDox\\TestDoxPrinter' => '/phpunit/Util/TestDox/TestDoxPrinter.php',
2061                'PHPUnit\\Util\\TestDox\\TextResultPrinter' => '/phpunit/Util/TestDox/TextResultPrinter.php',
2062                'PHPUnit\\Util\\TestDox\\XmlResultPrinter' => '/phpunit/Util/TestDox/XmlResultPrinter.php',
2063                'PHPUnit\\Util\\TextTestListRenderer' => '/phpunit/Util/TextTestListRenderer.php',
2064                'PHPUnit\\Util\\Type' => '/phpunit/Util/Type.php',
2065                'PHPUnit\\Util\\VersionComparisonOperator' => '/phpunit/Util/VersionComparisonOperator.php',
2066                'PHPUnit\\Util\\XdebugFilterScriptGenerator' => '/phpunit/Util/XdebugFilterScriptGenerator.php',
2067                'PHPUnit\\Util\\Xml' => '/phpunit/Util/Xml.php',
2068                'PHPUnit\\Util\\XmlTestListRenderer' => '/phpunit/Util/XmlTestListRenderer.php',
2069                'PHPUnit\\Util\\Xml\\Exception' => '/phpunit/Util/Xml/Exception.php',
2070                'PHPUnit\\Util\\Xml\\FailedSchemaDetectionResult' => '/phpunit/Util/Xml/FailedSchemaDetectionResult.php',
2071                'PHPUnit\\Util\\Xml\\Loader' => '/phpunit/Util/Xml/Loader.php',
2072                'PHPUnit\\Util\\Xml\\SchemaDetectionResult' => '/phpunit/Util/Xml/SchemaDetectionResult.php',
2073                'PHPUnit\\Util\\Xml\\SchemaDetector' => '/phpunit/Util/Xml/SchemaDetector.php',
2074                'PHPUnit\\Util\\Xml\\SchemaFinder' => '/phpunit/Util/Xml/SchemaFinder.php',
2075                'PHPUnit\\Util\\Xml\\SnapshotNodeList' => '/phpunit/Util/Xml/SnapshotNodeList.php',
2076                'PHPUnit\\Util\\Xml\\SuccessfulSchemaDetectionResult' => '/phpunit/Util/Xml/SuccessfulSchemaDetectionResult.php',
2077                'PHPUnit\\Util\\Xml\\ValidationResult' => '/phpunit/Util/Xml/ValidationResult.php',
2078                'PHPUnit\\Util\\Xml\\Validator' => '/phpunit/Util/Xml/Validator.php',
2079                'PHPUnit\\Webmozart\\Assert\\Assert' => '/webmozart-assert/Assert.php',
2080                'PHPUnit\\Webmozart\\Assert\\InvalidArgumentException' => '/webmozart-assert/InvalidArgumentException.php',
2081                'PHPUnit\\Webmozart\\Assert\\Mixin' => '/webmozart-assert/Mixin.php',
2082                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock' => '/phpdocumentor-reflection-docblock/DocBlock.php',
2083                'PHPUnit\\phpDocumentor\\Reflection\\DocBlockFactory' => '/phpdocumentor-reflection-docblock/DocBlockFactory.php',
2084                'PHPUnit\\phpDocumentor\\Reflection\\DocBlockFactoryInterface' => '/phpdocumentor-reflection-docblock/DocBlockFactoryInterface.php',
2085                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Description' => '/phpdocumentor-reflection-docblock/DocBlock/Description.php',
2086                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\DescriptionFactory' => '/phpdocumentor-reflection-docblock/DocBlock/DescriptionFactory.php',
2087                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\ExampleFinder' => '/phpdocumentor-reflection-docblock/DocBlock/ExampleFinder.php',
2088                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Serializer' => '/phpdocumentor-reflection-docblock/DocBlock/Serializer.php',
2089                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\StandardTagFactory' => '/phpdocumentor-reflection-docblock/DocBlock/StandardTagFactory.php',
2090                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tag' => '/phpdocumentor-reflection-docblock/DocBlock/Tag.php',
2091                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\TagFactory' => '/phpdocumentor-reflection-docblock/DocBlock/TagFactory.php',
2092                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Author' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Author.php',
2093                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\BaseTag' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/BaseTag.php',
2094                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Covers' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Covers.php',
2095                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Deprecated' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Deprecated.php',
2096                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Example' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Example.php',
2097                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Factory\\StaticMethod' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Factory/StaticMethod.php',
2098                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Formatter' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Formatter.php',
2099                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Formatter\\AlignFormatter' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Formatter/AlignFormatter.php',
2100                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Formatter\\PassthroughFormatter' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Formatter/PassthroughFormatter.php',
2101                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Generic' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Generic.php',
2102                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\InvalidTag' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/InvalidTag.php',
2103                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Link' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Link.php',
2104                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Method' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Method.php',
2105                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Param' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Param.php',
2106                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Property' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Property.php',
2107                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\PropertyRead' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/PropertyRead.php',
2108                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\PropertyWrite' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/PropertyWrite.php',
2109                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Reference\\Fqsen' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Reference/Fqsen.php',
2110                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Reference\\Reference' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Reference/Reference.php',
2111                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Reference\\Url' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Reference/Url.php',
2112                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Return_' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Return_.php',
2113                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\See' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/See.php',
2114                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Since' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Since.php',
2115                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Source' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Source.php',
2116                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\TagWithType' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/TagWithType.php',
2117                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Throws' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Throws.php',
2118                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Uses' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Uses.php',
2119                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Var_' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Var_.php',
2120                'PHPUnit\\phpDocumentor\\Reflection\\DocBlock\\Tags\\Version' => '/phpdocumentor-reflection-docblock/DocBlock/Tags/Version.php',
2121                'PHPUnit\\phpDocumentor\\Reflection\\Element' => '/phpdocumentor-reflection-common/Element.php',
2122                'PHPUnit\\phpDocumentor\\Reflection\\Exception\\PcreException' => '/phpdocumentor-reflection-docblock/Exception/PcreException.php',
2123                'PHPUnit\\phpDocumentor\\Reflection\\File' => '/phpdocumentor-reflection-common/File.php',
2124                'PHPUnit\\phpDocumentor\\Reflection\\Fqsen' => '/phpdocumentor-reflection-common/Fqsen.php',
2125                'PHPUnit\\phpDocumentor\\Reflection\\FqsenResolver' => '/phpdocumentor-type-resolver/FqsenResolver.php',
2126                'PHPUnit\\phpDocumentor\\Reflection\\Location' => '/phpdocumentor-reflection-common/Location.php',
2127                'PHPUnit\\phpDocumentor\\Reflection\\Project' => '/phpdocumentor-reflection-common/Project.php',
2128                'PHPUnit\\phpDocumentor\\Reflection\\ProjectFactory' => '/phpdocumentor-reflection-common/ProjectFactory.php',
2129                'PHPUnit\\phpDocumentor\\Reflection\\PseudoType' => '/phpdocumentor-type-resolver/PseudoType.php',
2130                'PHPUnit\\phpDocumentor\\Reflection\\PseudoTypes\\CallableString' => '/phpdocumentor-type-resolver/PseudoTypes/CallableString.php',
2131                'PHPUnit\\phpDocumentor\\Reflection\\PseudoTypes\\False_' => '/phpdocumentor-type-resolver/PseudoTypes/False_.php',
2132                'PHPUnit\\phpDocumentor\\Reflection\\PseudoTypes\\HtmlEscapedString' => '/phpdocumentor-type-resolver/PseudoTypes/HtmlEscapedString.php',
2133                'PHPUnit\\phpDocumentor\\Reflection\\PseudoTypes\\LowercaseString' => '/phpdocumentor-type-resolver/PseudoTypes/LowercaseString.php',
2134                'PHPUnit\\phpDocumentor\\Reflection\\PseudoTypes\\NonEmptyLowercaseString' => '/phpdocumentor-type-resolver/PseudoTypes/NonEmptyLowercaseString.php',
2135                'PHPUnit\\phpDocumentor\\Reflection\\PseudoTypes\\NonEmptyString' => '/phpdocumentor-type-resolver/PseudoTypes/NonEmptyString.php',
2136                'PHPUnit\\phpDocumentor\\Reflection\\PseudoTypes\\NumericString' => '/phpdocumentor-type-resolver/PseudoTypes/NumericString.php',
2137                'PHPUnit\\phpDocumentor\\Reflection\\PseudoTypes\\PositiveInteger' => '/phpdocumentor-type-resolver/PseudoTypes/PositiveInteger.php',
2138                'PHPUnit\\phpDocumentor\\Reflection\\PseudoTypes\\TraitString' => '/phpdocumentor-type-resolver/PseudoTypes/TraitString.php',
2139                'PHPUnit\\phpDocumentor\\Reflection\\PseudoTypes\\True_' => '/phpdocumentor-type-resolver/PseudoTypes/True_.php',
2140                'PHPUnit\\phpDocumentor\\Reflection\\Type' => '/phpdocumentor-type-resolver/Type.php',
2141                'PHPUnit\\phpDocumentor\\Reflection\\TypeResolver' => '/phpdocumentor-type-resolver/TypeResolver.php',
2142                'PHPUnit\\phpDocumentor\\Reflection\\Types\\AbstractList' => '/phpdocumentor-type-resolver/Types/AbstractList.php',
2143                'PHPUnit\\phpDocumentor\\Reflection\\Types\\AggregatedType' => '/phpdocumentor-type-resolver/Types/AggregatedType.php',
2144                'PHPUnit\\phpDocumentor\\Reflection\\Types\\ArrayKey' => '/phpdocumentor-type-resolver/Types/ArrayKey.php',
2145                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Array_' => '/phpdocumentor-type-resolver/Types/Array_.php',
2146                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Boolean' => '/phpdocumentor-type-resolver/Types/Boolean.php',
2147                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Callable_' => '/phpdocumentor-type-resolver/Types/Callable_.php',
2148                'PHPUnit\\phpDocumentor\\Reflection\\Types\\ClassString' => '/phpdocumentor-type-resolver/Types/ClassString.php',
2149                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Collection' => '/phpdocumentor-type-resolver/Types/Collection.php',
2150                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Compound' => '/phpdocumentor-type-resolver/Types/Compound.php',
2151                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Context' => '/phpdocumentor-type-resolver/Types/Context.php',
2152                'PHPUnit\\phpDocumentor\\Reflection\\Types\\ContextFactory' => '/phpdocumentor-type-resolver/Types/ContextFactory.php',
2153                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Expression' => '/phpdocumentor-type-resolver/Types/Expression.php',
2154                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Float_' => '/phpdocumentor-type-resolver/Types/Float_.php',
2155                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Integer' => '/phpdocumentor-type-resolver/Types/Integer.php',
2156                'PHPUnit\\phpDocumentor\\Reflection\\Types\\InterfaceString' => '/phpdocumentor-type-resolver/Types/InterfaceString.php',
2157                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Intersection' => '/phpdocumentor-type-resolver/Types/Intersection.php',
2158                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Iterable_' => '/phpdocumentor-type-resolver/Types/Iterable_.php',
2159                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Mixed_' => '/phpdocumentor-type-resolver/Types/Mixed_.php',
2160                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Never_' => '/phpdocumentor-type-resolver/Types/Never_.php',
2161                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Null_' => '/phpdocumentor-type-resolver/Types/Null_.php',
2162                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Nullable' => '/phpdocumentor-type-resolver/Types/Nullable.php',
2163                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Object_' => '/phpdocumentor-type-resolver/Types/Object_.php',
2164                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Parent_' => '/phpdocumentor-type-resolver/Types/Parent_.php',
2165                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Resource_' => '/phpdocumentor-type-resolver/Types/Resource_.php',
2166                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Scalar' => '/phpdocumentor-type-resolver/Types/Scalar.php',
2167                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Self_' => '/phpdocumentor-type-resolver/Types/Self_.php',
2168                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Static_' => '/phpdocumentor-type-resolver/Types/Static_.php',
2169                'PHPUnit\\phpDocumentor\\Reflection\\Types\\String_' => '/phpdocumentor-type-resolver/Types/String_.php',
2170                'PHPUnit\\phpDocumentor\\Reflection\\Types\\This' => '/phpdocumentor-type-resolver/Types/This.php',
2171                'PHPUnit\\phpDocumentor\\Reflection\\Types\\Void_' => '/phpdocumentor-type-resolver/Types/Void_.php',
2172                'PHPUnit\\phpDocumentor\\Reflection\\Utils' => '/phpdocumentor-reflection-docblock/Utils.php',
2173                'Prophecy\\Argument' => '/phpspec-prophecy/Prophecy/Argument.php',
2174                'Prophecy\\Argument\\ArgumentsWildcard' => '/phpspec-prophecy/Prophecy/Argument/ArgumentsWildcard.php',
2175                'Prophecy\\Argument\\Token\\AnyValueToken' => '/phpspec-prophecy/Prophecy/Argument/Token/AnyValueToken.php',
2176                'Prophecy\\Argument\\Token\\AnyValuesToken' => '/phpspec-prophecy/Prophecy/Argument/Token/AnyValuesToken.php',
2177                'Prophecy\\Argument\\Token\\ApproximateValueToken' => '/phpspec-prophecy/Prophecy/Argument/Token/ApproximateValueToken.php',
2178                'Prophecy\\Argument\\Token\\ArrayCountToken' => '/phpspec-prophecy/Prophecy/Argument/Token/ArrayCountToken.php',
2179                'Prophecy\\Argument\\Token\\ArrayEntryToken' => '/phpspec-prophecy/Prophecy/Argument/Token/ArrayEntryToken.php',
2180                'Prophecy\\Argument\\Token\\ArrayEveryEntryToken' => '/phpspec-prophecy/Prophecy/Argument/Token/ArrayEveryEntryToken.php',
2181                'Prophecy\\Argument\\Token\\CallbackToken' => '/phpspec-prophecy/Prophecy/Argument/Token/CallbackToken.php',
2182                'Prophecy\\Argument\\Token\\ExactValueToken' => '/phpspec-prophecy/Prophecy/Argument/Token/ExactValueToken.php',
2183                'Prophecy\\Argument\\Token\\IdenticalValueToken' => '/phpspec-prophecy/Prophecy/Argument/Token/IdenticalValueToken.php',
2184                'Prophecy\\Argument\\Token\\InArrayToken' => '/phpspec-prophecy/Prophecy/Argument/Token/InArrayToken.php',
2185                'Prophecy\\Argument\\Token\\LogicalAndToken' => '/phpspec-prophecy/Prophecy/Argument/Token/LogicalAndToken.php',
2186                'Prophecy\\Argument\\Token\\LogicalNotToken' => '/phpspec-prophecy/Prophecy/Argument/Token/LogicalNotToken.php',
2187                'Prophecy\\Argument\\Token\\NotInArrayToken' => '/phpspec-prophecy/Prophecy/Argument/Token/NotInArrayToken.php',
2188                'Prophecy\\Argument\\Token\\ObjectStateToken' => '/phpspec-prophecy/Prophecy/Argument/Token/ObjectStateToken.php',
2189                'Prophecy\\Argument\\Token\\StringContainsToken' => '/phpspec-prophecy/Prophecy/Argument/Token/StringContainsToken.php',
2190                'Prophecy\\Argument\\Token\\TokenInterface' => '/phpspec-prophecy/Prophecy/Argument/Token/TokenInterface.php',
2191                'Prophecy\\Argument\\Token\\TypeToken' => '/phpspec-prophecy/Prophecy/Argument/Token/TypeToken.php',
2192                'Prophecy\\Call\\Call' => '/phpspec-prophecy/Prophecy/Call/Call.php',
2193                'Prophecy\\Call\\CallCenter' => '/phpspec-prophecy/Prophecy/Call/CallCenter.php',
2194                'Prophecy\\Comparator\\ClosureComparator' => '/phpspec-prophecy/Prophecy/Comparator/ClosureComparator.php',
2195                'Prophecy\\Comparator\\Factory' => '/phpspec-prophecy/Prophecy/Comparator/Factory.php',
2196                'Prophecy\\Comparator\\ProphecyComparator' => '/phpspec-prophecy/Prophecy/Comparator/ProphecyComparator.php',
2197                'Prophecy\\Doubler\\CachedDoubler' => '/phpspec-prophecy/Prophecy/Doubler/CachedDoubler.php',
2198                'Prophecy\\Doubler\\ClassPatch\\ClassPatchInterface' => '/phpspec-prophecy/Prophecy/Doubler/ClassPatch/ClassPatchInterface.php',
2199                'Prophecy\\Doubler\\ClassPatch\\DisableConstructorPatch' => '/phpspec-prophecy/Prophecy/Doubler/ClassPatch/DisableConstructorPatch.php',
2200                'Prophecy\\Doubler\\ClassPatch\\HhvmExceptionPatch' => '/phpspec-prophecy/Prophecy/Doubler/ClassPatch/HhvmExceptionPatch.php',
2201                'Prophecy\\Doubler\\ClassPatch\\KeywordPatch' => '/phpspec-prophecy/Prophecy/Doubler/ClassPatch/KeywordPatch.php',
2202                'Prophecy\\Doubler\\ClassPatch\\MagicCallPatch' => '/phpspec-prophecy/Prophecy/Doubler/ClassPatch/MagicCallPatch.php',
2203                'Prophecy\\Doubler\\ClassPatch\\ProphecySubjectPatch' => '/phpspec-prophecy/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php',
2204                'Prophecy\\Doubler\\ClassPatch\\ReflectionClassNewInstancePatch' => '/phpspec-prophecy/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatch.php',
2205                'Prophecy\\Doubler\\ClassPatch\\SplFileInfoPatch' => '/phpspec-prophecy/Prophecy/Doubler/ClassPatch/SplFileInfoPatch.php',
2206                'Prophecy\\Doubler\\ClassPatch\\ThrowablePatch' => '/phpspec-prophecy/Prophecy/Doubler/ClassPatch/ThrowablePatch.php',
2207                'Prophecy\\Doubler\\ClassPatch\\TraversablePatch' => '/phpspec-prophecy/Prophecy/Doubler/ClassPatch/TraversablePatch.php',
2208                'Prophecy\\Doubler\\DoubleInterface' => '/phpspec-prophecy/Prophecy/Doubler/DoubleInterface.php',
2209                'Prophecy\\Doubler\\Doubler' => '/phpspec-prophecy/Prophecy/Doubler/Doubler.php',
2210                'Prophecy\\Doubler\\Generator\\ClassCodeGenerator' => '/phpspec-prophecy/Prophecy/Doubler/Generator/ClassCodeGenerator.php',
2211                'Prophecy\\Doubler\\Generator\\ClassCreator' => '/phpspec-prophecy/Prophecy/Doubler/Generator/ClassCreator.php',
2212                'Prophecy\\Doubler\\Generator\\ClassMirror' => '/phpspec-prophecy/Prophecy/Doubler/Generator/ClassMirror.php',
2213                'Prophecy\\Doubler\\Generator\\Node\\ArgumentNode' => '/phpspec-prophecy/Prophecy/Doubler/Generator/Node/ArgumentNode.php',
2214                'Prophecy\\Doubler\\Generator\\Node\\ArgumentTypeNode' => '/phpspec-prophecy/Prophecy/Doubler/Generator/Node/ArgumentTypeNode.php',
2215                'Prophecy\\Doubler\\Generator\\Node\\ClassNode' => '/phpspec-prophecy/Prophecy/Doubler/Generator/Node/ClassNode.php',
2216                'Prophecy\\Doubler\\Generator\\Node\\MethodNode' => '/phpspec-prophecy/Prophecy/Doubler/Generator/Node/MethodNode.php',
2217                'Prophecy\\Doubler\\Generator\\Node\\ReturnTypeNode' => '/phpspec-prophecy/Prophecy/Doubler/Generator/Node/ReturnTypeNode.php',
2218                'Prophecy\\Doubler\\Generator\\Node\\TypeNodeAbstract' => '/phpspec-prophecy/Prophecy/Doubler/Generator/Node/TypeNodeAbstract.php',
2219                'Prophecy\\Doubler\\Generator\\ReflectionInterface' => '/phpspec-prophecy/Prophecy/Doubler/Generator/ReflectionInterface.php',
2220                'Prophecy\\Doubler\\Generator\\TypeHintReference' => '/phpspec-prophecy/Prophecy/Doubler/Generator/TypeHintReference.php',
2221                'Prophecy\\Doubler\\LazyDouble' => '/phpspec-prophecy/Prophecy/Doubler/LazyDouble.php',
2222                'Prophecy\\Doubler\\NameGenerator' => '/phpspec-prophecy/Prophecy/Doubler/NameGenerator.php',
2223                'Prophecy\\Exception\\Call\\UnexpectedCallException' => '/phpspec-prophecy/Prophecy/Exception/Call/UnexpectedCallException.php',
2224                'Prophecy\\Exception\\Doubler\\ClassCreatorException' => '/phpspec-prophecy/Prophecy/Exception/Doubler/ClassCreatorException.php',
2225                'Prophecy\\Exception\\Doubler\\ClassMirrorException' => '/phpspec-prophecy/Prophecy/Exception/Doubler/ClassMirrorException.php',
2226                'Prophecy\\Exception\\Doubler\\ClassNotFoundException' => '/phpspec-prophecy/Prophecy/Exception/Doubler/ClassNotFoundException.php',
2227                'Prophecy\\Exception\\Doubler\\DoubleException' => '/phpspec-prophecy/Prophecy/Exception/Doubler/DoubleException.php',
2228                'Prophecy\\Exception\\Doubler\\DoublerException' => '/phpspec-prophecy/Prophecy/Exception/Doubler/DoublerException.php',
2229                'Prophecy\\Exception\\Doubler\\InterfaceNotFoundException' => '/phpspec-prophecy/Prophecy/Exception/Doubler/InterfaceNotFoundException.php',
2230                'Prophecy\\Exception\\Doubler\\MethodNotExtendableException' => '/phpspec-prophecy/Prophecy/Exception/Doubler/MethodNotExtendableException.php',
2231                'Prophecy\\Exception\\Doubler\\MethodNotFoundException' => '/phpspec-prophecy/Prophecy/Exception/Doubler/MethodNotFoundException.php',
2232                'Prophecy\\Exception\\Doubler\\ReturnByReferenceException' => '/phpspec-prophecy/Prophecy/Exception/Doubler/ReturnByReferenceException.php',
2233                'Prophecy\\Exception\\Exception' => '/phpspec-prophecy/Prophecy/Exception/Exception.php',
2234                'Prophecy\\Exception\\InvalidArgumentException' => '/phpspec-prophecy/Prophecy/Exception/InvalidArgumentException.php',
2235                'Prophecy\\Exception\\Prediction\\AggregateException' => '/phpspec-prophecy/Prophecy/Exception/Prediction/AggregateException.php',
2236                'Prophecy\\Exception\\Prediction\\FailedPredictionException' => '/phpspec-prophecy/Prophecy/Exception/Prediction/FailedPredictionException.php',
2237                'Prophecy\\Exception\\Prediction\\NoCallsException' => '/phpspec-prophecy/Prophecy/Exception/Prediction/NoCallsException.php',
2238                'Prophecy\\Exception\\Prediction\\PredictionException' => '/phpspec-prophecy/Prophecy/Exception/Prediction/PredictionException.php',
2239                'Prophecy\\Exception\\Prediction\\UnexpectedCallsCountException' => '/phpspec-prophecy/Prophecy/Exception/Prediction/UnexpectedCallsCountException.php',
2240                'Prophecy\\Exception\\Prediction\\UnexpectedCallsException' => '/phpspec-prophecy/Prophecy/Exception/Prediction/UnexpectedCallsException.php',
2241                'Prophecy\\Exception\\Prophecy\\MethodProphecyException' => '/phpspec-prophecy/Prophecy/Exception/Prophecy/MethodProphecyException.php',
2242                'Prophecy\\Exception\\Prophecy\\ObjectProphecyException' => '/phpspec-prophecy/Prophecy/Exception/Prophecy/ObjectProphecyException.php',
2243                'Prophecy\\Exception\\Prophecy\\ProphecyException' => '/phpspec-prophecy/Prophecy/Exception/Prophecy/ProphecyException.php',
2244                'Prophecy\\PhpDocumentor\\ClassAndInterfaceTagRetriever' => '/phpspec-prophecy/Prophecy/PhpDocumentor/ClassAndInterfaceTagRetriever.php',
2245                'Prophecy\\PhpDocumentor\\ClassTagRetriever' => '/phpspec-prophecy/Prophecy/PhpDocumentor/ClassTagRetriever.php',
2246                'Prophecy\\PhpDocumentor\\LegacyClassTagRetriever' => '/phpspec-prophecy/Prophecy/PhpDocumentor/LegacyClassTagRetriever.php',
2247                'Prophecy\\PhpDocumentor\\MethodTagRetrieverInterface' => '/phpspec-prophecy/Prophecy/PhpDocumentor/MethodTagRetrieverInterface.php',
2248                'Prophecy\\Prediction\\CallPrediction' => '/phpspec-prophecy/Prophecy/Prediction/CallPrediction.php',
2249                'Prophecy\\Prediction\\CallTimesPrediction' => '/phpspec-prophecy/Prophecy/Prediction/CallTimesPrediction.php',
2250                'Prophecy\\Prediction\\CallbackPrediction' => '/phpspec-prophecy/Prophecy/Prediction/CallbackPrediction.php',
2251                'Prophecy\\Prediction\\NoCallsPrediction' => '/phpspec-prophecy/Prophecy/Prediction/NoCallsPrediction.php',
2252                'Prophecy\\Prediction\\PredictionInterface' => '/phpspec-prophecy/Prophecy/Prediction/PredictionInterface.php',
2253                'Prophecy\\Promise\\CallbackPromise' => '/phpspec-prophecy/Prophecy/Promise/CallbackPromise.php',
2254                'Prophecy\\Promise\\PromiseInterface' => '/phpspec-prophecy/Prophecy/Promise/PromiseInterface.php',
2255                'Prophecy\\Promise\\ReturnArgumentPromise' => '/phpspec-prophecy/Prophecy/Promise/ReturnArgumentPromise.php',
2256                'Prophecy\\Promise\\ReturnPromise' => '/phpspec-prophecy/Prophecy/Promise/ReturnPromise.php',
2257                'Prophecy\\Promise\\ThrowPromise' => '/phpspec-prophecy/Prophecy/Promise/ThrowPromise.php',
2258                'Prophecy\\Prophecy\\MethodProphecy' => '/phpspec-prophecy/Prophecy/Prophecy/MethodProphecy.php',
2259                'Prophecy\\Prophecy\\ObjectProphecy' => '/phpspec-prophecy/Prophecy/Prophecy/ObjectProphecy.php',
2260                'Prophecy\\Prophecy\\ProphecyInterface' => '/phpspec-prophecy/Prophecy/Prophecy/ProphecyInterface.php',
2261                'Prophecy\\Prophecy\\ProphecySubjectInterface' => '/phpspec-prophecy/Prophecy/Prophecy/ProphecySubjectInterface.php',
2262                'Prophecy\\Prophecy\\Revealer' => '/phpspec-prophecy/Prophecy/Prophecy/Revealer.php',
2263                'Prophecy\\Prophecy\\RevealerInterface' => '/phpspec-prophecy/Prophecy/Prophecy/RevealerInterface.php',
2264                'Prophecy\\Prophet' => '/phpspec-prophecy/Prophecy/Prophet.php',
2265                'Prophecy\\Util\\ExportUtil' => '/phpspec-prophecy/Prophecy/Util/ExportUtil.php',
2266                'Prophecy\\Util\\StringUtil' => '/phpspec-prophecy/Prophecy/Util/StringUtil.php'] as $file) {
2267    require_once 'phar://phpunit-9.5.10.phar' . $file;
2268}
2269
2270require __PHPUNIT_PHAR_ROOT__ . '/phpunit/Framework/Assert/Functions.php';
2271
2272if ($execute) {
2273    if (isset($printManifest)) {
2274        print file_get_contents(__PHPUNIT_PHAR_ROOT__ . '/manifest.txt');
2275
2276        exit;
2277    }
2278
2279    unset($execute);
2280
2281    PHPUnit\TextUI\Command::main();
2282}
2283
2284__HALT_COMPILER(); ?>
2285gh�����������phpunit-9.5.10.phar�������webmozart-assert/Assert.php���� �Na����vA8X����������webmozart-assert/Mixin.php(� �Na(�GZl����������webmozart-assert/LICENSE<�� �Na<��t�}��������-���webmozart-assert/InvalidArgumentException.phpb�� �Nab���A���������)���phpdocumentor-reflection-common/Fqsen.php��� �Na�����?�������2���phpdocumentor-reflection-common/ProjectFactory.php_�� �Na_��j�\"�������(���phpdocumentor-reflection-common/File.php��� �Na�����I)�������,���phpdocumentor-reflection-common/Location.php��� �Na���=�(��������+���phpdocumentor-reflection-common/Project.php�� Na����J�������+���phpdocumentor-reflection-common/Element.php	�� �Na	���%��������'���phpdocumentor-reflection-common/LICENSE9�� �Na9��*2Ȑ����������php-text-template/Template.php(	�� �Na(	�����������1���php-text-template/exceptions/RuntimeException.php��� �Na���Ym'�������*���php-text-template/exceptions/Exception.phpy�� �Nay���n���������9���php-text-template/exceptions/InvalidArgumentException.php��� �Na����aM����������php-text-template/LICENSE�� �Na��u���������.���sebastian-object-reflector/ObjectReflector.php��� �Na�����Ƥ������(���sebastian-object-reflector/Exception.php��� �Na����Ьۤ������7���sebastian-object-reflector/InvalidArgumentException.php��� �Na���
2286��M����������php-invoker/Invoker.php	�� �Na	����O�������D���php-invoker/exceptions/ProcessControlExtensionNotLoadedException.php��� �Na�����������+���php-invoker/exceptions/TimeoutException.php��� �Na�����.��������$���php-invoker/exceptions/Exception.phpr�� �Nar��vvdu�������8���phar-io-version/constraints/OrVersionConstraintGroup.php�� �Na��M%�������1���phar-io-version/constraints/VersionConstraint.php��� �Na���eDq�������6���phar-io-version/constraints/ExactVersionConstraint.php>�� �Na>��t��������4���phar-io-version/constraints/AnyVersionConstraint.phpR�� �NaR��
2287#��������>���phar-io-version/constraints/SpecificMajorVersionConstraint.php�� �Na��`9q:�������F���phar-io-version/constraints/SpecificMajorAndMinorVersionConstraint.php��� �Na����ɍ��������E���phar-io-version/constraints/GreaterThanOrEqualToVersionConstraint.php��� �Na����VU��������9���phar-io-version/constraints/AbstractVersionConstraint.php��� �Na���xB��������9���phar-io-version/constraints/AndVersionConstraintGroup.php��� �Na����Y�������!���phar-io-version/VersionNumber.php��� �Na���O��1�������+���phar-io-version/VersionConstraintParser.php<
2288�� �Na<
2289��ͮ*Ҥ���������phar-io-version/Version.php�� �Na���<&��������?���phar-io-version/exceptions/InvalidPreReleaseSuffixException.php���� �Na������ҵ�������D���phar-io-version/exceptions/UnsupportedVersionConstraintException.php��� �Na�����9�������(���phar-io-version/exceptions/Exception.php��� �Na���$eb�������:���phar-io-version/exceptions/NoPreReleaseSuffixException.php���� �Na������T4�������6���phar-io-version/exceptions/InvalidVersionException.php���� �Na����4/S�������$���phar-io-version/PreReleaseSuffix.phpf�� �Naf��#�Ѥ���������phar-io-version/LICENSE1�� �Na1��>��:�������*���phar-io-version/VersionConstraintValue.phpH
2290�� �NaH
2291��F{~4�������*���sebastian-object-enumerator/Enumerator.php��� �Na����x}��������)���sebastian-object-enumerator/Exception.php��� �Na����}�Ȥ������8���sebastian-object-enumerator/InvalidArgumentException.php��� �Na����â����������phpunit.xsdF�� �NaF���uy����������nikic-php-parser/LICENSE��� �Na�����*�������)���nikic-php-parser/PhpParser/NodeDumper.phpd�� �Nad��Y	l��������3���nikic-php-parser/PhpParser/Internal/TokenStream.php%#�� �Na%#��D���������0���nikic-php-parser/PhpParser/Internal/DiffElem.php7�� �Na7��$����������.���nikic-php-parser/PhpParser/Internal/Differ.php-�� �Na-�����^�������A���nikic-php-parser/PhpParser/Internal/PrintableNewAnonClassNode.php$�� �Na$��'�c��������4���nikic-php-parser/PhpParser/PrettyPrinterAbstract.php���� �Na�������ޤ������*���nikic-php-parser/PhpParser/Comment/Doc.phpx��� �Nax����p��������0���nikic-php-parser/PhpParser/Builder/Function_.phpF�� �NaF��u�x�������1���nikic-php-parser/PhpParser/Builder/Interface_.php�	�� �Na�	�����������-���nikic-php-parser/PhpParser/Builder/Method.php��� �Na����}�������-���nikic-php-parser/PhpParser/Builder/Class_.php2292�� �Na�
2293������������-���nikic-php-parser/PhpParser/Builder/Trait_.php��� �Na���kj��������3���nikic-php-parser/PhpParser/Builder/FunctionLike.php��� �Na���Zqe�������/���nikic-php-parser/PhpParser/Builder/TraitUse.phpW�� �NaW���L@�������2���nikic-php-parser/PhpParser/Builder/Declaration.php��� �Na����E�7�������,���nikic-php-parser/PhpParser/Builder/Param.php��� �Na����֤������+���nikic-php-parser/PhpParser/Builder/Use_.php��� �Na����s���������1���nikic-php-parser/PhpParser/Builder/Namespace_.php:�� �Na:��ˆp�������1���nikic-php-parser/PhpParser/Builder/ClassConst.phpm
2294�� �Nam
2295���z��������/���nikic-php-parser/PhpParser/Builder/Property.php|�� �Na|��O
2296��������9���nikic-php-parser/PhpParser/Builder/TraitUseAdaptation.php��� �Na���UVx��������$���nikic-php-parser/PhpParser/Error.php��� �Na����QZ�������7���nikic-php-parser/PhpParser/NodeVisitor/NameResolver.phpm&�� �Nam&��f�[&�������B���nikic-php-parser/PhpParser/NodeVisitor/ParentConnectingVisitor.phpu�� �Nau��ME��������9���nikic-php-parser/PhpParser/NodeVisitor/CloningVisitor.php�� �Na���"WJ�������9���nikic-php-parser/PhpParser/NodeVisitor/FindingVisitor.php��� �Na�����B��������>���nikic-php-parser/PhpParser/NodeVisitor/FirstFindingVisitor.php��� �Na���m4�Ť������@���nikic-php-parser/PhpParser/NodeVisitor/NodeConnectingVisitor.php��� �Na����u
2297�����,���nikic-php-parser/PhpParser/ParserFactory.php��� �Na����
2298~&�������1���nikic-php-parser/PhpParser/ConstExprEvaluator.php�$�� �Na�$���.(	�������H���nikic-php-parser/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php��� �Na���*�#�������D���nikic-php-parser/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php��� �Na����LF��������L���nikic-php-parser/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php�� �Na��*§o�������@���nikic-php-parser/PhpParser/Lexer/TokenEmulator/TokenEmulator.phpu�� �Nau��D4h��������D���nikic-php-parser/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php��� �Na���r����������B���nikic-php-parser/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php��� �Na���I��}�������B���nikic-php-parser/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php��� �Na���j���������H���nikic-php-parser/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php��� �Na���0�k�������E���nikic-php-parser/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php��� �Na����c�/�������L���nikic-php-parser/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.phpn	�� �Nan	��1��������R���nikic-php-parser/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.phpV�� �NaV�����������B���nikic-php-parser/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php��� �Na�������������H���nikic-php-parser/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php��� �Na���:&E��������.���nikic-php-parser/PhpParser/Lexer/Emulative.php�"�� �Na�"��A����������*���nikic-php-parser/PhpParser/NameContext.php�%�� �Na�%��G-��������&���nikic-php-parser/PhpParser/Comment.php��� �Na���A��������-���nikic-php-parser/PhpParser/ParserAbstract.php���� �Na�������������;���nikic-php-parser/PhpParser/ConstExprEvaluationException.php_��� �Na_����I��������2���nikic-php-parser/PhpParser/NodeVisitorAbstract.php��� �Na�������������-���nikic-php-parser/PhpParser/BuilderFactory.php�(�� �Na�(�������������5���nikic-php-parser/PhpParser/NodeTraverserInterface.php|�� �Na|��Ś
2299��������&���nikic-php-parser/PhpParser/Builder.php���� �Na������6�������4���nikic-php-parser/PhpParser/ErrorHandler/Throwing.php��� �Na����S}<�������6���nikic-php-parser/PhpParser/ErrorHandler/Collecting.php��� �Na����&�Ȥ������)���nikic-php-parser/PhpParser/NodeFinder.php�	�� �Na�	������������#���nikic-php-parser/PhpParser/Node.php��� �Na�����������-���nikic-php-parser/PhpParser/BuilderHelpers.php_#�� �Na_#��,�1�������5���nikic-php-parser/PhpParser/PrettyPrinter/Standard.phpx��� �Nax���Lu��������+���nikic-php-parser/PhpParser/ErrorHandler.php/�� �Na/��#��\�������-���nikic-php-parser/PhpParser/Node/Attribute.phpH�� �NaH���hqK�������5���nikic-php-parser/PhpParser/Node/VarLikeIdentifier.php�� �Na����&��������'���nikic-php-parser/PhpParser/Node/Arg.php0�� �Na0��qH�������-���nikic-php-parser/PhpParser/Node/UnionType.php��� �Na���jViΤ������/���nikic-php-parser/PhpParser/Node/ComplexType.phpS�� �NaS���(���������0���nikic-php-parser/PhpParser/Node/FunctionLike.php��� �Na����4�ͤ������5���nikic-php-parser/PhpParser/Node/Stmt/HaltCompiler.php�� �Na��]�;�������/���nikic-php-parser/PhpParser/Node/Stmt/Break_.php��� �Na�����֤������,���nikic-php-parser/PhpParser/Node/Stmt/If_.php:�� �Na:���u٤������/���nikic-php-parser/PhpParser/Node/Stmt/While_.phpE�� �NaE��ա���������2���nikic-php-parser/PhpParser/Node/Stmt/Function_.php
2300�� �Na
2301�����̤������0���nikic-php-parser/PhpParser/Node/Stmt/ElseIf_.phpI�� �NaI���Eä������3���nikic-php-parser/PhpParser/Node/Stmt/Interface_.php��� �Na����L/Ǥ������/���nikic-php-parser/PhpParser/Node/Stmt/Class_.phpA�� �NaA����O�������1���nikic-php-parser/PhpParser/Node/Stmt/GroupUse.php
2302�� �Na
2303��ߎ0|�������/���nikic-php-parser/PhpParser/Node/Stmt/Throw_.php��� �Na�������������2���nikic-php-parser/PhpParser/Node/Stmt/Continue_.php��� �Na�������������.���nikic-php-parser/PhpParser/Node/Stmt/Else_.php��� �Na����|�ä������/���nikic-php-parser/PhpParser/Node/Stmt/Trait_.php�� �Na����$v�������/���nikic-php-parser/PhpParser/Node/Stmt/Unset_.php��� �Na���=o�B�������.���nikic-php-parser/PhpParser/Node/Stmt/Echo_.php��� Na���͘Ƥ������.���nikic-php-parser/PhpParser/Node/Stmt/Label.php��� �Na�����Ӥ������,���nikic-php-parser/PhpParser/Node/Stmt/Do_.phpB�� �NaB��
2304@�������7���nikic-php-parser/PhpParser/Node/Stmt/DeclareDeclare.php��� �Na����ƀ��������1���nikic-php-parser/PhpParser/Node/Stmt/Finally_.php��� �Na����1�A�������A���nikic-php-parser/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.phpA�� �NaA����d�������F���nikic-php-parser/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.phpZ�� �NaZ��P�֤������0���nikic-php-parser/PhpParser/Node/Stmt/Switch_.php5�� �Na5��FFY�������1���nikic-php-parser/PhpParser/Node/Stmt/TraitUse.php��� �Na���g�,��������3���nikic-php-parser/PhpParser/Node/Stmt/InlineHTML.php��� �Na���]��������2���nikic-php-parser/PhpParser/Node/Stmt/ClassLike.php��� �Na������������.���nikic-php-parser/PhpParser/Node/Stmt/Goto_.php�� �Na��VyPn�������0���nikic-php-parser/PhpParser/Node/Stmt/Return_.php��� �Na���Ϳ)e�������1���nikic-php-parser/PhpParser/Node/Stmt/Declare_.php��� �Na���..
2305�������2���nikic-php-parser/PhpParser/Node/Stmt/StaticVar.php��� �Na������������.���nikic-php-parser/PhpParser/Node/Stmt/Case_.phpl�� �Nal�����u�������/���nikic-php-parser/PhpParser/Node/Stmt/Const_.php��� �Na�������������,���nikic-php-parser/PhpParser/Node/Stmt/Nop.php@�� �Na@��G���������0���nikic-php-parser/PhpParser/Node/Stmt/Static_.php��� �Na�������������1���nikic-php-parser/PhpParser/Node/Stmt/TryCatch.php$�� �Na$���W��������1���nikic-php-parser/PhpParser/Node/Stmt/EnumCase.php��� �Na���jD���������1���nikic-php-parser/PhpParser/Node/Stmt/Foreach_.phpo�� �Nao��9���������/���nikic-php-parser/PhpParser/Node/Stmt/UseUse.phpd�� �Nad��b����������.���nikic-php-parser/PhpParser/Node/Stmt/Enum_.php=�� Na=���dA��������3���nikic-php-parser/PhpParser/Node/Stmt/Expression.php��� Na����RK�������4���nikic-php-parser/PhpParser/Node/Stmt/ClassMethod.php��� �Na���((�
2306�������/���nikic-php-parser/PhpParser/Node/Stmt/Catch_.php|�� �Na|��*V>�������0���nikic-php-parser/PhpParser/Node/Stmt/Global_.php��� �Na������������9���nikic-php-parser/PhpParser/Node/Stmt/PropertyProperty.php��� �Na����҉�������-���nikic-php-parser/PhpParser/Node/Stmt/For_.php>�� �Na>��N��Q�������-���nikic-php-parser/PhpParser/Node/Stmt/Use_.phpl�� �Nal���9=|�������3���nikic-php-parser/PhpParser/Node/Stmt/Namespace_.php��� �Na����㹀�������3���nikic-php-parser/PhpParser/Node/Stmt/ClassConst.php��� �Na���eX?ͤ������1���nikic-php-parser/PhpParser/Node/Stmt/Property.phpO
2307�� �NaO
2308�����=�������;���nikic-php-parser/PhpParser/Node/Stmt/TraitUseAdaptation.php�� �Na��a8��������>���nikic-php-parser/PhpParser/Node/Expr/NullsafePropertyFetch.php��� �Na���	�/N�������2���nikic-php-parser/PhpParser/Node/Expr/ArrayItem.phpx�� �Nax��|	�2�������/���nikic-php-parser/PhpParser/Node/Expr/PreDec.php��� �Na���t�g�������-���nikic-php-parser/PhpParser/Node/Expr/Cast.phpA�� �NaA���:Vs�������/���nikic-php-parser/PhpParser/Node/Expr/Clone_.php��� �Na�����W�������2���nikic-php-parser/PhpParser/Node/Expr/UnaryPlus.php��� �Na���e��̤������1���nikic-php-parser/PhpParser/Node/Expr/AssignOp.php��� �Na����,���������1���nikic-php-parser/PhpParser/Node/Expr/CallLike.php&�� �Na&���KS0�������/���nikic-php-parser/PhpParser/Node/Expr/Throw_.php��� �Na��� �?��������/���nikic-php-parser/PhpParser/Node/Expr/Yield_.php\�� �Na\�����
2309�������/���nikic-php-parser/PhpParser/Node/Expr/Match_.php��� �Na����W�	�������/���nikic-php-parser/PhpParser/Node/Expr/Print_.php��� �Na���nX�������1���nikic-php-parser/PhpParser/Node/Expr/Variable.php��� �Na���mJ�r�������.���nikic-php-parser/PhpParser/Node/Expr/Error.php�� �Na���a\�������0���nikic-php-parser/PhpParser/Node/Expr/PostDec.php��� �Na����w�:�������.���nikic-php-parser/PhpParser/Node/Expr/Eval_.php��� �Na���3�56�������-���nikic-php-parser/PhpParser/Node/Expr/New_.php��� �Na�����iĤ������6���nikic-php-parser/PhpParser/Node/Expr/ArrowFunction.php�	�� �Na�	����K�������5���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Mul.phpB�� �NaB��|���������;���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/BooleanOr.phpO�� �NaO���eӸ�������9���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Smaller.phpJ�� �NaJ���f���������<���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/LogicalXor.phpR�� �NaR��4�e�������5���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Pow.phpC�� �NaC�����������;���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Identical.phpP�� �NaP��"��������;���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/BitwiseOr.phpN�� �NaN���_|��������7���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Equal.phpG�� �NaG��ݙʤ������;���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Spaceship.phpP�� �NaP��HƉ.�������6���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Plus.phpD�� �NaD��',�������@���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.phpY�� �NaY����⍤������<���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.phpP�� �NaP��6L�6�������<���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/BitwiseXor.phpP�� �NaP��~�Ƥ������;���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/LogicalOr.phpO�� �NaO��@���������<���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/BooleanAnd.phpQ�� �NaQ���5v�������<���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/LogicalAnd.phpR�� �NaR��i����������9���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Greater.phpJ�� �NaJ��4�ͤ������5���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Div.phpB�� �NaB��i����������<���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/ShiftRight.phpQ�� �NaQ����Ǥ������:���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Coalesce.phpM�� �NaM��Y� ��������;���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/ShiftLeft.phpO�� �NaO����Q#�������5���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Mod.phpB�� �NaB�����ʤ������:���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/NotEqual.phpM�� �NaM����������7���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Minus.phpF�� �NaF���$������>���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/NotIdentical.phpV�� �NaV���h<
2310�������@���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.phpY�� �NaY��^�ز�������8���nikic-php-parser/PhpParser/Node/Expr/BinaryOp/Concat.phpH�� �NaH���@q�������0���nikic-php-parser/PhpParser/Node/Expr/PostInc.php��� �Na���ᦦ!�������0���nikic-php-parser/PhpParser/Node/Expr/Ternary.php��� �Na���Q��ͤ������;���nikic-php-parser/PhpParser/Node/Expr/NullsafeMethodCall.php��� �Na���Y�,l�������6���nikic-php-parser/PhpParser/Node/Expr/PropertyFetch.php��� �Na���ɾ��������4���nikic-php-parser/PhpParser/Node/Expr/Instanceof_.phpa�� �Naa��<���������/���nikic-php-parser/PhpParser/Node/Expr/Empty_.php��� �Na����'���������6���nikic-php-parser/PhpParser/Node/Expr/ArrayDimFetch.phpM�� �NaM��IY�������8���nikic-php-parser/PhpParser/Node/Expr/ClassConstFetch.php��� �Na�������������3���nikic-php-parser/PhpParser/Node/Expr/ConstFetch.php��� �Na���޶%��������3���nikic-php-parser/PhpParser/Node/Expr/StaticCall.phpe�� �Nae�����������1���nikic-php-parser/PhpParser/Node/Expr/FuncCall.php3�� �Na3���%A��������.���nikic-php-parser/PhpParser/Node/Expr/List_.php��� �Na�������������/���nikic-php-parser/PhpParser/Node/Expr/Isset_.php��� �Na���I��������5���nikic-php-parser/PhpParser/Node/Expr/AssignOp/Mul.php���� �Na����π�/�������5���nikic-php-parser/PhpParser/Node/Expr/AssignOp/Pow.php���� �Na�����yV�������;���nikic-php-parser/PhpParser/Node/Expr/AssignOp/BitwiseOr.php���� �Na������;��������6���nikic-php-parser/PhpParser/Node/Expr/AssignOp/Plus.php���� �Na����&|������<���nikic-php-parser/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php��� �Na������u�������<���nikic-php-parser/PhpParser/Node/Expr/AssignOp/BitwiseXor.php��� �Na���lϚ�������5���nikic-php-parser/PhpParser/Node/Expr/AssignOp/Div.php���� �Na�����YP
2311�������<���nikic-php-parser/PhpParser/Node/Expr/AssignOp/ShiftRight.php��� �Na���s�*��������:���nikic-php-parser/PhpParser/Node/Expr/AssignOp/Coalesce.php���� �Na�����q,�������;���nikic-php-parser/PhpParser/Node/Expr/AssignOp/ShiftLeft.php���� �Na��������������5���nikic-php-parser/PhpParser/Node/Expr/AssignOp/Mod.php���� �Na����]10Y�������7���nikic-php-parser/PhpParser/Node/Expr/AssignOp/Minus.php���� �Na������隤������8���nikic-php-parser/PhpParser/Node/Expr/AssignOp/Concat.php���� �Na��������������6���nikic-php-parser/PhpParser/Node/Expr/ErrorSuppress.php��� �Na����g��������3���nikic-php-parser/PhpParser/Node/Expr/BooleanNot.php��� �Na���D��C�������/���nikic-php-parser/PhpParser/Node/Expr/Array_.php8�� �Na8���;�p�������3���nikic-php-parser/PhpParser/Node/Expr/UnaryMinus.php��� �Na���l��A�������0���nikic-php-parser/PhpParser/Node/Expr/Closure.php2312�� �Na2313��U;�������4���nikic-php-parser/PhpParser/Node/Expr/Cast/Double.php��� �Na����>,��������4���nikic-php-parser/PhpParser/Node/Expr/Cast/Unset_.php���� �Na����1��Ӥ������2���nikic-php-parser/PhpParser/Node/Expr/Cast/Int_.php���� �Na������c�������5���nikic-php-parser/PhpParser/Node/Expr/Cast/String_.php���� �Na������������3���nikic-php-parser/PhpParser/Node/Expr/Cast/Bool_.php���� �Na����	V]S�������4���nikic-php-parser/PhpParser/Node/Expr/Cast/Array_.php���� �Na����I|��������5���nikic-php-parser/PhpParser/Node/Expr/Cast/Object_.php���� �Na��������������/���nikic-php-parser/PhpParser/Node/Expr/PreInc.php��� �Na����Yä������/���nikic-php-parser/PhpParser/Node/Expr/Assign.php�� �Na�����������1���nikic-php-parser/PhpParser/Node/Expr/BinaryOp.phpo�� �Nao��
2314��Ѥ������2���nikic-php-parser/PhpParser/Node/Expr/YieldFrom.php��� �Na����w8��������<���nikic-php-parser/PhpParser/Node/Expr/StaticPropertyFetch.php&�� �Na&���ܐ��������2���nikic-php-parser/PhpParser/Node/Expr/AssignRef.phpH�� �NaH��E`ob�������3���nikic-php-parser/PhpParser/Node/Expr/MethodCall.phpO�� �NaO���DWX�������3���nikic-php-parser/PhpParser/Node/Expr/BitwiseNot.php��� �Na���~'���������3���nikic-php-parser/PhpParser/Node/Expr/ClosureUse.php��� �Na������h�������2���nikic-php-parser/PhpParser/Node/Expr/ShellExec.php��� �Na����hy�������.���nikic-php-parser/PhpParser/Node/Expr/Exit_.php�� �Na������������1���nikic-php-parser/PhpParser/Node/Expr/Include_.php��� �Na����i��������0���nikic-php-parser/PhpParser/Node/NullableType.php��� �Na����6C�������5���nikic-php-parser/PhpParser/Node/Scalar/MagicConst.phpc�� �Nac��,�xG�������=���nikic-php-parser/PhpParser/Node/Scalar/EncapsedStringPart.php��� Na���%��������2���nikic-php-parser/PhpParser/Node/Scalar/LNumber.php�	�� �Na�	��v6훤������2���nikic-php-parser/PhpParser/Node/Scalar/String_.phpR�� �NaR����ؽ�������?���nikic-php-parser/PhpParser/Node/Scalar/MagicConst/Function_.php]�� �Na]��HnY�������<���nikic-php-parser/PhpParser/Node/Scalar/MagicConst/Method.phpV�� �NaV���Τ������<���nikic-php-parser/PhpParser/Node/Scalar/MagicConst/Class_.phpT�� �NaT��㨘X�������9���nikic-php-parser/PhpParser/Node/Scalar/MagicConst/Dir.phpM�� �NaM���al�������<���nikic-php-parser/PhpParser/Node/Scalar/MagicConst/Trait_.phpT�� �NaT���d�������:���nikic-php-parser/PhpParser/Node/Scalar/MagicConst/File.phpP�� �NaP��#��������:���nikic-php-parser/PhpParser/Node/Scalar/MagicConst/Line.phpP�� �NaP��M4���������@���nikic-php-parser/PhpParser/Node/Scalar/MagicConst/Namespace_.php`�� �Na`��>���������3���nikic-php-parser/PhpParser/Node/Scalar/Encapsed.php��� �Na���RU���������2���nikic-php-parser/PhpParser/Node/Scalar/DNumber.phpQ�� �NaQ��_��
2315�������7���nikic-php-parser/PhpParser/Node/VariadicPlaceholder.php��� �Na����P�������(���nikic-php-parser/PhpParser/Node/Name.php�� �Na��-��g�������2���nikic-php-parser/PhpParser/Node/AttributeGroup.php��� �Na���B9���������*���nikic-php-parser/PhpParser/Node/Const_.php��� �Na���y�h�������1���nikic-php-parser/PhpParser/Node/Name/Relative.php��� �Na���ǛEf�������7���nikic-php-parser/PhpParser/Node/Name/FullyQualified.php��� �Na���	�������.���nikic-php-parser/PhpParser/Node/Identifier.php��� �Na����Ja�������*���nikic-php-parser/PhpParser/Node/Scalar.phpk��� �Nak����,ߤ������(���nikic-php-parser/PhpParser/Node/Expr.php���� �Na����h�傤������(���nikic-php-parser/PhpParser/Node/Stmt.php���� �Na�����v2/�������)���nikic-php-parser/PhpParser/Node/Param.phpb�� �Nab��M��ߤ������,���nikic-php-parser/PhpParser/Node/MatchArm.php��� �Na����+m6�������4���nikic-php-parser/PhpParser/Node/IntersectionType.php��� �Na����o�������,���nikic-php-parser/PhpParser/NodeTraverser.php]'�� �Na]'��TG:Ƥ������%���nikic-php-parser/PhpParser/Parser.php}�� �Na}�����{�������*���nikic-php-parser/PhpParser/NodeVisitor.php��� �Na������3�������*���nikic-php-parser/PhpParser/JsonDecoder.php
2316�� �Na
2317���xg�������+���nikic-php-parser/PhpParser/NodeAbstract.phpZ�� �NaZ��׻�@�������$���nikic-php-parser/PhpParser/Lexer.phpuZ�� �NauZ��~�g�������*���nikic-php-parser/PhpParser/Parser/Php7.php�A� �Na�A����������,���nikic-php-parser/PhpParser/Parser/Tokens.php&�� �Na&��<����������.���nikic-php-parser/PhpParser/Parser/Multiple.php��� �Na���sF)7�������*���nikic-php-parser/PhpParser/Parser/Php5.php�*� �Na�*�
2318�[Q����������php-timer/Timer.php��� �Na���c������$���php-timer/ResourceUsageFormatter.php��� �Na�������������php-timer/Duration.php
2319�� �Na
2320��tXy�������/���php-timer/exceptions/NoActiveTimerException.php��� �Na�����������E���php-timer/exceptions/TimeSinceStartOfRequestNotAvailableException.php��� �Na����$b��������"���php-timer/exceptions/Exception.phpn�� �Nan���iuۤ���������php-timer/LICENSE�� �Na��x����������#���sebastian-global-state/Snapshot.php�)�� �Na�)������������'���sebastian-global-state/CodeExporter.php�	�� �Na�	��j!�դ������#���sebastian-global-state/Restorer.php��� �Na���GJ	�������6���sebastian-global-state/exceptions/RuntimeException.php��� �Na���;�������/���sebastian-global-state/exceptions/Exception.phpy�� �Nay���J�����������sebastian-global-state/LICENSE�� �Na������������&���sebastian-global-state/ExcludeList.php2321�� �Na2322��R�{��������:���myclabs-deep-copy/DeepCopy/Matcher/PropertyNameMatcher.php��� �Na����R���������6���myclabs-deep-copy/DeepCopy/Matcher/PropertyMatcher.php��� �Na���=�Bv�������.���myclabs-deep-copy/DeepCopy/Matcher/Matcher.php���� Na��������������D���myclabs-deep-copy/DeepCopy/Matcher/Doctrine/DoctrineProxyMatcher.php��� �Na�����P�������:���myclabs-deep-copy/DeepCopy/Matcher/PropertyTypeMatcher.php2�� �Na2��Z������:���myclabs-deep-copy/DeepCopy/Exception/PropertyException.php��� �Na���3Gz��������7���myclabs-deep-copy/DeepCopy/Exception/CloneException.php���� �Na����{�ˤ������(���myclabs-deep-copy/DeepCopy/deep_copy.php��� �Na���rx�������3���myclabs-deep-copy/DeepCopy/Filter/ReplaceFilter.php��� �Na������������3���myclabs-deep-copy/DeepCopy/Filter/SetNullFilter.php��� �Na����䊉�������0���myclabs-deep-copy/DeepCopy/Filter/KeepFilter.php�� �Na���Yn��������,���myclabs-deep-copy/DeepCopy/Filter/Filter.phpd�� �Nad���M�������G���myclabs-deep-copy/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php
2323�� �Na
2324���Dg�������L���myclabs-deep-copy/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php��� �Na���)$�������B���myclabs-deep-copy/DeepCopy/Filter/Doctrine/DoctrineProxyFilter.php��� �Na���)���������6���myclabs-deep-copy/DeepCopy/TypeMatcher/TypeMatcher.php��� �Na����QBŤ������7���myclabs-deep-copy/DeepCopy/TypeFilter/ReplaceFilter.php�� �Na���z���������4���myclabs-deep-copy/DeepCopy/TypeFilter/TypeFilter.php���� �Na�����VD��������?���myclabs-deep-copy/DeepCopy/TypeFilter/Spl/ArrayObjectFilter.php��� �Na���^���������A���myclabs-deep-copy/DeepCopy/TypeFilter/Spl/SplDoublyLinkedList.php���� �Na������v|�������G���myclabs-deep-copy/DeepCopy/TypeFilter/Spl/SplDoublyLinkedListFilter.php�� �Na��T��+�������;���myclabs-deep-copy/DeepCopy/TypeFilter/ShallowCopyFilter.php���� �Na�������ؤ������A���myclabs-deep-copy/DeepCopy/TypeFilter/Date/DateIntervalFilter.php��� �Na�����Ƥ������:���myclabs-deep-copy/DeepCopy/Reflection/ReflectionHelper.php5�� �Na5��ى��������'���myclabs-deep-copy/DeepCopy/DeepCopy.php��� �Na���wv˾����������myclabs-deep-copy/LICENSE5�� �Na5��ʭ˄����������sebastian-type/UnknownType.php-�� �Na-����}Y�������$���sebastian-type/GenericObjectType.php��� �Na���+M����������sebastian-type/UnionType.phpO	�� �NaO	����E�����������sebastian-type/MixedType.php��� �Na����
2325HK����������sebastian-type/CallableType.php4�� �Na4��/p������������sebastian-type/VoidType.phpQ�� �NaQ���������������sebastian-type/NullType.php<�� �Na<���4�����������sebastian-type/ObjectType.php��� �Na���ł������������sebastian-type/SimpleType.php�� �Na���Ť���������sebastian-type/TypeName.php~	�� �Na~	��h=�x����������sebastian-type/StaticType.php@�� Na@����`�����������sebastian-type/FalseType.php��� �Na���mZ�������#���sebastian-type/ReflectionMapper.php��� �Na���)R
2326����������sebastian-type/IterableType.php��� �Na���+�����������sebastian-type/Type.php�	�� �Na�	���[������������sebastian-type/LICENSE
2327�� �Na
2328��
2329+Τ������-���sebastian-type/exception/RuntimeException.php��� �Na������%�������+���sebastian-type/exception/LogicException.php}�� �Na}��/�[H�������&���sebastian-type/exception/Exception.phpj�� �Naj��bᮧ����������sebastian-version/Version.php��� �Na���	ƪ�����������sebastian-version/LICENSE�� �Na���Z������������schema/8.5.xsdB�� �NaB��贅�����������schema/9.2.xsdB�� �NaB���|l�������A���phpdocumentor-reflection-docblock/DocBlock/StandardTagFactory.php�0�� �Na�0�����<�������9���phpdocumentor-reflection-docblock/DocBlock/Serializer.php�� �Na����iB�������9���phpdocumentor-reflection-docblock/DocBlock/TagFactory.php��� �Na���JMx�������7���phpdocumentor-reflection-docblock/DocBlock/Tags/See.php
2330�� �Na
2331���
2332��������;���phpdocumentor-reflection-docblock/DocBlock/Tags/Generic.phpx	�� �Nax	��B��n�������>���phpdocumentor-reflection-docblock/DocBlock/Tags/InvalidTag.php&�� �Na&��,��l�������:���phpdocumentor-reflection-docblock/DocBlock/Tags/Source.phpH
2333�� �NaH
2334��Q%΋�������:���phpdocumentor-reflection-docblock/DocBlock/Tags/Method.php��� �Na���BD7�������=���phpdocumentor-reflection-docblock/DocBlock/Tags/Formatter.php�� �Na���}Bܤ������A���phpdocumentor-reflection-docblock/DocBlock/Tags/Reference/Url.php��� �Na���c[]�������C���phpdocumentor-reflection-docblock/DocBlock/Tags/Reference/Fqsen.php,�� �Na,��%8�������G���phpdocumentor-reflection-docblock/DocBlock/Tags/Reference/Reference.php��� �Na���� ��������;���phpdocumentor-reflection-docblock/DocBlock/Tags/BaseTag.php��� �Na�����Zr�������:���phpdocumentor-reflection-docblock/DocBlock/Tags/Author.php�	�� �Na�	��L��t�������9���phpdocumentor-reflection-docblock/DocBlock/Tags/Since.phpW
2335�� �NaW
2336��1>��������R���phpdocumentor-reflection-docblock/DocBlock/Tags/Formatter/PassthroughFormatter.php��� �Na���P�~�������L���phpdocumentor-reflection-docblock/DocBlock/Tags/Formatter/AlignFormatter.phpq�� �Naq������������@���phpdocumentor-reflection-docblock/DocBlock/Tags/PropertyRead.php2337�� �Na�
2338���Q'H�������?���phpdocumentor-reflection-docblock/DocBlock/Tags/TagWithType.php��� �Na���;u��������H���phpdocumentor-reflection-docblock/DocBlock/Tags/Factory/StaticMethod.php�� �Na��.��ͤ������A���phpdocumentor-reflection-docblock/DocBlock/Tags/PropertyWrite.php2339�� �Na�
2340����}��������;���phpdocumentor-reflection-docblock/DocBlock/Tags/Version.php2341�� �Na�
2342��@S���������>���phpdocumentor-reflection-docblock/DocBlock/Tags/Deprecated.php2343�� �Na�
2344��}C�O�������8���phpdocumentor-reflection-docblock/DocBlock/Tags/Link.php��� �Na�����������8���phpdocumentor-reflection-docblock/DocBlock/Tags/Var_.php2345�� �Na�
2346��o�Ԥ������;���phpdocumentor-reflection-docblock/DocBlock/Tags/Return_.php%�� �Na%��5�ä������:���phpdocumentor-reflection-docblock/DocBlock/Tags/Covers.phpg
2347�� �Nag
2348��w8��������;���phpdocumentor-reflection-docblock/DocBlock/Tags/Example.php��� �Na���UV�b�������9���phpdocumentor-reflection-docblock/DocBlock/Tags/Param.php�� �Na���W��������8���phpdocumentor-reflection-docblock/DocBlock/Tags/Uses.php>
2349�� �Na>
2350���
2351��������:���phpdocumentor-reflection-docblock/DocBlock/Tags/Throws.php�� �Na��"��G�������<���phpdocumentor-reflection-docblock/DocBlock/Tags/Property.php2352�� �Na2353����e_�������2���phpdocumentor-reflection-docblock/DocBlock/Tag.php��� �Na���78^�������<���phpdocumentor-reflection-docblock/DocBlock/ExampleFinder.php0�� �Na0���ێ��������A���phpdocumentor-reflection-docblock/DocBlock/DescriptionFactory.php��� �Na����"�L�������:���phpdocumentor-reflection-docblock/DocBlock/Description.php2354�� �Na2355��54��������5���phpdocumentor-reflection-docblock/DocBlockFactory.php�$�� �Na�$���br�������+���phpdocumentor-reflection-docblock/Utils.php@	�� �Na@	��$昤������=���phpdocumentor-reflection-docblock/Exception/PcreException.php��� Na���ϊWƤ������.���phpdocumentor-reflection-docblock/DocBlock.php;�� �Na;��%��p�������)���phpdocumentor-reflection-docblock/LICENSE8�� �Na8����ʤ������>���phpdocumentor-reflection-docblock/DocBlockFactoryInterface.php��� �Na���)%�ߤ������/���phpdocumentor-type-resolver/Types/Resource_.php�� �Na��ŞX��������.���phpdocumentor-type-resolver/Types/Compound.php�� �Na��>7��������-���phpdocumentor-type-resolver/Types/Integer.phpj�� �Naj����v��������,���phpdocumentor-type-resolver/Types/Never_.php��� �Na����j�������+���phpdocumentor-type-resolver/Types/Null_.phpx�� �Nax���s��������-���phpdocumentor-type-resolver/Types/Parent_.php��� �Na���O!.�������+���phpdocumentor-type-resolver/Types/Void_.php�� �Na��k�������-���phpdocumentor-type-resolver/Types/Boolean.phpn�� �Nan��r��Ĥ������.���phpdocumentor-type-resolver/Types/ArrayKey.php��� �Na����ʫ�������4���phpdocumentor-type-resolver/Types/ContextFactory.php7�� �Na7��q⬤������2���phpdocumentor-type-resolver/Types/AbstractList.phpt�� �Nat��t��������-���phpdocumentor-type-resolver/Types/String_.phps�� �Nas�����H�������1���phpdocumentor-type-resolver/Types/ClassString.php��� �Na����=t��������+���phpdocumentor-type-resolver/Types/Self_.php��� �Na����oȤ������,���phpdocumentor-type-resolver/Types/Float_.phpm�� �Nam��)�J�������-���phpdocumentor-type-resolver/Types/Static_.php�� �Na�����8�������-���phpdocumentor-type-resolver/Types/Context.php��� �Na����]�Z�������,���phpdocumentor-type-resolver/Types/Array_.php��� �Na���섍D�������-���phpdocumentor-type-resolver/Types/Object_.php��� �Na���wEhN�������/���phpdocumentor-type-resolver/Types/Callable_.php{�� �Na{���E��������0���phpdocumentor-type-resolver/Types/Collection.php��� �Na���?����������,���phpdocumentor-type-resolver/Types/Scalar.php��� �Na�������������0���phpdocumentor-type-resolver/Types/Expression.php8�� �Na8���g��������,���phpdocumentor-type-resolver/Types/Mixed_.php��� �Na���3�i��������4���phpdocumentor-type-resolver/Types/AggregatedType.php2356�� �Na�
2357���Hɵ�������/���phpdocumentor-type-resolver/Types/Iterable_.php?�� �Na?���Q8�������2���phpdocumentor-type-resolver/Types/Intersection.php�� �Na��Uz$��������*���phpdocumentor-type-resolver/Types/This.phpY�� �NaY��^?ֈ�������.���phpdocumentor-type-resolver/Types/Nullable.phpR�� �NaR��Cp\��������5���phpdocumentor-type-resolver/Types/InterfaceString.php��� �Na��������������-���phpdocumentor-type-resolver/FqsenResolver.php��� �Na���j��^�������=���phpdocumentor-type-resolver/PseudoTypes/HtmlEscapedString.phpg�� �Nag����we�������2���phpdocumentor-type-resolver/PseudoTypes/False_.php��� �Na����o䈤������:���phpdocumentor-type-resolver/PseudoTypes/NonEmptyString.phpa�� �Naa��²,�������7���phpdocumentor-type-resolver/PseudoTypes/TraitString.phpZ�� �NaZ���g�C�������1���phpdocumentor-type-resolver/PseudoTypes/True_.php��� �Na����l��������:���phpdocumentor-type-resolver/PseudoTypes/CallableString.php`�� �Na`��Z��������C���phpdocumentor-type-resolver/PseudoTypes/NonEmptyLowercaseString.phpt�� �Nat����)�������9���phpdocumentor-type-resolver/PseudoTypes/NumericString.php^�� �Na^����8M�������;���phpdocumentor-type-resolver/PseudoTypes/LowercaseString.phpb�� �Nab���7�������;���phpdocumentor-type-resolver/PseudoTypes/PositiveInteger.php^�� �Na^�����������$���phpdocumentor-type-resolver/Type.php��� �Na����b�&�������*���phpdocumentor-type-resolver/PseudoType.phpu�� �Nau���]�\�������#���phpdocumentor-type-resolver/LICENSE8�� �Na8����ʤ������,���phpdocumentor-type-resolver/TypeResolver.php�J�� �Na�J����������!���sebastian-environment/Console.php��� �Na����u�Ҥ������)���sebastian-environment/OperatingSystem.php��� �Na����^��������!���sebastian-environment/Runtime.php��� �Na����r*u����������sebastian-environment/LICENSE�� �Na��lm|�������*���sebastian-comparator/ComparisonFailure.php��� �Na����%���������+���sebastian-comparator/ResourceComparator.php�� �Na��J���������)���sebastian-comparator/DoubleComparator.php��� �Na���a�������*���sebastian-comparator/NumericComparator.php�	�� �Na�	��I�������� ���sebastian-comparator/Factory.php��� �Na����$/�������*���sebastian-comparator/DOMNodeComparator.php �� �Na ��1i�������)���sebastian-comparator/ObjectComparator.phpX
2358�� �NaX
2359����׌�������)���sebastian-comparator/ScalarComparator.php��� �Na�����d�������+���sebastian-comparator/DateTimeComparator.php��� �Na�����KQ�������'���sebastian-comparator/TypeComparator.php��� �Na���cX\�������,���sebastian-comparator/ExceptionComparator.php��� �Na�����1�������4���sebastian-comparator/exceptions/RuntimeException.php��� �Na���V�'�������-���sebastian-comparator/exceptions/Exception.phpv�� �Nav���Eᵤ������3���sebastian-comparator/SplObjectStorageComparator.php��� �Na���?�/�������#���sebastian-comparator/Comparator.php��� �Na���t����������(���sebastian-comparator/ArrayComparator.phpu�� �Nau��Emhf����������sebastian-comparator/LICENSE	�� �Na	��=(��������-���sebastian-comparator/MockObjectComparator.php��� �Na����I���������+���phar-io-manifest/ManifestDocumentMapper.php�� �Na����:��������?���phar-io-manifest/exceptions/ManifestDocumentMapperException.php���� �Na�����:9z�������3���phar-io-manifest/exceptions/InvalidUrlException.php��� �Na����
2360�������?���phar-io-manifest/exceptions/InvalidApplicationNameException.php��� �Na���:@�>�������8���phar-io-manifest/exceptions/ManifestElementException.php���� �Na������A4�������7���phar-io-manifest/exceptions/ManifestLoaderException.php���� �Na����D��>�������9���phar-io-manifest/exceptions/ManifestDocumentException.php���� �Na����!P4��������5���phar-io-manifest/exceptions/InvalidEmailException.php��� �Na���<����������)���phar-io-manifest/exceptions/Exception.php��� �Na��������������@���phar-io-manifest/exceptions/ManifestDocumentLoadingException.phpH�� �NaH��ǃ��������:���phar-io-manifest/exceptions/ElementCollectionException.php��� �Na�����I�������'���phar-io-manifest/ManifestSerializer.php��� �Na����rp�������#���phar-io-manifest/xml/ExtElement.php	�� �Na	��y>��������)���phar-io-manifest/xml/CopyrightElement.php��� �Na�����7�������#���phar-io-manifest/xml/PhpElement.php��� �Na����B:5�������0���phar-io-manifest/xml/AuthorElementCollection.php,�� �Na,���-��������*���phar-io-manifest/xml/ElementCollection.php�� �Na��@��������)���phar-io-manifest/xml/ExtensionElement.php}�� �Na}��0���������'���phar-io-manifest/xml/LicenseElement.phpo�� �Nao��%�:'�������-���phar-io-manifest/xml/ExtElementCollection.php#�� �Na#��E���������(���phar-io-manifest/xml/RequiresElement.php$�� �Na$��>���������'���phar-io-manifest/xml/BundlesElement.phpS�� �NaS���WN>�������(���phar-io-manifest/xml/ContainsElement.phpn�� �Nan��f���������)���phar-io-manifest/xml/ManifestDocument.php
2361�� �Na
2362����4��������)���phar-io-manifest/xml/ComponentElement.phpy�� �Nay����ݤ������(���phar-io-manifest/xml/ManifestElement.php4�� �Na4����������&���phar-io-manifest/xml/AuthorElement.phpr�� �Nar���<�������3���phar-io-manifest/xml/ComponentElementCollection.php5�� �Na5��(��\����������phar-io-manifest/LICENSE`�� �Na`����p�������$���phar-io-manifest/values/Manifest.php
2363�� �Na
2364��=La�����������phar-io-manifest/values/Url.php��� Na�����͚�������4���phar-io-manifest/values/AuthorCollectionIterator.php3�� �Na3��џ��������"���phar-io-manifest/values/Author.php�� �Na����F�������+���phar-io-manifest/values/ApplicationName.php;�� �Na;��D���������'���phar-io-manifest/values/Application.php��� �Na���I$ۤ������1���phar-io-manifest/values/PhpVersionRequirement.php�� �Na��m�?�������#���phar-io-manifest/values/License.php��� �Na����&!o�������#���phar-io-manifest/values/Library.php��� �Na�����O�������,���phar-io-manifest/values/AuthorCollection.php��� �Na����o�������'���phar-io-manifest/values/Requirement.php��� �Na�����d��������%���phar-io-manifest/values/Extension.php��� �Na�����q}�������>���phar-io-manifest/values/BundledComponentCollectionIterator.php��� �Na����Vh�������1���phar-io-manifest/values/RequirementCollection.php��� �Na�����P�������9���phar-io-manifest/values/RequirementCollectionIterator.phpj�� �Naj��ܭ:��������!���phar-io-manifest/values/Email.phpN�� �NaN��Z�&�������� ���phar-io-manifest/values/Type.php��� �Na�����=%�������6���phar-io-manifest/values/BundledComponentCollection.php �� �Na ��¾W6�������3���phar-io-manifest/values/PhpExtensionRequirement.php��� �Na�����1�������,���phar-io-manifest/values/BundledComponent.php@�� �Na@���DP`�������0���phar-io-manifest/values/CopyrightInformation.phpP�� �NaP��a�i�������#���phar-io-manifest/ManifestLoader.php��� �Na���.�-a�������<���sebastian-cli-parser/exceptions/AmbiguousOptionException.phpF�� �NaF���m\�������:���sebastian-cli-parser/exceptions/UnknownOptionException.php?�� �Na?��v��D�������G���sebastian-cli-parser/exceptions/OptionDoesNotAllowArgumentException.php_�� �Na_��|13��������-���sebastian-cli-parser/exceptions/Exception.phpu�� �Nau���ӫ��������J���sebastian-cli-parser/exceptions/RequiredOptionArgumentMissingException.phph�� �Nah���C�����������sebastian-cli-parser/Parser.php��� �Na����kM����������sebastian-cli-parser/LICENSE�� �Na����u�������$���symfony-polyfill-ctype/bootstrap.php�� �Na���(S�������&���symfony-polyfill-ctype/bootstrap80.phpR�� �NaR���L2365������� ���symfony-polyfill-ctype/Ctype.php~�� �Na~��J��Ҥ���������symfony-polyfill-ctype/LICENSE)�� �Na)���`e0�������3���sebastian-complexity/Exception/RuntimeException.php��� �Na���CdW�������,���sebastian-complexity/Exception/Exception.phpv�� �Nav��7���������#���sebastian-complexity/Calculator.phpe	�� �Nae	��(6���������8���sebastian-complexity/Complexity/ComplexityCollection.php��� �Na���i�l�������.���sebastian-complexity/Complexity/Complexity.phpQ�� �NaQ���l��������@���sebastian-complexity/Complexity/ComplexityCollectionIterator.php,�� �Na,����e�����������sebastian-complexity/LICENSE�� �Na��=��ݤ������=���sebastian-complexity/Visitor/ComplexityCalculatingVisitor.php��� Na����O�������G���sebastian-complexity/Visitor/CyclomaticComplexityCalculatingVisitor.php�� �Na��7�Y�����������object-reflector/LICENSE�� �Na���9v�������<���sebastian-lines-of-code/Exception/NegativeValueException.php��� �Na�����
2366ڤ������>���sebastian-lines-of-code/Exception/IllogicalValuesException.php��� �Na����G�������6���sebastian-lines-of-code/Exception/RuntimeException.php��� �Na����K��������/���sebastian-lines-of-code/Exception/Exception.phpz�� �Naz��a�V�������#���sebastian-lines-of-code/Counter.php��� �Na���H5�������'���sebastian-lines-of-code/LinesOfCode.php�	�� �Na�	��f��Ӥ������/���sebastian-lines-of-code/LineCountingVisitor.php��� �Na�����~A����������sebastian-lines-of-code/LICENSE�� �Na���bS~����������manifest.txt��� �Na����.���������R���doctrine-instantiator/Doctrine/Instantiator/Exception/UnexpectedValueException.php,�� �Na,����A��������L���doctrine-instantiator/Doctrine/Instantiator/Exception/ExceptionInterface.php���� �Na������b�������R���doctrine-instantiator/Doctrine/Instantiator/Exception/InvalidArgumentException.php��� �Na����+��������<���doctrine-instantiator/Doctrine/Instantiator/Instantiator.php�� �Na�����=�������E���doctrine-instantiator/Doctrine/Instantiator/InstantiatorInterface.php��� Na���v��h����������doctrine-instantiator/LICENSE$�� �Na$��
2367͂�������4���sebastian-resource-operations/ResourceOperations.php߲�� �Na߲�����������%���sebastian-resource-operations/LICENSE�� �Na��]�<�������$���sebastian-code-unit/FunctionUnit.php�� �Na���`��������2���sebastian-code-unit/CodeUnitCollectionIterator.php;�� �Na;���Lʤ���������sebastian-code-unit/Mapper.php�-�� �Na�-��#����������%���sebastian-code-unit/InterfaceUnit.php�� �Na���c�������� ���sebastian-code-unit/CodeUnit.php~%�� �Na~%��D){��������!���sebastian-code-unit/TraitUnit.php�� �Na���XA�������+���sebastian-code-unit/InterfaceMethodUnit.php�� �Na��Ǧ��������'���sebastian-code-unit/ClassMethodUnit.php�� �Na���@[�������3���sebastian-code-unit/exceptions/NoTraitException.php��� �Na����Q3�������6���sebastian-code-unit/exceptions/ReflectionException.php��� �Na������$�������,���sebastian-code-unit/exceptions/Exception.phps�� �Nas��tg��������;���sebastian-code-unit/exceptions/InvalidCodeUnitException.php��� �Na����6�-�������!���sebastian-code-unit/ClassUnit.php�� �Na�����F�������'���sebastian-code-unit/TraitMethodUnit.php�� �Na��q��z����������sebastian-code-unit/LICENSE
2368�� �Na
2369��p���������*���sebastian-code-unit/CodeUnitCollection.php��� �Na������J����������.phpstorm.meta.php��� �Na���O���������;���php-code-coverage/Exception/WrongXdebugVersionException.php��� �Na�����Ȥ������;���php-code-coverage/Exception/PhpdbgNotAvailableException.php`�� �Na`������������F���php-code-coverage/Exception/NoCodeCoverageDriverAvailableException.php/�� �Na/��6��R�������,���php-code-coverage/Exception/XmlException.php��� �Na���W��ܤ������?���php-code-coverage/Exception/ReportAlreadyFinalizedException.php:�� �Na:��d%6�������;���php-code-coverage/Exception/XdebugNotAvailableException.phpe�� �Nae��N��G�������=���php-code-coverage/Exception/WriteOperationFailedException.php��� Na�����(e�������C���php-code-coverage/Exception/DirectoryCouldNotBeCreatedException.php��� �Na���C*e�������F���php-code-coverage/Exception/DeadCodeDetectionNotSupportedException.php��� �Na�������������:���php-code-coverage/Exception/Xdebug2NotEnabledException.phpf�� �Naf����,'�������6���php-code-coverage/Exception/TestIdMissingException.php�� �Na���
2370���������3���php-code-coverage/Exception/ReflectionException.php��� �Na�����k)�������:���php-code-coverage/Exception/Xdebug3NotEnabledException.phpy�� �Nay��<�>�������]���php-code-coverage/Exception/NoCodeCoverageDriverWithPathCoverageSupportAvailableException.phpa�� �Naa��"A��������)���php-code-coverage/Exception/Exception.php}�� �Na}���z���������9���php-code-coverage/Exception/PcovNotAvailableException.phpa�� �Naa���j��������D���php-code-coverage/Exception/PathExistsButIsNotDirectoryException.php��� �Na����.2�������I���php-code-coverage/Exception/StaticAnalysisCacheNotConfiguredException.php��� �Na������}�������C���php-code-coverage/Exception/UnintentionallyCoveredCodeException.php+�� �Na+��Q_ª�������J���php-code-coverage/Exception/BranchAndPathCoverageNotSupportedException.php��� �Na�����77�������8���php-code-coverage/Exception/InvalidArgumentException.php��� �Na����K.n�������/���php-code-coverage/Exception/ParserException.php��� �Na���,�/�������� ���php-code-coverage/Percentage.php�� �Na�����ݤ���������php-code-coverage/Filter.php�� �Na���}�������'���php-code-coverage/Driver/PcovDriver.php��� �Na�������������#���php-code-coverage/Driver/Driver.php��� �Na���3�A��������*���php-code-coverage/Driver/Xdebug3Driver.php�� �Na���T�J�������*���php-code-coverage/Driver/Xdebug2Driver.phpO
2371�� �NaO
2372��=��������)���php-code-coverage/Driver/PhpdbgDriver.php`
2373�� �Na`
2374���WH�������%���php-code-coverage/Driver/Selector.php�	�� �Na�	���6�]�������?���php-code-coverage/StaticAnalysis/CachingCoveredFileAnalyser.php2375�� �Na�
2376����Ȥ������:���php-code-coverage/StaticAnalysis/UncoveredFileAnalyser.php+�� �Na+��B�=�������?���php-code-coverage/StaticAnalysis/ParsingCoveredFileAnalyser.phpF�� �NaF��ia��������B���php-code-coverage/StaticAnalysis/ExecutableLinesFindingVisitor.php
2377�� �Na
2378��z�p{�������*���php-code-coverage/StaticAnalysis/Cache.php6�� �Na6����M`�������;���php-code-coverage/StaticAnalysis/CodeUnitFindingVisitor.php��� �Na�����8��������A���php-code-coverage/StaticAnalysis/ParsingUncoveredFileAnalyser.phpo�� �Nao���㭤������A���php-code-coverage/StaticAnalysis/CachingUncoveredFileAnalyser.php��� �Na����hf��������8���php-code-coverage/StaticAnalysis/CoveredFileAnalyser.phpN�� �NaN���|�֤������?���php-code-coverage/StaticAnalysis/IgnoredLinesFindingVisitor.php��� �Na���v��٤������0���php-code-coverage/StaticAnalysis/CacheWarmer.phpB�� �NaB����J����������php-code-coverage/Version.php��� �Na���CK(*�������"���php-code-coverage/CodeCoverage.php�D�� �Na�D��P�L��������/���php-code-coverage/ProcessedCodeCoverageData.php$�� �Na$���'�������#���php-code-coverage/Report/Crap4j.php��� �Na����+���������!���php-code-coverage/Report/Text.php�'�� �Na�'�����������(���php-code-coverage/Report/Html/Facade.php4�� �Na4����k�������*���php-code-coverage/Report/Html/Renderer.phpU!�� �NaU!����}�������>���php-code-coverage/Report/Html/Renderer/Template/file.html.dist��� �Na�����F��������M���php-code-coverage/Report/Html/Renderer/Template/coverage_bar_branch.html.dist'�� �Na'���O}�������C���php-code-coverage/Report/Html/Renderer/Template/dashboard.html.distG�� �NaG����l�������?���php-code-coverage/Report/Html/Renderer/Template/paths.html.dist��� �Na����*'ݤ������C���php-code-coverage/Report/Html/Renderer/Template/directory.html.dist��� �Na���G�M��������?���php-code-coverage/Report/Html/Renderer/Template/js/nv.d3.min.js�R� �Na�R�<Ms�������:���php-code-coverage/Report/Html/Renderer/Template/js/file.js��� �Na���b�䆤������<���php-code-coverage/Report/Html/Renderer/Template/js/d3.min.jsP� �NaP��hb�������@���php-code-coverage/Report/Html/Renderer/Template/js/popper.min.jsR�� �NaR��Z�\�������@���php-code-coverage/Report/Html/Renderer/Template/js/jquery.min.js�]� �Na�]���=�������C���php-code-coverage/Report/Html/Renderer/Template/js/bootstrap.min.js��� Na�����s�������L���php-code-coverage/Report/Html/Renderer/Template/method_item_branch.html.dist|�� �Na|��A\�������E���php-code-coverage/Report/Html/Renderer/Template/file_branch.html.dist�	�� �Na�	�������������J���php-code-coverage/Report/Html/Renderer/Template/file_item_branch.html.distn�� �Nan�������������?���php-code-coverage/Report/Html/Renderer/Template/lines.html.diste��� �Nae���df�������>���php-code-coverage/Report/Html/Renderer/Template/line.html.dist���� �Na������{�������H���php-code-coverage/Report/Html/Renderer/Template/directory_item.html.distA�� �NaA��ds�������F���php-code-coverage/Report/Html/Renderer/Template/coverage_bar.html.dist'�� �Na'���O}�������E���php-code-coverage/Report/Html/Renderer/Template/method_item.html.dist��� �Na�����s:�������>���php-code-coverage/Report/Html/Renderer/Template/css/custom.css���� �Na���������������E���php-code-coverage/Report/Html/Renderer/Template/css/bootstrap.min.css�r� �Na�r�?�l�������=���php-code-coverage/Report/Html/Renderer/Template/css/style.css��� �Na�����:�������@���php-code-coverage/Report/Html/Renderer/Template/css/octicons.cssX��� �NaX���'#��������A���php-code-coverage/Report/Html/Renderer/Template/css/nv.d3.min.cssX%�� �NaX%���0,�������J���php-code-coverage/Report/Html/Renderer/Template/directory_branch.html.distj�� �Naj���H��������B���php-code-coverage/Report/Html/Renderer/Template/branches.html.dist��� �Na���h2+�������C���php-code-coverage/Report/Html/Renderer/Template/file_item.html.distt�� �Nat�����������O���php-code-coverage/Report/Html/Renderer/Template/directory_item_branch.html.dist;�� �Na;���m�ۤ������J���php-code-coverage/Report/Html/Renderer/Template/dashboard_branch.html.distG�� �NaG����l�������C���php-code-coverage/Report/Html/Renderer/Template/icons/file-code.svg0�� �Na0���QUU�������H���php-code-coverage/Report/Html/Renderer/Template/icons/file-directory.svg���� �Na������Z��������/���php-code-coverage/Report/Html/Renderer/File.phpS��� �NaS�����Y�������4���php-code-coverage/Report/Html/Renderer/Dashboard.phpC �� �NaC ���L�+�������4���php-code-coverage/Report/Html/Renderer/Directory.php �� �Na ����(������� ���php-code-coverage/Report/PHP.php��� �Na����>*\�������1���php-code-coverage/Report/Xml/BuildInformation.php�	�� �Na�	��T3�e�������'���php-code-coverage/Report/Xml/Source.phpz�� �Naz��'�1��������'���php-code-coverage/Report/Xml/Facade.php�!�� �Na�!����P�������'���php-code-coverage/Report/Xml/Method.phpW�� �NaW��
2379�ʤ������'���php-code-coverage/Report/Xml/Report.php	�� �Na	���HC�������%���php-code-coverage/Report/Xml/File.php+�� �Na+��g׃�������'���php-code-coverage/Report/Xml/Totals.php�� �Na��k���������&���php-code-coverage/Report/Xml/Tests.php��� �Na�������������%���php-code-coverage/Report/Xml/Node.php3�� �Na3������������(���php-code-coverage/Report/Xml/Project.phpf�� �Naf��P�e�������)���php-code-coverage/Report/Xml/Coverage.php+�� �Na+���9�E�������*���php-code-coverage/Report/Xml/Directory.php��� �Na���Af��������%���php-code-coverage/Report/Xml/Unit.php��� �Na���Y���������#���php-code-coverage/Report/Clover.php�'�� �Na�'���-���������&���php-code-coverage/Report/Cobertura.php�0�� �Na�0���q��������)���php-code-coverage/RawCodeCoverageData.php��� �Na�����<����������php-code-coverage/CrapIndex.php��� �Na���kS�;����������php-code-coverage/Node/File.phpJ�� �NaJ����K��������"���php-code-coverage/Node/Builder.php��� �Na����q�������#���php-code-coverage/Node/Iterator.php��� �Na���&���������$���php-code-coverage/Node/Directory.phpK$�� �NaK$���m'��������'���php-code-coverage/Node/AbstractNode.php�� �Na���5s�����������php-code-coverage/LICENSE�� �Na��\�T����������php-code-coverage/Directory.php��� �Na����H����������phpunit/Util/Xml.php��� �Na����x�@����������phpunit/Util/GlobalState.php�� �Na��=Ut��������(���phpunit/Util/InvalidDataSetException.php��� Na���1
2380�����������phpunit/Util/Log/JUnit.phpn*�� �Nan*��)�LB����������phpunit/Util/Log/TeamCity.php&�� �Na&��c�������������phpunit/Util/Blacklist.php��� �Na����s������������phpunit/Util/Filter.php��� �Na���l*	����������phpunit/Util/Test.php�]�� �Na�]���������������phpunit/Util/FileLoader.php�	�� �Na�	���Mꖤ������$���phpunit/Util/XmlTestListRenderer.php�	�� �Na�	����Z�������,���phpunit/Util/XdebugFilterScriptGenerator.phpx�� �Nax��=������������phpunit/Util/Filesystem.php�� Na��fޤ������*���phpunit/Util/VersionComparisonOperator.php��� �Na�����`,����������phpunit/Util/Color.php��� �Na������פ������%���phpunit/Util/TextTestListRenderer.php8�� �Na8���>�6�������"���phpunit/Util/RegularExpression.php��� �Na���0uR)����������phpunit/Util/ErrorHandler.php��� �Na���`u�Τ���������phpunit/Util/Exception.php��� �Na�����다������,���phpunit/Util/PHP/Template/TestCaseMethod.tpl2381�� �Na�
2382��m�D�������+���phpunit/Util/PHP/Template/TestCaseClass.tplp
2383�� �Nap
2384��3H݀������*���phpunit/Util/PHP/Template/PhptTestCase.tpl��� �Na���1���������&���phpunit/Util/PHP/WindowsPhpProcess.php��� �Na�����$��������&���phpunit/Util/PHP/DefaultPhpProcess.phpz�� �Naz����Cp�������'���phpunit/Util/PHP/AbstractPhpProcess.php�&�� �Na�&���{99����������phpunit/Util/Printer.php�	�� �Na�	����aV����������phpunit/Util/Type.php��� �Na���܌�*����������phpunit/Util/Json.phpH�� �NaH��A��$�������$���phpunit/Util/Annotation/DocBlock.phpA�� �NaA���.�������$���phpunit/Util/Annotation/Registry.phpL
2385�� �NaL
2386���I�����������phpunit/Util/ExcludeList.php=�� �Na=��(�1m�������!���phpunit/Util/Xml/SchemaFinder.php��� �Na�����S����������phpunit/Util/Xml/Validator.php�� �Na��V�������������phpunit/Util/Xml/Loader.php��� �Na����,?��������%���phpunit/Util/Xml/ValidationResult.php��� �Na���xv:�����������phpunit/Util/Xml/Exception.php��� �Na������Ӥ������0���phpunit/Util/Xml/FailedSchemaDetectionResult.php��� �Na����#S��������*���phpunit/Util/Xml/SchemaDetectionResult.php��� �Na���4χz�������#���phpunit/Util/Xml/SchemaDetector.php-�� �Na-�����������4���phpunit/Util/Xml/SuccessfulSchemaDetectionResult.php'�� �Na'����g�������%���phpunit/Util/Xml/SnapshotNodeList.php��� �Na����`6�������*���phpunit/Util/TestDox/TextResultPrinter.php��� �Na���ȹ!.�������'���phpunit/Util/TestDox/NamePrettifier.php�#�� �Na�#��[�֤������*���phpunit/Util/TestDox/CliTestDoxPrinter.php1*�� �Na1*����Dl�������&���phpunit/Util/TestDox/ResultPrinter.php"�� �Na"��1�q$�������)���phpunit/Util/TestDox/XmlResultPrinter.php��� �Na���y�������'���phpunit/Util/TestDox/TestDoxPrinter.php�)�� �Na�)�����ڤ������*���phpunit/Util/TestDox/HtmlResultPrinter.php2387�� �Na�
2388��t&��������*���phpunit/Runner/StandardTestSuiteLoader.php>
2389�� �Na>
2390��"�u�������"���phpunit/Runner/TestSuiteSorter.php�,�� �Na�,���kڤ������"���phpunit/Runner/TestSuiteLoader.php��� �Na������ޤ������"���phpunit/Runner/TestResultCache.php��� �Na����K�������'���phpunit/Runner/Extension/PharLoader.php�	�� �Na�	��R���������-���phpunit/Runner/Extension/ExtensionHandler.phpz�� �Naz���3Τ������4���phpunit/Runner/Filter/ExcludeGroupFilterIterator.phps�� �Nas��}�
2391Z�������4���phpunit/Runner/Filter/IncludeGroupFilterIterator.phpr�� �Nar��P;AD�������!���phpunit/Runner/Filter/Factory.php��� �Na���d�cΤ������-���phpunit/Runner/Filter/GroupFilterIterator.php��� �Na����=�;�������,���phpunit/Runner/Filter/NameFilterIterator.phpv�� �Nav���Z�����������phpunit/Runner/Version.php�� �Na��k�r3�������)���phpunit/Runner/DefaultTestResultCache.php�� �Na�����W����������phpunit/Runner/Exception.php��� �Na���zZ��������*���phpunit/Runner/Hook/AfterTestErrorHook.php+�� �Na+��	fz�������,���phpunit/Runner/Hook/AfterTestWarningHook.php/�� �Na/��)pԤ������,���phpunit/Runner/Hook/AfterTestFailureHook.php/�� �Na/��u.��������/���phpunit/Runner/Hook/AfterIncompleteTestHook.php5�� �Na5��� ɤ������,���phpunit/Runner/Hook/AfterSkippedTestHook.php/�� �Na/���7�Ԥ������+���phpunit/Runner/Hook/TestListenerAdapter.php��� �Na���\�6E�������*���phpunit/Runner/Hook/AfterRiskyTestHook.php+�� �Na+��5ÿ��������+���phpunit/Runner/Hook/BeforeFirstTestHook.php��� �Na���?]{դ������/���phpunit/Runner/Hook/AfterSuccessfulTestHook.php$�� �Na$���]�O������� ���phpunit/Runner/Hook/TestHook.php��� �Na���a��B�������&���phpunit/Runner/Hook/BeforeTestHook.php�� �Na����R
2392�������%���phpunit/Runner/Hook/AfterTestHook.php��� �Na����3uݤ���������phpunit/Runner/Hook/Hook.php��� �Na������b�������)���phpunit/Runner/Hook/AfterLastTestHook.php��� �Na���
2393"ܤ������&���phpunit/Runner/NullTestResultCache.php��� �Na����W<�����������phpunit/Runner/PhptTestCase.phpWV�� �NaWV���T_y�������!���phpunit/Runner/BaseTestRunner.php2394�� �Na2395��C
2396+�������'���phpunit/Runner/ResultCacheExtension.php<�� �Na<���6_�������A���phpunit/TextUI/XmlConfiguration/Group/GroupCollectionIterator.phpA�� �NaA��8�%��������9���phpunit/TextUI/XmlConfiguration/Group/GroupCollection.php��� �Na����k������0���phpunit/TextUI/XmlConfiguration/Group/Groups.php��� �Na�������������/���phpunit/TextUI/XmlConfiguration/Group/Group.php��� �Na���EL��������-���phpunit/TextUI/XmlConfiguration/Generator.php��� �Na���F�	��������0���phpunit/TextUI/XmlConfiguration/Logging/Text.php��� �Na���-�30�������1���phpunit/TextUI/XmlConfiguration/Logging/Junit.php��� �Na���z珥�������3���phpunit/TextUI/XmlConfiguration/Logging/Logging.php2397�� �Na2398��d4��������4���phpunit/TextUI/XmlConfiguration/Logging/TeamCity.php��� �Na����m��������7���phpunit/TextUI/XmlConfiguration/Logging/TestDox/Xml.php��� �Na����o��������8���phpunit/TextUI/XmlConfiguration/Logging/TestDox/Html.php��� �Na���}�7�������8���phpunit/TextUI/XmlConfiguration/Logging/TestDox/Text.php��� �Na���*Jj�������J���phpunit/TextUI/XmlConfiguration/Filesystem/DirectoryCollectionIterator.phpo�� �Nao��\�V�������B���phpunit/TextUI/XmlConfiguration/Filesystem/DirectoryCollection.php��� �Na���V9��������3���phpunit/TextUI/XmlConfiguration/Filesystem/File.php��� �Na��������������E���phpunit/TextUI/XmlConfiguration/Filesystem/FileCollectionIterator.php7�� �Na7���te7�������=���phpunit/TextUI/XmlConfiguration/Filesystem/FileCollection.phpC�� NaC�����������8���phpunit/TextUI/XmlConfiguration/Filesystem/Directory.php��� �Na���s��O�������*���phpunit/TextUI/XmlConfiguration/Loader.php̗�� �Na̗��m_|`�������1���phpunit/TextUI/XmlConfiguration/Configuration.php2�� �Na2���N'Ƥ������3���phpunit/TextUI/XmlConfiguration/PHPUnit/PHPUnit.phpiC�� �NaiC�� ��6�������5���phpunit/TextUI/XmlConfiguration/PHPUnit/Extension.php��� �Na����
2399J.�������?���phpunit/TextUI/XmlConfiguration/PHPUnit/ExtensionCollection.php��� �Na���ܔ��������G���phpunit/TextUI/XmlConfiguration/PHPUnit/ExtensionCollectionIterator.phpi�� �Nai���o�(�������7���phpunit/TextUI/XmlConfiguration/TestSuite/TestSuite.php�� �Na������������;���phpunit/TextUI/XmlConfiguration/TestSuite/TestDirectory.php@�� �Na@��)�e��������I���phpunit/TextUI/XmlConfiguration/TestSuite/TestSuiteCollectionIterator.phpi�� �Nai��� #��������6���phpunit/TextUI/XmlConfiguration/TestSuite/TestFile.php��� �Na���	��������E���phpunit/TextUI/XmlConfiguration/TestSuite/TestDirectoryCollection.php��� �Na����4X��������A���phpunit/TextUI/XmlConfiguration/TestSuite/TestSuiteCollection.php��� �Na���CS�������H���phpunit/TextUI/XmlConfiguration/TestSuite/TestFileCollectionIterator.phpG�� �NaG��w��Ǥ������@���phpunit/TextUI/XmlConfiguration/TestSuite/TestFileCollection.php_�� �Na_��.+ޤ������M���phpunit/TextUI/XmlConfiguration/TestSuite/TestDirectoryCollectionIterator.php�� �Na��yp��������S���phpunit/TextUI/XmlConfiguration/CodeCoverage/Filter/DirectoryCollectionIterator.php��� �Na�����je�������K���phpunit/TextUI/XmlConfiguration/CodeCoverage/Filter/DirectoryCollection.php��� �Na���Q4X�������A���phpunit/TextUI/XmlConfiguration/CodeCoverage/Filter/Directory.php��� �Na����ϕ�������=���phpunit/TextUI/XmlConfiguration/CodeCoverage/CodeCoverage.php��� Na����c%��������=���phpunit/TextUI/XmlConfiguration/CodeCoverage/FilterMapper.php��� Na���}ݚ��������;���phpunit/TextUI/XmlConfiguration/CodeCoverage/Report/Xml.php��� �Na�����8�������;���phpunit/TextUI/XmlConfiguration/CodeCoverage/Report/Php.php��� �Na���N_A��������<���phpunit/TextUI/XmlConfiguration/CodeCoverage/Report/Html.php��� �Na���ڴQ�������>���phpunit/TextUI/XmlConfiguration/CodeCoverage/Report/Crap4j.php��� �Na���ca�Ѥ������<���phpunit/TextUI/XmlConfiguration/CodeCoverage/Report/Text.php��� �Na������������>���phpunit/TextUI/XmlConfiguration/CodeCoverage/Report/Clover.php��� �Na���:�
2400�������A���phpunit/TextUI/XmlConfiguration/CodeCoverage/Report/Cobertura.php��� �Na���"�e��������-���phpunit/TextUI/XmlConfiguration/Exception.php��� �Na���N�5+�������+���phpunit/TextUI/XmlConfiguration/PHP/Php.php�� �Na�����������:���phpunit/TextUI/XmlConfiguration/PHP/VariableCollection.php-�� �Na-���c��������0���phpunit/TextUI/XmlConfiguration/PHP/Variable.php��� �Na���\�M,�������B���phpunit/TextUI/XmlConfiguration/PHP/ConstantCollectionIterator.php_�� �Na_���4V��������D���phpunit/TextUI/XmlConfiguration/PHP/IniSettingCollectionIterator.phps�� �Nas��iBt�������<���phpunit/TextUI/XmlConfiguration/PHP/IniSettingCollection.phpM�� �NaM��B�1�������2���phpunit/TextUI/XmlConfiguration/PHP/PhpHandler.phpy�� �Nay���]�b�������0���phpunit/TextUI/XmlConfiguration/PHP/Constant.php4�� �Na4��,-�q�������B���phpunit/TextUI/XmlConfiguration/PHP/VariableCollectionIterator.php_�� �Na_����K�������:���phpunit/TextUI/XmlConfiguration/PHP/ConstantCollection.php-�� �Na-��U%��������2���phpunit/TextUI/XmlConfiguration/PHP/IniSetting.phpG�� �NaG���T+�������6���phpunit/TextUI/XmlConfiguration/Migration/Migrator.php��� �Na���o$�V�������G���phpunit/TextUI/XmlConfiguration/Migration/MigrationBuilderException.php�� �Na��UWĝ�������d���phpunit/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromFilterWhitelistToCoverage.php��� �Na���U%5��������Y���phpunit/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromRootToCoverage.phpC�� �NaC����cF�������S���phpunit/TextUI/XmlConfiguration/Migration/Migrations/RemoveCacheTokensAttribute.php��� �Na����w���������H���phpunit/TextUI/XmlConfiguration/Migration/Migrations/ConvertLogTypes.php��� �Na���hoe�������O���phpunit/TextUI/XmlConfiguration/Migration/Migrations/CoverageCloverToReport.phpX�� �NaX��ij��������L���phpunit/TextUI/XmlConfiguration/Migration/Migrations/CoveragePhpToReport.phpF�� �NaF����^Ӥ������B���phpunit/TextUI/XmlConfiguration/Migration/Migrations/Migration.php��� �Na���'����������Q���phpunit/TextUI/XmlConfiguration/Migration/Migrations/UpdateSchemaLocationTo93.php��� �Na����bJ�������O���phpunit/TextUI/XmlConfiguration/Migration/Migrations/CoverageCrap4jToReport.php��� �Na���$�i'�������Q���phpunit/TextUI/XmlConfiguration/Migration/Migrations/IntroduceCoverageElement.php��� �Na���U���������J���phpunit/TextUI/XmlConfiguration/Migration/Migrations/RemoveEmptyFilter.php{�� �Na{����K�������[���phpunit/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistDirectoriesToCoverage.php��� �Na���†踤������G���phpunit/TextUI/XmlConfiguration/Migration/Migrations/RemoveLogTypes.php&�� �Na&���q3{�������M���phpunit/TextUI/XmlConfiguration/Migration/Migrations/CoverageHtmlToReport.php��� �Na���Մj��������M���phpunit/TextUI/XmlConfiguration/Migration/Migrations/LogToReportMigration.php��� �Na�����U�������M���phpunit/TextUI/XmlConfiguration/Migration/Migrations/CoverageTextToReport.php��� �Na����V_�������X���phpunit/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistExcludesToCoverage.php}�� �Na}���
2401�������L���phpunit/TextUI/XmlConfiguration/Migration/Migrations/CoverageXmlToReport.phpK�� �NaK����_
2402�������>���phpunit/TextUI/XmlConfiguration/Migration/MigrationBuilder.php#	�� �Na#	��g���������@���phpunit/TextUI/XmlConfiguration/Migration/MigrationException.php��� �Na���\Z�����������phpunit/TextUI/Help.php�.�� �Na�.��%������������phpunit/TextUI/TestRunner.php���� �Na��������������6���phpunit/TextUI/Exception/TestFileNotFoundException.php��� �Na�����pC�������0���phpunit/TextUI/Exception/ReflectionException.php��� �Na��� Y���������-���phpunit/TextUI/Exception/RuntimeException.php��� �Na�����F�������;���phpunit/TextUI/Exception/TestDirectoryNotFoundException.php��� �Na������������&���phpunit/TextUI/Exception/Exception.php��� �Na���D{i������� ���phpunit/TextUI/ResultPrinter.phpp�� �Nap�����ܤ������'���phpunit/TextUI/DefaultResultPrinter.php67�� �Na67��l���������&���phpunit/TextUI/CliArguments/Mapper.php+,�� �Na+,��'a���������-���phpunit/TextUI/CliArguments/Configuration.php��� �Na����0��������'���phpunit/TextUI/CliArguments/Builder.php�T�� �Na�T��6�6�������)���phpunit/TextUI/CliArguments/Exception.php��� �Na���%�zE����������phpunit/TextUI/Command.php&f�� �Na&f������������"���phpunit/TextUI/TestSuiteMapper.php
2403�� �Na
2404��A�+8�������#���phpunit/Framework/ErrorTestCase.php�� �Na����̤������!���phpunit/Framework/SkippedTest.php��� �Na���S�.����������phpunit/Framework/TestSuite.php�b�� �Na�b���!S��������+���phpunit/Framework/DataProviderTestSuite.php�� �Na��\8�������$���phpunit/Framework/IncompleteTest.php��� �Na���,+��������!���phpunit/Framework/TestFailure.php��� �Na���'�q��������%���phpunit/Framework/SkippedTestCase.php��� �Na����l�]�������8���phpunit/Framework/Exception/PHPTAssertionFailedError.php4�� �Na4��#M�������S���phpunit/Framework/Exception/ComparisonMethodDoesNotAcceptParameterTypeException.phpl�� �Nal��.~2��������5���phpunit/Framework/Exception/SyntheticSkippedError.php��� �Na�����ԗ�������E���phpunit/Framework/Exception/ComparisonMethodDoesNotExistException.php0�� �Na0��}�c�������+���phpunit/Framework/Exception/OutputError.php��� �Na�������������3���phpunit/Framework/Exception/IncompleteTestError.php��� �Na���ם�ܤ������5���phpunit/Framework/Exception/CodeCoverageException.php��� �Na�����[�������.���phpunit/Framework/Exception/RiskyTestError.php��� �Na���*�y�������%���phpunit/Framework/Exception/Error.php��� �Na����j�1�������0���phpunit/Framework/Exception/SkippedTestError.php��� �Na���
2405O~�������?���phpunit/Framework/Exception/CoveredCodeNotExecutedException.php��� �Na���8Y�Ф������9���phpunit/Framework/Exception/NoChildTestSuiteException.php��� �Na���P�$�������'���phpunit/Framework/Exception/Warning.php��� �Na����8;��������Z���phpunit/Framework/Exception/ComparisonMethodDoesNotDeclareExactlyOneParameterException.php]�� �Na]��N�s~�������:���phpunit/Framework/Exception/ExpectationFailedException.php��� �Na����g�٤������5���phpunit/Framework/Exception/SkippedTestSuiteError.php��� �Na���x���������@���phpunit/Framework/Exception/MissingCoversAnnotationException.php��� �Na���|��������A���phpunit/Framework/Exception/ActualValueIsNotAnObjectException.php��� �Na���i�Op�������.���phpunit/Framework/Exception/SyntheticError.php5�� �Na5��K�Y�������?���phpunit/Framework/Exception/UnintentionallyCoveredCodeError.php��� �Na������������<���phpunit/Framework/Exception/InvalidDataProviderException.php��� �Na���.ڜɤ������)���phpunit/Framework/Exception/Exception.php�	�� �Na�	���w�������4���phpunit/Framework/Exception/AssertionFailedError.php��� �Na�������������U���phpunit/Framework/Exception/ComparisonMethodDoesNotDeclareBoolReturnTypeException.phpS�� �NaS��zGt}�������<���phpunit/Framework/Exception/InvalidCoversTargetException.php��� �Na���o�苤������T���phpunit/Framework/Exception/ComparisonMethodDoesNotDeclareParameterTypeException.php[�� �Na[��]�8A�������8���phpunit/Framework/Exception/InvalidArgumentException.php �� �Na ������������&���phpunit/Framework/Assert/Functions.phpa�� �Naa���������������phpunit/Framework/Test.php~�� �Na~��wt����������phpunit/Framework/Assert.phppR� �NapR�4b��������'���phpunit/Framework/TestSuiteIterator.php��� �Na������������%���phpunit/Framework/MockObject/Stub.php�� �Na��Ŏ��������*���phpunit/Framework/MockObject/MockClass.php��� �Na����'C��������)���phpunit/Framework/MockObject/MockType.php��� �Na���FFt�������8���phpunit/Framework/MockObject/Builder/MethodNameMatch.phpw�� �Naw���Ty�������-���phpunit/Framework/MockObject/Builder/Stub.php�� �Na����(�������:���phpunit/Framework/MockObject/Builder/InvocationStubber.php��� �Na�������������1���phpunit/Framework/MockObject/Builder/Identity.php��� �Na������������8���phpunit/Framework/MockObject/Builder/ParametersMatch.php��� �Na����ڃ�������9���phpunit/Framework/MockObject/Builder/InvocationMocker.php �� �Na ���bK�������L���phpunit/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.php��� �Na���z�'��������Y���phpunit/Framework/MockObject/Exception/ConfigurableMethodsAlreadyInitializedException.php �� �Na ��ɅW�������F���phpunit/Framework/MockObject/Exception/ClassAlreadyExistsException.php��� �Na�������������L���phpunit/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php!�� �Na!��$�ہ�������K���phpunit/Framework/MockObject/Exception/IncompatibleReturnValueException.php��� �Na����8=�������M���phpunit/Framework/MockObject/Exception/SoapExtensionNotAvailableException.php��� Na������z�������G���phpunit/Framework/MockObject/Exception/CannotUseAddMethodsException.php5�� �Na5����{�������U���phpunit/Framework/MockObject/Exception/MethodParametersAlreadyConfiguredException.php��� �Na���	r��������H���phpunit/Framework/MockObject/Exception/MatchBuilderNotFoundException.php��� �Na������������Y���phpunit/Framework/MockObject/Exception/OriginalConstructorInvocationRequiredException.php��� �Na���ک���������?���phpunit/Framework/MockObject/Exception/UnknownTypeException.php��� �Na����~���������H���phpunit/Framework/MockObject/Exception/CannotUseOnlyMethodsException.phpE�� �NaE�����������>���phpunit/Framework/MockObject/Exception/ReflectionException.php�� �Na��.ؔ��������@���phpunit/Framework/MockObject/Exception/UnknownClassException.php��� �Na���5u�W�������;���phpunit/Framework/MockObject/Exception/RuntimeException.php��� �Na�����_|�������A���phpunit/Framework/MockObject/Exception/BadMethodCallException.php�� �Na��Ϋ�X�������O���phpunit/Framework/MockObject/Exception/MethodNameAlreadyConfiguredException.php��� �Na���ӁƤ������4���phpunit/Framework/MockObject/Exception/Exception.php��� �Na���B��'�������@���phpunit/Framework/MockObject/Exception/UnknownTraitException.php��� �Na���q¥��������L���phpunit/Framework/MockObject/Exception/MethodCannotBeConfiguredException.php�� �Na��}Q���������K���phpunit/Framework/MockObject/Exception/MethodNameNotConfiguredException.php~�� �Na~���x1)�������C���phpunit/Framework/MockObject/Exception/DuplicateMethodException.php��� �Na������_�������E���phpunit/Framework/MockObject/Exception/InvalidMethodNameException.php��� �Na��� ��ܤ������@���phpunit/Framework/MockObject/Exception/ClassIsFinalException.php��� �Na����(�)�������5���phpunit/Framework/MockObject/Stub/ReturnReference.php�� �Na���f���������*���phpunit/Framework/MockObject/Stub/Stub.php3�� �Na3��>+��������4���phpunit/Framework/MockObject/Stub/ReturnValueMap.php��� �Na������ۤ������4���phpunit/Framework/MockObject/Stub/ReturnCallback.php��� �Na���D0Ӥ������0���phpunit/Framework/MockObject/Stub/ReturnSelf.php4�� �Na4���DD��������/���phpunit/Framework/MockObject/Stub/Exception.php(�� �Na(���J��������4���phpunit/Framework/MockObject/Stub/ReturnArgument.php�� �Na��?�}6�������0���phpunit/Framework/MockObject/Stub/ReturnStub.php��� �Na������������6���phpunit/Framework/MockObject/Stub/ConsecutiveCalls.php
2406�� �Na
2407�����.�������*���phpunit/Framework/MockObject/Generator.phpw�� �Naw��4Iɇ�������=���phpunit/Framework/MockObject/Generator/mocked_method_void.tpl�� �Na���p�������7���phpunit/Framework/MockObject/Generator/mocked_class.tpl���� �Na�����wZ�������8���phpunit/Framework/MockObject/Generator/mocked_method.tplF�� �NaF����K�������6���phpunit/Framework/MockObject/Generator/wsdl_method.tpl<��� �Na<�����i��������5���phpunit/Framework/MockObject/Generator/wsdl_class.tpl���� �Na��������������9���phpunit/Framework/MockObject/Generator/proxied_method.tpl}�� �Na}��@�ė�������>���phpunit/Framework/MockObject/Generator/proxied_method_void.tplv�� �Nav����T�������?���phpunit/Framework/MockObject/Generator/mocked_static_method.tpl���� �Na���� 4�R�������6���phpunit/Framework/MockObject/Generator/trait_class.tplQ��� �NaQ����<�Ȥ������6���phpunit/Framework/MockObject/Generator/deprecation.tpl;��� �Na;���O5s�������,���phpunit/Framework/MockObject/MockBuilder.php=+�� Na=+��B�5��������.���phpunit/Framework/MockObject/MockMethodSet.php8�� Na8��G��\�������+���phpunit/Framework/MockObject/Invocation.php��� �Na�������������+���phpunit/Framework/MockObject/MockMethod.php�)�� �Na�)���ޙ�������5���phpunit/Framework/MockObject/MethodNameConstraint.php
2408�� �Na
2409���A1|�������;���phpunit/Framework/MockObject/Rule/ConsecutiveParameters.phpl
2410�� �Nal
2411���z'%�������0���phpunit/Framework/MockObject/Rule/MethodName.php��� �Na����
2412WG�������4���phpunit/Framework/MockObject/Rule/InvokedAtIndex.php)�� �Na)���A���������3���phpunit/Framework/MockObject/Rule/AnyParameters.php��� �Na���~'��������5���phpunit/Framework/MockObject/Rule/InvocationOrder.php��� �Na����LDӤ������8���phpunit/Framework/MockObject/Rule/InvokedAtLeastOnce.php-�� �Na-���
2413�(�������8���phpunit/Framework/MockObject/Rule/InvokedAtMostCount.php��� �Na����gY�������9���phpunit/Framework/MockObject/Rule/InvokedAtLeastCount.php��� �Na����B��������5���phpunit/Framework/MockObject/Rule/AnyInvokedCount.phpj�� �Naj����`Ť������4���phpunit/Framework/MockObject/Rule/ParametersRule.phpc�� �Nac��?�(�������2���phpunit/Framework/MockObject/Rule/InvokedCount.php�	�� �Na�	��^��������0���phpunit/Framework/MockObject/Rule/Parameters.phpQ�� �NaQ��`g|��������*���phpunit/Framework/MockObject/MockTrait.php��� �Na���&�������3���phpunit/Framework/MockObject/ConfigurableMethod.php��� �Na����������+���phpunit/Framework/MockObject/Verifiable.php��� �Na���̐s�������+���phpunit/Framework/MockObject/Api/Method.php��� �Na�������������(���phpunit/Framework/MockObject/Api/Api.php��� �Na����s��������6���phpunit/Framework/MockObject/Api/MockedCloneMethod.php*�� �Na*����?z�������8���phpunit/Framework/MockObject/Api/UnmockedCloneMethod.phpG�� �NaG���ө�������(���phpunit/Framework/MockObject/Matcher.phpB�� �NaB����*�������2���phpunit/Framework/MockObject/InvocationHandler.php:�� �Na:����ˤ������+���phpunit/Framework/MockObject/MockObject.php��� �Na�����bt�������$���phpunit/Framework/SelfDescribing.php
2414�� �Na
2415�����s����������phpunit/Framework/TestCase.php�"� �Na�"�`�q��������%���phpunit/Framework/WarningTestCase.php$�� �Na$���������4���phpunit/Framework/InvalidParameterGroupException.php��� �Na�������������;���phpunit/Framework/Constraint/Exception/ExceptionMessage.php��� �Na���w�;�������8���phpunit/Framework/Constraint/Exception/ExceptionCode.php��� �Na���iأ�������L���phpunit/Framework/Constraint/Exception/ExceptionMessageRegularExpression.php��� �Na���Lj[i�������4���phpunit/Framework/Constraint/Exception/Exception.php��� �Na���Ru�{�������8���phpunit/Framework/Constraint/Operator/BinaryOperator.php)�� �Na)��O��w�������4���phpunit/Framework/Constraint/Operator/LogicalXor.php$�� �Na$��O�������4���phpunit/Framework/Constraint/Operator/LogicalNot.php��� �Na�������������7���phpunit/Framework/Constraint/Operator/UnaryOperator.php
2416�� �Na
2417����a�������2���phpunit/Framework/Constraint/Operator/Operator.php&�� �Na&���
2418������3���phpunit/Framework/Constraint/Operator/LogicalOr.php��� �Na������Z�������4���phpunit/Framework/Constraint/Operator/LogicalAnd.php�� �Na���bJ��������6���phpunit/Framework/Constraint/Filesystem/FileExists.phpe�� �Nae��K���������6���phpunit/Framework/Constraint/Filesystem/IsWritable.phpe�� �Nae�����������;���phpunit/Framework/Constraint/Filesystem/DirectoryExists.phpj�� �Naj���i+��������6���phpunit/Framework/Constraint/Filesystem/IsReadable.phpe�� �Nae����1��������/���phpunit/Framework/Constraint/Boolean/IsTrue.php��� �Na�����}�������0���phpunit/Framework/Constraint/Boolean/IsFalse.php��� �Na��������������?���phpunit/Framework/Constraint/Equality/IsEqualCanonicalizing.php2419�� �Na2420���~��������=���phpunit/Framework/Constraint/Equality/IsEqualIgnoringCase.php�
2421�� �Na2422���C\�������:���phpunit/Framework/Constraint/Equality/IsEqualWithDelta.php
2423�� �Na
2424����6��������1���phpunit/Framework/Constraint/Equality/IsEqual.php��� �Na�����Ӥ������)���phpunit/Framework/Constraint/Callback.php?�� �Na?���
2425b�������+���phpunit/Framework/Constraint/IsAnything.php��� �Na����E���������+���phpunit/Framework/Constraint/Math/IsNan.php��� �Na���4�g0�������.���phpunit/Framework/Constraint/Math/IsFinite.php��� �Na����������0���phpunit/Framework/Constraint/Math/IsInfinite.php��� �Na���'*~��������2���phpunit/Framework/Constraint/Cardinality/Count.phpj
2426�� �Naj
2427��xR@ؤ������8���phpunit/Framework/Constraint/Cardinality/GreaterThan.php��� �Na���h,d}�������4���phpunit/Framework/Constraint/Cardinality/IsEmpty.php��� �Na����hf�������5���phpunit/Framework/Constraint/Cardinality/LessThan.php��� �Na���aT�������5���phpunit/Framework/Constraint/Cardinality/SameSize.php_�� �Na_��u��Ť������,���phpunit/Framework/Constraint/IsIdentical.php��� �Na����O���������4���phpunit/Framework/Constraint/Object/ObjectEquals.php
2428�� �Na
2429��0�W�������:���phpunit/Framework/Constraint/Object/ObjectHasAttribute.php[�� �Na[��F��m�������9���phpunit/Framework/Constraint/Object/ClassHasAttribute.phpn�� �Nan��9��<�������?���phpunit/Framework/Constraint/Object/ClassHasStaticAttribute.php��� �Na���dR��������8���phpunit/Framework/Constraint/Traversable/ArrayHasKey.php��� �Na���6�@!�������I���phpunit/Framework/Constraint/Traversable/TraversableContainsIdentical.php'�� �Na'��s��Ӥ������@���phpunit/Framework/Constraint/Traversable/TraversableContains.php�� �Na������������E���phpunit/Framework/Constraint/Traversable/TraversableContainsEqual.phpa�� �Naa��wA��������D���phpunit/Framework/Constraint/Traversable/TraversableContainsOnly.php	�� �Na	��R������+���phpunit/Framework/Constraint/Constraint.phpc"�� �Nac"���e�@�������@���phpunit/Framework/Constraint/JsonMatchesErrorMessageProvider.php;�� �Na;���������,���phpunit/Framework/Constraint/JsonMatches.phpz�� �Naz��'�R��������F���phpunit/Framework/Constraint/String/StringMatchesFormatDescription.php2430�� �Na2431��1���������.���phpunit/Framework/Constraint/String/IsJson.php��� �Na����\@�������8���phpunit/Framework/Constraint/String/StringStartsWith.phpB�� �NaB�����ߤ������6���phpunit/Framework/Constraint/String/StringContains.php��� �Na���ij"��������9���phpunit/Framework/Constraint/String/RegularExpression.php��� �Na���+�J��������6���phpunit/Framework/Constraint/String/StringEndsWith.php��� �Na���{���������,���phpunit/Framework/Constraint/Type/IsNull.php��� �Na�����?)�������,���phpunit/Framework/Constraint/Type/IsType.php��� �Na���G��Ȥ������2���phpunit/Framework/Constraint/Type/IsInstanceOf.php:�� �Na:���@��������.���phpunit/Framework/ExecutionOrderDependency.php�� �Na��R-2432�������"���phpunit/Framework/TestListener.php�	�� �Na�	���b��������!���phpunit/Framework/TestBuilder.php"�� �Na"���14j������� ���phpunit/Framework/TestResult.phpC|�� �NaC|��d$���������!���phpunit/Framework/Reorderable.php��� �Na����z�0�������7���phpunit/Framework/TestListenerDefaultImplementation.php$�� �Na$���C���������!���phpunit/Framework/Error/Error.phpl�� �Nal�����]�������#���phpunit/Framework/Error/Warning.phpw�� �Naw����G�������&���phpunit/Framework/Error/Deprecated.phpz�� �Naz����V�������"���phpunit/Framework/Error/Notice.phpv�� �Nav�����ˤ������&���phpunit/Framework/ExceptionWrapper.php��� �Na������m�������(���phpunit/Framework/IncompleteTestCase.php��� �Na�����I
2433����������phpunit/Exception.php��� �Na���a��#����������sebastian-exporter/Exporter.phpy"�� �Nay"���O�����������sebastian-exporter/LICENSE�� �Na��螷ͤ���������php-file-iterator/Facade.php*
2434�� �Na*
2435���K�����������php-file-iterator/Factory.php��� �Na���{�0Ԥ���������php-file-iterator/Iterator.phpZ�� �NaZ��C܎����������php-file-iterator/LICENSE�� �Na����.�������/���phpspec-prophecy/Prophecy/Prophecy/Revealer.php��� �Na���	�m��������5���phpspec-prophecy/Prophecy/Prophecy/MethodProphecy.php29�� �Na29��S���������8���phpspec-prophecy/Prophecy/Prophecy/RevealerInterface.phpG�� �NaG���WnZ�������?���phpspec-prophecy/Prophecy/Prophecy/ProphecySubjectInterface.php��� �Na���<��������8���phpspec-prophecy/Prophecy/Prophecy/ProphecyInterface.php+�� �Na+����X�������5���phpspec-prophecy/Prophecy/Prophecy/ObjectProphecy.php��� �Na�����#=�������&���phpspec-prophecy/Prophecy/Argument.php��� Na����n���������-���phpspec-prophecy/Prophecy/Util/StringUtil.php2436�� �Na2437��S���������-���phpspec-prophecy/Prophecy/Util/ExportUtil.phpb�� �Nab������������B���phpspec-prophecy/Prophecy/Exception/Prophecy/ProphecyException.php��� �Na���D�7j�������H���phpspec-prophecy/Prophecy/Exception/Prophecy/MethodProphecyException.phpA�� �NaA�����c�������H���phpspec-prophecy/Prophecy/Exception/Prophecy/ObjectProphecyException.php2�� �Na2�����e�������P���phpspec-prophecy/Prophecy/Exception/Prediction/UnexpectedCallsCountException.php#�� �Na#�����ߤ������K���phpspec-prophecy/Prophecy/Exception/Prediction/UnexpectedCallsException.phpF�� �NaF���|�b�������L���phpspec-prophecy/Prophecy/Exception/Prediction/FailedPredictionException.phpg�� �Nag��3'}}�������E���phpspec-prophecy/Prophecy/Exception/Prediction/AggregateException.php8�� �Na8��
2438�.ڤ������C���phpspec-prophecy/Prophecy/Exception/Prediction/NoCallsException.php��� �Na����Z�������F���phpspec-prophecy/Prophecy/Exception/Prediction/PredictionException.php��� �Na���R2ͤ������D���phpspec-prophecy/Prophecy/Exception/Call/UnexpectedCallException.php��� �Na����}�������1���phpspec-prophecy/Prophecy/Exception/Exception.php��� �Na���x��������G���phpspec-prophecy/Prophecy/Exception/Doubler/MethodNotFoundException.php��� �Na����e:��������F���phpspec-prophecy/Prophecy/Exception/Doubler/ClassNotFoundException.php��� �Na����>��������D���phpspec-prophecy/Prophecy/Exception/Doubler/ClassMirrorException.php��� �Na���b��������@���phpspec-prophecy/Prophecy/Exception/Doubler/DoublerException.php��� �Na���h���������J���phpspec-prophecy/Prophecy/Exception/Doubler/InterfaceNotFoundException.php��� �Na���&�q�������J���phpspec-prophecy/Prophecy/Exception/Doubler/ReturnByReferenceException.php��� �Na���0+5,�������L���phpspec-prophecy/Prophecy/Exception/Doubler/MethodNotExtendableException.php��� �Na�����[��������?���phpspec-prophecy/Prophecy/Exception/Doubler/DoubleException.php��� �Na���V�"^�������E���phpspec-prophecy/Prophecy/Exception/Doubler/ClassCreatorException.php��� �Na���r����������@���phpspec-prophecy/Prophecy/Exception/InvalidArgumentException.php��� �Na������������6���phpspec-prophecy/Prophecy/Promise/PromiseInterface.phpI�� �NaI��yv��������2���phpspec-prophecy/Prophecy/Promise/ThrowPromise.php%�� �Na%����Q3�������3���phpspec-prophecy/Prophecy/Promise/ReturnPromise.php%�� �Na%�����&�������;���phpspec-prophecy/Prophecy/Promise/ReturnArgumentPromise.php
2439�� �Na
2440���,�s�������5���phpspec-prophecy/Prophecy/Promise/CallbackPromise.php��� �Na���Ԍ�Ӥ������;���phpspec-prophecy/Prophecy/Prediction/CallbackPrediction.php��� �Na���~�*��������7���phpspec-prophecy/Prophecy/Prediction/CallPrediction.phpZ�� �NaZ��%��U�������<���phpspec-prophecy/Prophecy/Prediction/CallTimesPrediction.php2441�� �Na2442��#c��������<���phpspec-prophecy/Prophecy/Prediction/PredictionInterface.php��� �Na����v�������:���phpspec-prophecy/Prophecy/Prediction/NoCallsPrediction.php��� �Na����ܼ�������C���phpspec-prophecy/Prophecy/PhpDocumentor/LegacyClassTagRetriever.php��� �Na���|6��������G���phpspec-prophecy/Prophecy/PhpDocumentor/MethodTagRetrieverInterface.php��� �Na������1�������=���phpspec-prophecy/Prophecy/PhpDocumentor/ClassTagRetriever.php��� Na���@��%�������I���phpspec-prophecy/Prophecy/PhpDocumentor/ClassAndInterfaceTagRetriever.php��� �Na������Ƥ������-���phpspec-prophecy/Prophecy/Call/CallCenter.php��� �Na���ɝ.�������'���phpspec-prophecy/Prophecy/Call/Call.phpc
2443�� �Nac
2444��ڟJ�������;���phpspec-prophecy/Prophecy/Comparator/ProphecyComparator.php|�� �Na|���b�������0���phpspec-prophecy/Prophecy/Comparator/Factory.php�� �Na��8!
2445Ԥ������:���phpspec-prophecy/Prophecy/Comparator/ClosureComparator.php��� �Na���W��p�������%���phpspec-prophecy/Prophecy/Prophet.phpE�� �NaE���:.b�������3���phpspec-prophecy/Prophecy/Doubler/NameGenerator.php��� �Na�����d��������0���phpspec-prophecy/Prophecy/Doubler/LazyDouble.php��� �Na�������������3���phpspec-prophecy/Prophecy/Doubler/CachedDoubler.php��� �Na���Od\��������5���phpspec-prophecy/Prophecy/Doubler/DoubleInterface.php��� �Na���B��ۤ������A���phpspec-prophecy/Prophecy/Doubler/Generator/TypeHintReference.php��� �Na�����i��������B���phpspec-prophecy/Prophecy/Doubler/Generator/ClassCodeGenerator.php��� �Na���<XѤ������<���phpspec-prophecy/Prophecy/Doubler/Generator/ClassCreator.php��� �Na���扴��������C���phpspec-prophecy/Prophecy/Doubler/Generator/Node/ReturnTypeNode.php��� �Na���,�X;�������E���phpspec-prophecy/Prophecy/Doubler/Generator/Node/ArgumentTypeNode.php���� �Na�������ˤ������E���phpspec-prophecy/Prophecy/Doubler/Generator/Node/TypeNodeAbstract.php�	�� �Na�	���#&�������>���phpspec-prophecy/Prophecy/Doubler/Generator/Node/ClassNode.php�� �Na��"B�(�������?���phpspec-prophecy/Prophecy/Doubler/Generator/Node/MethodNode.phpo�� �Nao���}-�������A���phpspec-prophecy/Prophecy/Doubler/Generator/Node/ArgumentNode.phpz�� �Naz��C��i�������;���phpspec-prophecy/Prophecy/Doubler/Generator/ClassMirror.php��� �Na������t�������C���phpspec-prophecy/Prophecy/Doubler/Generator/ReflectionInterface.php��� �Na���	Y�������-���phpspec-prophecy/Prophecy/Doubler/Doubler.php5�� �Na5�����5�������?���phpspec-prophecy/Prophecy/Doubler/ClassPatch/ThrowablePatch.php	�� �Na	��83���������H���phpspec-prophecy/Prophecy/Doubler/ClassPatch/DisableConstructorPatch.php��� �Na�������������?���phpspec-prophecy/Prophecy/Doubler/ClassPatch/MagicCallPatch.php��� �Na���Q)�7�������D���phpspec-prophecy/Prophecy/Doubler/ClassPatch/ClassPatchInterface.phph�� �Nah���q!ʤ������E���phpspec-prophecy/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php��� �Na����/��������A���phpspec-prophecy/Prophecy/Doubler/ClassPatch/SplFileInfoPatch.phpi�� �Nai��[�ꢤ������=���phpspec-prophecy/Prophecy/Doubler/ClassPatch/KeywordPatch.php �� �Na �������������C���phpspec-prophecy/Prophecy/Doubler/ClassPatch/HhvmExceptionPatch.php��� �Na����雷�������A���phpspec-prophecy/Prophecy/Doubler/ClassPatch/TraversablePatch.php��� �Na����wp�������P���phpspec-prophecy/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatch.php��� �Na�����ۤ������<���phpspec-prophecy/Prophecy/Argument/Token/LogicalNotToken.phpX�� �NaX���5)�������A���phpspec-prophecy/Prophecy/Argument/Token/ArrayEveryEntryToken.php��� �Na������#�������<���phpspec-prophecy/Prophecy/Argument/Token/LogicalAndToken.phpD�� �NaD��(bL��������<���phpspec-prophecy/Prophecy/Argument/Token/ArrayEntryToken.php��� �Na��������������<���phpspec-prophecy/Prophecy/Argument/Token/NotInArrayToken.php��� �Na���;��������@���phpspec-prophecy/Prophecy/Argument/Token/IdenticalValueToken.php��� �Na���u`S��������6���phpspec-prophecy/Prophecy/Argument/Token/TypeToken.php��� �Na�����$�������=���phpspec-prophecy/Prophecy/Argument/Token/ObjectStateToken.php�	�� �Na�	����T�������9���phpspec-prophecy/Prophecy/Argument/Token/InArrayToken.php��� �Na����?xn�������:���phpspec-prophecy/Prophecy/Argument/Token/AnyValueToken.php��� �Na����{�ܤ������B���phpspec-prophecy/Prophecy/Argument/Token/ApproximateValueToken.php��� �Na������������;���phpspec-prophecy/Prophecy/Argument/Token/AnyValuesToken.php��� �Na����'�`�������<���phpspec-prophecy/Prophecy/Argument/Token/ExactValueToken.php��� �Na���j\���������<���phpspec-prophecy/Prophecy/Argument/Token/ArrayCountToken.php��� �Na����/*2�������@���phpspec-prophecy/Prophecy/Argument/Token/StringContainsToken.php-�� �Na-��3xD�������;���phpspec-prophecy/Prophecy/Argument/Token/TokenInterface.php��� �Na���(nGw�������:���phpspec-prophecy/Prophecy/Argument/Token/CallbackToken.php�� �Na��v���������8���phpspec-prophecy/Prophecy/Argument/ArgumentsWildcard.phpY	�� �NaY	���0?�����������phpspec-prophecy/LICENSE}�� �Na}��
2446ߦ�������/���sebastian-diff/Output/DiffOnlyOutputBuilder.phpz�� �Naz��c��������4���sebastian-diff/Output/DiffOutputBuilderInterface.php�� �Na��V���������2���sebastian-diff/Output/UnifiedDiffOutputBuilder.php>�� �Na>��'q)�������8���sebastian-diff/Output/StrictUnifiedDiffOutputBuilder.php�(�� �Na�(��kv��������4���sebastian-diff/Output/AbstractChunkOutputBuilder.php��� �Na�����\t�������3���sebastian-diff/Exception/ConfigurationException.php=�� �Na=��1/Ff�������&���sebastian-diff/Exception/Exception.phpj�� �Naj���0��������5���sebastian-diff/Exception/InvalidArgumentException.php��� �Na���q����������B���sebastian-diff/TimeEfficientLongestCommonSubsequenceCalculator.php��� �Na����t٤������D���sebastian-diff/MemoryEfficientLongestCommonSubsequenceCalculator.php��� �Na���9������������sebastian-diff/Chunk.php_�� �Na_����v�����������sebastian-diff/Diff.phpj�� �Naj��bX�A�������5���sebastian-diff/LongestCommonSubsequenceCalculator.php��� �Na���}e7z����������sebastian-diff/Differ.php$�� �Na$��]��E����������sebastian-diff/Parser.php��� �Na�����X{����������sebastian-diff/Line.phpL�� �NaL��
2447�q����������sebastian-diff/LICENSE
2448�� �Na
2449��a��1����������theseer-tokenizer/Token.php��� �Na���4�����������theseer-tokenizer/Tokenizer.php2450�� �Na�
2451��z�l��������+���theseer-tokenizer/NamespaceUriException.phpy��� �Nay���'He�������.���theseer-tokenizer/TokenCollectionException.php|��� �Na|���`g�-����������theseer-tokenizer/Exception.phpn��� �Nan����'Ǥ������#���theseer-tokenizer/XMLSerializer.php��� �Na����g;�������"���theseer-tokenizer/NamespaceUri.phpH�� �NaH���=C�����������theseer-tokenizer/LICENSE��� �Na����R(�������%���theseer-tokenizer/TokenCollection.php
2452�� �Na
2453����a����������object-enumerator/LICENSE�� �Na���y{�������-���sebastian-code-unit-reverse-lookup/Wizard.php��� �Na����}Z[�������*���sebastian-code-unit-reverse-lookup/LICENSE�� �Na��3G	(�������'���sebastian-recursion-context/Context.php��� �Na���`Mm�������)���sebastian-recursion-context/Exception.php��� �Na���PFA�������#���sebastian-recursion-context/LICENSE�� �Na��`��������8���sebastian-recursion-context/InvalidArgumentException.php��� �Na���b�21�������<?php
2454
2455/*
2456 * This file is part of the webmozart/assert package.
2457 *
2458 * (c) Bernhard Schussek <bschussek@gmail.com>
2459 *
2460 * For the full copyright and license information, please view the LICENSE
2461 * file that was distributed with this source code.
2462 */
2463namespace PHPUnit\Webmozart\Assert;
2464
2465use ArrayAccess;
2466use BadMethodCallException;
2467use Closure;
2468use Countable;
2469use DateTime;
2470use DateTimeImmutable;
2471use Exception;
2472use ResourceBundle;
2473use SimpleXMLElement;
2474use Throwable;
2475use Traversable;
2476/**
2477 * Efficient assertions to validate the input/output of your methods.
2478 *
2479 * @since  1.0
2480 *
2481 * @author Bernhard Schussek <bschussek@gmail.com>
2482 */
2483class Assert
2484{
2485    use Mixin;
2486    /**
2487     * @psalm-pure
2488     * @psalm-assert string $value
2489     *
2490     * @param mixed  $value
2491     * @param string $message
2492     *
2493     * @throws InvalidArgumentException
2494     */
2495    public static function string($value, $message = '')
2496    {
2497        if (!\is_string($value)) {
2498            static::reportInvalidArgument(\sprintf($message ?: 'Expected a string. Got: %s', static::typeToString($value)));
2499        }
2500    }
2501    /**
2502     * @psalm-pure
2503     * @psalm-assert non-empty-string $value
2504     *
2505     * @param mixed  $value
2506     * @param string $message
2507     *
2508     * @throws InvalidArgumentException
2509     */
2510    public static function stringNotEmpty($value, $message = '')
2511    {
2512        static::string($value, $message);
2513        static::notEq($value, '', $message);
2514    }
2515    /**
2516     * @psalm-pure
2517     * @psalm-assert int $value
2518     *
2519     * @param mixed  $value
2520     * @param string $message
2521     *
2522     * @throws InvalidArgumentException
2523     */
2524    public static function integer($value, $message = '')
2525    {
2526        if (!\is_int($value)) {
2527            static::reportInvalidArgument(\sprintf($message ?: 'Expected an integer. Got: %s', static::typeToString($value)));
2528        }
2529    }
2530    /**
2531     * @psalm-pure
2532     * @psalm-assert numeric $value
2533     *
2534     * @param mixed  $value
2535     * @param string $message
2536     *
2537     * @throws InvalidArgumentException
2538     */
2539    public static function integerish($value, $message = '')
2540    {
2541        if (!\is_numeric($value) || $value != (int) $value) {
2542            static::reportInvalidArgument(\sprintf($message ?: 'Expected an integerish value. Got: %s', static::typeToString($value)));
2543        }
2544    }
2545    /**
2546     * @psalm-pure
2547     * @psalm-assert positive-int $value
2548     *
2549     * @param mixed  $value
2550     * @param string $message
2551     *
2552     * @throws InvalidArgumentException
2553     */
2554    public static function positiveInteger($value, $message = '')
2555    {
2556        if (!(\is_int($value) && $value > 0)) {
2557            static::reportInvalidArgument(\sprintf($message ?: 'Expected a positive integer. Got: %s', static::valueToString($value)));
2558        }
2559    }
2560    /**
2561     * @psalm-pure
2562     * @psalm-assert float $value
2563     *
2564     * @param mixed  $value
2565     * @param string $message
2566     *
2567     * @throws InvalidArgumentException
2568     */
2569    public static function float($value, $message = '')
2570    {
2571        if (!\is_float($value)) {
2572            static::reportInvalidArgument(\sprintf($message ?: 'Expected a float. Got: %s', static::typeToString($value)));
2573        }
2574    }
2575    /**
2576     * @psalm-pure
2577     * @psalm-assert numeric $value
2578     *
2579     * @param mixed  $value
2580     * @param string $message
2581     *
2582     * @throws InvalidArgumentException
2583     */
2584    public static function numeric($value, $message = '')
2585    {
2586        if (!\is_numeric($value)) {
2587            static::reportInvalidArgument(\sprintf($message ?: 'Expected a numeric. Got: %s', static::typeToString($value)));
2588        }
2589    }
2590    /**
2591     * @psalm-pure
2592     * @psalm-assert positive-int|0 $value
2593     *
2594     * @param mixed  $value
2595     * @param string $message
2596     *
2597     * @throws InvalidArgumentException
2598     */
2599    public static function natural($value, $message = '')
2600    {
2601        if (!\is_int($value) || $value < 0) {
2602            static::reportInvalidArgument(\sprintf($message ?: 'Expected a non-negative integer. Got: %s', static::valueToString($value)));
2603        }
2604    }
2605    /**
2606     * @psalm-pure
2607     * @psalm-assert bool $value
2608     *
2609     * @param mixed  $value
2610     * @param string $message
2611     *
2612     * @throws InvalidArgumentException
2613     */
2614    public static function boolean($value, $message = '')
2615    {
2616        if (!\is_bool($value)) {
2617            static::reportInvalidArgument(\sprintf($message ?: 'Expected a boolean. Got: %s', static::typeToString($value)));
2618        }
2619    }
2620    /**
2621     * @psalm-pure
2622     * @psalm-assert scalar $value
2623     *
2624     * @param mixed  $value
2625     * @param string $message
2626     *
2627     * @throws InvalidArgumentException
2628     */
2629    public static function scalar($value, $message = '')
2630    {
2631        if (!\is_scalar($value)) {
2632            static::reportInvalidArgument(\sprintf($message ?: 'Expected a scalar. Got: %s', static::typeToString($value)));
2633        }
2634    }
2635    /**
2636     * @psalm-pure
2637     * @psalm-assert object $value
2638     *
2639     * @param mixed  $value
2640     * @param string $message
2641     *
2642     * @throws InvalidArgumentException
2643     */
2644    public static function object($value, $message = '')
2645    {
2646        if (!\is_object($value)) {
2647            static::reportInvalidArgument(\sprintf($message ?: 'Expected an object. Got: %s', static::typeToString($value)));
2648        }
2649    }
2650    /**
2651     * @psalm-pure
2652     * @psalm-assert resource $value
2653     *
2654     * @param mixed       $value
2655     * @param string|null $type    type of resource this should be. @see https://www.php.net/manual/en/function.get-resource-type.php
2656     * @param string      $message
2657     *
2658     * @throws InvalidArgumentException
2659     */
2660    public static function resource($value, $type = null, $message = '')
2661    {
2662        if (!\is_resource($value)) {
2663            static::reportInvalidArgument(\sprintf($message ?: 'Expected a resource. Got: %s', static::typeToString($value)));
2664        }
2665        if ($type && $type !== \get_resource_type($value)) {
2666            static::reportInvalidArgument(\sprintf($message ?: 'Expected a resource of type %2$s. Got: %s', static::typeToString($value), $type));
2667        }
2668    }
2669    /**
2670     * @psalm-pure
2671     * @psalm-assert callable $value
2672     *
2673     * @param mixed  $value
2674     * @param string $message
2675     *
2676     * @throws InvalidArgumentException
2677     */
2678    public static function isCallable($value, $message = '')
2679    {
2680        if (!\is_callable($value)) {
2681            static::reportInvalidArgument(\sprintf($message ?: 'Expected a callable. Got: %s', static::typeToString($value)));
2682        }
2683    }
2684    /**
2685     * @psalm-pure
2686     * @psalm-assert array $value
2687     *
2688     * @param mixed  $value
2689     * @param string $message
2690     *
2691     * @throws InvalidArgumentException
2692     */
2693    public static function isArray($value, $message = '')
2694    {
2695        if (!\is_array($value)) {
2696            static::reportInvalidArgument(\sprintf($message ?: 'Expected an array. Got: %s', static::typeToString($value)));
2697        }
2698    }
2699    /**
2700     * @psalm-pure
2701     * @psalm-assert iterable $value
2702     *
2703     * @deprecated use "isIterable" or "isInstanceOf" instead
2704     *
2705     * @param mixed  $value
2706     * @param string $message
2707     *
2708     * @throws InvalidArgumentException
2709     */
2710    public static function isTraversable($value, $message = '')
2711    {
2712        @\trigger_error(\sprintf('The "%s" assertion is deprecated. You should stop using it, as it will soon be removed in 2.0 version. Use "isIterable" or "isInstanceOf" instead.', __METHOD__), \E_USER_DEPRECATED);
2713        if (!\is_array($value) && !$value instanceof Traversable) {
2714            static::reportInvalidArgument(\sprintf($message ?: 'Expected a traversable. Got: %s', static::typeToString($value)));
2715        }
2716    }
2717    /**
2718     * @psalm-pure
2719     * @psalm-assert array|ArrayAccess $value
2720     *
2721     * @param mixed  $value
2722     * @param string $message
2723     *
2724     * @throws InvalidArgumentException
2725     */
2726    public static function isArrayAccessible($value, $message = '')
2727    {
2728        if (!\is_array($value) && !$value instanceof ArrayAccess) {
2729            static::reportInvalidArgument(\sprintf($message ?: 'Expected an array accessible. Got: %s', static::typeToString($value)));
2730        }
2731    }
2732    /**
2733     * @psalm-pure
2734     * @psalm-assert countable $value
2735     *
2736     * @param mixed  $value
2737     * @param string $message
2738     *
2739     * @throws InvalidArgumentException
2740     */
2741    public static function isCountable($value, $message = '')
2742    {
2743        if (!\is_array($value) && !$value instanceof Countable && !$value instanceof ResourceBundle && !$value instanceof SimpleXMLElement) {
2744            static::reportInvalidArgument(\sprintf($message ?: 'Expected a countable. Got: %s', static::typeToString($value)));
2745        }
2746    }
2747    /**
2748     * @psalm-pure
2749     * @psalm-assert iterable $value
2750     *
2751     * @param mixed  $value
2752     * @param string $message
2753     *
2754     * @throws InvalidArgumentException
2755     */
2756    public static function isIterable($value, $message = '')
2757    {
2758        if (!\is_array($value) && !$value instanceof Traversable) {
2759            static::reportInvalidArgument(\sprintf($message ?: 'Expected an iterable. Got: %s', static::typeToString($value)));
2760        }
2761    }
2762    /**
2763     * @psalm-pure
2764     * @psalm-template ExpectedType of object
2765     * @psalm-param class-string<ExpectedType> $class
2766     * @psalm-assert ExpectedType $value
2767     *
2768     * @param mixed         $value
2769     * @param string|object $class
2770     * @param string        $message
2771     *
2772     * @throws InvalidArgumentException
2773     */
2774    public static function isInstanceOf($value, $class, $message = '')
2775    {
2776        if (!$value instanceof $class) {
2777            static::reportInvalidArgument(\sprintf($message ?: 'Expected an instance of %2$s. Got: %s', static::typeToString($value), $class));
2778        }
2779    }
2780    /**
2781     * @psalm-pure
2782     * @psalm-template ExpectedType of object
2783     * @psalm-param class-string<ExpectedType> $class
2784     * @psalm-assert !ExpectedType $value
2785     *
2786     * @param mixed         $value
2787     * @param string|object $class
2788     * @param string        $message
2789     *
2790     * @throws InvalidArgumentException
2791     */
2792    public static function notInstanceOf($value, $class, $message = '')
2793    {
2794        if ($value instanceof $class) {
2795            static::reportInvalidArgument(\sprintf($message ?: 'Expected an instance other than %2$s. Got: %s', static::typeToString($value), $class));
2796        }
2797    }
2798    /**
2799     * @psalm-pure
2800     * @psalm-param array<class-string> $classes
2801     *
2802     * @param mixed                $value
2803     * @param array<object|string> $classes
2804     * @param string               $message
2805     *
2806     * @throws InvalidArgumentException
2807     */
2808    public static function isInstanceOfAny($value, array $classes, $message = '')
2809    {
2810        foreach ($classes as $class) {
2811            if ($value instanceof $class) {
2812                return;
2813            }
2814        }
2815        static::reportInvalidArgument(\sprintf($message ?: 'Expected an instance of any of %2$s. Got: %s', static::typeToString($value), \implode(', ', \array_map(array('static', 'valueToString'), $classes))));
2816    }
2817    /**
2818     * @psalm-pure
2819     * @psalm-template ExpectedType of object
2820     * @psalm-param class-string<ExpectedType> $class
2821     * @psalm-assert ExpectedType|class-string<ExpectedType> $value
2822     *
2823     * @param object|string $value
2824     * @param string        $class
2825     * @param string        $message
2826     *
2827     * @throws InvalidArgumentException
2828     */
2829    public static function isAOf($value, $class, $message = '')
2830    {
2831        static::string($class, 'Expected class as a string. Got: %s');
2832        if (!\is_a($value, $class, \is_string($value))) {
2833            static::reportInvalidArgument(\sprintf($message ?: 'Expected an instance of this class or to this class among his parents %2$s. Got: %s', static::typeToString($value), $class));
2834        }
2835    }
2836    /**
2837     * @psalm-pure
2838     * @psalm-template UnexpectedType of object
2839     * @psalm-param class-string<UnexpectedType> $class
2840     * @psalm-assert !UnexpectedType $value
2841     * @psalm-assert !class-string<UnexpectedType> $value
2842     *
2843     * @param object|string $value
2844     * @param string        $class
2845     * @param string        $message
2846     *
2847     * @throws InvalidArgumentException
2848     */
2849    public static function isNotA($value, $class, $message = '')
2850    {
2851        static::string($class, 'Expected class as a string. Got: %s');
2852        if (\is_a($value, $class, \is_string($value))) {
2853            static::reportInvalidArgument(\sprintf($message ?: 'Expected an instance of this class or to this class among his parents other than %2$s. Got: %s', static::typeToString($value), $class));
2854        }
2855    }
2856    /**
2857     * @psalm-pure
2858     * @psalm-param array<class-string> $classes
2859     *
2860     * @param object|string $value
2861     * @param string[]      $classes
2862     * @param string        $message
2863     *
2864     * @throws InvalidArgumentException
2865     */
2866    public static function isAnyOf($value, array $classes, $message = '')
2867    {
2868        foreach ($classes as $class) {
2869            static::string($class, 'Expected class as a string. Got: %s');
2870            if (\is_a($value, $class, \is_string($value))) {
2871                return;
2872            }
2873        }
2874        static::reportInvalidArgument(\sprintf($message ?: 'Expected an any of instance of this class or to this class among his parents other than %2$s. Got: %s', static::typeToString($value), \implode(', ', \array_map(array('static', 'valueToString'), $classes))));
2875    }
2876    /**
2877     * @psalm-pure
2878     * @psalm-assert empty $value
2879     *
2880     * @param mixed  $value
2881     * @param string $message
2882     *
2883     * @throws InvalidArgumentException
2884     */
2885    public static function isEmpty($value, $message = '')
2886    {
2887        if (!empty($value)) {
2888            static::reportInvalidArgument(\sprintf($message ?: 'Expected an empty value. Got: %s', static::valueToString($value)));
2889        }
2890    }
2891    /**
2892     * @psalm-pure
2893     * @psalm-assert !empty $value
2894     *
2895     * @param mixed  $value
2896     * @param string $message
2897     *
2898     * @throws InvalidArgumentException
2899     */
2900    public static function notEmpty($value, $message = '')
2901    {
2902        if (empty($value)) {
2903            static::reportInvalidArgument(\sprintf($message ?: 'Expected a non-empty value. Got: %s', static::valueToString($value)));
2904        }
2905    }
2906    /**
2907     * @psalm-pure
2908     * @psalm-assert null $value
2909     *
2910     * @param mixed  $value
2911     * @param string $message
2912     *
2913     * @throws InvalidArgumentException
2914     */
2915    public static function null($value, $message = '')
2916    {
2917        if (null !== $value) {
2918            static::reportInvalidArgument(\sprintf($message ?: 'Expected null. Got: %s', static::valueToString($value)));
2919        }
2920    }
2921    /**
2922     * @psalm-pure
2923     * @psalm-assert !null $value
2924     *
2925     * @param mixed  $value
2926     * @param string $message
2927     *
2928     * @throws InvalidArgumentException
2929     */
2930    public static function notNull($value, $message = '')
2931    {
2932        if (null === $value) {
2933            static::reportInvalidArgument($message ?: 'Expected a value other than null.');
2934        }
2935    }
2936    /**
2937     * @psalm-pure
2938     * @psalm-assert true $value
2939     *
2940     * @param mixed  $value
2941     * @param string $message
2942     *
2943     * @throws InvalidArgumentException
2944     */
2945    public static function true($value, $message = '')
2946    {
2947        if (\true !== $value) {
2948            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value to be true. Got: %s', static::valueToString($value)));
2949        }
2950    }
2951    /**
2952     * @psalm-pure
2953     * @psalm-assert false $value
2954     *
2955     * @param mixed  $value
2956     * @param string $message
2957     *
2958     * @throws InvalidArgumentException
2959     */
2960    public static function false($value, $message = '')
2961    {
2962        if (\false !== $value) {
2963            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value to be false. Got: %s', static::valueToString($value)));
2964        }
2965    }
2966    /**
2967     * @psalm-pure
2968     * @psalm-assert !false $value
2969     *
2970     * @param mixed  $value
2971     * @param string $message
2972     *
2973     * @throws InvalidArgumentException
2974     */
2975    public static function notFalse($value, $message = '')
2976    {
2977        if (\false === $value) {
2978            static::reportInvalidArgument($message ?: 'Expected a value other than false.');
2979        }
2980    }
2981    /**
2982     * @param mixed  $value
2983     * @param string $message
2984     *
2985     * @throws InvalidArgumentException
2986     */
2987    public static function ip($value, $message = '')
2988    {
2989        if (\false === \filter_var($value, \FILTER_VALIDATE_IP)) {
2990            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value to be an IP. Got: %s', static::valueToString($value)));
2991        }
2992    }
2993    /**
2994     * @param mixed  $value
2995     * @param string $message
2996     *
2997     * @throws InvalidArgumentException
2998     */
2999    public static function ipv4($value, $message = '')
3000    {
3001        if (\false === \filter_var($value, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV4)) {
3002            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value to be an IPv4. Got: %s', static::valueToString($value)));
3003        }
3004    }
3005    /**
3006     * @param mixed  $value
3007     * @param string $message
3008     *
3009     * @throws InvalidArgumentException
3010     */
3011    public static function ipv6($value, $message = '')
3012    {
3013        if (\false === \filter_var($value, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV6)) {
3014            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value to be an IPv6. Got: %s', static::valueToString($value)));
3015        }
3016    }
3017    /**
3018     * @param mixed  $value
3019     * @param string $message
3020     *
3021     * @throws InvalidArgumentException
3022     */
3023    public static function email($value, $message = '')
3024    {
3025        if (\false === \filter_var($value, \FILTER_VALIDATE_EMAIL)) {
3026            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value to be a valid e-mail address. Got: %s', static::valueToString($value)));
3027        }
3028    }
3029    /**
3030     * Does non strict comparisons on the items, so ['3', 3] will not pass the assertion.
3031     *
3032     * @param array  $values
3033     * @param string $message
3034     *
3035     * @throws InvalidArgumentException
3036     */
3037    public static function uniqueValues(array $values, $message = '')
3038    {
3039        $allValues = \count($values);
3040        $uniqueValues = \count(\array_unique($values));
3041        if ($allValues !== $uniqueValues) {
3042            $difference = $allValues - $uniqueValues;
3043            static::reportInvalidArgument(\sprintf($message ?: 'Expected an array of unique values, but %s of them %s duplicated', $difference, 1 === $difference ? 'is' : 'are'));
3044        }
3045    }
3046    /**
3047     * @param mixed  $value
3048     * @param mixed  $expect
3049     * @param string $message
3050     *
3051     * @throws InvalidArgumentException
3052     */
3053    public static function eq($value, $expect, $message = '')
3054    {
3055        if ($expect != $value) {
3056            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value equal to %2$s. Got: %s', static::valueToString($value), static::valueToString($expect)));
3057        }
3058    }
3059    /**
3060     * @param mixed  $value
3061     * @param mixed  $expect
3062     * @param string $message
3063     *
3064     * @throws InvalidArgumentException
3065     */
3066    public static function notEq($value, $expect, $message = '')
3067    {
3068        if ($expect == $value) {
3069            static::reportInvalidArgument(\sprintf($message ?: 'Expected a different value than %s.', static::valueToString($expect)));
3070        }
3071    }
3072    /**
3073     * @psalm-pure
3074     *
3075     * @param mixed  $value
3076     * @param mixed  $expect
3077     * @param string $message
3078     *
3079     * @throws InvalidArgumentException
3080     */
3081    public static function same($value, $expect, $message = '')
3082    {
3083        if ($expect !== $value) {
3084            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value identical to %2$s. Got: %s', static::valueToString($value), static::valueToString($expect)));
3085        }
3086    }
3087    /**
3088     * @psalm-pure
3089     *
3090     * @param mixed  $value
3091     * @param mixed  $expect
3092     * @param string $message
3093     *
3094     * @throws InvalidArgumentException
3095     */
3096    public static function notSame($value, $expect, $message = '')
3097    {
3098        if ($expect === $value) {
3099            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value not identical to %s.', static::valueToString($expect)));
3100        }
3101    }
3102    /**
3103     * @psalm-pure
3104     *
3105     * @param mixed  $value
3106     * @param mixed  $limit
3107     * @param string $message
3108     *
3109     * @throws InvalidArgumentException
3110     */
3111    public static function greaterThan($value, $limit, $message = '')
3112    {
3113        if ($value <= $limit) {
3114            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value greater than %2$s. Got: %s', static::valueToString($value), static::valueToString($limit)));
3115        }
3116    }
3117    /**
3118     * @psalm-pure
3119     *
3120     * @param mixed  $value
3121     * @param mixed  $limit
3122     * @param string $message
3123     *
3124     * @throws InvalidArgumentException
3125     */
3126    public static function greaterThanEq($value, $limit, $message = '')
3127    {
3128        if ($value < $limit) {
3129            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value greater than or equal to %2$s. Got: %s', static::valueToString($value), static::valueToString($limit)));
3130        }
3131    }
3132    /**
3133     * @psalm-pure
3134     *
3135     * @param mixed  $value
3136     * @param mixed  $limit
3137     * @param string $message
3138     *
3139     * @throws InvalidArgumentException
3140     */
3141    public static function lessThan($value, $limit, $message = '')
3142    {
3143        if ($value >= $limit) {
3144            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value less than %2$s. Got: %s', static::valueToString($value), static::valueToString($limit)));
3145        }
3146    }
3147    /**
3148     * @psalm-pure
3149     *
3150     * @param mixed  $value
3151     * @param mixed  $limit
3152     * @param string $message
3153     *
3154     * @throws InvalidArgumentException
3155     */
3156    public static function lessThanEq($value, $limit, $message = '')
3157    {
3158        if ($value > $limit) {
3159            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value less than or equal to %2$s. Got: %s', static::valueToString($value), static::valueToString($limit)));
3160        }
3161    }
3162    /**
3163     * Inclusive range, so Assert::(3, 3, 5) passes.
3164     *
3165     * @psalm-pure
3166     *
3167     * @param mixed  $value
3168     * @param mixed  $min
3169     * @param mixed  $max
3170     * @param string $message
3171     *
3172     * @throws InvalidArgumentException
3173     */
3174    public static function range($value, $min, $max, $message = '')
3175    {
3176        if ($value < $min || $value > $max) {
3177            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value between %2$s and %3$s. Got: %s', static::valueToString($value), static::valueToString($min), static::valueToString($max)));
3178        }
3179    }
3180    /**
3181     * A more human-readable alias of Assert::inArray().
3182     *
3183     * @psalm-pure
3184     *
3185     * @param mixed  $value
3186     * @param array  $values
3187     * @param string $message
3188     *
3189     * @throws InvalidArgumentException
3190     */
3191    public static function oneOf($value, array $values, $message = '')
3192    {
3193        static::inArray($value, $values, $message);
3194    }
3195    /**
3196     * Does strict comparison, so Assert::inArray(3, ['3']) does not pass the assertion.
3197     *
3198     * @psalm-pure
3199     *
3200     * @param mixed  $value
3201     * @param array  $values
3202     * @param string $message
3203     *
3204     * @throws InvalidArgumentException
3205     */
3206    public static function inArray($value, array $values, $message = '')
3207    {
3208        if (!\in_array($value, $values, \true)) {
3209            static::reportInvalidArgument(\sprintf($message ?: 'Expected one of: %2$s. Got: %s', static::valueToString($value), \implode(', ', \array_map(array('static', 'valueToString'), $values))));
3210        }
3211    }
3212    /**
3213     * @psalm-pure
3214     *
3215     * @param string $value
3216     * @param string $subString
3217     * @param string $message
3218     *
3219     * @throws InvalidArgumentException
3220     */
3221    public static function contains($value, $subString, $message = '')
3222    {
3223        if (\false === \strpos($value, $subString)) {
3224            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value to contain %2$s. Got: %s', static::valueToString($value), static::valueToString($subString)));
3225        }
3226    }
3227    /**
3228     * @psalm-pure
3229     *
3230     * @param string $value
3231     * @param string $subString
3232     * @param string $message
3233     *
3234     * @throws InvalidArgumentException
3235     */
3236    public static function notContains($value, $subString, $message = '')
3237    {
3238        if (\false !== \strpos($value, $subString)) {
3239            static::reportInvalidArgument(\sprintf($message ?: '%2$s was not expected to be contained in a value. Got: %s', static::valueToString($value), static::valueToString($subString)));
3240        }
3241    }
3242    /**
3243     * @psalm-pure
3244     *
3245     * @param string $value
3246     * @param string $message
3247     *
3248     * @throws InvalidArgumentException
3249     */
3250    public static function notWhitespaceOnly($value, $message = '')
3251    {
3252        if (\preg_match('/^\\s*$/', $value)) {
3253            static::reportInvalidArgument(\sprintf($message ?: 'Expected a non-whitespace string. Got: %s', static::valueToString($value)));
3254        }
3255    }
3256    /**
3257     * @psalm-pure
3258     *
3259     * @param string $value
3260     * @param string $prefix
3261     * @param string $message
3262     *
3263     * @throws InvalidArgumentException
3264     */
3265    public static function startsWith($value, $prefix, $message = '')
3266    {
3267        if (0 !== \strpos($value, $prefix)) {
3268            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value to start with %2$s. Got: %s', static::valueToString($value), static::valueToString($prefix)));
3269        }
3270    }
3271    /**
3272     * @psalm-pure
3273     *
3274     * @param string $value
3275     * @param string $prefix
3276     * @param string $message
3277     *
3278     * @throws InvalidArgumentException
3279     */
3280    public static function notStartsWith($value, $prefix, $message = '')
3281    {
3282        if (0 === \strpos($value, $prefix)) {
3283            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value not to start with %2$s. Got: %s', static::valueToString($value), static::valueToString($prefix)));
3284        }
3285    }
3286    /**
3287     * @psalm-pure
3288     *
3289     * @param mixed  $value
3290     * @param string $message
3291     *
3292     * @throws InvalidArgumentException
3293     */
3294    public static function startsWithLetter($value, $message = '')
3295    {
3296        static::string($value);
3297        $valid = isset($value[0]);
3298        if ($valid) {
3299            $locale = \setlocale(\LC_CTYPE, 0);
3300            \setlocale(\LC_CTYPE, 'C');
3301            $valid = \ctype_alpha($value[0]);
3302            \setlocale(\LC_CTYPE, $locale);
3303        }
3304        if (!$valid) {
3305            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value to start with a letter. Got: %s', static::valueToString($value)));
3306        }
3307    }
3308    /**
3309     * @psalm-pure
3310     *
3311     * @param string $value
3312     * @param string $suffix
3313     * @param string $message
3314     *
3315     * @throws InvalidArgumentException
3316     */
3317    public static function endsWith($value, $suffix, $message = '')
3318    {
3319        if ($suffix !== \substr($value, -\strlen($suffix))) {
3320            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value to end with %2$s. Got: %s', static::valueToString($value), static::valueToString($suffix)));
3321        }
3322    }
3323    /**
3324     * @psalm-pure
3325     *
3326     * @param string $value
3327     * @param string $suffix
3328     * @param string $message
3329     *
3330     * @throws InvalidArgumentException
3331     */
3332    public static function notEndsWith($value, $suffix, $message = '')
3333    {
3334        if ($suffix === \substr($value, -\strlen($suffix))) {
3335            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value not to end with %2$s. Got: %s', static::valueToString($value), static::valueToString($suffix)));
3336        }
3337    }
3338    /**
3339     * @psalm-pure
3340     *
3341     * @param string $value
3342     * @param string $pattern
3343     * @param string $message
3344     *
3345     * @throws InvalidArgumentException
3346     */
3347    public static function regex($value, $pattern, $message = '')
3348    {
3349        if (!\preg_match($pattern, $value)) {
3350            static::reportInvalidArgument(\sprintf($message ?: 'The value %s does not match the expected pattern.', static::valueToString($value)));
3351        }
3352    }
3353    /**
3354     * @psalm-pure
3355     *
3356     * @param string $value
3357     * @param string $pattern
3358     * @param string $message
3359     *
3360     * @throws InvalidArgumentException
3361     */
3362    public static function notRegex($value, $pattern, $message = '')
3363    {
3364        if (\preg_match($pattern, $value, $matches, \PREG_OFFSET_CAPTURE)) {
3365            static::reportInvalidArgument(\sprintf($message ?: 'The value %s matches the pattern %s (at offset %d).', static::valueToString($value), static::valueToString($pattern), $matches[0][1]));
3366        }
3367    }
3368    /**
3369     * @psalm-pure
3370     *
3371     * @param mixed  $value
3372     * @param string $message
3373     *
3374     * @throws InvalidArgumentException
3375     */
3376    public static function unicodeLetters($value, $message = '')
3377    {
3378        static::string($value);
3379        if (!\preg_match('/^\\p{L}+$/u', $value)) {
3380            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value to contain only Unicode letters. Got: %s', static::valueToString($value)));
3381        }
3382    }
3383    /**
3384     * @psalm-pure
3385     *
3386     * @param mixed  $value
3387     * @param string $message
3388     *
3389     * @throws InvalidArgumentException
3390     */
3391    public static function alpha($value, $message = '')
3392    {
3393        static::string($value);
3394        $locale = \setlocale(\LC_CTYPE, 0);
3395        \setlocale(\LC_CTYPE, 'C');
3396        $valid = !\ctype_alpha($value);
3397        \setlocale(\LC_CTYPE, $locale);
3398        if ($valid) {
3399            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value to contain only letters. Got: %s', static::valueToString($value)));
3400        }
3401    }
3402    /**
3403     * @psalm-pure
3404     *
3405     * @param string $value
3406     * @param string $message
3407     *
3408     * @throws InvalidArgumentException
3409     */
3410    public static function digits($value, $message = '')
3411    {
3412        $locale = \setlocale(\LC_CTYPE, 0);
3413        \setlocale(\LC_CTYPE, 'C');
3414        $valid = !\ctype_digit($value);
3415        \setlocale(\LC_CTYPE, $locale);
3416        if ($valid) {
3417            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value to contain digits only. Got: %s', static::valueToString($value)));
3418        }
3419    }
3420    /**
3421     * @psalm-pure
3422     *
3423     * @param string $value
3424     * @param string $message
3425     *
3426     * @throws InvalidArgumentException
3427     */
3428    public static function alnum($value, $message = '')
3429    {
3430        $locale = \setlocale(\LC_CTYPE, 0);
3431        \setlocale(\LC_CTYPE, 'C');
3432        $valid = !\ctype_alnum($value);
3433        \setlocale(\LC_CTYPE, $locale);
3434        if ($valid) {
3435            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value to contain letters and digits only. Got: %s', static::valueToString($value)));
3436        }
3437    }
3438    /**
3439     * @psalm-pure
3440     * @psalm-assert lowercase-string $value
3441     *
3442     * @param string $value
3443     * @param string $message
3444     *
3445     * @throws InvalidArgumentException
3446     */
3447    public static function lower($value, $message = '')
3448    {
3449        $locale = \setlocale(\LC_CTYPE, 0);
3450        \setlocale(\LC_CTYPE, 'C');
3451        $valid = !\ctype_lower($value);
3452        \setlocale(\LC_CTYPE, $locale);
3453        if ($valid) {
3454            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value to contain lowercase characters only. Got: %s', static::valueToString($value)));
3455        }
3456    }
3457    /**
3458     * @psalm-pure
3459     * @psalm-assert !lowercase-string $value
3460     *
3461     * @param string $value
3462     * @param string $message
3463     *
3464     * @throws InvalidArgumentException
3465     */
3466    public static function upper($value, $message = '')
3467    {
3468        $locale = \setlocale(\LC_CTYPE, 0);
3469        \setlocale(\LC_CTYPE, 'C');
3470        $valid = !\ctype_upper($value);
3471        \setlocale(\LC_CTYPE, $locale);
3472        if ($valid) {
3473            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value to contain uppercase characters only. Got: %s', static::valueToString($value)));
3474        }
3475    }
3476    /**
3477     * @psalm-pure
3478     *
3479     * @param string $value
3480     * @param int    $length
3481     * @param string $message
3482     *
3483     * @throws InvalidArgumentException
3484     */
3485    public static function length($value, $length, $message = '')
3486    {
3487        if ($length !== static::strlen($value)) {
3488            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value to contain %2$s characters. Got: %s', static::valueToString($value), $length));
3489        }
3490    }
3491    /**
3492     * Inclusive min.
3493     *
3494     * @psalm-pure
3495     *
3496     * @param string    $value
3497     * @param int|float $min
3498     * @param string    $message
3499     *
3500     * @throws InvalidArgumentException
3501     */
3502    public static function minLength($value, $min, $message = '')
3503    {
3504        if (static::strlen($value) < $min) {
3505            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value to contain at least %2$s characters. Got: %s', static::valueToString($value), $min));
3506        }
3507    }
3508    /**
3509     * Inclusive max.
3510     *
3511     * @psalm-pure
3512     *
3513     * @param string    $value
3514     * @param int|float $max
3515     * @param string    $message
3516     *
3517     * @throws InvalidArgumentException
3518     */
3519    public static function maxLength($value, $max, $message = '')
3520    {
3521        if (static::strlen($value) > $max) {
3522            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value to contain at most %2$s characters. Got: %s', static::valueToString($value), $max));
3523        }
3524    }
3525    /**
3526     * Inclusive , so Assert::lengthBetween('asd', 3, 5); passes the assertion.
3527     *
3528     * @psalm-pure
3529     *
3530     * @param string    $value
3531     * @param int|float $min
3532     * @param int|float $max
3533     * @param string    $message
3534     *
3535     * @throws InvalidArgumentException
3536     */
3537    public static function lengthBetween($value, $min, $max, $message = '')
3538    {
3539        $length = static::strlen($value);
3540        if ($length < $min || $length > $max) {
3541            static::reportInvalidArgument(\sprintf($message ?: 'Expected a value to contain between %2$s and %3$s characters. Got: %s', static::valueToString($value), $min, $max));
3542        }
3543    }
3544    /**
3545     * Will also pass if $value is a directory, use Assert::file() instead if you need to be sure it is a file.
3546     *
3547     * @param mixed  $value
3548     * @param string $message
3549     *
3550     * @throws InvalidArgumentException
3551     */
3552    public static function fileExists($value, $message = '')
3553    {
3554        static::string($value);
3555        if (!\file_exists($value)) {
3556            static::reportInvalidArgument(\sprintf($message ?: 'The file %s does not exist.', static::valueToString($value)));
3557        }
3558    }
3559    /**
3560     * @param mixed  $value
3561     * @param string $message
3562     *
3563     * @throws InvalidArgumentException
3564     */
3565    public static function file($value, $message = '')
3566    {
3567        static::fileExists($value, $message);
3568        if (!\is_file($value)) {
3569            static::reportInvalidArgument(\sprintf($message ?: 'The path %s is not a file.', static::valueToString($value)));
3570        }
3571    }
3572    /**
3573     * @param mixed  $value
3574     * @param string $message
3575     *
3576     * @throws InvalidArgumentException
3577     */
3578    public static function directory($value, $message = '')
3579    {
3580        static::fileExists($value, $message);
3581        if (!\is_dir($value)) {
3582            static::reportInvalidArgument(\sprintf($message ?: 'The path %s is no directory.', static::valueToString($value)));
3583        }
3584    }
3585    /**
3586     * @param string $value
3587     * @param string $message
3588     *
3589     * @throws InvalidArgumentException
3590     */
3591    public static function readable($value, $message = '')
3592    {
3593        if (!\is_readable($value)) {
3594            static::reportInvalidArgument(\sprintf($message ?: 'The path %s is not readable.', static::valueToString($value)));
3595        }
3596    }
3597    /**
3598     * @param string $value
3599     * @param string $message
3600     *
3601     * @throws InvalidArgumentException
3602     */
3603    public static function writable($value, $message = '')
3604    {
3605        if (!\is_writable($value)) {
3606            static::reportInvalidArgument(\sprintf($message ?: 'The path %s is not writable.', static::valueToString($value)));
3607        }
3608    }
3609    /**
3610     * @psalm-assert class-string $value
3611     *
3612     * @param mixed  $value
3613     * @param string $message
3614     *
3615     * @throws InvalidArgumentException
3616     */
3617    public static function classExists($value, $message = '')
3618    {
3619        if (!\class_exists($value)) {
3620            static::reportInvalidArgument(\sprintf($message ?: 'Expected an existing class name. Got: %s', static::valueToString($value)));
3621        }
3622    }
3623    /**
3624     * @psalm-pure
3625     * @psalm-template ExpectedType of object
3626     * @psalm-param class-string<ExpectedType> $class
3627     * @psalm-assert class-string<ExpectedType>|ExpectedType $value
3628     *
3629     * @param mixed         $value
3630     * @param string|object $class
3631     * @param string        $message
3632     *
3633     * @throws InvalidArgumentException
3634     */
3635    public static function subclassOf($value, $class, $message = '')
3636    {
3637        if (!\is_subclass_of($value, $class)) {
3638            static::reportInvalidArgument(\sprintf($message ?: 'Expected a sub-class of %2$s. Got: %s', static::valueToString($value), static::valueToString($class)));
3639        }
3640    }
3641    /**
3642     * @psalm-assert class-string $value
3643     *
3644     * @param mixed  $value
3645     * @param string $message
3646     *
3647     * @throws InvalidArgumentException
3648     */
3649    public static function interfaceExists($value, $message = '')
3650    {
3651        if (!\interface_exists($value)) {
3652            static::reportInvalidArgument(\sprintf($message ?: 'Expected an existing interface name. got %s', static::valueToString($value)));
3653        }
3654    }
3655    /**
3656     * @psalm-pure
3657     * @psalm-template ExpectedType of object
3658     * @psalm-param class-string<ExpectedType> $interface
3659     * @psalm-assert class-string<ExpectedType> $value
3660     *
3661     * @param mixed  $value
3662     * @param mixed  $interface
3663     * @param string $message
3664     *
3665     * @throws InvalidArgumentException
3666     */
3667    public static function implementsInterface($value, $interface, $message = '')
3668    {
3669        if (!\in_array($interface, \class_implements($value))) {
3670            static::reportInvalidArgument(\sprintf($message ?: 'Expected an implementation of %2$s. Got: %s', static::valueToString($value), static::valueToString($interface)));
3671        }
3672    }
3673    /**
3674     * @psalm-pure
3675     * @psalm-param class-string|object $classOrObject
3676     *
3677     * @param string|object $classOrObject
3678     * @param mixed         $property
3679     * @param string        $message
3680     *
3681     * @throws InvalidArgumentException
3682     */
3683    public static function propertyExists($classOrObject, $property, $message = '')
3684    {
3685        if (!\property_exists($classOrObject, $property)) {
3686            static::reportInvalidArgument(\sprintf($message ?: 'Expected the property %s to exist.', static::valueToString($property)));
3687        }
3688    }
3689    /**
3690     * @psalm-pure
3691     * @psalm-param class-string|object $classOrObject
3692     *
3693     * @param string|object $classOrObject
3694     * @param mixed         $property
3695     * @param string        $message
3696     *
3697     * @throws InvalidArgumentException
3698     */
3699    public static function propertyNotExists($classOrObject, $property, $message = '')
3700    {
3701        if (\property_exists($classOrObject, $property)) {
3702            static::reportInvalidArgument(\sprintf($message ?: 'Expected the property %s to not exist.', static::valueToString($property)));
3703        }
3704    }
3705    /**
3706     * @psalm-pure
3707     * @psalm-param class-string|object $classOrObject
3708     *
3709     * @param string|object $classOrObject
3710     * @param mixed         $method
3711     * @param string        $message
3712     *
3713     * @throws InvalidArgumentException
3714     */
3715    public static function methodExists($classOrObject, $method, $message = '')
3716    {
3717        if (!(\is_string($classOrObject) || \is_object($classOrObject)) || !\method_exists($classOrObject, $method)) {
3718            static::reportInvalidArgument(\sprintf($message ?: 'Expected the method %s to exist.', static::valueToString($method)));
3719        }
3720    }
3721    /**
3722     * @psalm-pure
3723     * @psalm-param class-string|object $classOrObject
3724     *
3725     * @param string|object $classOrObject
3726     * @param mixed         $method
3727     * @param string        $message
3728     *
3729     * @throws InvalidArgumentException
3730     */
3731    public static function methodNotExists($classOrObject, $method, $message = '')
3732    {
3733        if ((\is_string($classOrObject) || \is_object($classOrObject)) && \method_exists($classOrObject, $method)) {
3734            static::reportInvalidArgument(\sprintf($message ?: 'Expected the method %s to not exist.', static::valueToString($method)));
3735        }
3736    }
3737    /**
3738     * @psalm-pure
3739     *
3740     * @param array      $array
3741     * @param string|int $key
3742     * @param string     $message
3743     *
3744     * @throws InvalidArgumentException
3745     */
3746    public static function keyExists($array, $key, $message = '')
3747    {
3748        if (!(isset($array[$key]) || \array_key_exists($key, $array))) {
3749            static::reportInvalidArgument(\sprintf($message ?: 'Expected the key %s to exist.', static::valueToString($key)));
3750        }
3751    }
3752    /**
3753     * @psalm-pure
3754     *
3755     * @param array      $array
3756     * @param string|int $key
3757     * @param string     $message
3758     *
3759     * @throws InvalidArgumentException
3760     */
3761    public static function keyNotExists($array, $key, $message = '')
3762    {
3763        if (isset($array[$key]) || \array_key_exists($key, $array)) {
3764            static::reportInvalidArgument(\sprintf($message ?: 'Expected the key %s to not exist.', static::valueToString($key)));
3765        }
3766    }
3767    /**
3768     * Checks if a value is a valid array key (int or string).
3769     *
3770     * @psalm-pure
3771     * @psalm-assert array-key $value
3772     *
3773     * @param mixed  $value
3774     * @param string $message
3775     *
3776     * @throws InvalidArgumentException
3777     */
3778    public static function validArrayKey($value, $message = '')
3779    {
3780        if (!(\is_int($value) || \is_string($value))) {
3781            static::reportInvalidArgument(\sprintf($message ?: 'Expected string or integer. Got: %s', static::typeToString($value)));
3782        }
3783    }
3784    /**
3785     * Does not check if $array is countable, this can generate a warning on php versions after 7.2.
3786     *
3787     * @param Countable|array $array
3788     * @param int             $number
3789     * @param string          $message
3790     *
3791     * @throws InvalidArgumentException
3792     */
3793    public static function count($array, $number, $message = '')
3794    {
3795        static::eq(\count($array), $number, \sprintf($message ?: 'Expected an array to contain %d elements. Got: %d.', $number, \count($array)));
3796    }
3797    /**
3798     * Does not check if $array is countable, this can generate a warning on php versions after 7.2.
3799     *
3800     * @param Countable|array $array
3801     * @param int|float       $min
3802     * @param string          $message
3803     *
3804     * @throws InvalidArgumentException
3805     */
3806    public static function minCount($array, $min, $message = '')
3807    {
3808        if (\count($array) < $min) {
3809            static::reportInvalidArgument(\sprintf($message ?: 'Expected an array to contain at least %2$d elements. Got: %d', \count($array), $min));
3810        }
3811    }
3812    /**
3813     * Does not check if $array is countable, this can generate a warning on php versions after 7.2.
3814     *
3815     * @param Countable|array $array
3816     * @param int|float       $max
3817     * @param string          $message
3818     *
3819     * @throws InvalidArgumentException
3820     */
3821    public static function maxCount($array, $max, $message = '')
3822    {
3823        if (\count($array) > $max) {
3824            static::reportInvalidArgument(\sprintf($message ?: 'Expected an array to contain at most %2$d elements. Got: %d', \count($array), $max));
3825        }
3826    }
3827    /**
3828     * Does not check if $array is countable, this can generate a warning on php versions after 7.2.
3829     *
3830     * @param Countable|array $array
3831     * @param int|float       $min
3832     * @param int|float       $max
3833     * @param string          $message
3834     *
3835     * @throws InvalidArgumentException
3836     */
3837    public static function countBetween($array, $min, $max, $message = '')
3838    {
3839        $count = \count($array);
3840        if ($count < $min || $count > $max) {
3841            static::reportInvalidArgument(\sprintf($message ?: 'Expected an array to contain between %2$d and %3$d elements. Got: %d', $count, $min, $max));
3842        }
3843    }
3844    /**
3845     * @psalm-pure
3846     * @psalm-assert list $array
3847     *
3848     * @param mixed  $array
3849     * @param string $message
3850     *
3851     * @throws InvalidArgumentException
3852     */
3853    public static function isList($array, $message = '')
3854    {
3855        if (!\is_array($array) || $array !== \array_values($array)) {
3856            static::reportInvalidArgument($message ?: 'Expected list - non-associative array.');
3857        }
3858    }
3859    /**
3860     * @psalm-pure
3861     * @psalm-assert non-empty-list $array
3862     *
3863     * @param mixed  $array
3864     * @param string $message
3865     *
3866     * @throws InvalidArgumentException
3867     */
3868    public static function isNonEmptyList($array, $message = '')
3869    {
3870        static::isList($array, $message);
3871        static::notEmpty($array, $message);
3872    }
3873    /**
3874     * @psalm-pure
3875     * @psalm-template T
3876     * @psalm-param mixed|array<T> $array
3877     * @psalm-assert array<string, T> $array
3878     *
3879     * @param mixed  $array
3880     * @param string $message
3881     *
3882     * @throws InvalidArgumentException
3883     */
3884    public static function isMap($array, $message = '')
3885    {
3886        if (!\is_array($array) || \array_keys($array) !== \array_filter(\array_keys($array), '\\is_string')) {
3887            static::reportInvalidArgument($message ?: 'Expected map - associative array with string keys.');
3888        }
3889    }
3890    /**
3891     * @psalm-pure
3892     * @psalm-template T
3893     * @psalm-param mixed|array<T> $array
3894     * @psalm-assert array<string, T> $array
3895     * @psalm-assert !empty $array
3896     *
3897     * @param mixed  $array
3898     * @param string $message
3899     *
3900     * @throws InvalidArgumentException
3901     */
3902    public static function isNonEmptyMap($array, $message = '')
3903    {
3904        static::isMap($array, $message);
3905        static::notEmpty($array, $message);
3906    }
3907    /**
3908     * @psalm-pure
3909     *
3910     * @param string $value
3911     * @param string $message
3912     *
3913     * @throws InvalidArgumentException
3914     */
3915    public static function uuid($value, $message = '')
3916    {
3917        $value = \str_replace(array('urn:', 'uuid:', '{', '}'), '', $value);
3918        // The nil UUID is special form of UUID that is specified to have all
3919        // 128 bits set to zero.
3920        if ('00000000-0000-0000-0000-000000000000' === $value) {
3921            return;
3922        }
3923        if (!\preg_match('/^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/', $value)) {
3924            static::reportInvalidArgument(\sprintf($message ?: 'Value %s is not a valid UUID.', static::valueToString($value)));
3925        }
3926    }
3927    /**
3928     * @psalm-param class-string<Throwable> $class
3929     *
3930     * @param Closure $expression
3931     * @param string  $class
3932     * @param string  $message
3933     *
3934     * @throws InvalidArgumentException
3935     */
3936    public static function throws(Closure $expression, $class = 'Exception', $message = '')
3937    {
3938        static::string($class);
3939        $actual = 'none';
3940        try {
3941            $expression();
3942        } catch (Exception $e) {
3943            $actual = \get_class($e);
3944            if ($e instanceof $class) {
3945                return;
3946            }
3947        } catch (Throwable $e) {
3948            $actual = \get_class($e);
3949            if ($e instanceof $class) {
3950                return;
3951            }
3952        }
3953        static::reportInvalidArgument($message ?: \sprintf('Expected to throw "%s", got "%s"', $class, $actual));
3954    }
3955    /**
3956     * @throws BadMethodCallException
3957     */
3958    public static function __callStatic($name, $arguments)
3959    {
3960        if ('nullOr' === \substr($name, 0, 6)) {
3961            if (null !== $arguments[0]) {
3962                $method = \lcfirst(\substr($name, 6));
3963                \call_user_func_array(array('static', $method), $arguments);
3964            }
3965            return;
3966        }
3967        if ('all' === \substr($name, 0, 3)) {
3968            static::isIterable($arguments[0]);
3969            $method = \lcfirst(\substr($name, 3));
3970            $args = $arguments;
3971            foreach ($arguments[0] as $entry) {
3972                $args[0] = $entry;
3973                \call_user_func_array(array('static', $method), $args);
3974            }
3975            return;
3976        }
3977        throw new BadMethodCallException('No such method: ' . $name);
3978    }
3979    /**
3980     * @param mixed $value
3981     *
3982     * @return string
3983     */
3984    protected static function valueToString($value)
3985    {
3986        if (null === $value) {
3987            return 'null';
3988        }
3989        if (\true === $value) {
3990            return 'true';
3991        }
3992        if (\false === $value) {
3993            return 'false';
3994        }
3995        if (\is_array($value)) {
3996            return 'array';
3997        }
3998        if (\is_object($value)) {
3999            if (\method_exists($value, '__toString')) {
4000                return \get_class($value) . ': ' . self::valueToString($value->__toString());
4001            }
4002            if ($value instanceof DateTime || $value instanceof DateTimeImmutable) {
4003                return \get_class($value) . ': ' . self::valueToString($value->format('c'));
4004            }
4005            return \get_class($value);
4006        }
4007        if (\is_resource($value)) {
4008            return 'resource';
4009        }
4010        if (\is_string($value)) {
4011            return '"' . $value . '"';
4012        }
4013        return (string) $value;
4014    }
4015    /**
4016     * @param mixed $value
4017     *
4018     * @return string
4019     */
4020    protected static function typeToString($value)
4021    {
4022        return \is_object($value) ? \get_class($value) : \gettype($value);
4023    }
4024    protected static function strlen($value)
4025    {
4026        if (!\function_exists('mb_detect_encoding')) {
4027            return \strlen($value);
4028        }
4029        if (\false === ($encoding = \mb_detect_encoding($value))) {
4030            return \strlen($value);
4031        }
4032        return \mb_strlen($value, $encoding);
4033    }
4034    /**
4035     * @param string $message
4036     *
4037     * @throws InvalidArgumentException
4038     *
4039     * @psalm-pure this method is not supposed to perform side-effects
4040     */
4041    protected static function reportInvalidArgument($message)
4042    {
4043        throw new InvalidArgumentException($message);
4044    }
4045    private function __construct()
4046    {
4047    }
4048}
4049<?php
4050
4051/**
4052 * provides type inference and auto-completion for magic static methods of Assert.
4053 */
4054namespace PHPUnit\Webmozart\Assert;
4055
4056use ArrayAccess;
4057use Closure;
4058use Countable;
4059use Throwable;
4060/**
4061 * This trait aids static analysis tooling in introspecting assertion magic methods.
4062 * Do not use this trait directly: it will change, and is not designed for reuse.
4063 */
4064trait Mixin
4065{
4066    /**
4067     * @psalm-pure
4068     * @psalm-assert string|null $value
4069     *
4070     * @param mixed  $value
4071     * @param string $message
4072     *
4073     * @throws InvalidArgumentException
4074     *
4075     * @return void
4076     */
4077    public static function nullOrString($value, $message = '')
4078    {
4079        static::__callStatic('nullOrString', array($value, $message));
4080    }
4081    /**
4082     * @psalm-pure
4083     * @psalm-assert iterable<string> $value
4084     *
4085     * @param mixed  $value
4086     * @param string $message
4087     *
4088     * @throws InvalidArgumentException
4089     *
4090     * @return void
4091     */
4092    public static function allString($value, $message = '')
4093    {
4094        static::__callStatic('allString', array($value, $message));
4095    }
4096    /**
4097     * @psalm-pure
4098     * @psalm-assert non-empty-string|null $value
4099     *
4100     * @param mixed  $value
4101     * @param string $message
4102     *
4103     * @throws InvalidArgumentException
4104     *
4105     * @return void
4106     */
4107    public static function nullOrStringNotEmpty($value, $message = '')
4108    {
4109        static::__callStatic('nullOrStringNotEmpty', array($value, $message));
4110    }
4111    /**
4112     * @psalm-pure
4113     * @psalm-assert iterable<non-empty-string> $value
4114     *
4115     * @param mixed  $value
4116     * @param string $message
4117     *
4118     * @throws InvalidArgumentException
4119     *
4120     * @return void
4121     */
4122    public static function allStringNotEmpty($value, $message = '')
4123    {
4124        static::__callStatic('allStringNotEmpty', array($value, $message));
4125    }
4126    /**
4127     * @psalm-pure
4128     * @psalm-assert int|null $value
4129     *
4130     * @param mixed  $value
4131     * @param string $message
4132     *
4133     * @throws InvalidArgumentException
4134     *
4135     * @return void
4136     */
4137    public static function nullOrInteger($value, $message = '')
4138    {
4139        static::__callStatic('nullOrInteger', array($value, $message));
4140    }
4141    /**
4142     * @psalm-pure
4143     * @psalm-assert iterable<int> $value
4144     *
4145     * @param mixed  $value
4146     * @param string $message
4147     *
4148     * @throws InvalidArgumentException
4149     *
4150     * @return void
4151     */
4152    public static function allInteger($value, $message = '')
4153    {
4154        static::__callStatic('allInteger', array($value, $message));
4155    }
4156    /**
4157     * @psalm-pure
4158     * @psalm-assert numeric|null $value
4159     *
4160     * @param mixed  $value
4161     * @param string $message
4162     *
4163     * @throws InvalidArgumentException
4164     *
4165     * @return void
4166     */
4167    public static function nullOrIntegerish($value, $message = '')
4168    {
4169        static::__callStatic('nullOrIntegerish', array($value, $message));
4170    }
4171    /**
4172     * @psalm-pure
4173     * @psalm-assert iterable<numeric> $value
4174     *
4175     * @param mixed  $value
4176     * @param string $message
4177     *
4178     * @throws InvalidArgumentException
4179     *
4180     * @return void
4181     */
4182    public static function allIntegerish($value, $message = '')
4183    {
4184        static::__callStatic('allIntegerish', array($value, $message));
4185    }
4186    /**
4187     * @psalm-pure
4188     * @psalm-assert positive-int|null $value
4189     *
4190     * @param mixed  $value
4191     * @param string $message
4192     *
4193     * @throws InvalidArgumentException
4194     *
4195     * @return void
4196     */
4197    public static function nullOrPositiveInteger($value, $message = '')
4198    {
4199        static::__callStatic('nullOrPositiveInteger', array($value, $message));
4200    }
4201    /**
4202     * @psalm-pure
4203     * @psalm-assert iterable<positive-int> $value
4204     *
4205     * @param mixed  $value
4206     * @param string $message
4207     *
4208     * @throws InvalidArgumentException
4209     *
4210     * @return void
4211     */
4212    public static function allPositiveInteger($value, $message = '')
4213    {
4214        static::__callStatic('allPositiveInteger', array($value, $message));
4215    }
4216    /**
4217     * @psalm-pure
4218     * @psalm-assert float|null $value
4219     *
4220     * @param mixed  $value
4221     * @param string $message
4222     *
4223     * @throws InvalidArgumentException
4224     *
4225     * @return void
4226     */
4227    public static function nullOrFloat($value, $message = '')
4228    {
4229        static::__callStatic('nullOrFloat', array($value, $message));
4230    }
4231    /**
4232     * @psalm-pure
4233     * @psalm-assert iterable<float> $value
4234     *
4235     * @param mixed  $value
4236     * @param string $message
4237     *
4238     * @throws InvalidArgumentException
4239     *
4240     * @return void
4241     */
4242    public static function allFloat($value, $message = '')
4243    {
4244        static::__callStatic('allFloat', array($value, $message));
4245    }
4246    /**
4247     * @psalm-pure
4248     * @psalm-assert numeric|null $value
4249     *
4250     * @param mixed  $value
4251     * @param string $message
4252     *
4253     * @throws InvalidArgumentException
4254     *
4255     * @return void
4256     */
4257    public static function nullOrNumeric($value, $message = '')
4258    {
4259        static::__callStatic('nullOrNumeric', array($value, $message));
4260    }
4261    /**
4262     * @psalm-pure
4263     * @psalm-assert iterable<numeric> $value
4264     *
4265     * @param mixed  $value
4266     * @param string $message
4267     *
4268     * @throws InvalidArgumentException
4269     *
4270     * @return void
4271     */
4272    public static function allNumeric($value, $message = '')
4273    {
4274        static::__callStatic('allNumeric', array($value, $message));
4275    }
4276    /**
4277     * @psalm-pure
4278     * @psalm-assert positive-int|0|null $value
4279     *
4280     * @param mixed  $value
4281     * @param string $message
4282     *
4283     * @throws InvalidArgumentException
4284     *
4285     * @return void
4286     */
4287    public static function nullOrNatural($value, $message = '')
4288    {
4289        static::__callStatic('nullOrNatural', array($value, $message));
4290    }
4291    /**
4292     * @psalm-pure
4293     * @psalm-assert iterable<positive-int|0> $value
4294     *
4295     * @param mixed  $value
4296     * @param string $message
4297     *
4298     * @throws InvalidArgumentException
4299     *
4300     * @return void
4301     */
4302    public static function allNatural($value, $message = '')
4303    {
4304        static::__callStatic('allNatural', array($value, $message));
4305    }
4306    /**
4307     * @psalm-pure
4308     * @psalm-assert bool|null $value
4309     *
4310     * @param mixed  $value
4311     * @param string $message
4312     *
4313     * @throws InvalidArgumentException
4314     *
4315     * @return void
4316     */
4317    public static function nullOrBoolean($value, $message = '')
4318    {
4319        static::__callStatic('nullOrBoolean', array($value, $message));
4320    }
4321    /**
4322     * @psalm-pure
4323     * @psalm-assert iterable<bool> $value
4324     *
4325     * @param mixed  $value
4326     * @param string $message
4327     *
4328     * @throws InvalidArgumentException
4329     *
4330     * @return void
4331     */
4332    public static function allBoolean($value, $message = '')
4333    {
4334        static::__callStatic('allBoolean', array($value, $message));
4335    }
4336    /**
4337     * @psalm-pure
4338     * @psalm-assert scalar|null $value
4339     *
4340     * @param mixed  $value
4341     * @param string $message
4342     *
4343     * @throws InvalidArgumentException
4344     *
4345     * @return void
4346     */
4347    public static function nullOrScalar($value, $message = '')
4348    {
4349        static::__callStatic('nullOrScalar', array($value, $message));
4350    }
4351    /**
4352     * @psalm-pure
4353     * @psalm-assert iterable<scalar> $value
4354     *
4355     * @param mixed  $value
4356     * @param string $message
4357     *
4358     * @throws InvalidArgumentException
4359     *
4360     * @return void
4361     */
4362    public static function allScalar($value, $message = '')
4363    {
4364        static::__callStatic('allScalar', array($value, $message));
4365    }
4366    /**
4367     * @psalm-pure
4368     * @psalm-assert object|null $value
4369     *
4370     * @param mixed  $value
4371     * @param string $message
4372     *
4373     * @throws InvalidArgumentException
4374     *
4375     * @return void
4376     */
4377    public static function nullOrObject($value, $message = '')
4378    {
4379        static::__callStatic('nullOrObject', array($value, $message));
4380    }
4381    /**
4382     * @psalm-pure
4383     * @psalm-assert iterable<object> $value
4384     *
4385     * @param mixed  $value
4386     * @param string $message
4387     *
4388     * @throws InvalidArgumentException
4389     *
4390     * @return void
4391     */
4392    public static function allObject($value, $message = '')
4393    {
4394        static::__callStatic('allObject', array($value, $message));
4395    }
4396    /**
4397     * @psalm-pure
4398     * @psalm-assert resource|null $value
4399     *
4400     * @param mixed       $value
4401     * @param string|null $type    type of resource this should be. @see https://www.php.net/manual/en/function.get-resource-type.php
4402     * @param string      $message
4403     *
4404     * @throws InvalidArgumentException
4405     *
4406     * @return void
4407     */
4408    public static function nullOrResource($value, $type = null, $message = '')
4409    {
4410        static::__callStatic('nullOrResource', array($value, $type, $message));
4411    }
4412    /**
4413     * @psalm-pure
4414     * @psalm-assert iterable<resource> $value
4415     *
4416     * @param mixed       $value
4417     * @param string|null $type    type of resource this should be. @see https://www.php.net/manual/en/function.get-resource-type.php
4418     * @param string      $message
4419     *
4420     * @throws InvalidArgumentException
4421     *
4422     * @return void
4423     */
4424    public static function allResource($value, $type = null, $message = '')
4425    {
4426        static::__callStatic('allResource', array($value, $type, $message));
4427    }
4428    /**
4429     * @psalm-pure
4430     * @psalm-assert callable|null $value
4431     *
4432     * @param mixed  $value
4433     * @param string $message
4434     *
4435     * @throws InvalidArgumentException
4436     *
4437     * @return void
4438     */
4439    public static function nullOrIsCallable($value, $message = '')
4440    {
4441        static::__callStatic('nullOrIsCallable', array($value, $message));
4442    }
4443    /**
4444     * @psalm-pure
4445     * @psalm-assert iterable<callable> $value
4446     *
4447     * @param mixed  $value
4448     * @param string $message
4449     *
4450     * @throws InvalidArgumentException
4451     *
4452     * @return void
4453     */
4454    public static function allIsCallable($value, $message = '')
4455    {
4456        static::__callStatic('allIsCallable', array($value, $message));
4457    }
4458    /**
4459     * @psalm-pure
4460     * @psalm-assert array|null $value
4461     *
4462     * @param mixed  $value
4463     * @param string $message
4464     *
4465     * @throws InvalidArgumentException
4466     *
4467     * @return void
4468     */
4469    public static function nullOrIsArray($value, $message = '')
4470    {
4471        static::__callStatic('nullOrIsArray', array($value, $message));
4472    }
4473    /**
4474     * @psalm-pure
4475     * @psalm-assert iterable<array> $value
4476     *
4477     * @param mixed  $value
4478     * @param string $message
4479     *
4480     * @throws InvalidArgumentException
4481     *
4482     * @return void
4483     */
4484    public static function allIsArray($value, $message = '')
4485    {
4486        static::__callStatic('allIsArray', array($value, $message));
4487    }
4488    /**
4489     * @psalm-pure
4490     * @psalm-assert iterable|null $value
4491     *
4492     * @deprecated use "isIterable" or "isInstanceOf" instead
4493     *
4494     * @param mixed  $value
4495     * @param string $message
4496     *
4497     * @throws InvalidArgumentException
4498     *
4499     * @return void
4500     */
4501    public static function nullOrIsTraversable($value, $message = '')
4502    {
4503        static::__callStatic('nullOrIsTraversable', array($value, $message));
4504    }
4505    /**
4506     * @psalm-pure
4507     * @psalm-assert iterable<iterable> $value
4508     *
4509     * @deprecated use "isIterable" or "isInstanceOf" instead
4510     *
4511     * @param mixed  $value
4512     * @param string $message
4513     *
4514     * @throws InvalidArgumentException
4515     *
4516     * @return void
4517     */
4518    public static function allIsTraversable($value, $message = '')
4519    {
4520        static::__callStatic('allIsTraversable', array($value, $message));
4521    }
4522    /**
4523     * @psalm-pure
4524     * @psalm-assert array|ArrayAccess|null $value
4525     *
4526     * @param mixed  $value
4527     * @param string $message
4528     *
4529     * @throws InvalidArgumentException
4530     *
4531     * @return void
4532     */
4533    public static function nullOrIsArrayAccessible($value, $message = '')
4534    {
4535        static::__callStatic('nullOrIsArrayAccessible', array($value, $message));
4536    }
4537    /**
4538     * @psalm-pure
4539     * @psalm-assert iterable<array|ArrayAccess> $value
4540     *
4541     * @param mixed  $value
4542     * @param string $message
4543     *
4544     * @throws InvalidArgumentException
4545     *
4546     * @return void
4547     */
4548    public static function allIsArrayAccessible($value, $message = '')
4549    {
4550        static::__callStatic('allIsArrayAccessible', array($value, $message));
4551    }
4552    /**
4553     * @psalm-pure
4554     * @psalm-assert countable|null $value
4555     *
4556     * @param mixed  $value
4557     * @param string $message
4558     *
4559     * @throws InvalidArgumentException
4560     *
4561     * @return void
4562     */
4563    public static function nullOrIsCountable($value, $message = '')
4564    {
4565        static::__callStatic('nullOrIsCountable', array($value, $message));
4566    }
4567    /**
4568     * @psalm-pure
4569     * @psalm-assert iterable<countable> $value
4570     *
4571     * @param mixed  $value
4572     * @param string $message
4573     *
4574     * @throws InvalidArgumentException
4575     *
4576     * @return void
4577     */
4578    public static function allIsCountable($value, $message = '')
4579    {
4580        static::__callStatic('allIsCountable', array($value, $message));
4581    }
4582    /**
4583     * @psalm-pure
4584     * @psalm-assert iterable|null $value
4585     *
4586     * @param mixed  $value
4587     * @param string $message
4588     *
4589     * @throws InvalidArgumentException
4590     *
4591     * @return void
4592     */
4593    public static function nullOrIsIterable($value, $message = '')
4594    {
4595        static::__callStatic('nullOrIsIterable', array($value, $message));
4596    }
4597    /**
4598     * @psalm-pure
4599     * @psalm-assert iterable<iterable> $value
4600     *
4601     * @param mixed  $value
4602     * @param string $message
4603     *
4604     * @throws InvalidArgumentException
4605     *
4606     * @return void
4607     */
4608    public static function allIsIterable($value, $message = '')
4609    {
4610        static::__callStatic('allIsIterable', array($value, $message));
4611    }
4612    /**
4613     * @psalm-pure
4614     * @psalm-template ExpectedType of object
4615     * @psalm-param class-string<ExpectedType> $class
4616     * @psalm-assert ExpectedType|null $value
4617     *
4618     * @param mixed         $value
4619     * @param string|object $class
4620     * @param string        $message
4621     *
4622     * @throws InvalidArgumentException
4623     *
4624     * @return void
4625     */
4626    public static function nullOrIsInstanceOf($value, $class, $message = '')
4627    {
4628        static::__callStatic('nullOrIsInstanceOf', array($value, $class, $message));
4629    }
4630    /**
4631     * @psalm-pure
4632     * @psalm-template ExpectedType of object
4633     * @psalm-param class-string<ExpectedType> $class
4634     * @psalm-assert iterable<ExpectedType> $value
4635     *
4636     * @param mixed         $value
4637     * @param string|object $class
4638     * @param string        $message
4639     *
4640     * @throws InvalidArgumentException
4641     *
4642     * @return void
4643     */
4644    public static function allIsInstanceOf($value, $class, $message = '')
4645    {
4646        static::__callStatic('allIsInstanceOf', array($value, $class, $message));
4647    }
4648    /**
4649     * @psalm-pure
4650     * @psalm-template ExpectedType of object
4651     * @psalm-param class-string<ExpectedType> $class
4652     *
4653     * @param mixed         $value
4654     * @param string|object $class
4655     * @param string        $message
4656     *
4657     * @throws InvalidArgumentException
4658     *
4659     * @return void
4660     */
4661    public static function nullOrNotInstanceOf($value, $class, $message = '')
4662    {
4663        static::__callStatic('nullOrNotInstanceOf', array($value, $class, $message));
4664    }
4665    /**
4666     * @psalm-pure
4667     * @psalm-template ExpectedType of object
4668     * @psalm-param class-string<ExpectedType> $class
4669     *
4670     * @param mixed         $value
4671     * @param string|object $class
4672     * @param string        $message
4673     *
4674     * @throws InvalidArgumentException
4675     *
4676     * @return void
4677     */
4678    public static function allNotInstanceOf($value, $class, $message = '')
4679    {
4680        static::__callStatic('allNotInstanceOf', array($value, $class, $message));
4681    }
4682    /**
4683     * @psalm-pure
4684     * @psalm-param array<class-string> $classes
4685     *
4686     * @param mixed                $value
4687     * @param array<object|string> $classes
4688     * @param string               $message
4689     *
4690     * @throws InvalidArgumentException
4691     *
4692     * @return void
4693     */
4694    public static function nullOrIsInstanceOfAny($value, $classes, $message = '')
4695    {
4696        static::__callStatic('nullOrIsInstanceOfAny', array($value, $classes, $message));
4697    }
4698    /**
4699     * @psalm-pure
4700     * @psalm-param array<class-string> $classes
4701     *
4702     * @param mixed                $value
4703     * @param array<object|string> $classes
4704     * @param string               $message
4705     *
4706     * @throws InvalidArgumentException
4707     *
4708     * @return void
4709     */
4710    public static function allIsInstanceOfAny($value, $classes, $message = '')
4711    {
4712        static::__callStatic('allIsInstanceOfAny', array($value, $classes, $message));
4713    }
4714    /**
4715     * @psalm-pure
4716     * @psalm-template ExpectedType of object
4717     * @psalm-param class-string<ExpectedType> $class
4718     * @psalm-assert ExpectedType|class-string<ExpectedType>|null $value
4719     *
4720     * @param object|string|null $value
4721     * @param string             $class
4722     * @param string             $message
4723     *
4724     * @throws InvalidArgumentException
4725     *
4726     * @return void
4727     */
4728    public static function nullOrIsAOf($value, $class, $message = '')
4729    {
4730        static::__callStatic('nullOrIsAOf', array($value, $class, $message));
4731    }
4732    /**
4733     * @psalm-pure
4734     * @psalm-template ExpectedType of object
4735     * @psalm-param class-string<ExpectedType> $class
4736     * @psalm-assert iterable<ExpectedType|class-string<ExpectedType>> $value
4737     *
4738     * @param iterable<object|string> $value
4739     * @param string                  $class
4740     * @param string                  $message
4741     *
4742     * @throws InvalidArgumentException
4743     *
4744     * @return void
4745     */
4746    public static function allIsAOf($value, $class, $message = '')
4747    {
4748        static::__callStatic('allIsAOf', array($value, $class, $message));
4749    }
4750    /**
4751     * @psalm-pure
4752     * @psalm-template UnexpectedType of object
4753     * @psalm-param class-string<UnexpectedType> $class
4754     *
4755     * @param object|string|null $value
4756     * @param string             $class
4757     * @param string             $message
4758     *
4759     * @throws InvalidArgumentException
4760     *
4761     * @return void
4762     */
4763    public static function nullOrIsNotA($value, $class, $message = '')
4764    {
4765        static::__callStatic('nullOrIsNotA', array($value, $class, $message));
4766    }
4767    /**
4768     * @psalm-pure
4769     * @psalm-template UnexpectedType of object
4770     * @psalm-param class-string<UnexpectedType> $class
4771     *
4772     * @param iterable<object|string> $value
4773     * @param string                  $class
4774     * @param string                  $message
4775     *
4776     * @throws InvalidArgumentException
4777     *
4778     * @return void
4779     */
4780    public static function allIsNotA($value, $class, $message = '')
4781    {
4782        static::__callStatic('allIsNotA', array($value, $class, $message));
4783    }
4784    /**
4785     * @psalm-pure
4786     * @psalm-param array<class-string> $classes
4787     *
4788     * @param object|string|null $value
4789     * @param string[]           $classes
4790     * @param string             $message
4791     *
4792     * @throws InvalidArgumentException
4793     *
4794     * @return void
4795     */
4796    public static function nullOrIsAnyOf($value, $classes, $message = '')
4797    {
4798        static::__callStatic('nullOrIsAnyOf', array($value, $classes, $message));
4799    }
4800    /**
4801     * @psalm-pure
4802     * @psalm-param array<class-string> $classes
4803     *
4804     * @param iterable<object|string> $value
4805     * @param string[]                $classes
4806     * @param string                  $message
4807     *
4808     * @throws InvalidArgumentException
4809     *
4810     * @return void
4811     */
4812    public static function allIsAnyOf($value, $classes, $message = '')
4813    {
4814        static::__callStatic('allIsAnyOf', array($value, $classes, $message));
4815    }
4816    /**
4817     * @psalm-pure
4818     * @psalm-assert empty $value
4819     *
4820     * @param mixed  $value
4821     * @param string $message
4822     *
4823     * @throws InvalidArgumentException
4824     *
4825     * @return void
4826     */
4827    public static function nullOrIsEmpty($value, $message = '')
4828    {
4829        static::__callStatic('nullOrIsEmpty', array($value, $message));
4830    }
4831    /**
4832     * @psalm-pure
4833     * @psalm-assert iterable<empty> $value
4834     *
4835     * @param mixed  $value
4836     * @param string $message
4837     *
4838     * @throws InvalidArgumentException
4839     *
4840     * @return void
4841     */
4842    public static function allIsEmpty($value, $message = '')
4843    {
4844        static::__callStatic('allIsEmpty', array($value, $message));
4845    }
4846    /**
4847     * @psalm-pure
4848     *
4849     * @param mixed  $value
4850     * @param string $message
4851     *
4852     * @throws InvalidArgumentException
4853     *
4854     * @return void
4855     */
4856    public static function nullOrNotEmpty($value, $message = '')
4857    {
4858        static::__callStatic('nullOrNotEmpty', array($value, $message));
4859    }
4860    /**
4861     * @psalm-pure
4862     *
4863     * @param mixed  $value
4864     * @param string $message
4865     *
4866     * @throws InvalidArgumentException
4867     *
4868     * @return void
4869     */
4870    public static function allNotEmpty($value, $message = '')
4871    {
4872        static::__callStatic('allNotEmpty', array($value, $message));
4873    }
4874    /**
4875     * @psalm-pure
4876     * @psalm-assert iterable<null> $value
4877     *
4878     * @param mixed  $value
4879     * @param string $message
4880     *
4881     * @throws InvalidArgumentException
4882     *
4883     * @return void
4884     */
4885    public static function allNull($value, $message = '')
4886    {
4887        static::__callStatic('allNull', array($value, $message));
4888    }
4889    /**
4890     * @psalm-pure
4891     *
4892     * @param mixed  $value
4893     * @param string $message
4894     *
4895     * @throws InvalidArgumentException
4896     *
4897     * @return void
4898     */
4899    public static function allNotNull($value, $message = '')
4900    {
4901        static::__callStatic('allNotNull', array($value, $message));
4902    }
4903    /**
4904     * @psalm-pure
4905     * @psalm-assert true|null $value
4906     *
4907     * @param mixed  $value
4908     * @param string $message
4909     *
4910     * @throws InvalidArgumentException
4911     *
4912     * @return void
4913     */
4914    public static function nullOrTrue($value, $message = '')
4915    {
4916        static::__callStatic('nullOrTrue', array($value, $message));
4917    }
4918    /**
4919     * @psalm-pure
4920     * @psalm-assert iterable<true> $value
4921     *
4922     * @param mixed  $value
4923     * @param string $message
4924     *
4925     * @throws InvalidArgumentException
4926     *
4927     * @return void
4928     */
4929    public static function allTrue($value, $message = '')
4930    {
4931        static::__callStatic('allTrue', array($value, $message));
4932    }
4933    /**
4934     * @psalm-pure
4935     * @psalm-assert false|null $value
4936     *
4937     * @param mixed  $value
4938     * @param string $message
4939     *
4940     * @throws InvalidArgumentException
4941     *
4942     * @return void
4943     */
4944    public static function nullOrFalse($value, $message = '')
4945    {
4946        static::__callStatic('nullOrFalse', array($value, $message));
4947    }
4948    /**
4949     * @psalm-pure
4950     * @psalm-assert iterable<false> $value
4951     *
4952     * @param mixed  $value
4953     * @param string $message
4954     *
4955     * @throws InvalidArgumentException
4956     *
4957     * @return void
4958     */
4959    public static function allFalse($value, $message = '')
4960    {
4961        static::__callStatic('allFalse', array($value, $message));
4962    }
4963    /**
4964     * @psalm-pure
4965     *
4966     * @param mixed  $value
4967     * @param string $message
4968     *
4969     * @throws InvalidArgumentException
4970     *
4971     * @return void
4972     */
4973    public static function nullOrNotFalse($value, $message = '')
4974    {
4975        static::__callStatic('nullOrNotFalse', array($value, $message));
4976    }
4977    /**
4978     * @psalm-pure
4979     *
4980     * @param mixed  $value
4981     * @param string $message
4982     *
4983     * @throws InvalidArgumentException
4984     *
4985     * @return void
4986     */
4987    public static function allNotFalse($value, $message = '')
4988    {
4989        static::__callStatic('allNotFalse', array($value, $message));
4990    }
4991    /**
4992     * @param mixed  $value
4993     * @param string $message
4994     *
4995     * @throws InvalidArgumentException
4996     *
4997     * @return void
4998     */
4999    public static function nullOrIp($value, $message = '')
5000    {
5001        static::__callStatic('nullOrIp', array($value, $message));
5002    }
5003    /**
5004     * @param mixed  $value
5005     * @param string $message
5006     *
5007     * @throws InvalidArgumentException
5008     *
5009     * @return void
5010     */
5011    public static function allIp($value, $message = '')
5012    {
5013        static::__callStatic('allIp', array($value, $message));
5014    }
5015    /**
5016     * @param mixed  $value
5017     * @param string $message
5018     *
5019     * @throws InvalidArgumentException
5020     *
5021     * @return void
5022     */
5023    public static function nullOrIpv4($value, $message = '')
5024    {
5025        static::__callStatic('nullOrIpv4', array($value, $message));
5026    }
5027    /**
5028     * @param mixed  $value
5029     * @param string $message
5030     *
5031     * @throws InvalidArgumentException
5032     *
5033     * @return void
5034     */
5035    public static function allIpv4($value, $message = '')
5036    {
5037        static::__callStatic('allIpv4', array($value, $message));
5038    }
5039    /**
5040     * @param mixed  $value
5041     * @param string $message
5042     *
5043     * @throws InvalidArgumentException
5044     *
5045     * @return void
5046     */
5047    public static function nullOrIpv6($value, $message = '')
5048    {
5049        static::__callStatic('nullOrIpv6', array($value, $message));
5050    }
5051    /**
5052     * @param mixed  $value
5053     * @param string $message
5054     *
5055     * @throws InvalidArgumentException
5056     *
5057     * @return void
5058     */
5059    public static function allIpv6($value, $message = '')
5060    {
5061        static::__callStatic('allIpv6', array($value, $message));
5062    }
5063    /**
5064     * @param mixed  $value
5065     * @param string $message
5066     *
5067     * @throws InvalidArgumentException
5068     *
5069     * @return void
5070     */
5071    public static function nullOrEmail($value, $message = '')
5072    {
5073        static::__callStatic('nullOrEmail', array($value, $message));
5074    }
5075    /**
5076     * @param mixed  $value
5077     * @param string $message
5078     *
5079     * @throws InvalidArgumentException
5080     *
5081     * @return void
5082     */
5083    public static function allEmail($value, $message = '')
5084    {
5085        static::__callStatic('allEmail', array($value, $message));
5086    }
5087    /**
5088     * @param array|null $values
5089     * @param string     $message
5090     *
5091     * @throws InvalidArgumentException
5092     *
5093     * @return void
5094     */
5095    public static function nullOrUniqueValues($values, $message = '')
5096    {
5097        static::__callStatic('nullOrUniqueValues', array($values, $message));
5098    }
5099    /**
5100     * @param iterable<array> $values
5101     * @param string          $message
5102     *
5103     * @throws InvalidArgumentException
5104     *
5105     * @return void
5106     */
5107    public static function allUniqueValues($values, $message = '')
5108    {
5109        static::__callStatic('allUniqueValues', array($values, $message));
5110    }
5111    /**
5112     * @param mixed  $value
5113     * @param mixed  $expect
5114     * @param string $message
5115     *
5116     * @throws InvalidArgumentException
5117     *
5118     * @return void
5119     */
5120    public static function nullOrEq($value, $expect, $message = '')
5121    {
5122        static::__callStatic('nullOrEq', array($value, $expect, $message));
5123    }
5124    /**
5125     * @param mixed  $value
5126     * @param mixed  $expect
5127     * @param string $message
5128     *
5129     * @throws InvalidArgumentException
5130     *
5131     * @return void
5132     */
5133    public static function allEq($value, $expect, $message = '')
5134    {
5135        static::__callStatic('allEq', array($value, $expect, $message));
5136    }
5137    /**
5138     * @param mixed  $value
5139     * @param mixed  $expect
5140     * @param string $message
5141     *
5142     * @throws InvalidArgumentException
5143     *
5144     * @return void
5145     */
5146    public static function nullOrNotEq($value, $expect, $message = '')
5147    {
5148        static::__callStatic('nullOrNotEq', array($value, $expect, $message));
5149    }
5150    /**
5151     * @param mixed  $value
5152     * @param mixed  $expect
5153     * @param string $message
5154     *
5155     * @throws InvalidArgumentException
5156     *
5157     * @return void
5158     */
5159    public static function allNotEq($value, $expect, $message = '')
5160    {
5161        static::__callStatic('allNotEq', array($value, $expect, $message));
5162    }
5163    /**
5164     * @psalm-pure
5165     *
5166     * @param mixed  $value
5167     * @param mixed  $expect
5168     * @param string $message
5169     *
5170     * @throws InvalidArgumentException
5171     *
5172     * @return void
5173     */
5174    public static function nullOrSame($value, $expect, $message = '')
5175    {
5176        static::__callStatic('nullOrSame', array($value, $expect, $message));
5177    }
5178    /**
5179     * @psalm-pure
5180     *
5181     * @param mixed  $value
5182     * @param mixed  $expect
5183     * @param string $message
5184     *
5185     * @throws InvalidArgumentException
5186     *
5187     * @return void
5188     */
5189    public static function allSame($value, $expect, $message = '')
5190    {
5191        static::__callStatic('allSame', array($value, $expect, $message));
5192    }
5193    /**
5194     * @psalm-pure
5195     *
5196     * @param mixed  $value
5197     * @param mixed  $expect
5198     * @param string $message
5199     *
5200     * @throws InvalidArgumentException
5201     *
5202     * @return void
5203     */
5204    public static function nullOrNotSame($value, $expect, $message = '')
5205    {
5206        static::__callStatic('nullOrNotSame', array($value, $expect, $message));
5207    }
5208    /**
5209     * @psalm-pure
5210     *
5211     * @param mixed  $value
5212     * @param mixed  $expect
5213     * @param string $message
5214     *
5215     * @throws InvalidArgumentException
5216     *
5217     * @return void
5218     */
5219    public static function allNotSame($value, $expect, $message = '')
5220    {
5221        static::__callStatic('allNotSame', array($value, $expect, $message));
5222    }
5223    /**
5224     * @psalm-pure
5225     *
5226     * @param mixed  $value
5227     * @param mixed  $limit
5228     * @param string $message
5229     *
5230     * @throws InvalidArgumentException
5231     *
5232     * @return void
5233     */
5234    public static function nullOrGreaterThan($value, $limit, $message = '')
5235    {
5236        static::__callStatic('nullOrGreaterThan', array($value, $limit, $message));
5237    }
5238    /**
5239     * @psalm-pure
5240     *
5241     * @param mixed  $value
5242     * @param mixed  $limit
5243     * @param string $message
5244     *
5245     * @throws InvalidArgumentException
5246     *
5247     * @return void
5248     */
5249    public static function allGreaterThan($value, $limit, $message = '')
5250    {
5251        static::__callStatic('allGreaterThan', array($value, $limit, $message));
5252    }
5253    /**
5254     * @psalm-pure
5255     *
5256     * @param mixed  $value
5257     * @param mixed  $limit
5258     * @param string $message
5259     *
5260     * @throws InvalidArgumentException
5261     *
5262     * @return void
5263     */
5264    public static function nullOrGreaterThanEq($value, $limit, $message = '')
5265    {
5266        static::__callStatic('nullOrGreaterThanEq', array($value, $limit, $message));
5267    }
5268    /**
5269     * @psalm-pure
5270     *
5271     * @param mixed  $value
5272     * @param mixed  $limit
5273     * @param string $message
5274     *
5275     * @throws InvalidArgumentException
5276     *
5277     * @return void
5278     */
5279    public static function allGreaterThanEq($value, $limit, $message = '')
5280    {
5281        static::__callStatic('allGreaterThanEq', array($value, $limit, $message));
5282    }
5283    /**
5284     * @psalm-pure
5285     *
5286     * @param mixed  $value
5287     * @param mixed  $limit
5288     * @param string $message
5289     *
5290     * @throws InvalidArgumentException
5291     *
5292     * @return void
5293     */
5294    public static function nullOrLessThan($value, $limit, $message = '')
5295    {
5296        static::__callStatic('nullOrLessThan', array($value, $limit, $message));
5297    }
5298    /**
5299     * @psalm-pure
5300     *
5301     * @param mixed  $value
5302     * @param mixed  $limit
5303     * @param string $message
5304     *
5305     * @throws InvalidArgumentException
5306     *
5307     * @return void
5308     */
5309    public static function allLessThan($value, $limit, $message = '')
5310    {
5311        static::__callStatic('allLessThan', array($value, $limit, $message));
5312    }
5313    /**
5314     * @psalm-pure
5315     *
5316     * @param mixed  $value
5317     * @param mixed  $limit
5318     * @param string $message
5319     *
5320     * @throws InvalidArgumentException
5321     *
5322     * @return void
5323     */
5324    public static function nullOrLessThanEq($value, $limit, $message = '')
5325    {
5326        static::__callStatic('nullOrLessThanEq', array($value, $limit, $message));
5327    }
5328    /**
5329     * @psalm-pure
5330     *
5331     * @param mixed  $value
5332     * @param mixed  $limit
5333     * @param string $message
5334     *
5335     * @throws InvalidArgumentException
5336     *
5337     * @return void
5338     */
5339    public static function allLessThanEq($value, $limit, $message = '')
5340    {
5341        static::__callStatic('allLessThanEq', array($value, $limit, $message));
5342    }
5343    /**
5344     * @psalm-pure
5345     *
5346     * @param mixed  $value
5347     * @param mixed  $min
5348     * @param mixed  $max
5349     * @param string $message
5350     *
5351     * @throws InvalidArgumentException
5352     *
5353     * @return void
5354     */
5355    public static function nullOrRange($value, $min, $max, $message = '')
5356    {
5357        static::__callStatic('nullOrRange', array($value, $min, $max, $message));
5358    }
5359    /**
5360     * @psalm-pure
5361     *
5362     * @param mixed  $value
5363     * @param mixed  $min
5364     * @param mixed  $max
5365     * @param string $message
5366     *
5367     * @throws InvalidArgumentException
5368     *
5369     * @return void
5370     */
5371    public static function allRange($value, $min, $max, $message = '')
5372    {
5373        static::__callStatic('allRange', array($value, $min, $max, $message));
5374    }
5375    /**
5376     * @psalm-pure
5377     *
5378     * @param mixed  $value
5379     * @param array  $values
5380     * @param string $message
5381     *
5382     * @throws InvalidArgumentException
5383     *
5384     * @return void
5385     */
5386    public static function nullOrOneOf($value, $values, $message = '')
5387    {
5388        static::__callStatic('nullOrOneOf', array($value, $values, $message));
5389    }
5390    /**
5391     * @psalm-pure
5392     *
5393     * @param mixed  $value
5394     * @param array  $values
5395     * @param string $message
5396     *
5397     * @throws InvalidArgumentException
5398     *
5399     * @return void
5400     */
5401    public static function allOneOf($value, $values, $message = '')
5402    {
5403        static::__callStatic('allOneOf', array($value, $values, $message));
5404    }
5405    /**
5406     * @psalm-pure
5407     *
5408     * @param mixed  $value
5409     * @param array  $values
5410     * @param string $message
5411     *
5412     * @throws InvalidArgumentException
5413     *
5414     * @return void
5415     */
5416    public static function nullOrInArray($value, $values, $message = '')
5417    {
5418        static::__callStatic('nullOrInArray', array($value, $values, $message));
5419    }
5420    /**
5421     * @psalm-pure
5422     *
5423     * @param mixed  $value
5424     * @param array  $values
5425     * @param string $message
5426     *
5427     * @throws InvalidArgumentException
5428     *
5429     * @return void
5430     */
5431    public static function allInArray($value, $values, $message = '')
5432    {
5433        static::__callStatic('allInArray', array($value, $values, $message));
5434    }
5435    /**
5436     * @psalm-pure
5437     *
5438     * @param string|null $value
5439     * @param string      $subString
5440     * @param string      $message
5441     *
5442     * @throws InvalidArgumentException
5443     *
5444     * @return void
5445     */
5446    public static function nullOrContains($value, $subString, $message = '')
5447    {
5448        static::__callStatic('nullOrContains', array($value, $subString, $message));
5449    }
5450    /**
5451     * @psalm-pure
5452     *
5453     * @param iterable<string> $value
5454     * @param string           $subString
5455     * @param string           $message
5456     *
5457     * @throws InvalidArgumentException
5458     *
5459     * @return void
5460     */
5461    public static function allContains($value, $subString, $message = '')
5462    {
5463        static::__callStatic('allContains', array($value, $subString, $message));
5464    }
5465    /**
5466     * @psalm-pure
5467     *
5468     * @param string|null $value
5469     * @param string      $subString
5470     * @param string      $message
5471     *
5472     * @throws InvalidArgumentException
5473     *
5474     * @return void
5475     */
5476    public static function nullOrNotContains($value, $subString, $message = '')
5477    {
5478        static::__callStatic('nullOrNotContains', array($value, $subString, $message));
5479    }
5480    /**
5481     * @psalm-pure
5482     *
5483     * @param iterable<string> $value
5484     * @param string           $subString
5485     * @param string           $message
5486     *
5487     * @throws InvalidArgumentException
5488     *
5489     * @return void
5490     */
5491    public static function allNotContains($value, $subString, $message = '')
5492    {
5493        static::__callStatic('allNotContains', array($value, $subString, $message));
5494    }
5495    /**
5496     * @psalm-pure
5497     *
5498     * @param string|null $value
5499     * @param string      $message
5500     *
5501     * @throws InvalidArgumentException
5502     *
5503     * @return void
5504     */
5505    public static function nullOrNotWhitespaceOnly($value, $message = '')
5506    {
5507        static::__callStatic('nullOrNotWhitespaceOnly', array($value, $message));
5508    }
5509    /**
5510     * @psalm-pure
5511     *
5512     * @param iterable<string> $value
5513     * @param string           $message
5514     *
5515     * @throws InvalidArgumentException
5516     *
5517     * @return void
5518     */
5519    public static function allNotWhitespaceOnly($value, $message = '')
5520    {
5521        static::__callStatic('allNotWhitespaceOnly', array($value, $message));
5522    }
5523    /**
5524     * @psalm-pure
5525     *
5526     * @param string|null $value
5527     * @param string      $prefix
5528     * @param string      $message
5529     *
5530     * @throws InvalidArgumentException
5531     *
5532     * @return void
5533     */
5534    public static function nullOrStartsWith($value, $prefix, $message = '')
5535    {
5536        static::__callStatic('nullOrStartsWith', array($value, $prefix, $message));
5537    }
5538    /**
5539     * @psalm-pure
5540     *
5541     * @param iterable<string> $value
5542     * @param string           $prefix
5543     * @param string           $message
5544     *
5545     * @throws InvalidArgumentException
5546     *
5547     * @return void
5548     */
5549    public static function allStartsWith($value, $prefix, $message = '')
5550    {
5551        static::__callStatic('allStartsWith', array($value, $prefix, $message));
5552    }
5553    /**
5554     * @psalm-pure
5555     *
5556     * @param string|null $value
5557     * @param string      $prefix
5558     * @param string      $message
5559     *
5560     * @throws InvalidArgumentException
5561     *
5562     * @return void
5563     */
5564    public static function nullOrNotStartsWith($value, $prefix, $message = '')
5565    {
5566        static::__callStatic('nullOrNotStartsWith', array($value, $prefix, $message));
5567    }
5568    /**
5569     * @psalm-pure
5570     *
5571     * @param iterable<string> $value
5572     * @param string           $prefix
5573     * @param string           $message
5574     *
5575     * @throws InvalidArgumentException
5576     *
5577     * @return void
5578     */
5579    public static function allNotStartsWith($value, $prefix, $message = '')
5580    {
5581        static::__callStatic('allNotStartsWith', array($value, $prefix, $message));
5582    }
5583    /**
5584     * @psalm-pure
5585     *
5586     * @param mixed  $value
5587     * @param string $message
5588     *
5589     * @throws InvalidArgumentException
5590     *
5591     * @return void
5592     */
5593    public static function nullOrStartsWithLetter($value, $message = '')
5594    {
5595        static::__callStatic('nullOrStartsWithLetter', array($value, $message));
5596    }
5597    /**
5598     * @psalm-pure
5599     *
5600     * @param mixed  $value
5601     * @param string $message
5602     *
5603     * @throws InvalidArgumentException
5604     *
5605     * @return void
5606     */
5607    public static function allStartsWithLetter($value, $message = '')
5608    {
5609        static::__callStatic('allStartsWithLetter', array($value, $message));
5610    }
5611    /**
5612     * @psalm-pure
5613     *
5614     * @param string|null $value
5615     * @param string      $suffix
5616     * @param string      $message
5617     *
5618     * @throws InvalidArgumentException
5619     *
5620     * @return void
5621     */
5622    public static function nullOrEndsWith($value, $suffix, $message = '')
5623    {
5624        static::__callStatic('nullOrEndsWith', array($value, $suffix, $message));
5625    }
5626    /**
5627     * @psalm-pure
5628     *
5629     * @param iterable<string> $value
5630     * @param string           $suffix
5631     * @param string           $message
5632     *
5633     * @throws InvalidArgumentException
5634     *
5635     * @return void
5636     */
5637    public static function allEndsWith($value, $suffix, $message = '')
5638    {
5639        static::__callStatic('allEndsWith', array($value, $suffix, $message));
5640    }
5641    /**
5642     * @psalm-pure
5643     *
5644     * @param string|null $value
5645     * @param string      $suffix
5646     * @param string      $message
5647     *
5648     * @throws InvalidArgumentException
5649     *
5650     * @return void
5651     */
5652    public static function nullOrNotEndsWith($value, $suffix, $message = '')
5653    {
5654        static::__callStatic('nullOrNotEndsWith', array($value, $suffix, $message));
5655    }
5656    /**
5657     * @psalm-pure
5658     *
5659     * @param iterable<string> $value
5660     * @param string           $suffix
5661     * @param string           $message
5662     *
5663     * @throws InvalidArgumentException
5664     *
5665     * @return void
5666     */
5667    public static function allNotEndsWith($value, $suffix, $message = '')
5668    {
5669        static::__callStatic('allNotEndsWith', array($value, $suffix, $message));
5670    }
5671    /**
5672     * @psalm-pure
5673     *
5674     * @param string|null $value
5675     * @param string      $pattern
5676     * @param string      $message
5677     *
5678     * @throws InvalidArgumentException
5679     *
5680     * @return void
5681     */
5682    public static function nullOrRegex($value, $pattern, $message = '')
5683    {
5684        static::__callStatic('nullOrRegex', array($value, $pattern, $message));
5685    }
5686    /**
5687     * @psalm-pure
5688     *
5689     * @param iterable<string> $value
5690     * @param string           $pattern
5691     * @param string           $message
5692     *
5693     * @throws InvalidArgumentException
5694     *
5695     * @return void
5696     */
5697    public static function allRegex($value, $pattern, $message = '')
5698    {
5699        static::__callStatic('allRegex', array($value, $pattern, $message));
5700    }
5701    /**
5702     * @psalm-pure
5703     *
5704     * @param string|null $value
5705     * @param string      $pattern
5706     * @param string      $message
5707     *
5708     * @throws InvalidArgumentException
5709     *
5710     * @return void
5711     */
5712    public static function nullOrNotRegex($value, $pattern, $message = '')
5713    {
5714        static::__callStatic('nullOrNotRegex', array($value, $pattern, $message));
5715    }
5716    /**
5717     * @psalm-pure
5718     *
5719     * @param iterable<string> $value
5720     * @param string           $pattern
5721     * @param string           $message
5722     *
5723     * @throws InvalidArgumentException
5724     *
5725     * @return void
5726     */
5727    public static function allNotRegex($value, $pattern, $message = '')
5728    {
5729        static::__callStatic('allNotRegex', array($value, $pattern, $message));
5730    }
5731    /**
5732     * @psalm-pure
5733     *
5734     * @param mixed  $value
5735     * @param string $message
5736     *
5737     * @throws InvalidArgumentException
5738     *
5739     * @return void
5740     */
5741    public static function nullOrUnicodeLetters($value, $message = '')
5742    {
5743        static::__callStatic('nullOrUnicodeLetters', array($value, $message));
5744    }
5745    /**
5746     * @psalm-pure
5747     *
5748     * @param mixed  $value
5749     * @param string $message
5750     *
5751     * @throws InvalidArgumentException
5752     *
5753     * @return void
5754     */
5755    public static function allUnicodeLetters($value, $message = '')
5756    {
5757        static::__callStatic('allUnicodeLetters', array($value, $message));
5758    }
5759    /**
5760     * @psalm-pure
5761     *
5762     * @param mixed  $value
5763     * @param string $message
5764     *
5765     * @throws InvalidArgumentException
5766     *
5767     * @return void
5768     */
5769    public static function nullOrAlpha($value, $message = '')
5770    {
5771        static::__callStatic('nullOrAlpha', array($value, $message));
5772    }
5773    /**
5774     * @psalm-pure
5775     *
5776     * @param mixed  $value
5777     * @param string $message
5778     *
5779     * @throws InvalidArgumentException
5780     *
5781     * @return void
5782     */
5783    public static function allAlpha($value, $message = '')
5784    {
5785        static::__callStatic('allAlpha', array($value, $message));
5786    }
5787    /**
5788     * @psalm-pure
5789     *
5790     * @param string|null $value
5791     * @param string      $message
5792     *
5793     * @throws InvalidArgumentException
5794     *
5795     * @return void
5796     */
5797    public static function nullOrDigits($value, $message = '')
5798    {
5799        static::__callStatic('nullOrDigits', array($value, $message));
5800    }
5801    /**
5802     * @psalm-pure
5803     *
5804     * @param iterable<string> $value
5805     * @param string           $message
5806     *
5807     * @throws InvalidArgumentException
5808     *
5809     * @return void
5810     */
5811    public static function allDigits($value, $message = '')
5812    {
5813        static::__callStatic('allDigits', array($value, $message));
5814    }
5815    /**
5816     * @psalm-pure
5817     *
5818     * @param string|null $value
5819     * @param string      $message
5820     *
5821     * @throws InvalidArgumentException
5822     *
5823     * @return void
5824     */
5825    public static function nullOrAlnum($value, $message = '')
5826    {
5827        static::__callStatic('nullOrAlnum', array($value, $message));
5828    }
5829    /**
5830     * @psalm-pure
5831     *
5832     * @param iterable<string> $value
5833     * @param string           $message
5834     *
5835     * @throws InvalidArgumentException
5836     *
5837     * @return void
5838     */
5839    public static function allAlnum($value, $message = '')
5840    {
5841        static::__callStatic('allAlnum', array($value, $message));
5842    }
5843    /**
5844     * @psalm-pure
5845     * @psalm-assert lowercase-string|null $value
5846     *
5847     * @param string|null $value
5848     * @param string      $message
5849     *
5850     * @throws InvalidArgumentException
5851     *
5852     * @return void
5853     */
5854    public static function nullOrLower($value, $message = '')
5855    {
5856        static::__callStatic('nullOrLower', array($value, $message));
5857    }
5858    /**
5859     * @psalm-pure
5860     * @psalm-assert iterable<lowercase-string> $value
5861     *
5862     * @param iterable<string> $value
5863     * @param string           $message
5864     *
5865     * @throws InvalidArgumentException
5866     *
5867     * @return void
5868     */
5869    public static function allLower($value, $message = '')
5870    {
5871        static::__callStatic('allLower', array($value, $message));
5872    }
5873    /**
5874     * @psalm-pure
5875     *
5876     * @param string|null $value
5877     * @param string      $message
5878     *
5879     * @throws InvalidArgumentException
5880     *
5881     * @return void
5882     */
5883    public static function nullOrUpper($value, $message = '')
5884    {
5885        static::__callStatic('nullOrUpper', array($value, $message));
5886    }
5887    /**
5888     * @psalm-pure
5889     *
5890     * @param iterable<string> $value
5891     * @param string           $message
5892     *
5893     * @throws InvalidArgumentException
5894     *
5895     * @return void
5896     */
5897    public static function allUpper($value, $message = '')
5898    {
5899        static::__callStatic('allUpper', array($value, $message));
5900    }
5901    /**
5902     * @psalm-pure
5903     *
5904     * @param string|null $value
5905     * @param int         $length
5906     * @param string      $message
5907     *
5908     * @throws InvalidArgumentException
5909     *
5910     * @return void
5911     */
5912    public static function nullOrLength($value, $length, $message = '')
5913    {
5914        static::__callStatic('nullOrLength', array($value, $length, $message));
5915    }
5916    /**
5917     * @psalm-pure
5918     *
5919     * @param iterable<string> $value
5920     * @param int              $length
5921     * @param string           $message
5922     *
5923     * @throws InvalidArgumentException
5924     *
5925     * @return void
5926     */
5927    public static function allLength($value, $length, $message = '')
5928    {
5929        static::__callStatic('allLength', array($value, $length, $message));
5930    }
5931    /**
5932     * @psalm-pure
5933     *
5934     * @param string|null $value
5935     * @param int|float   $min
5936     * @param string      $message
5937     *
5938     * @throws InvalidArgumentException
5939     *
5940     * @return void
5941     */
5942    public static function nullOrMinLength($value, $min, $message = '')
5943    {
5944        static::__callStatic('nullOrMinLength', array($value, $min, $message));
5945    }
5946    /**
5947     * @psalm-pure
5948     *
5949     * @param iterable<string> $value
5950     * @param int|float        $min
5951     * @param string           $message
5952     *
5953     * @throws InvalidArgumentException
5954     *
5955     * @return void
5956     */
5957    public static function allMinLength($value, $min, $message = '')
5958    {
5959        static::__callStatic('allMinLength', array($value, $min, $message));
5960    }
5961    /**
5962     * @psalm-pure
5963     *
5964     * @param string|null $value
5965     * @param int|float   $max
5966     * @param string      $message
5967     *
5968     * @throws InvalidArgumentException
5969     *
5970     * @return void
5971     */
5972    public static function nullOrMaxLength($value, $max, $message = '')
5973    {
5974        static::__callStatic('nullOrMaxLength', array($value, $max, $message));
5975    }
5976    /**
5977     * @psalm-pure
5978     *
5979     * @param iterable<string> $value
5980     * @param int|float        $max
5981     * @param string           $message
5982     *
5983     * @throws InvalidArgumentException
5984     *
5985     * @return void
5986     */
5987    public static function allMaxLength($value, $max, $message = '')
5988    {
5989        static::__callStatic('allMaxLength', array($value, $max, $message));
5990    }
5991    /**
5992     * @psalm-pure
5993     *
5994     * @param string|null $value
5995     * @param int|float   $min
5996     * @param int|float   $max
5997     * @param string      $message
5998     *
5999     * @throws InvalidArgumentException
6000     *
6001     * @return void
6002     */
6003    public static function nullOrLengthBetween($value, $min, $max, $message = '')
6004    {
6005        static::__callStatic('nullOrLengthBetween', array($value, $min, $max, $message));
6006    }
6007    /**
6008     * @psalm-pure
6009     *
6010     * @param iterable<string> $value
6011     * @param int|float        $min
6012     * @param int|float        $max
6013     * @param string           $message
6014     *
6015     * @throws InvalidArgumentException
6016     *
6017     * @return void
6018     */
6019    public static function allLengthBetween($value, $min, $max, $message = '')
6020    {
6021        static::__callStatic('allLengthBetween', array($value, $min, $max, $message));
6022    }
6023    /**
6024     * @param mixed  $value
6025     * @param string $message
6026     *
6027     * @throws InvalidArgumentException
6028     *
6029     * @return void
6030     */
6031    public static function nullOrFileExists($value, $message = '')
6032    {
6033        static::__callStatic('nullOrFileExists', array($value, $message));
6034    }
6035    /**
6036     * @param mixed  $value
6037     * @param string $message
6038     *
6039     * @throws InvalidArgumentException
6040     *
6041     * @return void
6042     */
6043    public static function allFileExists($value, $message = '')
6044    {
6045        static::__callStatic('allFileExists', array($value, $message));
6046    }
6047    /**
6048     * @param mixed  $value
6049     * @param string $message
6050     *
6051     * @throws InvalidArgumentException
6052     *
6053     * @return void
6054     */
6055    public static function nullOrFile($value, $message = '')
6056    {
6057        static::__callStatic('nullOrFile', array($value, $message));
6058    }
6059    /**
6060     * @param mixed  $value
6061     * @param string $message
6062     *
6063     * @throws InvalidArgumentException
6064     *
6065     * @return void
6066     */
6067    public static function allFile($value, $message = '')
6068    {
6069        static::__callStatic('allFile', array($value, $message));
6070    }
6071    /**
6072     * @param mixed  $value
6073     * @param string $message
6074     *
6075     * @throws InvalidArgumentException
6076     *
6077     * @return void
6078     */
6079    public static function nullOrDirectory($value, $message = '')
6080    {
6081        static::__callStatic('nullOrDirectory', array($value, $message));
6082    }
6083    /**
6084     * @param mixed  $value
6085     * @param string $message
6086     *
6087     * @throws InvalidArgumentException
6088     *
6089     * @return void
6090     */
6091    public static function allDirectory($value, $message = '')
6092    {
6093        static::__callStatic('allDirectory', array($value, $message));
6094    }
6095    /**
6096     * @param string|null $value
6097     * @param string      $message
6098     *
6099     * @throws InvalidArgumentException
6100     *
6101     * @return void
6102     */
6103    public static function nullOrReadable($value, $message = '')
6104    {
6105        static::__callStatic('nullOrReadable', array($value, $message));
6106    }
6107    /**
6108     * @param iterable<string> $value
6109     * @param string           $message
6110     *
6111     * @throws InvalidArgumentException
6112     *
6113     * @return void
6114     */
6115    public static function allReadable($value, $message = '')
6116    {
6117        static::__callStatic('allReadable', array($value, $message));
6118    }
6119    /**
6120     * @param string|null $value
6121     * @param string      $message
6122     *
6123     * @throws InvalidArgumentException
6124     *
6125     * @return void
6126     */
6127    public static function nullOrWritable($value, $message = '')
6128    {
6129        static::__callStatic('nullOrWritable', array($value, $message));
6130    }
6131    /**
6132     * @param iterable<string> $value
6133     * @param string           $message
6134     *
6135     * @throws InvalidArgumentException
6136     *
6137     * @return void
6138     */
6139    public static function allWritable($value, $message = '')
6140    {
6141        static::__callStatic('allWritable', array($value, $message));
6142    }
6143    /**
6144     * @psalm-assert class-string|null $value
6145     *
6146     * @param mixed  $value
6147     * @param string $message
6148     *
6149     * @throws InvalidArgumentException
6150     *
6151     * @return void
6152     */
6153    public static function nullOrClassExists($value, $message = '')
6154    {
6155        static::__callStatic('nullOrClassExists', array($value, $message));
6156    }
6157    /**
6158     * @psalm-assert iterable<class-string> $value
6159     *
6160     * @param mixed  $value
6161     * @param string $message
6162     *
6163     * @throws InvalidArgumentException
6164     *
6165     * @return void
6166     */
6167    public static function allClassExists($value, $message = '')
6168    {
6169        static::__callStatic('allClassExists', array($value, $message));
6170    }
6171    /**
6172     * @psalm-pure
6173     * @psalm-template ExpectedType of object
6174     * @psalm-param class-string<ExpectedType> $class
6175     * @psalm-assert class-string<ExpectedType>|ExpectedType|null $value
6176     *
6177     * @param mixed         $value
6178     * @param string|object $class
6179     * @param string        $message
6180     *
6181     * @throws InvalidArgumentException
6182     *
6183     * @return void
6184     */
6185    public static function nullOrSubclassOf($value, $class, $message = '')
6186    {
6187        static::__callStatic('nullOrSubclassOf', array($value, $class, $message));
6188    }
6189    /**
6190     * @psalm-pure
6191     * @psalm-template ExpectedType of object
6192     * @psalm-param class-string<ExpectedType> $class
6193     * @psalm-assert iterable<class-string<ExpectedType>|ExpectedType> $value
6194     *
6195     * @param mixed         $value
6196     * @param string|object $class
6197     * @param string        $message
6198     *
6199     * @throws InvalidArgumentException
6200     *
6201     * @return void
6202     */
6203    public static function allSubclassOf($value, $class, $message = '')
6204    {
6205        static::__callStatic('allSubclassOf', array($value, $class, $message));
6206    }
6207    /**
6208     * @psalm-assert class-string|null $value
6209     *
6210     * @param mixed  $value
6211     * @param string $message
6212     *
6213     * @throws InvalidArgumentException
6214     *
6215     * @return void
6216     */
6217    public static function nullOrInterfaceExists($value, $message = '')
6218    {
6219        static::__callStatic('nullOrInterfaceExists', array($value, $message));
6220    }
6221    /**
6222     * @psalm-assert iterable<class-string> $value
6223     *
6224     * @param mixed  $value
6225     * @param string $message
6226     *
6227     * @throws InvalidArgumentException
6228     *
6229     * @return void
6230     */
6231    public static function allInterfaceExists($value, $message = '')
6232    {
6233        static::__callStatic('allInterfaceExists', array($value, $message));
6234    }
6235    /**
6236     * @psalm-pure
6237     * @psalm-template ExpectedType of object
6238     * @psalm-param class-string<ExpectedType> $interface
6239     * @psalm-assert class-string<ExpectedType>|null $value
6240     *
6241     * @param mixed  $value
6242     * @param mixed  $interface
6243     * @param string $message
6244     *
6245     * @throws InvalidArgumentException
6246     *
6247     * @return void
6248     */
6249    public static function nullOrImplementsInterface($value, $interface, $message = '')
6250    {
6251        static::__callStatic('nullOrImplementsInterface', array($value, $interface, $message));
6252    }
6253    /**
6254     * @psalm-pure
6255     * @psalm-template ExpectedType of object
6256     * @psalm-param class-string<ExpectedType> $interface
6257     * @psalm-assert iterable<class-string<ExpectedType>> $value
6258     *
6259     * @param mixed  $value
6260     * @param mixed  $interface
6261     * @param string $message
6262     *
6263     * @throws InvalidArgumentException
6264     *
6265     * @return void
6266     */
6267    public static function allImplementsInterface($value, $interface, $message = '')
6268    {
6269        static::__callStatic('allImplementsInterface', array($value, $interface, $message));
6270    }
6271    /**
6272     * @psalm-pure
6273     * @psalm-param class-string|object|null $classOrObject
6274     *
6275     * @param string|object|null $classOrObject
6276     * @param mixed              $property
6277     * @param string             $message
6278     *
6279     * @throws InvalidArgumentException
6280     *
6281     * @return void
6282     */
6283    public static function nullOrPropertyExists($classOrObject, $property, $message = '')
6284    {
6285        static::__callStatic('nullOrPropertyExists', array($classOrObject, $property, $message));
6286    }
6287    /**
6288     * @psalm-pure
6289     * @psalm-param iterable<class-string|object> $classOrObject
6290     *
6291     * @param iterable<string|object> $classOrObject
6292     * @param mixed                   $property
6293     * @param string                  $message
6294     *
6295     * @throws InvalidArgumentException
6296     *
6297     * @return void
6298     */
6299    public static function allPropertyExists($classOrObject, $property, $message = '')
6300    {
6301        static::__callStatic('allPropertyExists', array($classOrObject, $property, $message));
6302    }
6303    /**
6304     * @psalm-pure
6305     * @psalm-param class-string|object|null $classOrObject
6306     *
6307     * @param string|object|null $classOrObject
6308     * @param mixed              $property
6309     * @param string             $message
6310     *
6311     * @throws InvalidArgumentException
6312     *
6313     * @return void
6314     */
6315    public static function nullOrPropertyNotExists($classOrObject, $property, $message = '')
6316    {
6317        static::__callStatic('nullOrPropertyNotExists', array($classOrObject, $property, $message));
6318    }
6319    /**
6320     * @psalm-pure
6321     * @psalm-param iterable<class-string|object> $classOrObject
6322     *
6323     * @param iterable<string|object> $classOrObject
6324     * @param mixed                   $property
6325     * @param string                  $message
6326     *
6327     * @throws InvalidArgumentException
6328     *
6329     * @return void
6330     */
6331    public static function allPropertyNotExists($classOrObject, $property, $message = '')
6332    {
6333        static::__callStatic('allPropertyNotExists', array($classOrObject, $property, $message));
6334    }
6335    /**
6336     * @psalm-pure
6337     * @psalm-param class-string|object|null $classOrObject
6338     *
6339     * @param string|object|null $classOrObject
6340     * @param mixed              $method
6341     * @param string             $message
6342     *
6343     * @throws InvalidArgumentException
6344     *
6345     * @return void
6346     */
6347    public static function nullOrMethodExists($classOrObject, $method, $message = '')
6348    {
6349        static::__callStatic('nullOrMethodExists', array($classOrObject, $method, $message));
6350    }
6351    /**
6352     * @psalm-pure
6353     * @psalm-param iterable<class-string|object> $classOrObject
6354     *
6355     * @param iterable<string|object> $classOrObject
6356     * @param mixed                   $method
6357     * @param string                  $message
6358     *
6359     * @throws InvalidArgumentException
6360     *
6361     * @return void
6362     */
6363    public static function allMethodExists($classOrObject, $method, $message = '')
6364    {
6365        static::__callStatic('allMethodExists', array($classOrObject, $method, $message));
6366    }
6367    /**
6368     * @psalm-pure
6369     * @psalm-param class-string|object|null $classOrObject
6370     *
6371     * @param string|object|null $classOrObject
6372     * @param mixed              $method
6373     * @param string             $message
6374     *
6375     * @throws InvalidArgumentException
6376     *
6377     * @return void
6378     */
6379    public static function nullOrMethodNotExists($classOrObject, $method, $message = '')
6380    {
6381        static::__callStatic('nullOrMethodNotExists', array($classOrObject, $method, $message));
6382    }
6383    /**
6384     * @psalm-pure
6385     * @psalm-param iterable<class-string|object> $classOrObject
6386     *
6387     * @param iterable<string|object> $classOrObject
6388     * @param mixed                   $method
6389     * @param string                  $message
6390     *
6391     * @throws InvalidArgumentException
6392     *
6393     * @return void
6394     */
6395    public static function allMethodNotExists($classOrObject, $method, $message = '')
6396    {
6397        static::__callStatic('allMethodNotExists', array($classOrObject, $method, $message));
6398    }
6399    /**
6400     * @psalm-pure
6401     *
6402     * @param array|null $array
6403     * @param string|int $key
6404     * @param string     $message
6405     *
6406     * @throws InvalidArgumentException
6407     *
6408     * @return void
6409     */
6410    public static function nullOrKeyExists($array, $key, $message = '')
6411    {
6412        static::__callStatic('nullOrKeyExists', array($array, $key, $message));
6413    }
6414    /**
6415     * @psalm-pure
6416     *
6417     * @param iterable<array> $array
6418     * @param string|int      $key
6419     * @param string          $message
6420     *
6421     * @throws InvalidArgumentException
6422     *
6423     * @return void
6424     */
6425    public static function allKeyExists($array, $key, $message = '')
6426    {
6427        static::__callStatic('allKeyExists', array($array, $key, $message));
6428    }
6429    /**
6430     * @psalm-pure
6431     *
6432     * @param array|null $array
6433     * @param string|int $key
6434     * @param string     $message
6435     *
6436     * @throws InvalidArgumentException
6437     *
6438     * @return void
6439     */
6440    public static function nullOrKeyNotExists($array, $key, $message = '')
6441    {
6442        static::__callStatic('nullOrKeyNotExists', array($array, $key, $message));
6443    }
6444    /**
6445     * @psalm-pure
6446     *
6447     * @param iterable<array> $array
6448     * @param string|int      $key
6449     * @param string          $message
6450     *
6451     * @throws InvalidArgumentException
6452     *
6453     * @return void
6454     */
6455    public static function allKeyNotExists($array, $key, $message = '')
6456    {
6457        static::__callStatic('allKeyNotExists', array($array, $key, $message));
6458    }
6459    /**
6460     * @psalm-pure
6461     * @psalm-assert array-key|null $value
6462     *
6463     * @param mixed  $value
6464     * @param string $message
6465     *
6466     * @throws InvalidArgumentException
6467     *
6468     * @return void
6469     */
6470    public static function nullOrValidArrayKey($value, $message = '')
6471    {
6472        static::__callStatic('nullOrValidArrayKey', array($value, $message));
6473    }
6474    /**
6475     * @psalm-pure
6476     * @psalm-assert iterable<array-key> $value
6477     *
6478     * @param mixed  $value
6479     * @param string $message
6480     *
6481     * @throws InvalidArgumentException
6482     *
6483     * @return void
6484     */
6485    public static function allValidArrayKey($value, $message = '')
6486    {
6487        static::__callStatic('allValidArrayKey', array($value, $message));
6488    }
6489    /**
6490     * @param Countable|array|null $array
6491     * @param int                  $number
6492     * @param string               $message
6493     *
6494     * @throws InvalidArgumentException
6495     *
6496     * @return void
6497     */
6498    public static function nullOrCount($array, $number, $message = '')
6499    {
6500        static::__callStatic('nullOrCount', array($array, $number, $message));
6501    }
6502    /**
6503     * @param iterable<Countable|array> $array
6504     * @param int                       $number
6505     * @param string                    $message
6506     *
6507     * @throws InvalidArgumentException
6508     *
6509     * @return void
6510     */
6511    public static function allCount($array, $number, $message = '')
6512    {
6513        static::__callStatic('allCount', array($array, $number, $message));
6514    }
6515    /**
6516     * @param Countable|array|null $array
6517     * @param int|float            $min
6518     * @param string               $message
6519     *
6520     * @throws InvalidArgumentException
6521     *
6522     * @return void
6523     */
6524    public static function nullOrMinCount($array, $min, $message = '')
6525    {
6526        static::__callStatic('nullOrMinCount', array($array, $min, $message));
6527    }
6528    /**
6529     * @param iterable<Countable|array> $array
6530     * @param int|float                 $min
6531     * @param string                    $message
6532     *
6533     * @throws InvalidArgumentException
6534     *
6535     * @return void
6536     */
6537    public static function allMinCount($array, $min, $message = '')
6538    {
6539        static::__callStatic('allMinCount', array($array, $min, $message));
6540    }
6541    /**
6542     * @param Countable|array|null $array
6543     * @param int|float            $max
6544     * @param string               $message
6545     *
6546     * @throws InvalidArgumentException
6547     *
6548     * @return void
6549     */
6550    public static function nullOrMaxCount($array, $max, $message = '')
6551    {
6552        static::__callStatic('nullOrMaxCount', array($array, $max, $message));
6553    }
6554    /**
6555     * @param iterable<Countable|array> $array
6556     * @param int|float                 $max
6557     * @param string                    $message
6558     *
6559     * @throws InvalidArgumentException
6560     *
6561     * @return void
6562     */
6563    public static function allMaxCount($array, $max, $message = '')
6564    {
6565        static::__callStatic('allMaxCount', array($array, $max, $message));
6566    }
6567    /**
6568     * @param Countable|array|null $array
6569     * @param int|float            $min
6570     * @param int|float            $max
6571     * @param string               $message
6572     *
6573     * @throws InvalidArgumentException
6574     *
6575     * @return void
6576     */
6577    public static function nullOrCountBetween($array, $min, $max, $message = '')
6578    {
6579        static::__callStatic('nullOrCountBetween', array($array, $min, $max, $message));
6580    }
6581    /**
6582     * @param iterable<Countable|array> $array
6583     * @param int|float                 $min
6584     * @param int|float                 $max
6585     * @param string                    $message
6586     *
6587     * @throws InvalidArgumentException
6588     *
6589     * @return void
6590     */
6591    public static function allCountBetween($array, $min, $max, $message = '')
6592    {
6593        static::__callStatic('allCountBetween', array($array, $min, $max, $message));
6594    }
6595    /**
6596     * @psalm-pure
6597     * @psalm-assert list|null $array
6598     *
6599     * @param mixed  $array
6600     * @param string $message
6601     *
6602     * @throws InvalidArgumentException
6603     *
6604     * @return void
6605     */
6606    public static function nullOrIsList($array, $message = '')
6607    {
6608        static::__callStatic('nullOrIsList', array($array, $message));
6609    }
6610    /**
6611     * @psalm-pure
6612     * @psalm-assert iterable<list> $array
6613     *
6614     * @param mixed  $array
6615     * @param string $message
6616     *
6617     * @throws InvalidArgumentException
6618     *
6619     * @return void
6620     */
6621    public static function allIsList($array, $message = '')
6622    {
6623        static::__callStatic('allIsList', array($array, $message));
6624    }
6625    /**
6626     * @psalm-pure
6627     * @psalm-assert non-empty-list|null $array
6628     *
6629     * @param mixed  $array
6630     * @param string $message
6631     *
6632     * @throws InvalidArgumentException
6633     *
6634     * @return void
6635     */
6636    public static function nullOrIsNonEmptyList($array, $message = '')
6637    {
6638        static::__callStatic('nullOrIsNonEmptyList', array($array, $message));
6639    }
6640    /**
6641     * @psalm-pure
6642     * @psalm-assert iterable<non-empty-list> $array
6643     *
6644     * @param mixed  $array
6645     * @param string $message
6646     *
6647     * @throws InvalidArgumentException
6648     *
6649     * @return void
6650     */
6651    public static function allIsNonEmptyList($array, $message = '')
6652    {
6653        static::__callStatic('allIsNonEmptyList', array($array, $message));
6654    }
6655    /**
6656     * @psalm-pure
6657     * @psalm-template T
6658     * @psalm-param mixed|array<T>|null $array
6659     * @psalm-assert array<string, T>|null $array
6660     *
6661     * @param mixed  $array
6662     * @param string $message
6663     *
6664     * @throws InvalidArgumentException
6665     *
6666     * @return void
6667     */
6668    public static function nullOrIsMap($array, $message = '')
6669    {
6670        static::__callStatic('nullOrIsMap', array($array, $message));
6671    }
6672    /**
6673     * @psalm-pure
6674     * @psalm-template T
6675     * @psalm-param iterable<mixed|array<T>> $array
6676     * @psalm-assert iterable<array<string, T>> $array
6677     *
6678     * @param mixed  $array
6679     * @param string $message
6680     *
6681     * @throws InvalidArgumentException
6682     *
6683     * @return void
6684     */
6685    public static function allIsMap($array, $message = '')
6686    {
6687        static::__callStatic('allIsMap', array($array, $message));
6688    }
6689    /**
6690     * @psalm-pure
6691     * @psalm-template T
6692     * @psalm-param mixed|array<T>|null $array
6693     *
6694     * @param mixed  $array
6695     * @param string $message
6696     *
6697     * @throws InvalidArgumentException
6698     *
6699     * @return void
6700     */
6701    public static function nullOrIsNonEmptyMap($array, $message = '')
6702    {
6703        static::__callStatic('nullOrIsNonEmptyMap', array($array, $message));
6704    }
6705    /**
6706     * @psalm-pure
6707     * @psalm-template T
6708     * @psalm-param iterable<mixed|array<T>> $array
6709     *
6710     * @param mixed  $array
6711     * @param string $message
6712     *
6713     * @throws InvalidArgumentException
6714     *
6715     * @return void
6716     */
6717    public static function allIsNonEmptyMap($array, $message = '')
6718    {
6719        static::__callStatic('allIsNonEmptyMap', array($array, $message));
6720    }
6721    /**
6722     * @psalm-pure
6723     *
6724     * @param string|null $value
6725     * @param string      $message
6726     *
6727     * @throws InvalidArgumentException
6728     *
6729     * @return void
6730     */
6731    public static function nullOrUuid($value, $message = '')
6732    {
6733        static::__callStatic('nullOrUuid', array($value, $message));
6734    }
6735    /**
6736     * @psalm-pure
6737     *
6738     * @param iterable<string> $value
6739     * @param string           $message
6740     *
6741     * @throws InvalidArgumentException
6742     *
6743     * @return void
6744     */
6745    public static function allUuid($value, $message = '')
6746    {
6747        static::__callStatic('allUuid', array($value, $message));
6748    }
6749    /**
6750     * @psalm-param class-string<Throwable> $class
6751     *
6752     * @param Closure|null $expression
6753     * @param string       $class
6754     * @param string       $message
6755     *
6756     * @throws InvalidArgumentException
6757     *
6758     * @return void
6759     */
6760    public static function nullOrThrows($expression, $class = 'Exception', $message = '')
6761    {
6762        static::__callStatic('nullOrThrows', array($expression, $class, $message));
6763    }
6764    /**
6765     * @psalm-param class-string<Throwable> $class
6766     *
6767     * @param iterable<Closure> $expression
6768     * @param string            $class
6769     * @param string            $message
6770     *
6771     * @throws InvalidArgumentException
6772     *
6773     * @return void
6774     */
6775    public static function allThrows($expression, $class = 'Exception', $message = '')
6776    {
6777        static::__callStatic('allThrows', array($expression, $class, $message));
6778    }
6779}
6780The MIT License (MIT)
6781
6782Copyright (c) 2014 Bernhard Schussek
6783
6784Permission is hereby granted, free of charge, to any person obtaining a copy of
6785this software and associated documentation files (the "Software"), to deal in
6786the Software without restriction, including without limitation the rights to
6787use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
6788the Software, and to permit persons to whom the Software is furnished to do so,
6789subject to the following conditions:
6790
6791The above copyright notice and this permission notice shall be included in all
6792copies or substantial portions of the Software.
6793
6794THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
6795IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
6796FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
6797COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
6798IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
6799CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
6800<?php
6801
6802/*
6803 * This file is part of the webmozart/assert package.
6804 *
6805 * (c) Bernhard Schussek <bschussek@gmail.com>
6806 *
6807 * For the full copyright and license information, please view the LICENSE
6808 * file that was distributed with this source code.
6809 */
6810namespace PHPUnit\Webmozart\Assert;
6811
6812class InvalidArgumentException extends \InvalidArgumentException
6813{
6814}
6815<?php
6816
6817declare (strict_types=1);
6818/**
6819 * phpDocumentor
6820 *
6821 * For the full copyright and license information, please view the LICENSE
6822 * file that was distributed with this source code.
6823 *
6824 * @link      http://phpdoc.org
6825 */
6826namespace PHPUnit\phpDocumentor\Reflection;
6827
6828use InvalidArgumentException;
6829use function assert;
6830use function end;
6831use function explode;
6832use function is_string;
6833use function preg_match;
6834use function sprintf;
6835use function trim;
6836/**
6837 * Value Object for Fqsen.
6838 *
6839 * @link https://github.com/phpDocumentor/fig-standards/blob/master/proposed/phpdoc-meta.md
6840 *
6841 * @psalm-immutable
6842 */
6843final class Fqsen
6844{
6845    /** @var string full quallified class name */
6846    private $fqsen;
6847    /** @var string name of the element without path. */
6848    private $name;
6849    /**
6850     * Initializes the object.
6851     *
6852     * @throws InvalidArgumentException when $fqsen is not matching the format.
6853     */
6854    public function __construct(string $fqsen)
6855    {
6856        $matches = [];
6857        $result = preg_match(
6858            //phpcs:ignore Generic.Files.LineLength.TooLong
6859            '/^\\\\([a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff\\\\]*)?(?:[:]{2}\\$?([a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*))?(?:\\(\\))?$/',
6860            $fqsen,
6861            $matches
6862        );
6863        if ($result === 0) {
6864            throw new InvalidArgumentException(sprintf('"%s" is not a valid Fqsen.', $fqsen));
6865        }
6866        $this->fqsen = $fqsen;
6867        if (isset($matches[2])) {
6868            $this->name = $matches[2];
6869        } else {
6870            $matches = explode('\\', $fqsen);
6871            $name = end($matches);
6872            assert(is_string($name));
6873            $this->name = trim($name, '()');
6874        }
6875    }
6876    /**
6877     * converts this class to string.
6878     */
6879    public function __toString() : string
6880    {
6881        return $this->fqsen;
6882    }
6883    /**
6884     * Returns the name of the element without path.
6885     */
6886    public function getName() : string
6887    {
6888        return $this->name;
6889    }
6890}
6891<?php
6892
6893declare (strict_types=1);
6894/**
6895 * phpDocumentor
6896 *
6897 * For the full copyright and license information, please view the LICENSE
6898 * file that was distributed with this source code.
6899 *
6900 * @link      http://phpdoc.org
6901 */
6902namespace PHPUnit\phpDocumentor\Reflection;
6903
6904/**
6905 * Interface for project factories. A project factory shall convert a set of files
6906 * into an object implementing the Project interface.
6907 */
6908interface ProjectFactory
6909{
6910    /**
6911     * Creates a project from the set of files.
6912     *
6913     * @param File[] $files
6914     */
6915    public function create(string $name, array $files) : Project;
6916}
6917<?php
6918
6919declare (strict_types=1);
6920/**
6921 * This file is part of phpDocumentor.
6922 *
6923 * For the full copyright and license information, please view the LICENSE
6924 * file that was distributed with this source code.
6925 *
6926 * @link      http://phpdoc.org
6927 */
6928namespace PHPUnit\phpDocumentor\Reflection;
6929
6930/**
6931 * Interface for files processed by the ProjectFactory
6932 */
6933interface File
6934{
6935    /**
6936     * Returns the content of the file as a string.
6937     */
6938    public function getContents() : string;
6939    /**
6940     * Returns md5 hash of the file.
6941     */
6942    public function md5() : string;
6943    /**
6944     * Returns an relative path to the file.
6945     */
6946    public function path() : string;
6947}
6948<?php
6949
6950declare (strict_types=1);
6951/**
6952 * This file is part of phpDocumentor.
6953 *
6954 * For the full copyright and license information, please view the LICENSE
6955 * file that was distributed with this source code.
6956 *
6957 * @link      http://phpdoc.org
6958 */
6959namespace PHPUnit\phpDocumentor\Reflection;
6960
6961/**
6962 * The location where an element occurs within a file.
6963 *
6964 * @psalm-immutable
6965 */
6966final class Location
6967{
6968    /** @var int */
6969    private $lineNumber = 0;
6970    /** @var int */
6971    private $columnNumber = 0;
6972    /**
6973     * Initializes the location for an element using its line number in the file and optionally the column number.
6974     */
6975    public function __construct(int $lineNumber, int $columnNumber = 0)
6976    {
6977        $this->lineNumber = $lineNumber;
6978        $this->columnNumber = $columnNumber;
6979    }
6980    /**
6981     * Returns the line number that is covered by this location.
6982     */
6983    public function getLineNumber() : int
6984    {
6985        return $this->lineNumber;
6986    }
6987    /**
6988     * Returns the column number (character position on a line) for this location object.
6989     */
6990    public function getColumnNumber() : int
6991    {
6992        return $this->columnNumber;
6993    }
6994}
6995<?php
6996
6997declare (strict_types=1);
6998/**
6999 * phpDocumentor
7000 *
7001 * For the full copyright and license information, please view the LICENSE
7002 * file that was distributed with this source code.
7003 *
7004 * @link      http://phpdoc.org
7005 */
7006namespace PHPUnit\phpDocumentor\Reflection;
7007
7008/**
7009 * Interface for project. Since the definition of a project can be different per factory this interface will be small.
7010 */
7011interface Project
7012{
7013    /**
7014     * Returns the name of the project.
7015     */
7016    public function getName() : string;
7017}
7018<?php
7019
7020declare (strict_types=1);
7021/**
7022 * phpDocumentor
7023 *
7024 * For the full copyright and license information, please view the LICENSE
7025 * file that was distributed with this source code.
7026 *
7027 * @link      http://phpdoc.org
7028 */
7029namespace PHPUnit\phpDocumentor\Reflection;
7030
7031/**
7032 * Interface for Api Elements
7033 */
7034interface Element
7035{
7036    /**
7037     * Returns the Fqsen of the element.
7038     */
7039    public function getFqsen() : Fqsen;
7040    /**
7041     * Returns the name of the element.
7042     */
7043    public function getName() : string;
7044}
7045The MIT License (MIT)
7046
7047Copyright (c) 2015 phpDocumentor
7048
7049Permission is hereby granted, free of charge, to any person obtaining a copy
7050of this software and associated documentation files (the "Software"), to deal
7051in the Software without restriction, including without limitation the rights
7052to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7053copies of the Software, and to permit persons to whom the Software is
7054furnished to do so, subject to the following conditions:
7055
7056The above copyright notice and this permission notice shall be included in all
7057copies or substantial portions of the Software.
7058
7059THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
7060IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
7061FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
7062AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
7063LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
7064OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
7065SOFTWARE.
7066
7067<?php
7068
7069declare (strict_types=1);
7070/*
7071 * This file is part of phpunit/php-text-template.
7072 *
7073 * (c) Sebastian Bergmann <sebastian@phpunit.de>
7074 *
7075 * For the full copyright and license information, please view the LICENSE
7076 * file that was distributed with this source code.
7077 */
7078namespace PHPUnit\SebastianBergmann\Template;
7079
7080use function array_merge;
7081use function file_exists;
7082use function file_get_contents;
7083use function file_put_contents;
7084use function sprintf;
7085use function str_replace;
7086final class Template
7087{
7088    /**
7089     * @var string
7090     */
7091    private $template = '';
7092    /**
7093     * @var string
7094     */
7095    private $openDelimiter;
7096    /**
7097     * @var string
7098     */
7099    private $closeDelimiter;
7100    /**
7101     * @var array
7102     */
7103    private $values = [];
7104    /**
7105     * @throws InvalidArgumentException
7106     */
7107    public function __construct(string $file = '', string $openDelimiter = '{', string $closeDelimiter = '}')
7108    {
7109        $this->setFile($file);
7110        $this->openDelimiter = $openDelimiter;
7111        $this->closeDelimiter = $closeDelimiter;
7112    }
7113    /**
7114     * @throws InvalidArgumentException
7115     */
7116    public function setFile(string $file) : void
7117    {
7118        $distFile = $file . '.dist';
7119        if (file_exists($file)) {
7120            $this->template = file_get_contents($file);
7121        } elseif (file_exists($distFile)) {
7122            $this->template = file_get_contents($distFile);
7123        } else {
7124            throw new InvalidArgumentException(sprintf('Failed to load template "%s"', $file));
7125        }
7126    }
7127    public function setVar(array $values, bool $merge = \true) : void
7128    {
7129        if (!$merge || empty($this->values)) {
7130            $this->values = $values;
7131        } else {
7132            $this->values = array_merge($this->values, $values);
7133        }
7134    }
7135    public function render() : string
7136    {
7137        $keys = [];
7138        foreach ($this->values as $key => $value) {
7139            $keys[] = $this->openDelimiter . $key . $this->closeDelimiter;
7140        }
7141        return str_replace($keys, $this->values, $this->template);
7142    }
7143    /**
7144     * @codeCoverageIgnore
7145     */
7146    public function renderTo(string $target) : void
7147    {
7148        if (!file_put_contents($target, $this->render())) {
7149            throw new RuntimeException(sprintf('Writing rendered result to "%s" failed', $target));
7150        }
7151    }
7152}
7153<?php
7154
7155declare (strict_types=1);
7156/*
7157 * This file is part of phpunit/php-text-template.
7158 *
7159 * (c) Sebastian Bergmann <sebastian@phpunit.de>
7160 *
7161 * For the full copyright and license information, please view the LICENSE
7162 * file that was distributed with this source code.
7163 */
7164namespace PHPUnit\SebastianBergmann\Template;
7165
7166use InvalidArgumentException;
7167final class RuntimeException extends InvalidArgumentException implements Exception
7168{
7169}
7170<?php
7171
7172declare (strict_types=1);
7173/*
7174 * This file is part of phpunit/php-text-template.
7175 *
7176 * (c) Sebastian Bergmann <sebastian@phpunit.de>
7177 *
7178 * For the full copyright and license information, please view the LICENSE
7179 * file that was distributed with this source code.
7180 */
7181namespace PHPUnit\SebastianBergmann\Template;
7182
7183use Throwable;
7184interface Exception extends Throwable
7185{
7186}
7187<?php
7188
7189declare (strict_types=1);
7190/*
7191 * This file is part of phpunit/php-text-template.
7192 *
7193 * (c) Sebastian Bergmann <sebastian@phpunit.de>
7194 *
7195 * For the full copyright and license information, please view the LICENSE
7196 * file that was distributed with this source code.
7197 */
7198namespace PHPUnit\SebastianBergmann\Template;
7199
7200final class InvalidArgumentException extends \InvalidArgumentException implements Exception
7201{
7202}
7203phpunit/php-text-template
7204
7205Copyright (c) 2009-2020, Sebastian Bergmann <sebastian@phpunit.de>.
7206All rights reserved.
7207
7208Redistribution and use in source and binary forms, with or without
7209modification, are permitted provided that the following conditions
7210are met:
7211
7212 * Redistributions of source code must retain the above copyright
7213   notice, this list of conditions and the following disclaimer.
7214
7215 * Redistributions in binary form must reproduce the above copyright
7216   notice, this list of conditions and the following disclaimer in
7217   the documentation and/or other materials provided with the
7218   distribution.
7219
7220 * Neither the name of Sebastian Bergmann nor the names of his
7221   contributors may be used to endorse or promote products derived
7222   from this software without specific prior written permission.
7223
7224THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
7225"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7226LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
7227FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
7228COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
7229INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
7230BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
7231LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
7232CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
7233LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
7234ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
7235POSSIBILITY OF SUCH DAMAGE.
7236<?php
7237
7238declare (strict_types=1);
7239/*
7240 * This file is part of sebastian/object-reflector.
7241 *
7242 * (c) Sebastian Bergmann <sebastian@phpunit.de>
7243 *
7244 * For the full copyright and license information, please view the LICENSE
7245 * file that was distributed with this source code.
7246 */
7247namespace PHPUnit\SebastianBergmann\ObjectReflector;
7248
7249use function count;
7250use function explode;
7251use function get_class;
7252use function is_object;
7253class ObjectReflector
7254{
7255    /**
7256     * @param object $object
7257     *
7258     * @throws InvalidArgumentException
7259     */
7260    public function getAttributes($object) : array
7261    {
7262        if (!is_object($object)) {
7263            throw new InvalidArgumentException();
7264        }
7265        $attributes = [];
7266        $className = get_class($object);
7267        foreach ((array) $object as $name => $value) {
7268            $name = explode("\0", (string) $name);
7269            if (count($name) === 1) {
7270                $name = $name[0];
7271            } else {
7272                if ($name[1] !== $className) {
7273                    $name = $name[1] . '::' . $name[2];
7274                } else {
7275                    $name = $name[2];
7276                }
7277            }
7278            $attributes[$name] = $value;
7279        }
7280        return $attributes;
7281    }
7282}
7283<?php
7284
7285declare (strict_types=1);
7286/*
7287 * This file is part of sebastian/object-reflector.
7288 *
7289 * (c) Sebastian Bergmann <sebastian@phpunit.de>
7290 *
7291 * For the full copyright and license information, please view the LICENSE
7292 * file that was distributed with this source code.
7293 */
7294namespace PHPUnit\SebastianBergmann\ObjectReflector;
7295
7296use Throwable;
7297interface Exception extends Throwable
7298{
7299}
7300<?php
7301
7302declare (strict_types=1);
7303/*
7304 * This file is part of sebastian/object-reflector.
7305 *
7306 * (c) Sebastian Bergmann <sebastian@phpunit.de>
7307 *
7308 * For the full copyright and license information, please view the LICENSE
7309 * file that was distributed with this source code.
7310 */
7311namespace PHPUnit\SebastianBergmann\ObjectReflector;
7312
7313class InvalidArgumentException extends \InvalidArgumentException implements Exception
7314{
7315}
7316<?php
7317
7318declare (strict_types=1);
7319/*
7320 * This file is part of phpunit/php-invoker.
7321 *
7322 * (c) Sebastian Bergmann <sebastian@phpunit.de>
7323 *
7324 * For the full copyright and license information, please view the LICENSE
7325 * file that was distributed with this source code.
7326 */
7327namespace PHPUnit\SebastianBergmann\Invoker;
7328
7329use const SIGALRM;
7330use function call_user_func_array;
7331use function function_exists;
7332use function pcntl_alarm;
7333use function pcntl_async_signals;
7334use function pcntl_signal;
7335use function sprintf;
7336use Throwable;
7337final class Invoker
7338{
7339    /**
7340     * @var int
7341     */
7342    private $timeout;
7343    /**
7344     * @throws Throwable
7345     */
7346    public function invoke(callable $callable, array $arguments, int $timeout)
7347    {
7348        if (!$this->canInvokeWithTimeout()) {
7349            throw new ProcessControlExtensionNotLoadedException('The pcntl (process control) extension for PHP is required');
7350        }
7351        pcntl_signal(\SIGALRM, function () : void {
7352            throw new TimeoutException(sprintf('Execution aborted after %d second%s', $this->timeout, $this->timeout === 1 ? '' : 's'));
7353        }, \true);
7354        $this->timeout = $timeout;
7355        pcntl_async_signals(\true);
7356        pcntl_alarm($timeout);
7357        try {
7358            return call_user_func_array($callable, $arguments);
7359        } finally {
7360            pcntl_alarm(0);
7361        }
7362    }
7363    public function canInvokeWithTimeout() : bool
7364    {
7365        return function_exists('pcntl_signal') && function_exists('pcntl_async_signals') && function_exists('pcntl_alarm');
7366    }
7367}
7368<?php
7369
7370declare (strict_types=1);
7371/*
7372 * This file is part of phpunit/php-invoker.
7373 *
7374 * (c) Sebastian Bergmann <sebastian@phpunit.de>
7375 *
7376 * For the full copyright and license information, please view the LICENSE
7377 * file that was distributed with this source code.
7378 */
7379namespace PHPUnit\SebastianBergmann\Invoker;
7380
7381use RuntimeException;
7382final class ProcessControlExtensionNotLoadedException extends RuntimeException implements Exception
7383{
7384}
7385<?php
7386
7387declare (strict_types=1);
7388/*
7389 * This file is part of phpunit/php-invoker.
7390 *
7391 * (c) Sebastian Bergmann <sebastian@phpunit.de>
7392 *
7393 * For the full copyright and license information, please view the LICENSE
7394 * file that was distributed with this source code.
7395 */
7396namespace PHPUnit\SebastianBergmann\Invoker;
7397
7398use RuntimeException;
7399final class TimeoutException extends RuntimeException implements Exception
7400{
7401}
7402<?php
7403
7404declare (strict_types=1);
7405/*
7406 * This file is part of phpunit/php-invoker.
7407 *
7408 * (c) Sebastian Bergmann <sebastian@phpunit.de>
7409 *
7410 * For the full copyright and license information, please view the LICENSE
7411 * file that was distributed with this source code.
7412 */
7413namespace PHPUnit\SebastianBergmann\Invoker;
7414
7415use Throwable;
7416interface Exception extends Throwable
7417{
7418}
7419<?php
7420
7421declare (strict_types=1);
7422/*
7423 * This file is part of PharIo\Version.
7424 *
7425 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
7426 *
7427 * For the full copyright and license information, please view the LICENSE
7428 * file that was distributed with this source code.
7429 */
7430namespace PHPUnit\PharIo\Version;
7431
7432class OrVersionConstraintGroup extends AbstractVersionConstraint
7433{
7434    /** @var VersionConstraint[] */
7435    private $constraints = [];
7436    /**
7437     * @param string              $originalValue
7438     * @param VersionConstraint[] $constraints
7439     */
7440    public function __construct($originalValue, array $constraints)
7441    {
7442        parent::__construct($originalValue);
7443        $this->constraints = $constraints;
7444    }
7445    public function complies(Version $version) : bool
7446    {
7447        foreach ($this->constraints as $constraint) {
7448            if ($constraint->complies($version)) {
7449                return \true;
7450            }
7451        }
7452        return \false;
7453    }
7454}
7455<?php
7456
7457declare (strict_types=1);
7458/*
7459 * This file is part of PharIo\Version.
7460 *
7461 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
7462 *
7463 * For the full copyright and license information, please view the LICENSE
7464 * file that was distributed with this source code.
7465 */
7466namespace PHPUnit\PharIo\Version;
7467
7468interface VersionConstraint
7469{
7470    public function complies(Version $version) : bool;
7471    public function asString() : string;
7472}
7473<?php
7474
7475declare (strict_types=1);
7476/*
7477 * This file is part of PharIo\Version.
7478 *
7479 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
7480 *
7481 * For the full copyright and license information, please view the LICENSE
7482 * file that was distributed with this source code.
7483 */
7484namespace PHPUnit\PharIo\Version;
7485
7486class ExactVersionConstraint extends AbstractVersionConstraint
7487{
7488    public function complies(Version $version) : bool
7489    {
7490        return $this->asString() === $version->getVersionString();
7491    }
7492}
7493<?php
7494
7495declare (strict_types=1);
7496/*
7497 * This file is part of PharIo\Version.
7498 *
7499 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
7500 *
7501 * For the full copyright and license information, please view the LICENSE
7502 * file that was distributed with this source code.
7503 */
7504namespace PHPUnit\PharIo\Version;
7505
7506class AnyVersionConstraint implements VersionConstraint
7507{
7508    public function complies(Version $version) : bool
7509    {
7510        return \true;
7511    }
7512    public function asString() : string
7513    {
7514        return '*';
7515    }
7516}
7517<?php
7518
7519declare (strict_types=1);
7520/*
7521 * This file is part of PharIo\Version.
7522 *
7523 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
7524 *
7525 * For the full copyright and license information, please view the LICENSE
7526 * file that was distributed with this source code.
7527 */
7528namespace PHPUnit\PharIo\Version;
7529
7530class SpecificMajorVersionConstraint extends AbstractVersionConstraint
7531{
7532    /** @var int */
7533    private $major;
7534    public function __construct(string $originalValue, int $major)
7535    {
7536        parent::__construct($originalValue);
7537        $this->major = $major;
7538    }
7539    public function complies(Version $version) : bool
7540    {
7541        return $version->getMajor()->getValue() === $this->major;
7542    }
7543}
7544<?php
7545
7546declare (strict_types=1);
7547/*
7548 * This file is part of PharIo\Version.
7549 *
7550 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
7551 *
7552 * For the full copyright and license information, please view the LICENSE
7553 * file that was distributed with this source code.
7554 */
7555namespace PHPUnit\PharIo\Version;
7556
7557class SpecificMajorAndMinorVersionConstraint extends AbstractVersionConstraint
7558{
7559    /** @var int */
7560    private $major;
7561    /** @var int */
7562    private $minor;
7563    public function __construct(string $originalValue, int $major, int $minor)
7564    {
7565        parent::__construct($originalValue);
7566        $this->major = $major;
7567        $this->minor = $minor;
7568    }
7569    public function complies(Version $version) : bool
7570    {
7571        if ($version->getMajor()->getValue() !== $this->major) {
7572            return \false;
7573        }
7574        return $version->getMinor()->getValue() === $this->minor;
7575    }
7576}
7577<?php
7578
7579declare (strict_types=1);
7580/*
7581 * This file is part of PharIo\Version.
7582 *
7583 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
7584 *
7585 * For the full copyright and license information, please view the LICENSE
7586 * file that was distributed with this source code.
7587 */
7588namespace PHPUnit\PharIo\Version;
7589
7590class GreaterThanOrEqualToVersionConstraint extends AbstractVersionConstraint
7591{
7592    /** @var Version */
7593    private $minimalVersion;
7594    public function __construct(string $originalValue, Version $minimalVersion)
7595    {
7596        parent::__construct($originalValue);
7597        $this->minimalVersion = $minimalVersion;
7598    }
7599    public function complies(Version $version) : bool
7600    {
7601        return $version->getVersionString() === $this->minimalVersion->getVersionString() || $version->isGreaterThan($this->minimalVersion);
7602    }
7603}
7604<?php
7605
7606declare (strict_types=1);
7607/*
7608 * This file is part of PharIo\Version.
7609 *
7610 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
7611 *
7612 * For the full copyright and license information, please view the LICENSE
7613 * file that was distributed with this source code.
7614 */
7615namespace PHPUnit\PharIo\Version;
7616
7617abstract class AbstractVersionConstraint implements VersionConstraint
7618{
7619    /** @var string */
7620    private $originalValue;
7621    public function __construct(string $originalValue)
7622    {
7623        $this->originalValue = $originalValue;
7624    }
7625    public function asString() : string
7626    {
7627        return $this->originalValue;
7628    }
7629}
7630<?php
7631
7632declare (strict_types=1);
7633/*
7634 * This file is part of PharIo\Version.
7635 *
7636 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
7637 *
7638 * For the full copyright and license information, please view the LICENSE
7639 * file that was distributed with this source code.
7640 */
7641namespace PHPUnit\PharIo\Version;
7642
7643class AndVersionConstraintGroup extends AbstractVersionConstraint
7644{
7645    /** @var VersionConstraint[] */
7646    private $constraints = [];
7647    /**
7648     * @param VersionConstraint[] $constraints
7649     */
7650    public function __construct(string $originalValue, array $constraints)
7651    {
7652        parent::__construct($originalValue);
7653        $this->constraints = $constraints;
7654    }
7655    public function complies(Version $version) : bool
7656    {
7657        foreach ($this->constraints as $constraint) {
7658            if (!$constraint->complies($version)) {
7659                return \false;
7660            }
7661        }
7662        return \true;
7663    }
7664}
7665<?php
7666
7667declare (strict_types=1);
7668/*
7669 * This file is part of PharIo\Version.
7670 *
7671 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
7672 *
7673 * For the full copyright and license information, please view the LICENSE
7674 * file that was distributed with this source code.
7675 */
7676namespace PHPUnit\PharIo\Version;
7677
7678class VersionNumber
7679{
7680    /** @var ?int */
7681    private $value;
7682    public function __construct(?int $value)
7683    {
7684        $this->value = $value;
7685    }
7686    public function isAny() : bool
7687    {
7688        return $this->value === null;
7689    }
7690    public function getValue() : ?int
7691    {
7692        return $this->value;
7693    }
7694}
7695<?php
7696
7697declare (strict_types=1);
7698/*
7699 * This file is part of PharIo\Version.
7700 *
7701 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
7702 *
7703 * For the full copyright and license information, please view the LICENSE
7704 * file that was distributed with this source code.
7705 */
7706namespace PHPUnit\PharIo\Version;
7707
7708class VersionConstraintParser
7709{
7710    /**
7711     * @throws UnsupportedVersionConstraintException
7712     */
7713    public function parse(string $value) : VersionConstraint
7714    {
7715        if (\strpos($value, '||') !== \false) {
7716            return $this->handleOrGroup($value);
7717        }
7718        if (!\preg_match('/^[\\^~*]?v?[\\d.*]+(?:-.*)?$/i', $value)) {
7719            throw new UnsupportedVersionConstraintException(\sprintf('Version constraint %s is not supported.', $value));
7720        }
7721        switch ($value[0]) {
7722            case '~':
7723                return $this->handleTildeOperator($value);
7724            case '^':
7725                return $this->handleCaretOperator($value);
7726        }
7727        $constraint = new VersionConstraintValue($value);
7728        if ($constraint->getMajor()->isAny()) {
7729            return new AnyVersionConstraint();
7730        }
7731        if ($constraint->getMinor()->isAny()) {
7732            return new SpecificMajorVersionConstraint($constraint->getVersionString(), $constraint->getMajor()->getValue() ?? 0);
7733        }
7734        if ($constraint->getPatch()->isAny()) {
7735            return new SpecificMajorAndMinorVersionConstraint($constraint->getVersionString(), $constraint->getMajor()->getValue() ?? 0, $constraint->getMinor()->getValue() ?? 0);
7736        }
7737        return new ExactVersionConstraint($constraint->getVersionString());
7738    }
7739    private function handleOrGroup(string $value) : OrVersionConstraintGroup
7740    {
7741        $constraints = [];
7742        foreach (\explode('||', $value) as $groupSegment) {
7743            $constraints[] = $this->parse(\trim($groupSegment));
7744        }
7745        return new OrVersionConstraintGroup($value, $constraints);
7746    }
7747    private function handleTildeOperator(string $value) : AndVersionConstraintGroup
7748    {
7749        $constraintValue = new VersionConstraintValue(\substr($value, 1));
7750        if ($constraintValue->getPatch()->isAny()) {
7751            return $this->handleCaretOperator($value);
7752        }
7753        $constraints = [new GreaterThanOrEqualToVersionConstraint($value, new Version(\substr($value, 1))), new SpecificMajorAndMinorVersionConstraint($value, $constraintValue->getMajor()->getValue() ?? 0, $constraintValue->getMinor()->getValue() ?? 0)];
7754        return new AndVersionConstraintGroup($value, $constraints);
7755    }
7756    private function handleCaretOperator(string $value) : AndVersionConstraintGroup
7757    {
7758        $constraintValue = new VersionConstraintValue(\substr($value, 1));
7759        $constraints = [new GreaterThanOrEqualToVersionConstraint($value, new Version(\substr($value, 1)))];
7760        if ($constraintValue->getMajor()->getValue() === 0) {
7761            $constraints[] = new SpecificMajorAndMinorVersionConstraint($value, $constraintValue->getMajor()->getValue() ?? 0, $constraintValue->getMinor()->getValue() ?? 0);
7762        } else {
7763            $constraints[] = new SpecificMajorVersionConstraint($value, $constraintValue->getMajor()->getValue() ?? 0);
7764        }
7765        return new AndVersionConstraintGroup($value, $constraints);
7766    }
7767}
7768<?php
7769
7770declare (strict_types=1);
7771/*
7772 * This file is part of PharIo\Version.
7773 *
7774 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
7775 *
7776 * For the full copyright and license information, please view the LICENSE
7777 * file that was distributed with this source code.
7778 */
7779namespace PHPUnit\PharIo\Version;
7780
7781class Version
7782{
7783    /** @var string */
7784    private $originalVersionString;
7785    /** @var VersionNumber */
7786    private $major;
7787    /** @var VersionNumber */
7788    private $minor;
7789    /** @var VersionNumber */
7790    private $patch;
7791    /** @var null|PreReleaseSuffix */
7792    private $preReleaseSuffix;
7793    public function __construct(string $versionString)
7794    {
7795        $this->ensureVersionStringIsValid($versionString);
7796        $this->originalVersionString = $versionString;
7797    }
7798    public function getPreReleaseSuffix() : PreReleaseSuffix
7799    {
7800        if ($this->preReleaseSuffix === null) {
7801            throw new NoPreReleaseSuffixException('No pre-release suffix set');
7802        }
7803        return $this->preReleaseSuffix;
7804    }
7805    public function getOriginalString() : string
7806    {
7807        return $this->originalVersionString;
7808    }
7809    public function getVersionString() : string
7810    {
7811        $str = \sprintf('%d.%d.%d', $this->getMajor()->getValue() ?? 0, $this->getMinor()->getValue() ?? 0, $this->getPatch()->getValue() ?? 0);
7812        if (!$this->hasPreReleaseSuffix()) {
7813            return $str;
7814        }
7815        return $str . '-' . $this->getPreReleaseSuffix()->asString();
7816    }
7817    public function hasPreReleaseSuffix() : bool
7818    {
7819        return $this->preReleaseSuffix !== null;
7820    }
7821    public function equals(Version $other) : bool
7822    {
7823        return $this->getVersionString() === $other->getVersionString();
7824    }
7825    public function isGreaterThan(Version $version) : bool
7826    {
7827        if ($version->getMajor()->getValue() > $this->getMajor()->getValue()) {
7828            return \false;
7829        }
7830        if ($version->getMajor()->getValue() < $this->getMajor()->getValue()) {
7831            return \true;
7832        }
7833        if ($version->getMinor()->getValue() > $this->getMinor()->getValue()) {
7834            return \false;
7835        }
7836        if ($version->getMinor()->getValue() < $this->getMinor()->getValue()) {
7837            return \true;
7838        }
7839        if ($version->getPatch()->getValue() > $this->getPatch()->getValue()) {
7840            return \false;
7841        }
7842        if ($version->getPatch()->getValue() < $this->getPatch()->getValue()) {
7843            return \true;
7844        }
7845        if (!$version->hasPreReleaseSuffix() && !$this->hasPreReleaseSuffix()) {
7846            return \false;
7847        }
7848        if ($version->hasPreReleaseSuffix() && !$this->hasPreReleaseSuffix()) {
7849            return \true;
7850        }
7851        if (!$version->hasPreReleaseSuffix() && $this->hasPreReleaseSuffix()) {
7852            return \false;
7853        }
7854        return $this->getPreReleaseSuffix()->isGreaterThan($version->getPreReleaseSuffix());
7855    }
7856    public function getMajor() : VersionNumber
7857    {
7858        return $this->major;
7859    }
7860    public function getMinor() : VersionNumber
7861    {
7862        return $this->minor;
7863    }
7864    public function getPatch() : VersionNumber
7865    {
7866        return $this->patch;
7867    }
7868    /**
7869     * @param string[] $matches
7870     *
7871     * @throws InvalidPreReleaseSuffixException
7872     */
7873    private function parseVersion(array $matches) : void
7874    {
7875        $this->major = new VersionNumber((int) $matches['Major']);
7876        $this->minor = new VersionNumber((int) $matches['Minor']);
7877        $this->patch = isset($matches['Patch']) ? new VersionNumber((int) $matches['Patch']) : new VersionNumber(0);
7878        if (isset($matches['PreReleaseSuffix'])) {
7879            $this->preReleaseSuffix = new PreReleaseSuffix($matches['PreReleaseSuffix']);
7880        }
7881    }
7882    /**
7883     * @param string $version
7884     *
7885     * @throws InvalidVersionException
7886     */
7887    private function ensureVersionStringIsValid($version) : void
7888    {
7889        $regex = '/^v?
7890            (?<Major>(0|(?:[1-9]\\d*)))
7891            \\.
7892            (?<Minor>(0|(?:[1-9]\\d*)))
7893            (\\.
7894                (?<Patch>(0|(?:[1-9]\\d*)))
7895            )?
7896            (?:
7897                -
7898                (?<PreReleaseSuffix>(?:(dev|beta|b|rc|alpha|a|patch|p)\\.?\\d*))
7899            )?
7900        $/xi';
7901        if (\preg_match($regex, $version, $matches) !== 1) {
7902            throw new InvalidVersionException(\sprintf("Version string '%s' does not follow SemVer semantics", $version));
7903        }
7904        $this->parseVersion($matches);
7905    }
7906}
7907<?php
7908
7909declare (strict_types=1);
7910namespace PHPUnit\PharIo\Version;
7911
7912class InvalidPreReleaseSuffixException extends \Exception implements Exception
7913{
7914}
7915<?php
7916
7917declare (strict_types=1);
7918/*
7919 * This file is part of PharIo\Version.
7920 *
7921 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
7922 *
7923 * For the full copyright and license information, please view the LICENSE
7924 * file that was distributed with this source code.
7925 */
7926namespace PHPUnit\PharIo\Version;
7927
7928final class UnsupportedVersionConstraintException extends \RuntimeException implements Exception
7929{
7930}
7931<?php
7932
7933declare (strict_types=1);
7934/*
7935 * This file is part of PharIo\Version.
7936 *
7937 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
7938 *
7939 * For the full copyright and license information, please view the LICENSE
7940 * file that was distributed with this source code.
7941 */
7942namespace PHPUnit\PharIo\Version;
7943
7944use Throwable;
7945interface Exception extends Throwable
7946{
7947}
7948<?php
7949
7950declare (strict_types=1);
7951namespace PHPUnit\PharIo\Version;
7952
7953class NoPreReleaseSuffixException extends \Exception implements Exception
7954{
7955}
7956<?php
7957
7958declare (strict_types=1);
7959namespace PHPUnit\PharIo\Version;
7960
7961class InvalidVersionException extends \InvalidArgumentException implements Exception
7962{
7963}
7964<?php
7965
7966declare (strict_types=1);
7967namespace PHPUnit\PharIo\Version;
7968
7969class PreReleaseSuffix
7970{
7971    private const valueScoreMap = ['dev' => 0, 'a' => 1, 'alpha' => 1, 'b' => 2, 'beta' => 2, 'rc' => 3, 'p' => 4, 'patch' => 4];
7972    /** @var string */
7973    private $value;
7974    /** @var int */
7975    private $valueScore;
7976    /** @var int */
7977    private $number = 0;
7978    /** @var string */
7979    private $full;
7980    /**
7981     * @throws InvalidPreReleaseSuffixException
7982     */
7983    public function __construct(string $value)
7984    {
7985        $this->parseValue($value);
7986    }
7987    public function asString() : string
7988    {
7989        return $this->full;
7990    }
7991    public function getValue() : string
7992    {
7993        return $this->value;
7994    }
7995    public function getNumber() : ?int
7996    {
7997        return $this->number;
7998    }
7999    public function isGreaterThan(PreReleaseSuffix $suffix) : bool
8000    {
8001        if ($this->valueScore > $suffix->valueScore) {
8002            return \true;
8003        }
8004        if ($this->valueScore < $suffix->valueScore) {
8005            return \false;
8006        }
8007        return $this->getNumber() > $suffix->getNumber();
8008    }
8009    private function mapValueToScore(string $value) : int
8010    {
8011        $value = \strtolower($value);
8012        if (\array_key_exists($value, self::valueScoreMap)) {
8013            return self::valueScoreMap[$value];
8014        }
8015        return 0;
8016    }
8017    private function parseValue(string $value) : void
8018    {
8019        $regex = '/-?((dev|beta|b|rc|alpha|a|patch|p)\\.?(\\d*)).*$/i';
8020        if (\preg_match($regex, $value, $matches) !== 1) {
8021            throw new InvalidPreReleaseSuffixException(\sprintf('Invalid label %s', $value));
8022        }
8023        $this->full = $matches[1];
8024        $this->value = $matches[2];
8025        if ($matches[3] !== '') {
8026            $this->number = (int) $matches[3];
8027        }
8028        $this->valueScore = $this->mapValueToScore($matches[2]);
8029    }
8030}
8031phar-io/version
8032
8033Copyright (c) 2016-2017 Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de> and contributors
8034All rights reserved.
8035
8036Redistribution and use in source and binary forms, with or without modification,
8037are permitted provided that the following conditions are met:
8038
8039* Redistributions of source code must retain the above copyright notice,
8040  this list of conditions and the following disclaimer.
8041
8042* Redistributions in binary form must reproduce the above copyright notice,
8043  this list of conditions and the following disclaimer in the documentation
8044  and/or other materials provided with the distribution.
8045
8046* Neither the name of Arne Blankerts nor the names of contributors
8047  may be used to endorse or promote products derived from this software
8048  without specific prior written permission.
8049
8050THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
8051AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT  * NOT LIMITED TO,
8052THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
8053PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
8054BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
8055OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
8056SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
8057INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
8058CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
8059ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
8060POSSIBILITY OF SUCH DAMAGE.
8061
8062<?php
8063
8064declare (strict_types=1);
8065namespace PHPUnit\PharIo\Version;
8066
8067class VersionConstraintValue
8068{
8069    /** @var VersionNumber */
8070    private $major;
8071    /** @var VersionNumber */
8072    private $minor;
8073    /** @var VersionNumber */
8074    private $patch;
8075    /** @var string */
8076    private $label = '';
8077    /** @var string */
8078    private $buildMetaData = '';
8079    /** @var string */
8080    private $versionString = '';
8081    public function __construct(string $versionString)
8082    {
8083        $this->versionString = $versionString;
8084        $this->parseVersion($versionString);
8085    }
8086    public function getLabel() : string
8087    {
8088        return $this->label;
8089    }
8090    public function getBuildMetaData() : string
8091    {
8092        return $this->buildMetaData;
8093    }
8094    public function getVersionString() : string
8095    {
8096        return $this->versionString;
8097    }
8098    public function getMajor() : VersionNumber
8099    {
8100        return $this->major;
8101    }
8102    public function getMinor() : VersionNumber
8103    {
8104        return $this->minor;
8105    }
8106    public function getPatch() : VersionNumber
8107    {
8108        return $this->patch;
8109    }
8110    private function parseVersion(string $versionString) : void
8111    {
8112        $this->extractBuildMetaData($versionString);
8113        $this->extractLabel($versionString);
8114        $this->stripPotentialVPrefix($versionString);
8115        $versionSegments = \explode('.', $versionString);
8116        $this->major = new VersionNumber(\is_numeric($versionSegments[0]) ? (int) $versionSegments[0] : null);
8117        $minorValue = isset($versionSegments[1]) && \is_numeric($versionSegments[1]) ? (int) $versionSegments[1] : null;
8118        $patchValue = isset($versionSegments[2]) && \is_numeric($versionSegments[2]) ? (int) $versionSegments[2] : null;
8119        $this->minor = new VersionNumber($minorValue);
8120        $this->patch = new VersionNumber($patchValue);
8121    }
8122    private function extractBuildMetaData(string &$versionString) : void
8123    {
8124        if (\preg_match('/\\+(.*)/', $versionString, $matches) === 1) {
8125            $this->buildMetaData = $matches[1];
8126            $versionString = \str_replace($matches[0], '', $versionString);
8127        }
8128    }
8129    private function extractLabel(string &$versionString) : void
8130    {
8131        if (\preg_match('/-(.*)/', $versionString, $matches) === 1) {
8132            $this->label = $matches[1];
8133            $versionString = \str_replace($matches[0], '', $versionString);
8134        }
8135    }
8136    private function stripPotentialVPrefix(string &$versionString) : void
8137    {
8138        if ($versionString[0] !== 'v') {
8139            return;
8140        }
8141        $versionString = \substr($versionString, 1);
8142    }
8143}
8144<?php
8145
8146declare (strict_types=1);
8147/*
8148 * This file is part of sebastian/object-enumerator.
8149 *
8150 * (c) Sebastian Bergmann <sebastian@phpunit.de>
8151 *
8152 * For the full copyright and license information, please view the LICENSE
8153 * file that was distributed with this source code.
8154 */
8155namespace PHPUnit\SebastianBergmann\ObjectEnumerator;
8156
8157use function array_merge;
8158use function func_get_args;
8159use function is_array;
8160use function is_object;
8161use PHPUnit\SebastianBergmann\ObjectReflector\ObjectReflector;
8162use PHPUnit\SebastianBergmann\RecursionContext\Context;
8163/**
8164 * Traverses array structures and object graphs
8165 * to enumerate all referenced objects.
8166 */
8167class Enumerator
8168{
8169    /**
8170     * Returns an array of all objects referenced either
8171     * directly or indirectly by a variable.
8172     *
8173     * @param array|object $variable
8174     *
8175     * @return object[]
8176     */
8177    public function enumerate($variable)
8178    {
8179        if (!is_array($variable) && !is_object($variable)) {
8180            throw new InvalidArgumentException();
8181        }
8182        if (isset(func_get_args()[1])) {
8183            if (!func_get_args()[1] instanceof Context) {
8184                throw new InvalidArgumentException();
8185            }
8186            $processed = func_get_args()[1];
8187        } else {
8188            $processed = new Context();
8189        }
8190        $objects = [];
8191        if ($processed->contains($variable)) {
8192            return $objects;
8193        }
8194        $array = $variable;
8195        $processed->add($variable);
8196        if (is_array($variable)) {
8197            foreach ($array as $element) {
8198                if (!is_array($element) && !is_object($element)) {
8199                    continue;
8200                }
8201                $objects = array_merge($objects, $this->enumerate($element, $processed));
8202            }
8203        } else {
8204            $objects[] = $variable;
8205            $reflector = new ObjectReflector();
8206            foreach ($reflector->getAttributes($variable) as $value) {
8207                if (!is_array($value) && !is_object($value)) {
8208                    continue;
8209                }
8210                $objects = array_merge($objects, $this->enumerate($value, $processed));
8211            }
8212        }
8213        return $objects;
8214    }
8215}
8216<?php
8217
8218declare (strict_types=1);
8219/*
8220 * This file is part of sebastian/object-enumerator.
8221 *
8222 * (c) Sebastian Bergmann <sebastian@phpunit.de>
8223 *
8224 * For the full copyright and license information, please view the LICENSE
8225 * file that was distributed with this source code.
8226 */
8227namespace PHPUnit\SebastianBergmann\ObjectEnumerator;
8228
8229use Throwable;
8230interface Exception extends Throwable
8231{
8232}
8233<?php
8234
8235declare (strict_types=1);
8236/*
8237 * This file is part of sebastian/object-enumerator.
8238 *
8239 * (c) Sebastian Bergmann <sebastian@phpunit.de>
8240 *
8241 * For the full copyright and license information, please view the LICENSE
8242 * file that was distributed with this source code.
8243 */
8244namespace PHPUnit\SebastianBergmann\ObjectEnumerator;
8245
8246class InvalidArgumentException extends \InvalidArgumentException implements Exception
8247{
8248}
8249<?xml version="1.0" encoding="UTF-8"?>
8250<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
8251    <xs:annotation>
8252        <xs:documentation source="https://phpunit.de/documentation.html">
8253            This Schema file defines the rules by which the XML configuration file of PHPUnit 9.5 may be structured.
8254        </xs:documentation>
8255        <xs:appinfo source="https://phpunit.de/documentation.html"/>
8256    </xs:annotation>
8257    <xs:element name="phpunit" type="phpUnitType">
8258        <xs:annotation>
8259            <xs:documentation>Root Element</xs:documentation>
8260        </xs:annotation>
8261    </xs:element>
8262    <xs:complexType name="coverageType">
8263        <xs:all>
8264            <xs:element name="include" minOccurs="0" maxOccurs="1">
8265                <xs:complexType>
8266                    <xs:group ref="pathGroup"/>
8267                </xs:complexType>
8268            </xs:element>
8269            <xs:element name="exclude" minOccurs="0" maxOccurs="1">
8270                <xs:complexType>
8271                    <xs:group ref="pathGroup"/>
8272                </xs:complexType>
8273            </xs:element>
8274            <xs:element name="report" minOccurs="0" maxOccurs="1">
8275                <xs:complexType>
8276                    <xs:group ref="coverageReportGroup"/>
8277                </xs:complexType>
8278            </xs:element>
8279        </xs:all>
8280        <xs:attribute name="cacheDirectory" type="xs:anyURI"/>
8281        <xs:attribute name="pathCoverage" type="xs:boolean" default="false"/>
8282        <xs:attribute name="includeUncoveredFiles" type="xs:boolean" default="true"/>
8283        <xs:attribute name="processUncoveredFiles" type="xs:boolean" default="false"/>
8284        <xs:attribute name="ignoreDeprecatedCodeUnits" type="xs:boolean" default="false"/>
8285        <xs:attribute name="disableCodeCoverageIgnore" type="xs:boolean" default="false"/>
8286    </xs:complexType>
8287    <xs:complexType name="loggingType">
8288        <xs:group ref="loggingGroup"/>
8289    </xs:complexType>
8290    <xs:complexType name="groupsType">
8291        <xs:choice>
8292            <xs:sequence>
8293                <xs:element name="include" type="groupType"/>
8294                <xs:element name="exclude" type="groupType" minOccurs="0"/>
8295            </xs:sequence>
8296            <xs:sequence>
8297                <xs:element name="exclude" type="groupType"/>
8298            </xs:sequence>
8299        </xs:choice>
8300    </xs:complexType>
8301    <xs:complexType name="groupType">
8302        <xs:sequence>
8303            <xs:element name="group" type="xs:string" maxOccurs="unbounded"/>
8304        </xs:sequence>
8305    </xs:complexType>
8306    <xs:complexType name="extensionsType">
8307        <xs:sequence>
8308            <xs:element name="extension" type="objectType" maxOccurs="unbounded"/>
8309        </xs:sequence>
8310    </xs:complexType>
8311    <xs:complexType name="listenersType">
8312        <xs:sequence>
8313            <xs:element name="listener" type="objectType" maxOccurs="unbounded"/>
8314        </xs:sequence>
8315    </xs:complexType>
8316    <xs:complexType name="objectType">
8317        <xs:sequence>
8318            <xs:element name="arguments" minOccurs="0">
8319                <xs:complexType>
8320                    <xs:group ref="argumentsGroup"/>
8321                </xs:complexType>
8322            </xs:element>
8323        </xs:sequence>
8324        <xs:attribute name="class" type="xs:string" use="required"/>
8325        <xs:attribute name="file" type="xs:anyURI"/>
8326    </xs:complexType>
8327    <xs:complexType name="arrayType">
8328        <xs:sequence>
8329            <xs:element name="element" type="argumentType" minOccurs="0" maxOccurs="unbounded"/>
8330        </xs:sequence>
8331    </xs:complexType>
8332    <xs:complexType name="argumentType">
8333        <xs:group ref="argumentChoice"/>
8334        <xs:attribute name="key" use="required"/>
8335    </xs:complexType>
8336    <xs:group name="argumentsGroup">
8337        <xs:sequence>
8338            <xs:choice minOccurs="0" maxOccurs="unbounded">
8339                <xs:element name="array" type="arrayType" />
8340                <xs:element name="integer" type="xs:integer" />
8341                <xs:element name="string" type="xs:string" />
8342                <xs:element name="double" type="xs:double" />
8343                <xs:element name="null" />
8344                <xs:element name="object" type="objectType" />
8345                <xs:element name="file" type="xs:anyURI" />
8346                <xs:element name="directory" type="xs:anyURI" />
8347                <xs:element name="boolean" type="xs:boolean" />
8348            </xs:choice>
8349        </xs:sequence>
8350    </xs:group>
8351    <xs:group name="argumentChoice">
8352        <xs:choice>
8353            <xs:element name="array" type="arrayType" minOccurs="0" maxOccurs="unbounded"/>
8354            <xs:element name="integer" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
8355            <xs:element name="string" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
8356            <xs:element name="double" type="xs:double" minOccurs="0" maxOccurs="unbounded"/>
8357            <xs:element name="null" minOccurs="0" maxOccurs="unbounded"/>
8358            <xs:element name="object" type="objectType" minOccurs="0" maxOccurs="unbounded"/>
8359            <xs:element name="file" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
8360            <xs:element name="directory" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
8361            <xs:element name="boolean" type="xs:boolean" minOccurs="0" maxOccurs="unbounded"/>
8362        </xs:choice>
8363    </xs:group>
8364    <xs:simpleType name="columnsType">
8365        <xs:union>
8366            <xs:simpleType>
8367                <xs:restriction base="xs:integer"/>
8368            </xs:simpleType>
8369            <xs:simpleType>
8370                <xs:restriction base="xs:string">
8371                    <xs:enumeration value="max"/>
8372                </xs:restriction>
8373            </xs:simpleType>
8374        </xs:union>
8375    </xs:simpleType>
8376    <xs:group name="pathGroup">
8377        <xs:sequence>
8378            <xs:choice minOccurs="0" maxOccurs="unbounded">
8379                <xs:element name="directory" type="directoryFilterType"/>
8380                <xs:element name="file" type="fileFilterType"/>
8381            </xs:choice>
8382        </xs:sequence>
8383    </xs:group>
8384    <xs:complexType name="directoryFilterType">
8385        <xs:simpleContent>
8386            <xs:extension base="xs:string">
8387                <xs:attribute type="xs:string" name="prefix" default=""/>
8388                <xs:attribute type="xs:string" name="suffix" default="Test.php"/>
8389                <xs:attributeGroup ref="phpVersionGroup"/>
8390            </xs:extension>
8391        </xs:simpleContent>
8392    </xs:complexType>
8393    <xs:simpleType name="executionOrderType">
8394        <xs:restriction base="xs:string">
8395            <xs:enumeration value="default"/>
8396            <xs:enumeration value="defects"/>
8397            <xs:enumeration value="depends"/>
8398            <xs:enumeration value="depends,defects"/>
8399            <xs:enumeration value="depends,duration"/>
8400            <xs:enumeration value="depends,random"/>
8401            <xs:enumeration value="depends,reverse"/>
8402            <xs:enumeration value="depends,size"/>
8403            <xs:enumeration value="duration"/>
8404            <xs:enumeration value="no-depends"/>
8405            <xs:enumeration value="no-depends,defects"/>
8406            <xs:enumeration value="no-depends,duration"/>
8407            <xs:enumeration value="no-depends,random"/>
8408            <xs:enumeration value="no-depends,reverse"/>
8409            <xs:enumeration value="no-depends,size"/>
8410            <xs:enumeration value="random"/>
8411            <xs:enumeration value="reverse"/>
8412            <xs:enumeration value="size"/>
8413        </xs:restriction>
8414    </xs:simpleType>
8415    <xs:complexType name="fileFilterType">
8416        <xs:simpleContent>
8417            <xs:extension base="xs:anyURI">
8418                <xs:attributeGroup ref="phpVersionGroup"/>
8419            </xs:extension>
8420        </xs:simpleContent>
8421    </xs:complexType>
8422    <xs:attributeGroup name="phpVersionGroup">
8423        <xs:attribute name="phpVersion" type="xs:string" default="5.3.0"/>
8424        <xs:attribute name="phpVersionOperator" type="xs:string" default="&gt;="/>
8425    </xs:attributeGroup>
8426    <xs:complexType name="phpType">
8427        <xs:sequence>
8428            <xs:choice maxOccurs="unbounded">
8429                <xs:element name="includePath" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
8430                <xs:element name="ini" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
8431                <xs:element name="const" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
8432                <xs:element name="var" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
8433                <xs:element name="env" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
8434                <xs:element name="post" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
8435                <xs:element name="get" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
8436                <xs:element name="cookie" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
8437                <xs:element name="server" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
8438                <xs:element name="files" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
8439                <xs:element name="request" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
8440            </xs:choice>
8441        </xs:sequence>
8442    </xs:complexType>
8443    <xs:complexType name="namedValueType">
8444        <xs:attribute name="name" use="required" type="xs:string"/>
8445        <xs:attribute name="value" use="required" type="xs:anySimpleType"/>
8446        <xs:attribute name="verbatim" use="optional" type="xs:boolean"/>
8447        <xs:attribute name="force" use="optional" type="xs:boolean"/>
8448    </xs:complexType>
8449    <xs:complexType name="phpUnitType">
8450        <xs:annotation>
8451            <xs:documentation>The main type specifying the document structure</xs:documentation>
8452        </xs:annotation>
8453        <xs:group ref="configGroup"/>
8454        <xs:attributeGroup ref="configAttributeGroup"/>
8455    </xs:complexType>
8456    <xs:attributeGroup name="configAttributeGroup">
8457        <xs:attribute name="backupGlobals" type="xs:boolean" default="false"/>
8458        <xs:attribute name="backupStaticAttributes" type="xs:boolean" default="false"/>
8459        <xs:attribute name="bootstrap" type="xs:anyURI"/>
8460        <xs:attribute name="cacheResult" type="xs:boolean" default="true"/>
8461        <xs:attribute name="cacheResultFile" type="xs:anyURI"/>
8462        <xs:attribute name="colors" type="xs:boolean" default="false"/>
8463        <xs:attribute name="columns" type="columnsType" default="80"/>
8464        <xs:attribute name="convertDeprecationsToExceptions" type="xs:boolean" default="false"/>
8465        <xs:attribute name="convertErrorsToExceptions" type="xs:boolean" default="true"/>
8466        <xs:attribute name="convertNoticesToExceptions" type="xs:boolean" default="true"/>
8467        <xs:attribute name="convertWarningsToExceptions" type="xs:boolean" default="true"/>
8468        <xs:attribute name="forceCoversAnnotation" type="xs:boolean" default="false"/>
8469        <xs:attribute name="printerClass" type="xs:string" default="PHPUnit\TextUI\DefaultResultPrinter"/>
8470        <xs:attribute name="printerFile" type="xs:anyURI"/>
8471        <xs:attribute name="processIsolation" type="xs:boolean" default="false"/>
8472        <xs:attribute name="stopOnDefect" type="xs:boolean" default="false"/>
8473        <xs:attribute name="stopOnError" type="xs:boolean" default="false"/>
8474        <xs:attribute name="stopOnFailure" type="xs:boolean" default="false"/>
8475        <xs:attribute name="stopOnWarning" type="xs:boolean" default="false"/>
8476        <xs:attribute name="stopOnIncomplete" type="xs:boolean" default="false"/>
8477        <xs:attribute name="stopOnRisky" type="xs:boolean" default="false"/>
8478        <xs:attribute name="stopOnSkipped" type="xs:boolean" default="false"/>
8479        <xs:attribute name="failOnEmptyTestSuite" type="xs:boolean" default="false"/>
8480        <xs:attribute name="failOnIncomplete" type="xs:boolean" default="false"/>
8481        <xs:attribute name="failOnRisky" type="xs:boolean" default="false"/>
8482        <xs:attribute name="failOnSkipped" type="xs:boolean" default="false"/>
8483        <xs:attribute name="failOnWarning" type="xs:boolean" default="false"/>
8484        <xs:attribute name="beStrictAboutChangesToGlobalState" type="xs:boolean" default="false"/>
8485        <xs:attribute name="beStrictAboutOutputDuringTests" type="xs:boolean" default="false"/>
8486        <xs:attribute name="beStrictAboutResourceUsageDuringSmallTests" type="xs:boolean" default="false"/>
8487        <xs:attribute name="beStrictAboutTestsThatDoNotTestAnything" type="xs:boolean" default="true"/>
8488        <xs:attribute name="beStrictAboutTodoAnnotatedTests" type="xs:boolean" default="false"/>
8489        <xs:attribute name="beStrictAboutCoversAnnotation" type="xs:boolean" default="false"/>
8490        <xs:attribute name="defaultTimeLimit" type="xs:integer" default="0"/>
8491        <xs:attribute name="enforceTimeLimit" type="xs:boolean" default="false"/>
8492        <xs:attribute name="timeoutForSmallTests" type="xs:integer" default="1"/>
8493        <xs:attribute name="timeoutForMediumTests" type="xs:integer" default="10"/>
8494        <xs:attribute name="timeoutForLargeTests" type="xs:integer" default="60"/>
8495        <xs:attribute name="testSuiteLoaderClass" type="xs:string" default="PHPUnit\Runner\StandardTestSuiteLoader"/>
8496        <xs:attribute name="testSuiteLoaderFile" type="xs:anyURI"/>
8497        <xs:attribute name="defaultTestSuite" type="xs:string" default=""/>
8498        <xs:attribute name="verbose" type="xs:boolean" default="false"/>
8499        <xs:attribute name="testdox" type="xs:boolean" default="false"/>
8500        <xs:attribute name="stderr" type="xs:boolean" default="false"/>
8501        <xs:attribute name="reverseDefectList" type="xs:boolean" default="false"/>
8502        <xs:attribute name="registerMockObjectsFromTestArgumentsRecursively" type="xs:boolean" default="false"/>
8503        <xs:attribute name="extensionsDirectory" type="xs:anyURI"/>
8504        <xs:attribute name="executionOrder" type="executionOrderType" default="default"/>
8505        <xs:attribute name="resolveDependencies" type="xs:boolean" default="true"/>
8506        <xs:attribute name="noInteraction" type="xs:boolean" default="false"/>
8507    </xs:attributeGroup>
8508    <xs:group name="configGroup">
8509        <xs:all>
8510            <xs:element ref="testSuiteFacet" minOccurs="0"/>
8511            <xs:element name="groups" type="groupsType" minOccurs="0"/>
8512            <xs:element name="testdoxGroups" type="groupsType" minOccurs="0"/>
8513            <xs:element name="coverage" type="coverageType" minOccurs="0"/>
8514            <xs:element name="logging" type="loggingType" minOccurs="0"/>
8515            <xs:element name="extensions" type="extensionsType" minOccurs="0"/>
8516            <xs:element name="listeners" type="listenersType" minOccurs="0"/>
8517            <xs:element name="php" type="phpType" minOccurs="0"/>
8518        </xs:all>
8519    </xs:group>
8520    <xs:element name="testSuiteFacet" abstract="true"/>
8521    <xs:element name="testsuite" type="testSuiteType" substitutionGroup="testSuiteFacet"/>
8522    <xs:element name="testsuites" type="testSuitesType" substitutionGroup="testSuiteFacet"/>
8523    <xs:complexType name="testSuitesType">
8524        <xs:sequence>
8525            <xs:element name="testsuite" type="testSuiteType" maxOccurs="unbounded"/>
8526        </xs:sequence>
8527    </xs:complexType>
8528    <xs:complexType name="testSuiteType">
8529        <xs:sequence>
8530            <xs:group ref="pathGroup"/>
8531            <xs:element name="exclude" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
8532        </xs:sequence>
8533        <xs:attribute name="name" type="xs:string" use="required"/>
8534    </xs:complexType>
8535    <xs:group name="coverageReportGroup">
8536        <xs:all>
8537            <xs:element name="clover" type="logToFileType" minOccurs="0"/>
8538            <xs:element name="cobertura" type="logToFileType" minOccurs="0"/>
8539            <xs:element name="crap4j" type="coverageReportCrap4JType" minOccurs="0" />
8540            <xs:element name="html" type="coverageReportHtmlType" minOccurs="0" />
8541            <xs:element name="php" type="logToFileType" minOccurs="0" />
8542            <xs:element name="text" type="coverageReportTextType" minOccurs="0" />
8543            <xs:element name="xml" type="logToDirectoryType" minOccurs="0" />
8544        </xs:all>
8545    </xs:group>
8546    <xs:group name="loggingGroup">
8547        <xs:all>
8548            <xs:element name="junit" type="logToFileType" minOccurs="0" />
8549            <xs:element name="teamcity" type="logToFileType" minOccurs="0" />
8550            <xs:element name="testdoxHtml" type="logToFileType" minOccurs="0" />
8551            <xs:element name="testdoxText" type="logToFileType" minOccurs="0" />
8552            <xs:element name="testdoxXml" type="logToFileType" minOccurs="0" />
8553            <xs:element name="text" type="logToFileType" minOccurs="0"/>
8554        </xs:all>
8555    </xs:group>
8556    <xs:complexType name="logToFileType">
8557        <xs:attribute name="outputFile" type="xs:anyURI" use="required"/>
8558    </xs:complexType>
8559    <xs:complexType name="logToDirectoryType">
8560        <xs:attribute name="outputDirectory" type="xs:anyURI" use="required"/>
8561    </xs:complexType>
8562    <xs:complexType name="coverageReportCrap4JType">
8563        <xs:attribute name="outputFile" type="xs:anyURI" use="required"/>
8564        <xs:attribute name="threshold" type="xs:integer"/>
8565    </xs:complexType>
8566    <xs:complexType name="coverageReportHtmlType">
8567        <xs:attribute name="outputDirectory" type="xs:anyURI" use="required"/>
8568        <xs:attribute name="lowUpperBound" type="xs:integer" default="50"/>
8569        <xs:attribute name="highLowerBound" type="xs:integer" default="90"/>
8570    </xs:complexType>
8571    <xs:complexType name="coverageReportTextType">
8572        <xs:attribute name="outputFile" type="xs:anyURI" use="required"/>
8573        <xs:attribute name="showUncoveredFiles" type="xs:boolean" default="false"/>
8574        <xs:attribute name="showOnlySummary" type="xs:boolean" default="false"/>
8575    </xs:complexType>
8576</xs:schema>
8577BSD 3-Clause License
8578
8579Copyright (c) 2011, Nikita Popov
8580All rights reserved.
8581
8582Redistribution and use in source and binary forms, with or without
8583modification, are permitted provided that the following conditions are met:
8584
85851. Redistributions of source code must retain the above copyright notice, this
8586   list of conditions and the following disclaimer.
8587
85882. Redistributions in binary form must reproduce the above copyright notice,
8589   this list of conditions and the following disclaimer in the documentation
8590   and/or other materials provided with the distribution.
8591
85923. Neither the name of the copyright holder nor the names of its
8593   contributors may be used to endorse or promote products derived from
8594   this software without specific prior written permission.
8595
8596THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
8597AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
8598IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
8599DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
8600FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
8601DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
8602SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
8603CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
8604OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8605OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8606<?php
8607
8608declare (strict_types=1);
8609namespace PHPUnit\PhpParser;
8610
8611use PHPUnit\PhpParser\Node\Expr\Include_;
8612use PHPUnit\PhpParser\Node\Stmt\Class_;
8613use PHPUnit\PhpParser\Node\Stmt\GroupUse;
8614use PHPUnit\PhpParser\Node\Stmt\Use_;
8615use PHPUnit\PhpParser\Node\Stmt\UseUse;
8616class NodeDumper
8617{
8618    private $dumpComments;
8619    private $dumpPositions;
8620    private $code;
8621    /**
8622     * Constructs a NodeDumper.
8623     *
8624     * Supported options:
8625     *  * bool dumpComments: Whether comments should be dumped.
8626     *  * bool dumpPositions: Whether line/offset information should be dumped. To dump offset
8627     *                        information, the code needs to be passed to dump().
8628     *
8629     * @param array $options Options (see description)
8630     */
8631    public function __construct(array $options = [])
8632    {
8633        $this->dumpComments = !empty($options['dumpComments']);
8634        $this->dumpPositions = !empty($options['dumpPositions']);
8635    }
8636    /**
8637     * Dumps a node or array.
8638     *
8639     * @param array|Node  $node Node or array to dump
8640     * @param string|null $code Code corresponding to dumped AST. This only needs to be passed if
8641     *                          the dumpPositions option is enabled and the dumping of node offsets
8642     *                          is desired.
8643     *
8644     * @return string Dumped value
8645     */
8646    public function dump($node, string $code = null) : string
8647    {
8648        $this->code = $code;
8649        return $this->dumpRecursive($node);
8650    }
8651    protected function dumpRecursive($node)
8652    {
8653        if ($node instanceof Node) {
8654            $r = $node->getType();
8655            if ($this->dumpPositions && null !== ($p = $this->dumpPosition($node))) {
8656                $r .= $p;
8657            }
8658            $r .= '(';
8659            foreach ($node->getSubNodeNames() as $key) {
8660                $r .= "\n    " . $key . ': ';
8661                $value = $node->{$key};
8662                if (null === $value) {
8663                    $r .= 'null';
8664                } elseif (\false === $value) {
8665                    $r .= 'false';
8666                } elseif (\true === $value) {
8667                    $r .= 'true';
8668                } elseif (\is_scalar($value)) {
8669                    if ('flags' === $key || 'newModifier' === $key) {
8670                        $r .= $this->dumpFlags($value);
8671                    } elseif ('type' === $key && $node instanceof Include_) {
8672                        $r .= $this->dumpIncludeType($value);
8673                    } elseif ('type' === $key && ($node instanceof Use_ || $node instanceof UseUse || $node instanceof GroupUse)) {
8674                        $r .= $this->dumpUseType($value);
8675                    } else {
8676                        $r .= $value;
8677                    }
8678                } else {
8679                    $r .= \str_replace("\n", "\n    ", $this->dumpRecursive($value));
8680                }
8681            }
8682            if ($this->dumpComments && ($comments = $node->getComments())) {
8683                $r .= "\n    comments: " . \str_replace("\n", "\n    ", $this->dumpRecursive($comments));
8684            }
8685        } elseif (\is_array($node)) {
8686            $r = 'array(';
8687            foreach ($node as $key => $value) {
8688                $r .= "\n    " . $key . ': ';
8689                if (null === $value) {
8690                    $r .= 'null';
8691                } elseif (\false === $value) {
8692                    $r .= 'false';
8693                } elseif (\true === $value) {
8694                    $r .= 'true';
8695                } elseif (\is_scalar($value)) {
8696                    $r .= $value;
8697                } else {
8698                    $r .= \str_replace("\n", "\n    ", $this->dumpRecursive($value));
8699                }
8700            }
8701        } elseif ($node instanceof Comment) {
8702            return $node->getReformattedText();
8703        } else {
8704            throw new \InvalidArgumentException('Can only dump nodes and arrays.');
8705        }
8706        return $r . "\n)";
8707    }
8708    protected function dumpFlags($flags)
8709    {
8710        $strs = [];
8711        if ($flags & Class_::MODIFIER_PUBLIC) {
8712            $strs[] = 'MODIFIER_PUBLIC';
8713        }
8714        if ($flags & Class_::MODIFIER_PROTECTED) {
8715            $strs[] = 'MODIFIER_PROTECTED';
8716        }
8717        if ($flags & Class_::MODIFIER_PRIVATE) {
8718            $strs[] = 'MODIFIER_PRIVATE';
8719        }
8720        if ($flags & Class_::MODIFIER_ABSTRACT) {
8721            $strs[] = 'MODIFIER_ABSTRACT';
8722        }
8723        if ($flags & Class_::MODIFIER_STATIC) {
8724            $strs[] = 'MODIFIER_STATIC';
8725        }
8726        if ($flags & Class_::MODIFIER_FINAL) {
8727            $strs[] = 'MODIFIER_FINAL';
8728        }
8729        if ($flags & Class_::MODIFIER_READONLY) {
8730            $strs[] = 'MODIFIER_READONLY';
8731        }
8732        if ($strs) {
8733            return \implode(' | ', $strs) . ' (' . $flags . ')';
8734        } else {
8735            return $flags;
8736        }
8737    }
8738    protected function dumpIncludeType($type)
8739    {
8740        $map = [Include_::TYPE_INCLUDE => 'TYPE_INCLUDE', Include_::TYPE_INCLUDE_ONCE => 'TYPE_INCLUDE_ONCE', Include_::TYPE_REQUIRE => 'TYPE_REQUIRE', Include_::TYPE_REQUIRE_ONCE => 'TYPE_REQUIRE_ONCE'];
8741        if (!isset($map[$type])) {
8742            return $type;
8743        }
8744        return $map[$type] . ' (' . $type . ')';
8745    }
8746    protected function dumpUseType($type)
8747    {
8748        $map = [Use_::TYPE_UNKNOWN => 'TYPE_UNKNOWN', Use_::TYPE_NORMAL => 'TYPE_NORMAL', Use_::TYPE_FUNCTION => 'TYPE_FUNCTION', Use_::TYPE_CONSTANT => 'TYPE_CONSTANT'];
8749        if (!isset($map[$type])) {
8750            return $type;
8751        }
8752        return $map[$type] . ' (' . $type . ')';
8753    }
8754    /**
8755     * Dump node position, if possible.
8756     *
8757     * @param Node $node Node for which to dump position
8758     *
8759     * @return string|null Dump of position, or null if position information not available
8760     */
8761    protected function dumpPosition(Node $node)
8762    {
8763        if (!$node->hasAttribute('startLine') || !$node->hasAttribute('endLine')) {
8764            return null;
8765        }
8766        $start = $node->getStartLine();
8767        $end = $node->getEndLine();
8768        if ($node->hasAttribute('startFilePos') && $node->hasAttribute('endFilePos') && null !== $this->code) {
8769            $start .= ':' . $this->toColumn($this->code, $node->getStartFilePos());
8770            $end .= ':' . $this->toColumn($this->code, $node->getEndFilePos());
8771        }
8772        return "[{$start} - {$end}]";
8773    }
8774    // Copied from Error class
8775    private function toColumn($code, $pos)
8776    {
8777        if ($pos > \strlen($code)) {
8778            throw new \RuntimeException('Invalid position information');
8779        }
8780        $lineStartPos = \strrpos($code, "\n", $pos - \strlen($code));
8781        if (\false === $lineStartPos) {
8782            $lineStartPos = -1;
8783        }
8784        return $pos - $lineStartPos;
8785    }
8786}
8787<?php
8788
8789declare (strict_types=1);
8790namespace PHPUnit\PhpParser\Internal;
8791
8792/**
8793 * Provides operations on token streams, for use by pretty printer.
8794 *
8795 * @internal
8796 */
8797class TokenStream
8798{
8799    /** @var array Tokens (in token_get_all format) */
8800    private $tokens;
8801    /** @var int[] Map from position to indentation */
8802    private $indentMap;
8803    /**
8804     * Create token stream instance.
8805     *
8806     * @param array $tokens Tokens in token_get_all() format
8807     */
8808    public function __construct(array $tokens)
8809    {
8810        $this->tokens = $tokens;
8811        $this->indentMap = $this->calcIndentMap();
8812    }
8813    /**
8814     * Whether the given position is immediately surrounded by parenthesis.
8815     *
8816     * @param int $startPos Start position
8817     * @param int $endPos   End position
8818     *
8819     * @return bool
8820     */
8821    public function haveParens(int $startPos, int $endPos) : bool
8822    {
8823        return $this->haveTokenImmediatelyBefore($startPos, '(') && $this->haveTokenImmediatelyAfter($endPos, ')');
8824    }
8825    /**
8826     * Whether the given position is immediately surrounded by braces.
8827     *
8828     * @param int $startPos Start position
8829     * @param int $endPos   End position
8830     *
8831     * @return bool
8832     */
8833    public function haveBraces(int $startPos, int $endPos) : bool
8834    {
8835        return ($this->haveTokenImmediatelyBefore($startPos, '{') || $this->haveTokenImmediatelyBefore($startPos, \T_CURLY_OPEN)) && $this->haveTokenImmediatelyAfter($endPos, '}');
8836    }
8837    /**
8838     * Check whether the position is directly preceded by a certain token type.
8839     *
8840     * During this check whitespace and comments are skipped.
8841     *
8842     * @param int        $pos               Position before which the token should occur
8843     * @param int|string $expectedTokenType Token to check for
8844     *
8845     * @return bool Whether the expected token was found
8846     */
8847    public function haveTokenImmediatelyBefore(int $pos, $expectedTokenType) : bool
8848    {
8849        $tokens = $this->tokens;
8850        $pos--;
8851        for (; $pos >= 0; $pos--) {
8852            $tokenType = $tokens[$pos][0];
8853            if ($tokenType === $expectedTokenType) {
8854                return \true;
8855            }
8856            if ($tokenType !== \T_WHITESPACE && $tokenType !== \T_COMMENT && $tokenType !== \T_DOC_COMMENT) {
8857                break;
8858            }
8859        }
8860        return \false;
8861    }
8862    /**
8863     * Check whether the position is directly followed by a certain token type.
8864     *
8865     * During this check whitespace and comments are skipped.
8866     *
8867     * @param int        $pos               Position after which the token should occur
8868     * @param int|string $expectedTokenType Token to check for
8869     *
8870     * @return bool Whether the expected token was found
8871     */
8872    public function haveTokenImmediatelyAfter(int $pos, $expectedTokenType) : bool
8873    {
8874        $tokens = $this->tokens;
8875        $pos++;
8876        for (; $pos < \count($tokens); $pos++) {
8877            $tokenType = $tokens[$pos][0];
8878            if ($tokenType === $expectedTokenType) {
8879                return \true;
8880            }
8881            if ($tokenType !== \T_WHITESPACE && $tokenType !== \T_COMMENT && $tokenType !== \T_DOC_COMMENT) {
8882                break;
8883            }
8884        }
8885        return \false;
8886    }
8887    public function skipLeft(int $pos, $skipTokenType)
8888    {
8889        $tokens = $this->tokens;
8890        $pos = $this->skipLeftWhitespace($pos);
8891        if ($skipTokenType === \T_WHITESPACE) {
8892            return $pos;
8893        }
8894        if ($tokens[$pos][0] !== $skipTokenType) {
8895            // Shouldn't happen. The skip token MUST be there
8896            throw new \Exception('Encountered unexpected token');
8897        }
8898        $pos--;
8899        return $this->skipLeftWhitespace($pos);
8900    }
8901    public function skipRight(int $pos, $skipTokenType)
8902    {
8903        $tokens = $this->tokens;
8904        $pos = $this->skipRightWhitespace($pos);
8905        if ($skipTokenType === \T_WHITESPACE) {
8906            return $pos;
8907        }
8908        if ($tokens[$pos][0] !== $skipTokenType) {
8909            // Shouldn't happen. The skip token MUST be there
8910            throw new \Exception('Encountered unexpected token');
8911        }
8912        $pos++;
8913        return $this->skipRightWhitespace($pos);
8914    }
8915    /**
8916     * Return first non-whitespace token position smaller or equal to passed position.
8917     *
8918     * @param int $pos Token position
8919     * @return int Non-whitespace token position
8920     */
8921    public function skipLeftWhitespace(int $pos)
8922    {
8923        $tokens = $this->tokens;
8924        for (; $pos >= 0; $pos--) {
8925            $type = $tokens[$pos][0];
8926            if ($type !== \T_WHITESPACE && $type !== \T_COMMENT && $type !== \T_DOC_COMMENT) {
8927                break;
8928            }
8929        }
8930        return $pos;
8931    }
8932    /**
8933     * Return first non-whitespace position greater or equal to passed position.
8934     *
8935     * @param int $pos Token position
8936     * @return int Non-whitespace token position
8937     */
8938    public function skipRightWhitespace(int $pos)
8939    {
8940        $tokens = $this->tokens;
8941        for ($count = \count($tokens); $pos < $count; $pos++) {
8942            $type = $tokens[$pos][0];
8943            if ($type !== \T_WHITESPACE && $type !== \T_COMMENT && $type !== \T_DOC_COMMENT) {
8944                break;
8945            }
8946        }
8947        return $pos;
8948    }
8949    public function findRight(int $pos, $findTokenType)
8950    {
8951        $tokens = $this->tokens;
8952        for ($count = \count($tokens); $pos < $count; $pos++) {
8953            $type = $tokens[$pos][0];
8954            if ($type === $findTokenType) {
8955                return $pos;
8956            }
8957        }
8958        return -1;
8959    }
8960    /**
8961     * Whether the given position range contains a certain token type.
8962     *
8963     * @param int $startPos Starting position (inclusive)
8964     * @param int $endPos Ending position (exclusive)
8965     * @param int|string $tokenType Token type to look for
8966     * @return bool Whether the token occurs in the given range
8967     */
8968    public function haveTokenInRange(int $startPos, int $endPos, $tokenType)
8969    {
8970        $tokens = $this->tokens;
8971        for ($pos = $startPos; $pos < $endPos; $pos++) {
8972            if ($tokens[$pos][0] === $tokenType) {
8973                return \true;
8974            }
8975        }
8976        return \false;
8977    }
8978    public function haveBracesInRange(int $startPos, int $endPos)
8979    {
8980        return $this->haveTokenInRange($startPos, $endPos, '{') || $this->haveTokenInRange($startPos, $endPos, \T_CURLY_OPEN) || $this->haveTokenInRange($startPos, $endPos, '}');
8981    }
8982    /**
8983     * Get indentation before token position.
8984     *
8985     * @param int $pos Token position
8986     *
8987     * @return int Indentation depth (in spaces)
8988     */
8989    public function getIndentationBefore(int $pos) : int
8990    {
8991        return $this->indentMap[$pos];
8992    }
8993    /**
8994     * Get the code corresponding to a token offset range, optionally adjusted for indentation.
8995     *
8996     * @param int $from   Token start position (inclusive)
8997     * @param int $to     Token end position (exclusive)
8998     * @param int $indent By how much the code should be indented (can be negative as well)
8999     *
9000     * @return string Code corresponding to token range, adjusted for indentation
9001     */
9002    public function getTokenCode(int $from, int $to, int $indent) : string
9003    {
9004        $tokens = $this->tokens;
9005        $result = '';
9006        for ($pos = $from; $pos < $to; $pos++) {
9007            $token = $tokens[$pos];
9008            if (\is_array($token)) {
9009                $type = $token[0];
9010                $content = $token[1];
9011                if ($type === \T_CONSTANT_ENCAPSED_STRING || $type === \T_ENCAPSED_AND_WHITESPACE) {
9012                    $result .= $content;
9013                } else {
9014                    // TODO Handle non-space indentation
9015                    if ($indent < 0) {
9016                        $result .= \str_replace("\n" . \str_repeat(" ", -$indent), "\n", $content);
9017                    } elseif ($indent > 0) {
9018                        $result .= \str_replace("\n", "\n" . \str_repeat(" ", $indent), $content);
9019                    } else {
9020                        $result .= $content;
9021                    }
9022                }
9023            } else {
9024                $result .= $token;
9025            }
9026        }
9027        return $result;
9028    }
9029    /**
9030     * Precalculate the indentation at every token position.
9031     *
9032     * @return int[] Token position to indentation map
9033     */
9034    private function calcIndentMap()
9035    {
9036        $indentMap = [];
9037        $indent = 0;
9038        foreach ($this->tokens as $token) {
9039            $indentMap[] = $indent;
9040            if ($token[0] === \T_WHITESPACE) {
9041                $content = $token[1];
9042                $newlinePos = \strrpos($content, "\n");
9043                if (\false !== $newlinePos) {
9044                    $indent = \strlen($content) - $newlinePos - 1;
9045                }
9046            }
9047        }
9048        // Add a sentinel for one past end of the file
9049        $indentMap[] = $indent;
9050        return $indentMap;
9051    }
9052}
9053<?php
9054
9055declare (strict_types=1);
9056namespace PHPUnit\PhpParser\Internal;
9057
9058/**
9059 * @internal
9060 */
9061class DiffElem
9062{
9063    const TYPE_KEEP = 0;
9064    const TYPE_REMOVE = 1;
9065    const TYPE_ADD = 2;
9066    const TYPE_REPLACE = 3;
9067    /** @var int One of the TYPE_* constants */
9068    public $type;
9069    /** @var mixed Is null for add operations */
9070    public $old;
9071    /** @var mixed Is null for remove operations */
9072    public $new;
9073    public function __construct(int $type, $old, $new)
9074    {
9075        $this->type = $type;
9076        $this->old = $old;
9077        $this->new = $new;
9078    }
9079}
9080<?php
9081
9082declare (strict_types=1);
9083namespace PHPUnit\PhpParser\Internal;
9084
9085/**
9086 * Implements the Myers diff algorithm.
9087 *
9088 * Myers, Eugene W. "An O (ND) difference algorithm and its variations."
9089 * Algorithmica 1.1 (1986): 251-266.
9090 *
9091 * @internal
9092 */
9093class Differ
9094{
9095    private $isEqual;
9096    /**
9097     * Create differ over the given equality relation.
9098     *
9099     * @param callable $isEqual Equality relation with signature function($a, $b) : bool
9100     */
9101    public function __construct(callable $isEqual)
9102    {
9103        $this->isEqual = $isEqual;
9104    }
9105    /**
9106     * Calculate diff (edit script) from $old to $new.
9107     *
9108     * @param array $old Original array
9109     * @param array $new New array
9110     *
9111     * @return DiffElem[] Diff (edit script)
9112     */
9113    public function diff(array $old, array $new)
9114    {
9115        list($trace, $x, $y) = $this->calculateTrace($old, $new);
9116        return $this->extractDiff($trace, $x, $y, $old, $new);
9117    }
9118    /**
9119     * Calculate diff, including "replace" operations.
9120     *
9121     * If a sequence of remove operations is followed by the same number of add operations, these
9122     * will be coalesced into replace operations.
9123     *
9124     * @param array $old Original array
9125     * @param array $new New array
9126     *
9127     * @return DiffElem[] Diff (edit script), including replace operations
9128     */
9129    public function diffWithReplacements(array $old, array $new)
9130    {
9131        return $this->coalesceReplacements($this->diff($old, $new));
9132    }
9133    private function calculateTrace(array $a, array $b)
9134    {
9135        $n = \count($a);
9136        $m = \count($b);
9137        $max = $n + $m;
9138        $v = [1 => 0];
9139        $trace = [];
9140        for ($d = 0; $d <= $max; $d++) {
9141            $trace[] = $v;
9142            for ($k = -$d; $k <= $d; $k += 2) {
9143                if ($k === -$d || $k !== $d && $v[$k - 1] < $v[$k + 1]) {
9144                    $x = $v[$k + 1];
9145                } else {
9146                    $x = $v[$k - 1] + 1;
9147                }
9148                $y = $x - $k;
9149                while ($x < $n && $y < $m && ($this->isEqual)($a[$x], $b[$y])) {
9150                    $x++;
9151                    $y++;
9152                }
9153                $v[$k] = $x;
9154                if ($x >= $n && $y >= $m) {
9155                    return [$trace, $x, $y];
9156                }
9157            }
9158        }
9159        throw new \Exception('Should not happen');
9160    }
9161    private function extractDiff(array $trace, int $x, int $y, array $a, array $b)
9162    {
9163        $result = [];
9164        for ($d = \count($trace) - 1; $d >= 0; $d--) {
9165            $v = $trace[$d];
9166            $k = $x - $y;
9167            if ($k === -$d || $k !== $d && $v[$k - 1] < $v[$k + 1]) {
9168                $prevK = $k + 1;
9169            } else {
9170                $prevK = $k - 1;
9171            }
9172            $prevX = $v[$prevK];
9173            $prevY = $prevX - $prevK;
9174            while ($x > $prevX && $y > $prevY) {
9175                $result[] = new DiffElem(DiffElem::TYPE_KEEP, $a[$x - 1], $b[$y - 1]);
9176                $x--;
9177                $y--;
9178            }
9179            if ($d === 0) {
9180                break;
9181            }
9182            while ($x > $prevX) {
9183                $result[] = new DiffElem(DiffElem::TYPE_REMOVE, $a[$x - 1], null);
9184                $x--;
9185            }
9186            while ($y > $prevY) {
9187                $result[] = new DiffElem(DiffElem::TYPE_ADD, null, $b[$y - 1]);
9188                $y--;
9189            }
9190        }
9191        return \array_reverse($result);
9192    }
9193    /**
9194     * Coalesce equal-length sequences of remove+add into a replace operation.
9195     *
9196     * @param DiffElem[] $diff
9197     * @return DiffElem[]
9198     */
9199    private function coalesceReplacements(array $diff)
9200    {
9201        $newDiff = [];
9202        $c = \count($diff);
9203        for ($i = 0; $i < $c; $i++) {
9204            $diffType = $diff[$i]->type;
9205            if ($diffType !== DiffElem::TYPE_REMOVE) {
9206                $newDiff[] = $diff[$i];
9207                continue;
9208            }
9209            $j = $i;
9210            while ($j < $c && $diff[$j]->type === DiffElem::TYPE_REMOVE) {
9211                $j++;
9212            }
9213            $k = $j;
9214            while ($k < $c && $diff[$k]->type === DiffElem::TYPE_ADD) {
9215                $k++;
9216            }
9217            if ($j - $i === $k - $j) {
9218                $len = $j - $i;
9219                for ($n = 0; $n < $len; $n++) {
9220                    $newDiff[] = new DiffElem(DiffElem::TYPE_REPLACE, $diff[$i + $n]->old, $diff[$j + $n]->new);
9221                }
9222            } else {
9223                for (; $i < $k; $i++) {
9224                    $newDiff[] = $diff[$i];
9225                }
9226            }
9227            $i = $k - 1;
9228        }
9229        return $newDiff;
9230    }
9231}
9232<?php
9233
9234declare (strict_types=1);
9235namespace PHPUnit\PhpParser\Internal;
9236
9237use PHPUnit\PhpParser\Node;
9238use PHPUnit\PhpParser\Node\Expr;
9239/**
9240 * This node is used internally by the format-preserving pretty printer to print anonymous classes.
9241 *
9242 * The normal anonymous class structure violates assumptions about the order of token offsets.
9243 * Namely, the constructor arguments are part of the Expr\New_ node and follow the class node, even
9244 * though they are actually interleaved with them. This special node type is used temporarily to
9245 * restore a sane token offset order.
9246 *
9247 * @internal
9248 */
9249class PrintableNewAnonClassNode extends Expr
9250{
9251    /** @var Node\AttributeGroup[] PHP attribute groups */
9252    public $attrGroups;
9253    /** @var Node\Arg[] Arguments */
9254    public $args;
9255    /** @var null|Node\Name Name of extended class */
9256    public $extends;
9257    /** @var Node\Name[] Names of implemented interfaces */
9258    public $implements;
9259    /** @var Node\Stmt[] Statements */
9260    public $stmts;
9261    public function __construct(array $attrGroups, array $args, Node\Name $extends = null, array $implements, array $stmts, array $attributes)
9262    {
9263        parent::__construct($attributes);
9264        $this->attrGroups = $attrGroups;
9265        $this->args = $args;
9266        $this->extends = $extends;
9267        $this->implements = $implements;
9268        $this->stmts = $stmts;
9269    }
9270    public static function fromNewNode(Expr\New_ $newNode)
9271    {
9272        $class = $newNode->class;
9273        \assert($class instanceof Node\Stmt\Class_);
9274        // We don't assert that $class->name is null here, to allow consumers to assign unique names
9275        // to anonymous classes for their own purposes. We simplify ignore the name here.
9276        return new self($class->attrGroups, $newNode->args, $class->extends, $class->implements, $class->stmts, $newNode->getAttributes());
9277    }
9278    public function getType() : string
9279    {
9280        return 'Expr_PrintableNewAnonClass';
9281    }
9282    public function getSubNodeNames() : array
9283    {
9284        return ['attrGroups', 'args', 'extends', 'implements', 'stmts'];
9285    }
9286}
9287<?php
9288
9289declare (strict_types=1);
9290namespace PHPUnit\PhpParser;
9291
9292use PHPUnit\PhpParser\Internal\DiffElem;
9293use PHPUnit\PhpParser\Internal\PrintableNewAnonClassNode;
9294use PHPUnit\PhpParser\Internal\TokenStream;
9295use PHPUnit\PhpParser\Node\Expr;
9296use PHPUnit\PhpParser\Node\Expr\AssignOp;
9297use PHPUnit\PhpParser\Node\Expr\BinaryOp;
9298use PHPUnit\PhpParser\Node\Expr\Cast;
9299use PHPUnit\PhpParser\Node\Scalar;
9300use PHPUnit\PhpParser\Node\Stmt;
9301abstract class PrettyPrinterAbstract
9302{
9303    const FIXUP_PREC_LEFT = 0;
9304    // LHS operand affected by precedence
9305    const FIXUP_PREC_RIGHT = 1;
9306    // RHS operand affected by precedence
9307    const FIXUP_CALL_LHS = 2;
9308    // LHS of call
9309    const FIXUP_DEREF_LHS = 3;
9310    // LHS of dereferencing operation
9311    const FIXUP_BRACED_NAME = 4;
9312    // Name operand that may require bracing
9313    const FIXUP_VAR_BRACED_NAME = 5;
9314    // Name operand that may require ${} bracing
9315    const FIXUP_ENCAPSED = 6;
9316    // Encapsed string part
9317    protected $precedenceMap = [
9318        // [precedence, associativity]
9319        // where for precedence -1 is %left, 0 is %nonassoc and 1 is %right
9320        BinaryOp\Pow::class => [0, 1],
9321        Expr\BitwiseNot::class => [10, 1],
9322        Expr\PreInc::class => [10, 1],
9323        Expr\PreDec::class => [10, 1],
9324        Expr\PostInc::class => [10, -1],
9325        Expr\PostDec::class => [10, -1],
9326        Expr\UnaryPlus::class => [10, 1],
9327        Expr\UnaryMinus::class => [10, 1],
9328        Cast\Int_::class => [10, 1],
9329        Cast\Double::class => [10, 1],
9330        Cast\String_::class => [10, 1],
9331        Cast\Array_::class => [10, 1],
9332        Cast\Object_::class => [10, 1],
9333        Cast\Bool_::class => [10, 1],
9334        Cast\Unset_::class => [10, 1],
9335        Expr\ErrorSuppress::class => [10, 1],
9336        Expr\Instanceof_::class => [20, 0],
9337        Expr\BooleanNot::class => [30, 1],
9338        BinaryOp\Mul::class => [40, -1],
9339        BinaryOp\Div::class => [40, -1],
9340        BinaryOp\Mod::class => [40, -1],
9341        BinaryOp\Plus::class => [50, -1],
9342        BinaryOp\Minus::class => [50, -1],
9343        BinaryOp\Concat::class => [50, -1],
9344        BinaryOp\ShiftLeft::class => [60, -1],
9345        BinaryOp\ShiftRight::class => [60, -1],
9346        BinaryOp\Smaller::class => [70, 0],
9347        BinaryOp\SmallerOrEqual::class => [70, 0],
9348        BinaryOp\Greater::class => [70, 0],
9349        BinaryOp\GreaterOrEqual::class => [70, 0],
9350        BinaryOp\Equal::class => [80, 0],
9351        BinaryOp\NotEqual::class => [80, 0],
9352        BinaryOp\Identical::class => [80, 0],
9353        BinaryOp\NotIdentical::class => [80, 0],
9354        BinaryOp\Spaceship::class => [80, 0],
9355        BinaryOp\BitwiseAnd::class => [90, -1],
9356        BinaryOp\BitwiseXor::class => [100, -1],
9357        BinaryOp\BitwiseOr::class => [110, -1],
9358        BinaryOp\BooleanAnd::class => [120, -1],
9359        BinaryOp\BooleanOr::class => [130, -1],
9360        BinaryOp\Coalesce::class => [140, 1],
9361        Expr\Ternary::class => [150, 0],
9362        // parser uses %left for assignments, but they really behave as %right
9363        Expr\Assign::class => [160, 1],
9364        Expr\AssignRef::class => [160, 1],
9365        AssignOp\Plus::class => [160, 1],
9366        AssignOp\Minus::class => [160, 1],
9367        AssignOp\Mul::class => [160, 1],
9368        AssignOp\Div::class => [160, 1],
9369        AssignOp\Concat::class => [160, 1],
9370        AssignOp\Mod::class => [160, 1],
9371        AssignOp\BitwiseAnd::class => [160, 1],
9372        AssignOp\BitwiseOr::class => [160, 1],
9373        AssignOp\BitwiseXor::class => [160, 1],
9374        AssignOp\ShiftLeft::class => [160, 1],
9375        AssignOp\ShiftRight::class => [160, 1],
9376        AssignOp\Pow::class => [160, 1],
9377        AssignOp\Coalesce::class => [160, 1],
9378        Expr\YieldFrom::class => [165, 1],
9379        Expr\Print_::class => [168, 1],
9380        BinaryOp\LogicalAnd::class => [170, -1],
9381        BinaryOp\LogicalXor::class => [180, -1],
9382        BinaryOp\LogicalOr::class => [190, -1],
9383        Expr\Include_::class => [200, -1],
9384    ];
9385    /** @var int Current indentation level. */
9386    protected $indentLevel;
9387    /** @var string Newline including current indentation. */
9388    protected $nl;
9389    /** @var string Token placed at end of doc string to ensure it is followed by a newline. */
9390    protected $docStringEndToken;
9391    /** @var bool Whether semicolon namespaces can be used (i.e. no global namespace is used) */
9392    protected $canUseSemicolonNamespaces;
9393    /** @var array Pretty printer options */
9394    protected $options;
9395    /** @var TokenStream Original tokens for use in format-preserving pretty print */
9396    protected $origTokens;
9397    /** @var Internal\Differ Differ for node lists */
9398    protected $nodeListDiffer;
9399    /** @var bool[] Map determining whether a certain character is a label character */
9400    protected $labelCharMap;
9401    /**
9402     * @var int[][] Map from token classes and subnode names to FIXUP_* constants. This is used
9403     *              during format-preserving prints to place additional parens/braces if necessary.
9404     */
9405    protected $fixupMap;
9406    /**
9407     * @var int[][] Map from "{$node->getType()}->{$subNode}" to ['left' => $l, 'right' => $r],
9408     *              where $l and $r specify the token type that needs to be stripped when removing
9409     *              this node.
9410     */
9411    protected $removalMap;
9412    /**
9413     * @var mixed[] Map from "{$node->getType()}->{$subNode}" to [$find, $beforeToken, $extraLeft, $extraRight].
9414     *              $find is an optional token after which the insertion occurs. $extraLeft/Right
9415     *              are optionally added before/after the main insertions.
9416     */
9417    protected $insertionMap;
9418    /**
9419     * @var string[] Map From "{$node->getType()}->{$subNode}" to string that should be inserted
9420     *               between elements of this list subnode.
9421     */
9422    protected $listInsertionMap;
9423    protected $emptyListInsertionMap;
9424    /** @var int[] Map from "{$node->getType()}->{$subNode}" to token before which the modifiers
9425     *             should be reprinted. */
9426    protected $modifierChangeMap;
9427    /**
9428     * Creates a pretty printer instance using the given options.
9429     *
9430     * Supported options:
9431     *  * bool $shortArraySyntax = false: Whether to use [] instead of array() as the default array
9432     *                                    syntax, if the node does not specify a format.
9433     *
9434     * @param array $options Dictionary of formatting options
9435     */
9436    public function __construct(array $options = [])
9437    {
9438        $this->docStringEndToken = '_DOC_STRING_END_' . \mt_rand();
9439        $defaultOptions = ['shortArraySyntax' => \false];
9440        $this->options = $options + $defaultOptions;
9441    }
9442    /**
9443     * Reset pretty printing state.
9444     */
9445    protected function resetState()
9446    {
9447        $this->indentLevel = 0;
9448        $this->nl = "\n";
9449        $this->origTokens = null;
9450    }
9451    /**
9452     * Set indentation level
9453     *
9454     * @param int $level Level in number of spaces
9455     */
9456    protected function setIndentLevel(int $level)
9457    {
9458        $this->indentLevel = $level;
9459        $this->nl = "\n" . \str_repeat(' ', $level);
9460    }
9461    /**
9462     * Increase indentation level.
9463     */
9464    protected function indent()
9465    {
9466        $this->indentLevel += 4;
9467        $this->nl .= '    ';
9468    }
9469    /**
9470     * Decrease indentation level.
9471     */
9472    protected function outdent()
9473    {
9474        \assert($this->indentLevel >= 4);
9475        $this->indentLevel -= 4;
9476        $this->nl = "\n" . \str_repeat(' ', $this->indentLevel);
9477    }
9478    /**
9479     * Pretty prints an array of statements.
9480     *
9481     * @param Node[] $stmts Array of statements
9482     *
9483     * @return string Pretty printed statements
9484     */
9485    public function prettyPrint(array $stmts) : string
9486    {
9487        $this->resetState();
9488        $this->preprocessNodes($stmts);
9489        return \ltrim($this->handleMagicTokens($this->pStmts($stmts, \false)));
9490    }
9491    /**
9492     * Pretty prints an expression.
9493     *
9494     * @param Expr $node Expression node
9495     *
9496     * @return string Pretty printed node
9497     */
9498    public function prettyPrintExpr(Expr $node) : string
9499    {
9500        $this->resetState();
9501        return $this->handleMagicTokens($this->p($node));
9502    }
9503    /**
9504     * Pretty prints a file of statements (includes the opening <?php tag if it is required).
9505     *
9506     * @param Node[] $stmts Array of statements
9507     *
9508     * @return string Pretty printed statements
9509     */
9510    public function prettyPrintFile(array $stmts) : string
9511    {
9512        if (!$stmts) {
9513            return "<?php\n\n";
9514        }
9515        $p = "<?php\n\n" . $this->prettyPrint($stmts);
9516        if ($stmts[0] instanceof Stmt\InlineHTML) {
9517            $p = \preg_replace('/^<\\?php\\s+\\?>\\n?/', '', $p);
9518        }
9519        if ($stmts[\count($stmts) - 1] instanceof Stmt\InlineHTML) {
9520            $p = \preg_replace('/<\\?php$/', '', \rtrim($p));
9521        }
9522        return $p;
9523    }
9524    /**
9525     * Preprocesses the top-level nodes to initialize pretty printer state.
9526     *
9527     * @param Node[] $nodes Array of nodes
9528     */
9529    protected function preprocessNodes(array $nodes)
9530    {
9531        /* We can use semicolon-namespaces unless there is a global namespace declaration */
9532        $this->canUseSemicolonNamespaces = \true;
9533        foreach ($nodes as $node) {
9534            if ($node instanceof Stmt\Namespace_ && null === $node->name) {
9535                $this->canUseSemicolonNamespaces = \false;
9536                break;
9537            }
9538        }
9539    }
9540    /**
9541     * Handles (and removes) no-indent and doc-string-end tokens.
9542     *
9543     * @param string $str
9544     * @return string
9545     */
9546    protected function handleMagicTokens(string $str) : string
9547    {
9548        // Replace doc-string-end tokens with nothing or a newline
9549        $str = \str_replace($this->docStringEndToken . ";\n", ";\n", $str);
9550        $str = \str_replace($this->docStringEndToken, "\n", $str);
9551        return $str;
9552    }
9553    /**
9554     * Pretty prints an array of nodes (statements) and indents them optionally.
9555     *
9556     * @param Node[] $nodes  Array of nodes
9557     * @param bool   $indent Whether to indent the printed nodes
9558     *
9559     * @return string Pretty printed statements
9560     */
9561    protected function pStmts(array $nodes, bool $indent = \true) : string
9562    {
9563        if ($indent) {
9564            $this->indent();
9565        }
9566        $result = '';
9567        foreach ($nodes as $node) {
9568            $comments = $node->getComments();
9569            if ($comments) {
9570                $result .= $this->nl . $this->pComments($comments);
9571                if ($node instanceof Stmt\Nop) {
9572                    continue;
9573                }
9574            }
9575            $result .= $this->nl . $this->p($node);
9576        }
9577        if ($indent) {
9578            $this->outdent();
9579        }
9580        return $result;
9581    }
9582    /**
9583     * Pretty-print an infix operation while taking precedence into account.
9584     *
9585     * @param string $class          Node class of operator
9586     * @param Node   $leftNode       Left-hand side node
9587     * @param string $operatorString String representation of the operator
9588     * @param Node   $rightNode      Right-hand side node
9589     *
9590     * @return string Pretty printed infix operation
9591     */
9592    protected function pInfixOp(string $class, Node $leftNode, string $operatorString, Node $rightNode) : string
9593    {
9594        list($precedence, $associativity) = $this->precedenceMap[$class];
9595        return $this->pPrec($leftNode, $precedence, $associativity, -1) . $operatorString . $this->pPrec($rightNode, $precedence, $associativity, 1);
9596    }
9597    /**
9598     * Pretty-print a prefix operation while taking precedence into account.
9599     *
9600     * @param string $class          Node class of operator
9601     * @param string $operatorString String representation of the operator
9602     * @param Node   $node           Node
9603     *
9604     * @return string Pretty printed prefix operation
9605     */
9606    protected function pPrefixOp(string $class, string $operatorString, Node $node) : string
9607    {
9608        list($precedence, $associativity) = $this->precedenceMap[$class];
9609        return $operatorString . $this->pPrec($node, $precedence, $associativity, 1);
9610    }
9611    /**
9612     * Pretty-print a postfix operation while taking precedence into account.
9613     *
9614     * @param string $class          Node class of operator
9615     * @param string $operatorString String representation of the operator
9616     * @param Node   $node           Node
9617     *
9618     * @return string Pretty printed postfix operation
9619     */
9620    protected function pPostfixOp(string $class, Node $node, string $operatorString) : string
9621    {
9622        list($precedence, $associativity) = $this->precedenceMap[$class];
9623        return $this->pPrec($node, $precedence, $associativity, -1) . $operatorString;
9624    }
9625    /**
9626     * Prints an expression node with the least amount of parentheses necessary to preserve the meaning.
9627     *
9628     * @param Node $node                Node to pretty print
9629     * @param int  $parentPrecedence    Precedence of the parent operator
9630     * @param int  $parentAssociativity Associativity of parent operator
9631     *                                  (-1 is left, 0 is nonassoc, 1 is right)
9632     * @param int  $childPosition       Position of the node relative to the operator
9633     *                                  (-1 is left, 1 is right)
9634     *
9635     * @return string The pretty printed node
9636     */
9637    protected function pPrec(Node $node, int $parentPrecedence, int $parentAssociativity, int $childPosition) : string
9638    {
9639        $class = \get_class($node);
9640        if (isset($this->precedenceMap[$class])) {
9641            $childPrecedence = $this->precedenceMap[$class][0];
9642            if ($childPrecedence > $parentPrecedence || $parentPrecedence === $childPrecedence && $parentAssociativity !== $childPosition) {
9643                return '(' . $this->p($node) . ')';
9644            }
9645        }
9646        return $this->p($node);
9647    }
9648    /**
9649     * Pretty prints an array of nodes and implodes the printed values.
9650     *
9651     * @param Node[] $nodes Array of Nodes to be printed
9652     * @param string $glue  Character to implode with
9653     *
9654     * @return string Imploded pretty printed nodes
9655     */
9656    protected function pImplode(array $nodes, string $glue = '') : string
9657    {
9658        $pNodes = [];
9659        foreach ($nodes as $node) {
9660            if (null === $node) {
9661                $pNodes[] = '';
9662            } else {
9663                $pNodes[] = $this->p($node);
9664            }
9665        }
9666        return \implode($glue, $pNodes);
9667    }
9668    /**
9669     * Pretty prints an array of nodes and implodes the printed values with commas.
9670     *
9671     * @param Node[] $nodes Array of Nodes to be printed
9672     *
9673     * @return string Comma separated pretty printed nodes
9674     */
9675    protected function pCommaSeparated(array $nodes) : string
9676    {
9677        return $this->pImplode($nodes, ', ');
9678    }
9679    /**
9680     * Pretty prints a comma-separated list of nodes in multiline style, including comments.
9681     *
9682     * The result includes a leading newline and one level of indentation (same as pStmts).
9683     *
9684     * @param Node[] $nodes         Array of Nodes to be printed
9685     * @param bool   $trailingComma Whether to use a trailing comma
9686     *
9687     * @return string Comma separated pretty printed nodes in multiline style
9688     */
9689    protected function pCommaSeparatedMultiline(array $nodes, bool $trailingComma) : string
9690    {
9691        $this->indent();
9692        $result = '';
9693        $lastIdx = \count($nodes) - 1;
9694        foreach ($nodes as $idx => $node) {
9695            if ($node !== null) {
9696                $comments = $node->getComments();
9697                if ($comments) {
9698                    $result .= $this->nl . $this->pComments($comments);
9699                }
9700                $result .= $this->nl . $this->p($node);
9701            } else {
9702                $result .= $this->nl;
9703            }
9704            if ($trailingComma || $idx !== $lastIdx) {
9705                $result .= ',';
9706            }
9707        }
9708        $this->outdent();
9709        return $result;
9710    }
9711    /**
9712     * Prints reformatted text of the passed comments.
9713     *
9714     * @param Comment[] $comments List of comments
9715     *
9716     * @return string Reformatted text of comments
9717     */
9718    protected function pComments(array $comments) : string
9719    {
9720        $formattedComments = [];
9721        foreach ($comments as $comment) {
9722            $formattedComments[] = \str_replace("\n", $this->nl, $comment->getReformattedText());
9723        }
9724        return \implode($this->nl, $formattedComments);
9725    }
9726    /**
9727     * Perform a format-preserving pretty print of an AST.
9728     *
9729     * The format preservation is best effort. For some changes to the AST the formatting will not
9730     * be preserved (at least not locally).
9731     *
9732     * In order to use this method a number of prerequisites must be satisfied:
9733     *  * The startTokenPos and endTokenPos attributes in the lexer must be enabled.
9734     *  * The CloningVisitor must be run on the AST prior to modification.
9735     *  * The original tokens must be provided, using the getTokens() method on the lexer.
9736     *
9737     * @param Node[] $stmts      Modified AST with links to original AST
9738     * @param Node[] $origStmts  Original AST with token offset information
9739     * @param array  $origTokens Tokens of the original code
9740     *
9741     * @return string
9742     */
9743    public function printFormatPreserving(array $stmts, array $origStmts, array $origTokens) : string
9744    {
9745        $this->initializeNodeListDiffer();
9746        $this->initializeLabelCharMap();
9747        $this->initializeFixupMap();
9748        $this->initializeRemovalMap();
9749        $this->initializeInsertionMap();
9750        $this->initializeListInsertionMap();
9751        $this->initializeEmptyListInsertionMap();
9752        $this->initializeModifierChangeMap();
9753        $this->resetState();
9754        $this->origTokens = new TokenStream($origTokens);
9755        $this->preprocessNodes($stmts);
9756        $pos = 0;
9757        $result = $this->pArray($stmts, $origStmts, $pos, 0, 'File', 'stmts', null);
9758        if (null !== $result) {
9759            $result .= $this->origTokens->getTokenCode($pos, \count($origTokens), 0);
9760        } else {
9761            // Fallback
9762            // TODO Add <?php properly
9763            $result = "<?php\n" . $this->pStmts($stmts, \false);
9764        }
9765        return \ltrim($this->handleMagicTokens($result));
9766    }
9767    protected function pFallback(Node $node)
9768    {
9769        return $this->{'p' . $node->getType()}($node);
9770    }
9771    /**
9772     * Pretty prints a node.
9773     *
9774     * This method also handles formatting preservation for nodes.
9775     *
9776     * @param Node $node Node to be pretty printed
9777     * @param bool $parentFormatPreserved Whether parent node has preserved formatting
9778     *
9779     * @return string Pretty printed node
9780     */
9781    protected function p(Node $node, $parentFormatPreserved = \false) : string
9782    {
9783        // No orig tokens means this is a normal pretty print without preservation of formatting
9784        if (!$this->origTokens) {
9785            return $this->{'p' . $node->getType()}($node);
9786        }
9787        /** @var Node $origNode */
9788        $origNode = $node->getAttribute('origNode');
9789        if (null === $origNode) {
9790            return $this->pFallback($node);
9791        }
9792        $class = \get_class($node);
9793        \assert($class === \get_class($origNode));
9794        $startPos = $origNode->getStartTokenPos();
9795        $endPos = $origNode->getEndTokenPos();
9796        \assert($startPos >= 0 && $endPos >= 0);
9797        $fallbackNode = $node;
9798        if ($node instanceof Expr\New_ && $node->class instanceof Stmt\Class_) {
9799            // Normalize node structure of anonymous classes
9800            $node = PrintableNewAnonClassNode::fromNewNode($node);
9801            $origNode = PrintableNewAnonClassNode::fromNewNode($origNode);
9802        }
9803        // InlineHTML node does not contain closing and opening PHP tags. If the parent formatting
9804        // is not preserved, then we need to use the fallback code to make sure the tags are
9805        // printed.
9806        if ($node instanceof Stmt\InlineHTML && !$parentFormatPreserved) {
9807            return $this->pFallback($fallbackNode);
9808        }
9809        $indentAdjustment = $this->indentLevel - $this->origTokens->getIndentationBefore($startPos);
9810        $type = $node->getType();
9811        $fixupInfo = $this->fixupMap[$class] ?? null;
9812        $result = '';
9813        $pos = $startPos;
9814        foreach ($node->getSubNodeNames() as $subNodeName) {
9815            $subNode = $node->{$subNodeName};
9816            $origSubNode = $origNode->{$subNodeName};
9817            if (!$subNode instanceof Node && $subNode !== null || !$origSubNode instanceof Node && $origSubNode !== null) {
9818                if ($subNode === $origSubNode) {
9819                    // Unchanged, can reuse old code
9820                    continue;
9821                }
9822                if (\is_array($subNode) && \is_array($origSubNode)) {
9823                    // Array subnode changed, we might be able to reconstruct it
9824                    $listResult = $this->pArray($subNode, $origSubNode, $pos, $indentAdjustment, $type, $subNodeName, $fixupInfo[$subNodeName] ?? null);
9825                    if (null === $listResult) {
9826                        return $this->pFallback($fallbackNode);
9827                    }
9828                    $result .= $listResult;
9829                    continue;
9830                }
9831                if (\is_int($subNode) && \is_int($origSubNode)) {
9832                    // Check if this is a modifier change
9833                    $key = $type . '->' . $subNodeName;
9834                    if (!isset($this->modifierChangeMap[$key])) {
9835                        return $this->pFallback($fallbackNode);
9836                    }
9837                    $findToken = $this->modifierChangeMap[$key];
9838                    $result .= $this->pModifiers($subNode);
9839                    $pos = $this->origTokens->findRight($pos, $findToken);
9840                    continue;
9841                }
9842                // If a non-node, non-array subnode changed, we don't be able to do a partial
9843                // reconstructions, as we don't have enough offset information. Pretty print the
9844                // whole node instead.
9845                return $this->pFallback($fallbackNode);
9846            }
9847            $extraLeft = '';
9848            $extraRight = '';
9849            if ($origSubNode !== null) {
9850                $subStartPos = $origSubNode->getStartTokenPos();
9851                $subEndPos = $origSubNode->getEndTokenPos();
9852                \assert($subStartPos >= 0 && $subEndPos >= 0);
9853            } else {
9854                if ($subNode === null) {
9855                    // Both null, nothing to do
9856                    continue;
9857                }
9858                // A node has been inserted, check if we have insertion information for it
9859                $key = $type . '->' . $subNodeName;
9860                if (!isset($this->insertionMap[$key])) {
9861                    return $this->pFallback($fallbackNode);
9862                }
9863                list($findToken, $beforeToken, $extraLeft, $extraRight) = $this->insertionMap[$key];
9864                if (null !== $findToken) {
9865                    $subStartPos = $this->origTokens->findRight($pos, $findToken) + (int) (!$beforeToken);
9866                } else {
9867                    $subStartPos = $pos;
9868                }
9869                if (null === $extraLeft && null !== $extraRight) {
9870                    // If inserting on the right only, skipping whitespace looks better
9871                    $subStartPos = $this->origTokens->skipRightWhitespace($subStartPos);
9872                }
9873                $subEndPos = $subStartPos - 1;
9874            }
9875            if (null === $subNode) {
9876                // A node has been removed, check if we have removal information for it
9877                $key = $type . '->' . $subNodeName;
9878                if (!isset($this->removalMap[$key])) {
9879                    return $this->pFallback($fallbackNode);
9880                }
9881                // Adjust positions to account for additional tokens that must be skipped
9882                $removalInfo = $this->removalMap[$key];
9883                if (isset($removalInfo['left'])) {
9884                    $subStartPos = $this->origTokens->skipLeft($subStartPos - 1, $removalInfo['left']) + 1;
9885                }
9886                if (isset($removalInfo['right'])) {
9887                    $subEndPos = $this->origTokens->skipRight($subEndPos + 1, $removalInfo['right']) - 1;
9888                }
9889            }
9890            $result .= $this->origTokens->getTokenCode($pos, $subStartPos, $indentAdjustment);
9891            if (null !== $subNode) {
9892                $result .= $extraLeft;
9893                $origIndentLevel = $this->indentLevel;
9894                $this->setIndentLevel($this->origTokens->getIndentationBefore($subStartPos) + $indentAdjustment);
9895                // If it's the same node that was previously in this position, it certainly doesn't
9896                // need fixup. It's important to check this here, because our fixup checks are more
9897                // conservative than strictly necessary.
9898                if (isset($fixupInfo[$subNodeName]) && $subNode->getAttribute('origNode') !== $origSubNode) {
9899                    $fixup = $fixupInfo[$subNodeName];
9900                    $res = $this->pFixup($fixup, $subNode, $class, $subStartPos, $subEndPos);
9901                } else {
9902                    $res = $this->p($subNode, \true);
9903                }
9904                $this->safeAppend($result, $res);
9905                $this->setIndentLevel($origIndentLevel);
9906                $result .= $extraRight;
9907            }
9908            $pos = $subEndPos + 1;
9909        }
9910        $result .= $this->origTokens->getTokenCode($pos, $endPos + 1, $indentAdjustment);
9911        return $result;
9912    }
9913    /**
9914     * Perform a format-preserving pretty print of an array.
9915     *
9916     * @param array       $nodes            New nodes
9917     * @param array       $origNodes        Original nodes
9918     * @param int         $pos              Current token position (updated by reference)
9919     * @param int         $indentAdjustment Adjustment for indentation
9920     * @param string      $parentNodeType   Type of the containing node.
9921     * @param string      $subNodeName      Name of array subnode.
9922     * @param null|int    $fixup            Fixup information for array item nodes
9923     *
9924     * @return null|string Result of pretty print or null if cannot preserve formatting
9925     */
9926    protected function pArray(array $nodes, array $origNodes, int &$pos, int $indentAdjustment, string $parentNodeType, string $subNodeName, $fixup)
9927    {
9928        $diff = $this->nodeListDiffer->diffWithReplacements($origNodes, $nodes);
9929        $mapKey = $parentNodeType . '->' . $subNodeName;
9930        $insertStr = $this->listInsertionMap[$mapKey] ?? null;
9931        $isStmtList = $subNodeName === 'stmts';
9932        $beforeFirstKeepOrReplace = \true;
9933        $skipRemovedNode = \false;
9934        $delayedAdd = [];
9935        $lastElemIndentLevel = $this->indentLevel;
9936        $insertNewline = \false;
9937        if ($insertStr === "\n") {
9938            $insertStr = '';
9939            $insertNewline = \true;
9940        }
9941        if ($isStmtList && \count($origNodes) === 1 && \count($nodes) !== 1) {
9942            $startPos = $origNodes[0]->getStartTokenPos();
9943            $endPos = $origNodes[0]->getEndTokenPos();
9944            \assert($startPos >= 0 && $endPos >= 0);
9945            if (!$this->origTokens->haveBraces($startPos, $endPos)) {
9946                // This was a single statement without braces, but either additional statements
9947                // have been added, or the single statement has been removed. This requires the
9948                // addition of braces. For now fall back.
9949                // TODO: Try to preserve formatting
9950                return null;
9951            }
9952        }
9953        $result = '';
9954        foreach ($diff as $i => $diffElem) {
9955            $diffType = $diffElem->type;
9956            /** @var Node|null $arrItem */
9957            $arrItem = $diffElem->new;
9958            /** @var Node|null $origArrItem */
9959            $origArrItem = $diffElem->old;
9960            if ($diffType === DiffElem::TYPE_KEEP || $diffType === DiffElem::TYPE_REPLACE) {
9961                $beforeFirstKeepOrReplace = \false;
9962                if ($origArrItem === null || $arrItem === null) {
9963                    // We can only handle the case where both are null
9964                    if ($origArrItem === $arrItem) {
9965                        continue;
9966                    }
9967                    return null;
9968                }
9969                if (!$arrItem instanceof Node || !$origArrItem instanceof Node) {
9970                    // We can only deal with nodes. This can occur for Names, which use string arrays.
9971                    return null;
9972                }
9973                $itemStartPos = $origArrItem->getStartTokenPos();
9974                $itemEndPos = $origArrItem->getEndTokenPos();
9975                \assert($itemStartPos >= 0 && $itemEndPos >= 0 && $itemStartPos >= $pos);
9976                $origIndentLevel = $this->indentLevel;
9977                $lastElemIndentLevel = $this->origTokens->getIndentationBefore($itemStartPos) + $indentAdjustment;
9978                $this->setIndentLevel($lastElemIndentLevel);
9979                $comments = $arrItem->getComments();
9980                $origComments = $origArrItem->getComments();
9981                $commentStartPos = $origComments ? $origComments[0]->getStartTokenPos() : $itemStartPos;
9982                \assert($commentStartPos >= 0);
9983                if ($commentStartPos < $pos) {
9984                    // Comments may be assigned to multiple nodes if they start at the same position.
9985                    // Make sure we don't try to print them multiple times.
9986                    $commentStartPos = $itemStartPos;
9987                }
9988                if ($skipRemovedNode) {
9989                    if ($isStmtList && $this->origTokens->haveBracesInRange($pos, $itemStartPos)) {
9990                        // We'd remove the brace of a code block.
9991                        // TODO: Preserve formatting.
9992                        $this->setIndentLevel($origIndentLevel);
9993                        return null;
9994                    }
9995                } else {
9996                    $result .= $this->origTokens->getTokenCode($pos, $commentStartPos, $indentAdjustment);
9997                }
9998                if (!empty($delayedAdd)) {
9999                    /** @var Node $delayedAddNode */
10000                    foreach ($delayedAdd as $delayedAddNode) {
10001                        if ($insertNewline) {
10002                            $delayedAddComments = $delayedAddNode->getComments();
10003                            if ($delayedAddComments) {
10004                                $result .= $this->pComments($delayedAddComments) . $this->nl;
10005                            }
10006                        }
10007                        $this->safeAppend($result, $this->p($delayedAddNode, \true));
10008                        if ($insertNewline) {
10009                            $result .= $insertStr . $this->nl;
10010                        } else {
10011                            $result .= $insertStr;
10012                        }
10013                    }
10014                    $delayedAdd = [];
10015                }
10016                if ($comments !== $origComments) {
10017                    if ($comments) {
10018                        $result .= $this->pComments($comments) . $this->nl;
10019                    }
10020                } else {
10021                    $result .= $this->origTokens->getTokenCode($commentStartPos, $itemStartPos, $indentAdjustment);
10022                }
10023                // If we had to remove anything, we have done so now.
10024                $skipRemovedNode = \false;
10025            } elseif ($diffType === DiffElem::TYPE_ADD) {
10026                if (null === $insertStr) {
10027                    // We don't have insertion information for this list type
10028                    return null;
10029                }
10030                // We go multiline if the original code was multiline,
10031                // or if it's an array item with a comment above it.
10032                if ($insertStr === ', ' && ($this->isMultiline($origNodes) || $arrItem->getComments())) {
10033                    $insertStr = ',';
10034                    $insertNewline = \true;
10035                }
10036                if ($beforeFirstKeepOrReplace) {
10037                    // Will be inserted at the next "replace" or "keep" element
10038                    $delayedAdd[] = $arrItem;
10039                    continue;
10040                }
10041                $itemStartPos = $pos;
10042                $itemEndPos = $pos - 1;
10043                $origIndentLevel = $this->indentLevel;
10044                $this->setIndentLevel($lastElemIndentLevel);
10045                if ($insertNewline) {
10046                    $result .= $insertStr . $this->nl;
10047                    $comments = $arrItem->getComments();
10048                    if ($comments) {
10049                        $result .= $this->pComments($comments) . $this->nl;
10050                    }
10051                } else {
10052                    $result .= $insertStr;
10053                }
10054            } elseif ($diffType === DiffElem::TYPE_REMOVE) {
10055                if (!$origArrItem instanceof Node) {
10056                    // We only support removal for nodes
10057                    return null;
10058                }
10059                $itemStartPos = $origArrItem->getStartTokenPos();
10060                $itemEndPos = $origArrItem->getEndTokenPos();
10061                \assert($itemStartPos >= 0 && $itemEndPos >= 0);
10062                // Consider comments part of the node.
10063                $origComments = $origArrItem->getComments();
10064                if ($origComments) {
10065                    $itemStartPos = $origComments[0]->getStartTokenPos();
10066                }
10067                if ($i === 0) {
10068                    // If we're removing from the start, keep the tokens before the node and drop those after it,
10069                    // instead of the other way around.
10070                    $result .= $this->origTokens->getTokenCode($pos, $itemStartPos, $indentAdjustment);
10071                    $skipRemovedNode = \true;
10072                } else {
10073                    if ($isStmtList && $this->origTokens->haveBracesInRange($pos, $itemStartPos)) {
10074                        // We'd remove the brace of a code block.
10075                        // TODO: Preserve formatting.
10076                        return null;
10077                    }
10078                }
10079                $pos = $itemEndPos + 1;
10080                continue;
10081            } else {
10082                throw new \Exception("Shouldn't happen");
10083            }
10084            if (null !== $fixup && $arrItem->getAttribute('origNode') !== $origArrItem) {
10085                $res = $this->pFixup($fixup, $arrItem, null, $itemStartPos, $itemEndPos);
10086            } else {
10087                $res = $this->p($arrItem, \true);
10088            }
10089            $this->safeAppend($result, $res);
10090            $this->setIndentLevel($origIndentLevel);
10091            $pos = $itemEndPos + 1;
10092        }
10093        if ($skipRemovedNode) {
10094            // TODO: Support removing single node.
10095            return null;
10096        }
10097        if (!empty($delayedAdd)) {
10098            if (!isset($this->emptyListInsertionMap[$mapKey])) {
10099                return null;
10100            }
10101            list($findToken, $extraLeft, $extraRight) = $this->emptyListInsertionMap[$mapKey];
10102            if (null !== $findToken) {
10103                $insertPos = $this->origTokens->findRight($pos, $findToken) + 1;
10104                $result .= $this->origTokens->getTokenCode($pos, $insertPos, $indentAdjustment);
10105                $pos = $insertPos;
10106            }
10107            $first = \true;
10108            $result .= $extraLeft;
10109            foreach ($delayedAdd as $delayedAddNode) {
10110                if (!$first) {
10111                    $result .= $insertStr;
10112                }
10113                $result .= $this->p($delayedAddNode, \true);
10114                $first = \false;
10115            }
10116            $result .= $extraRight;
10117        }
10118        return $result;
10119    }
10120    /**
10121     * Print node with fixups.
10122     *
10123     * Fixups here refer to the addition of extra parentheses, braces or other characters, that
10124     * are required to preserve program semantics in a certain context (e.g. to maintain precedence
10125     * or because only certain expressions are allowed in certain places).
10126     *
10127     * @param int         $fixup       Fixup type
10128     * @param Node        $subNode     Subnode to print
10129     * @param string|null $parentClass Class of parent node
10130     * @param int         $subStartPos Original start pos of subnode
10131     * @param int         $subEndPos   Original end pos of subnode
10132     *
10133     * @return string Result of fixed-up print of subnode
10134     */
10135    protected function pFixup(int $fixup, Node $subNode, $parentClass, int $subStartPos, int $subEndPos) : string
10136    {
10137        switch ($fixup) {
10138            case self::FIXUP_PREC_LEFT:
10139            case self::FIXUP_PREC_RIGHT:
10140                if (!$this->origTokens->haveParens($subStartPos, $subEndPos)) {
10141                    list($precedence, $associativity) = $this->precedenceMap[$parentClass];
10142                    return $this->pPrec($subNode, $precedence, $associativity, $fixup === self::FIXUP_PREC_LEFT ? -1 : 1);
10143                }
10144                break;
10145            case self::FIXUP_CALL_LHS:
10146                if ($this->callLhsRequiresParens($subNode) && !$this->origTokens->haveParens($subStartPos, $subEndPos)) {
10147                    return '(' . $this->p($subNode) . ')';
10148                }
10149                break;
10150            case self::FIXUP_DEREF_LHS:
10151                if ($this->dereferenceLhsRequiresParens($subNode) && !$this->origTokens->haveParens($subStartPos, $subEndPos)) {
10152                    return '(' . $this->p($subNode) . ')';
10153                }
10154                break;
10155            case self::FIXUP_BRACED_NAME:
10156            case self::FIXUP_VAR_BRACED_NAME:
10157                if ($subNode instanceof Expr && !$this->origTokens->haveBraces($subStartPos, $subEndPos)) {
10158                    return ($fixup === self::FIXUP_VAR_BRACED_NAME ? '$' : '') . '{' . $this->p($subNode) . '}';
10159                }
10160                break;
10161            case self::FIXUP_ENCAPSED:
10162                if (!$subNode instanceof Scalar\EncapsedStringPart && !$this->origTokens->haveBraces($subStartPos, $subEndPos)) {
10163                    return '{' . $this->p($subNode) . '}';
10164                }
10165                break;
10166            default:
10167                throw new \Exception('Cannot happen');
10168        }
10169        // Nothing special to do
10170        return $this->p($subNode);
10171    }
10172    /**
10173     * Appends to a string, ensuring whitespace between label characters.
10174     *
10175     * Example: "echo" and "$x" result in "echo$x", but "echo" and "x" result in "echo x".
10176     * Without safeAppend the result would be "echox", which does not preserve semantics.
10177     *
10178     * @param string $str
10179     * @param string $append
10180     */
10181    protected function safeAppend(string &$str, string $append)
10182    {
10183        if ($str === "") {
10184            $str = $append;
10185            return;
10186        }
10187        if ($append === "") {
10188            return;
10189        }
10190        if (!$this->labelCharMap[$append[0]] || !$this->labelCharMap[$str[\strlen($str) - 1]]) {
10191            $str .= $append;
10192        } else {
10193            $str .= " " . $append;
10194        }
10195    }
10196    /**
10197     * Determines whether the LHS of a call must be wrapped in parenthesis.
10198     *
10199     * @param Node $node LHS of a call
10200     *
10201     * @return bool Whether parentheses are required
10202     */
10203    protected function callLhsRequiresParens(Node $node) : bool
10204    {
10205        return !($node instanceof Node\Name || $node instanceof Expr\Variable || $node instanceof Expr\ArrayDimFetch || $node instanceof Expr\FuncCall || $node instanceof Expr\MethodCall || $node instanceof Expr\NullsafeMethodCall || $node instanceof Expr\StaticCall || $node instanceof Expr\Array_);
10206    }
10207    /**
10208     * Determines whether the LHS of a dereferencing operation must be wrapped in parenthesis.
10209     *
10210     * @param Node $node LHS of dereferencing operation
10211     *
10212     * @return bool Whether parentheses are required
10213     */
10214    protected function dereferenceLhsRequiresParens(Node $node) : bool
10215    {
10216        return !($node instanceof Expr\Variable || $node instanceof Node\Name || $node instanceof Expr\ArrayDimFetch || $node instanceof Expr\PropertyFetch || $node instanceof Expr\NullsafePropertyFetch || $node instanceof Expr\StaticPropertyFetch || $node instanceof Expr\FuncCall || $node instanceof Expr\MethodCall || $node instanceof Expr\NullsafeMethodCall || $node instanceof Expr\StaticCall || $node instanceof Expr\Array_ || $node instanceof Scalar\String_ || $node instanceof Expr\ConstFetch || $node instanceof Expr\ClassConstFetch);
10217    }
10218    /**
10219     * Print modifiers, including trailing whitespace.
10220     *
10221     * @param int $modifiers Modifier mask to print
10222     *
10223     * @return string Printed modifiers
10224     */
10225    protected function pModifiers(int $modifiers)
10226    {
10227        return ($modifiers & Stmt\Class_::MODIFIER_PUBLIC ? 'public ' : '') . ($modifiers & Stmt\Class_::MODIFIER_PROTECTED ? 'protected ' : '') . ($modifiers & Stmt\Class_::MODIFIER_PRIVATE ? 'private ' : '') . ($modifiers & Stmt\Class_::MODIFIER_STATIC ? 'static ' : '') . ($modifiers & Stmt\Class_::MODIFIER_ABSTRACT ? 'abstract ' : '') . ($modifiers & Stmt\Class_::MODIFIER_FINAL ? 'final ' : '') . ($modifiers & Stmt\Class_::MODIFIER_READONLY ? 'readonly ' : '');
10228    }
10229    /**
10230     * Determine whether a list of nodes uses multiline formatting.
10231     *
10232     * @param (Node|null)[] $nodes Node list
10233     *
10234     * @return bool Whether multiline formatting is used
10235     */
10236    protected function isMultiline(array $nodes) : bool
10237    {
10238        if (\count($nodes) < 2) {
10239            return \false;
10240        }
10241        $pos = -1;
10242        foreach ($nodes as $node) {
10243            if (null === $node) {
10244                continue;
10245            }
10246            $endPos = $node->getEndTokenPos() + 1;
10247            if ($pos >= 0) {
10248                $text = $this->origTokens->getTokenCode($pos, $endPos, 0);
10249                if (\false === \strpos($text, "\n")) {
10250                    // We require that a newline is present between *every* item. If the formatting
10251                    // is inconsistent, with only some items having newlines, we don't consider it
10252                    // as multiline
10253                    return \false;
10254                }
10255            }
10256            $pos = $endPos;
10257        }
10258        return \true;
10259    }
10260    /**
10261     * Lazily initializes label char map.
10262     *
10263     * The label char map determines whether a certain character may occur in a label.
10264     */
10265    protected function initializeLabelCharMap()
10266    {
10267        if ($this->labelCharMap) {
10268            return;
10269        }
10270        $this->labelCharMap = [];
10271        for ($i = 0; $i < 256; $i++) {
10272            // Since PHP 7.1 The lower range is 0x80. However, we also want to support code for
10273            // older versions.
10274            $chr = \chr($i);
10275            $this->labelCharMap[$chr] = $i >= 0x7f || \ctype_alnum($chr);
10276        }
10277    }
10278    /**
10279     * Lazily initializes node list differ.
10280     *
10281     * The node list differ is used to determine differences between two array subnodes.
10282     */
10283    protected function initializeNodeListDiffer()
10284    {
10285        if ($this->nodeListDiffer) {
10286            return;
10287        }
10288        $this->nodeListDiffer = new Internal\Differ(function ($a, $b) {
10289            if ($a instanceof Node && $b instanceof Node) {
10290                return $a === $b->getAttribute('origNode');
10291            }
10292            // Can happen for array destructuring
10293            return $a === null && $b === null;
10294        });
10295    }
10296    /**
10297     * Lazily initializes fixup map.
10298     *
10299     * The fixup map is used to determine whether a certain subnode of a certain node may require
10300     * some kind of "fixup" operation, e.g. the addition of parenthesis or braces.
10301     */
10302    protected function initializeFixupMap()
10303    {
10304        if ($this->fixupMap) {
10305            return;
10306        }
10307        $this->fixupMap = [
10308            Expr\PreInc::class => ['var' => self::FIXUP_PREC_RIGHT],
10309            Expr\PreDec::class => ['var' => self::FIXUP_PREC_RIGHT],
10310            Expr\PostInc::class => ['var' => self::FIXUP_PREC_LEFT],
10311            Expr\PostDec::class => ['var' => self::FIXUP_PREC_LEFT],
10312            Expr\Instanceof_::class => ['expr' => self::FIXUP_PREC_LEFT, 'class' => self::FIXUP_PREC_RIGHT],
10313            Expr\Ternary::class => ['cond' => self::FIXUP_PREC_LEFT, 'else' => self::FIXUP_PREC_RIGHT],
10314            Expr\FuncCall::class => ['name' => self::FIXUP_CALL_LHS],
10315            Expr\StaticCall::class => ['class' => self::FIXUP_DEREF_LHS],
10316            Expr\ArrayDimFetch::class => ['var' => self::FIXUP_DEREF_LHS],
10317            Expr\ClassConstFetch::class => ['var' => self::FIXUP_DEREF_LHS],
10318            Expr\New_::class => ['class' => self::FIXUP_DEREF_LHS],
10319            // TODO: FIXUP_NEW_VARIABLE
10320            Expr\MethodCall::class => ['var' => self::FIXUP_DEREF_LHS, 'name' => self::FIXUP_BRACED_NAME],
10321            Expr\NullsafeMethodCall::class => ['var' => self::FIXUP_DEREF_LHS, 'name' => self::FIXUP_BRACED_NAME],
10322            Expr\StaticPropertyFetch::class => ['class' => self::FIXUP_DEREF_LHS, 'name' => self::FIXUP_VAR_BRACED_NAME],
10323            Expr\PropertyFetch::class => ['var' => self::FIXUP_DEREF_LHS, 'name' => self::FIXUP_BRACED_NAME],
10324            Expr\NullsafePropertyFetch::class => ['var' => self::FIXUP_DEREF_LHS, 'name' => self::FIXUP_BRACED_NAME],
10325            Scalar\Encapsed::class => ['parts' => self::FIXUP_ENCAPSED],
10326        ];
10327        $binaryOps = [BinaryOp\Pow::class, BinaryOp\Mul::class, BinaryOp\Div::class, BinaryOp\Mod::class, BinaryOp\Plus::class, BinaryOp\Minus::class, BinaryOp\Concat::class, BinaryOp\ShiftLeft::class, BinaryOp\ShiftRight::class, BinaryOp\Smaller::class, BinaryOp\SmallerOrEqual::class, BinaryOp\Greater::class, BinaryOp\GreaterOrEqual::class, BinaryOp\Equal::class, BinaryOp\NotEqual::class, BinaryOp\Identical::class, BinaryOp\NotIdentical::class, BinaryOp\Spaceship::class, BinaryOp\BitwiseAnd::class, BinaryOp\BitwiseXor::class, BinaryOp\BitwiseOr::class, BinaryOp\BooleanAnd::class, BinaryOp\BooleanOr::class, BinaryOp\Coalesce::class, BinaryOp\LogicalAnd::class, BinaryOp\LogicalXor::class, BinaryOp\LogicalOr::class];
10328        foreach ($binaryOps as $binaryOp) {
10329            $this->fixupMap[$binaryOp] = ['left' => self::FIXUP_PREC_LEFT, 'right' => self::FIXUP_PREC_RIGHT];
10330        }
10331        $assignOps = [Expr\Assign::class, Expr\AssignRef::class, AssignOp\Plus::class, AssignOp\Minus::class, AssignOp\Mul::class, AssignOp\Div::class, AssignOp\Concat::class, AssignOp\Mod::class, AssignOp\BitwiseAnd::class, AssignOp\BitwiseOr::class, AssignOp\BitwiseXor::class, AssignOp\ShiftLeft::class, AssignOp\ShiftRight::class, AssignOp\Pow::class, AssignOp\Coalesce::class];
10332        foreach ($assignOps as $assignOp) {
10333            $this->fixupMap[$assignOp] = ['var' => self::FIXUP_PREC_LEFT, 'expr' => self::FIXUP_PREC_RIGHT];
10334        }
10335        $prefixOps = [Expr\BitwiseNot::class, Expr\BooleanNot::class, Expr\UnaryPlus::class, Expr\UnaryMinus::class, Cast\Int_::class, Cast\Double::class, Cast\String_::class, Cast\Array_::class, Cast\Object_::class, Cast\Bool_::class, Cast\Unset_::class, Expr\ErrorSuppress::class, Expr\YieldFrom::class, Expr\Print_::class, Expr\Include_::class];
10336        foreach ($prefixOps as $prefixOp) {
10337            $this->fixupMap[$prefixOp] = ['expr' => self::FIXUP_PREC_RIGHT];
10338        }
10339    }
10340    /**
10341     * Lazily initializes the removal map.
10342     *
10343     * The removal map is used to determine which additional tokens should be removed when a
10344     * certain node is replaced by null.
10345     */
10346    protected function initializeRemovalMap()
10347    {
10348        if ($this->removalMap) {
10349            return;
10350        }
10351        $stripBoth = ['left' => \T_WHITESPACE, 'right' => \T_WHITESPACE];
10352        $stripLeft = ['left' => \T_WHITESPACE];
10353        $stripRight = ['right' => \T_WHITESPACE];
10354        $stripDoubleArrow = ['right' => \T_DOUBLE_ARROW];
10355        $stripColon = ['left' => ':'];
10356        $stripEquals = ['left' => '='];
10357        $this->removalMap = ['Expr_ArrayDimFetch->dim' => $stripBoth, 'Expr_ArrayItem->key' => $stripDoubleArrow, 'Expr_ArrowFunction->returnType' => $stripColon, 'Expr_Closure->returnType' => $stripColon, 'Expr_Exit->expr' => $stripBoth, 'Expr_Ternary->if' => $stripBoth, 'Expr_Yield->key' => $stripDoubleArrow, 'Expr_Yield->value' => $stripBoth, 'Param->type' => $stripRight, 'Param->default' => $stripEquals, 'Stmt_Break->num' => $stripBoth, 'Stmt_Catch->var' => $stripLeft, 'Stmt_ClassMethod->returnType' => $stripColon, 'Stmt_Class->extends' => ['left' => \T_EXTENDS], 'Stmt_Enum->scalarType' => $stripColon, 'Stmt_EnumCase->expr' => $stripEquals, 'Expr_PrintableNewAnonClass->extends' => ['left' => \T_EXTENDS], 'Stmt_Continue->num' => $stripBoth, 'Stmt_Foreach->keyVar' => $stripDoubleArrow, 'Stmt_Function->returnType' => $stripColon, 'Stmt_If->else' => $stripLeft, 'Stmt_Namespace->name' => $stripLeft, 'Stmt_Property->type' => $stripRight, 'Stmt_PropertyProperty->default' => $stripEquals, 'Stmt_Return->expr' => $stripBoth, 'Stmt_StaticVar->default' => $stripEquals, 'Stmt_TraitUseAdaptation_Alias->newName' => $stripLeft, 'Stmt_TryCatch->finally' => $stripLeft];
10358    }
10359    protected function initializeInsertionMap()
10360    {
10361        if ($this->insertionMap) {
10362            return;
10363        }
10364        // TODO: "yield" where both key and value are inserted doesn't work
10365        // [$find, $beforeToken, $extraLeft, $extraRight]
10366        $this->insertionMap = [
10367            'Expr_ArrayDimFetch->dim' => ['[', \false, null, null],
10368            'Expr_ArrayItem->key' => [null, \false, null, ' => '],
10369            'Expr_ArrowFunction->returnType' => [')', \false, ' : ', null],
10370            'Expr_Closure->returnType' => [')', \false, ' : ', null],
10371            'Expr_Ternary->if' => ['?', \false, ' ', ' '],
10372            'Expr_Yield->key' => [\T_YIELD, \false, null, ' => '],
10373            'Expr_Yield->value' => [\T_YIELD, \false, ' ', null],
10374            'Param->type' => [null, \false, null, ' '],
10375            'Param->default' => [null, \false, ' = ', null],
10376            'Stmt_Break->num' => [\T_BREAK, \false, ' ', null],
10377            'Stmt_Catch->var' => [null, \false, ' ', null],
10378            'Stmt_ClassMethod->returnType' => [')', \false, ' : ', null],
10379            'Stmt_Class->extends' => [null, \false, ' extends ', null],
10380            'Stmt_Enum->scalarType' => [null, \false, ' : ', null],
10381            'Stmt_EnumCase->expr' => [null, \false, ' = ', null],
10382            'Expr_PrintableNewAnonClass->extends' => [null, ' extends ', null],
10383            'Stmt_Continue->num' => [\T_CONTINUE, \false, ' ', null],
10384            'Stmt_Foreach->keyVar' => [\T_AS, \false, null, ' => '],
10385            'Stmt_Function->returnType' => [')', \false, ' : ', null],
10386            'Stmt_If->else' => [null, \false, ' ', null],
10387            'Stmt_Namespace->name' => [\T_NAMESPACE, \false, ' ', null],
10388            'Stmt_Property->type' => [\T_VARIABLE, \true, null, ' '],
10389            'Stmt_PropertyProperty->default' => [null, \false, ' = ', null],
10390            'Stmt_Return->expr' => [\T_RETURN, \false, ' ', null],
10391            'Stmt_StaticVar->default' => [null, \false, ' = ', null],
10392            //'Stmt_TraitUseAdaptation_Alias->newName' => [T_AS, false, ' ', null], // TODO
10393            'Stmt_TryCatch->finally' => [null, \false, ' ', null],
10394        ];
10395    }
10396    protected function initializeListInsertionMap()
10397    {
10398        if ($this->listInsertionMap) {
10399            return;
10400        }
10401        $this->listInsertionMap = [
10402            // special
10403            //'Expr_ShellExec->parts' => '', // TODO These need to be treated more carefully
10404            //'Scalar_Encapsed->parts' => '',
10405            'Stmt_Catch->types' => '|',
10406            'UnionType->types' => '|',
10407            'IntersectionType->types' => '&',
10408            'Stmt_If->elseifs' => ' ',
10409            'Stmt_TryCatch->catches' => ' ',
10410            // comma-separated lists
10411            'Expr_Array->items' => ', ',
10412            'Expr_ArrowFunction->params' => ', ',
10413            'Expr_Closure->params' => ', ',
10414            'Expr_Closure->uses' => ', ',
10415            'Expr_FuncCall->args' => ', ',
10416            'Expr_Isset->vars' => ', ',
10417            'Expr_List->items' => ', ',
10418            'Expr_MethodCall->args' => ', ',
10419            'Expr_NullsafeMethodCall->args' => ', ',
10420            'Expr_New->args' => ', ',
10421            'Expr_PrintableNewAnonClass->args' => ', ',
10422            'Expr_StaticCall->args' => ', ',
10423            'Stmt_ClassConst->consts' => ', ',
10424            'Stmt_ClassMethod->params' => ', ',
10425            'Stmt_Class->implements' => ', ',
10426            'Stmt_Enum->implements' => ', ',
10427            'Expr_PrintableNewAnonClass->implements' => ', ',
10428            'Stmt_Const->consts' => ', ',
10429            'Stmt_Declare->declares' => ', ',
10430            'Stmt_Echo->exprs' => ', ',
10431            'Stmt_For->init' => ', ',
10432            'Stmt_For->cond' => ', ',
10433            'Stmt_For->loop' => ', ',
10434            'Stmt_Function->params' => ', ',
10435            'Stmt_Global->vars' => ', ',
10436            'Stmt_GroupUse->uses' => ', ',
10437            'Stmt_Interface->extends' => ', ',
10438            'Stmt_Match->arms' => ', ',
10439            'Stmt_Property->props' => ', ',
10440            'Stmt_StaticVar->vars' => ', ',
10441            'Stmt_TraitUse->traits' => ', ',
10442            'Stmt_TraitUseAdaptation_Precedence->insteadof' => ', ',
10443            'Stmt_Unset->vars' => ', ',
10444            'Stmt_Use->uses' => ', ',
10445            'MatchArm->conds' => ', ',
10446            'AttributeGroup->attrs' => ', ',
10447            // statement lists
10448            'Expr_Closure->stmts' => "\n",
10449            'Stmt_Case->stmts' => "\n",
10450            'Stmt_Catch->stmts' => "\n",
10451            'Stmt_Class->stmts' => "\n",
10452            'Stmt_Enum->stmts' => "\n",
10453            'Expr_PrintableNewAnonClass->stmts' => "\n",
10454            'Stmt_Interface->stmts' => "\n",
10455            'Stmt_Trait->stmts' => "\n",
10456            'Stmt_ClassMethod->stmts' => "\n",
10457            'Stmt_Declare->stmts' => "\n",
10458            'Stmt_Do->stmts' => "\n",
10459            'Stmt_ElseIf->stmts' => "\n",
10460            'Stmt_Else->stmts' => "\n",
10461            'Stmt_Finally->stmts' => "\n",
10462            'Stmt_Foreach->stmts' => "\n",
10463            'Stmt_For->stmts' => "\n",
10464            'Stmt_Function->stmts' => "\n",
10465            'Stmt_If->stmts' => "\n",
10466            'Stmt_Namespace->stmts' => "\n",
10467            'Stmt_Class->attrGroups' => "\n",
10468            'Stmt_Enum->attrGroups' => "\n",
10469            'Stmt_EnumCase->attrGroups' => "\n",
10470            'Stmt_Interface->attrGroups' => "\n",
10471            'Stmt_Trait->attrGroups' => "\n",
10472            'Stmt_Function->attrGroups' => "\n",
10473            'Stmt_ClassMethod->attrGroups' => "\n",
10474            'Stmt_ClassConst->attrGroups' => "\n",
10475            'Stmt_Property->attrGroups' => "\n",
10476            'Expr_PrintableNewAnonClass->attrGroups' => ' ',
10477            'Expr_Closure->attrGroups' => ' ',
10478            'Expr_ArrowFunction->attrGroups' => ' ',
10479            'Param->attrGroups' => ' ',
10480            'Stmt_Switch->cases' => "\n",
10481            'Stmt_TraitUse->adaptations' => "\n",
10482            'Stmt_TryCatch->stmts' => "\n",
10483            'Stmt_While->stmts' => "\n",
10484            // dummy for top-level context
10485            'File->stmts' => "\n",
10486        ];
10487    }
10488    protected function initializeEmptyListInsertionMap()
10489    {
10490        if ($this->emptyListInsertionMap) {
10491            return;
10492        }
10493        // TODO Insertion into empty statement lists.
10494        // [$find, $extraLeft, $extraRight]
10495        $this->emptyListInsertionMap = ['Expr_ArrowFunction->params' => ['(', '', ''], 'Expr_Closure->uses' => [')', ' use(', ')'], 'Expr_Closure->params' => ['(', '', ''], 'Expr_FuncCall->args' => ['(', '', ''], 'Expr_MethodCall->args' => ['(', '', ''], 'Expr_NullsafeMethodCall->args' => ['(', '', ''], 'Expr_New->args' => ['(', '', ''], 'Expr_PrintableNewAnonClass->args' => ['(', '', ''], 'Expr_PrintableNewAnonClass->implements' => [null, ' implements ', ''], 'Expr_StaticCall->args' => ['(', '', ''], 'Stmt_Class->implements' => [null, ' implements ', ''], 'Stmt_Enum->implements' => [null, ' implements ', ''], 'Stmt_ClassMethod->params' => ['(', '', ''], 'Stmt_Interface->extends' => [null, ' extends ', ''], 'Stmt_Function->params' => ['(', '', '']];
10496    }
10497    protected function initializeModifierChangeMap()
10498    {
10499        if ($this->modifierChangeMap) {
10500            return;
10501        }
10502        $this->modifierChangeMap = ['Stmt_ClassConst->flags' => \T_CONST, 'Stmt_ClassMethod->flags' => \T_FUNCTION, 'Stmt_Class->flags' => \T_CLASS, 'Stmt_Property->flags' => \T_VARIABLE, 'Param->flags' => \T_VARIABLE];
10503        // List of integer subnodes that are not modifiers:
10504        // Expr_Include->type
10505        // Stmt_GroupUse->type
10506        // Stmt_Use->type
10507        // Stmt_UseUse->type
10508    }
10509}
10510<?php
10511
10512declare (strict_types=1);
10513namespace PHPUnit\PhpParser\Comment;
10514
10515class Doc extends \PHPUnit\PhpParser\Comment
10516{
10517}
10518<?php
10519
10520declare (strict_types=1);
10521namespace PHPUnit\PhpParser\Builder;
10522
10523use PHPUnit\PhpParser;
10524use PHPUnit\PhpParser\BuilderHelpers;
10525use PHPUnit\PhpParser\Node;
10526use PHPUnit\PhpParser\Node\Stmt;
10527class Function_ extends FunctionLike
10528{
10529    protected $name;
10530    protected $stmts = [];
10531    /** @var Node\AttributeGroup[] */
10532    protected $attributeGroups = [];
10533    /**
10534     * Creates a function builder.
10535     *
10536     * @param string $name Name of the function
10537     */
10538    public function __construct(string $name)
10539    {
10540        $this->name = $name;
10541    }
10542    /**
10543     * Adds a statement.
10544     *
10545     * @param Node|PhpParser\Builder $stmt The statement to add
10546     *
10547     * @return $this The builder instance (for fluid interface)
10548     */
10549    public function addStmt($stmt)
10550    {
10551        $this->stmts[] = BuilderHelpers::normalizeStmt($stmt);
10552        return $this;
10553    }
10554    /**
10555     * Adds an attribute group.
10556     *
10557     * @param Node\Attribute|Node\AttributeGroup $attribute
10558     *
10559     * @return $this The builder instance (for fluid interface)
10560     */
10561    public function addAttribute($attribute)
10562    {
10563        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);
10564        return $this;
10565    }
10566    /**
10567     * Returns the built function node.
10568     *
10569     * @return Stmt\Function_ The built function node
10570     */
10571    public function getNode() : Node
10572    {
10573        return new Stmt\Function_($this->name, ['byRef' => $this->returnByRef, 'params' => $this->params, 'returnType' => $this->returnType, 'stmts' => $this->stmts, 'attrGroups' => $this->attributeGroups], $this->attributes);
10574    }
10575}
10576<?php
10577
10578declare (strict_types=1);
10579namespace PHPUnit\PhpParser\Builder;
10580
10581use PHPUnit\PhpParser;
10582use PHPUnit\PhpParser\BuilderHelpers;
10583use PHPUnit\PhpParser\Node;
10584use PHPUnit\PhpParser\Node\Name;
10585use PHPUnit\PhpParser\Node\Stmt;
10586class Interface_ extends Declaration
10587{
10588    protected $name;
10589    protected $extends = [];
10590    protected $constants = [];
10591    protected $methods = [];
10592    /** @var Node\AttributeGroup[] */
10593    protected $attributeGroups = [];
10594    /**
10595     * Creates an interface builder.
10596     *
10597     * @param string $name Name of the interface
10598     */
10599    public function __construct(string $name)
10600    {
10601        $this->name = $name;
10602    }
10603    /**
10604     * Extends one or more interfaces.
10605     *
10606     * @param Name|string ...$interfaces Names of interfaces to extend
10607     *
10608     * @return $this The builder instance (for fluid interface)
10609     */
10610    public function extend(...$interfaces)
10611    {
10612        foreach ($interfaces as $interface) {
10613            $this->extends[] = BuilderHelpers::normalizeName($interface);
10614        }
10615        return $this;
10616    }
10617    /**
10618     * Adds a statement.
10619     *
10620     * @param Stmt|PhpParser\Builder $stmt The statement to add
10621     *
10622     * @return $this The builder instance (for fluid interface)
10623     */
10624    public function addStmt($stmt)
10625    {
10626        $stmt = BuilderHelpers::normalizeNode($stmt);
10627        if ($stmt instanceof Stmt\ClassConst) {
10628            $this->constants[] = $stmt;
10629        } elseif ($stmt instanceof Stmt\ClassMethod) {
10630            // we erase all statements in the body of an interface method
10631            $stmt->stmts = null;
10632            $this->methods[] = $stmt;
10633        } else {
10634            throw new \LogicException(\sprintf('Unexpected node of type "%s"', $stmt->getType()));
10635        }
10636        return $this;
10637    }
10638    /**
10639     * Adds an attribute group.
10640     *
10641     * @param Node\Attribute|Node\AttributeGroup $attribute
10642     *
10643     * @return $this The builder instance (for fluid interface)
10644     */
10645    public function addAttribute($attribute)
10646    {
10647        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);
10648        return $this;
10649    }
10650    /**
10651     * Returns the built interface node.
10652     *
10653     * @return Stmt\Interface_ The built interface node
10654     */
10655    public function getNode() : PhpParser\Node
10656    {
10657        return new Stmt\Interface_($this->name, ['extends' => $this->extends, 'stmts' => \array_merge($this->constants, $this->methods), 'attrGroups' => $this->attributeGroups], $this->attributes);
10658    }
10659}
10660<?php
10661
10662declare (strict_types=1);
10663namespace PHPUnit\PhpParser\Builder;
10664
10665use PHPUnit\PhpParser;
10666use PHPUnit\PhpParser\BuilderHelpers;
10667use PHPUnit\PhpParser\Node;
10668use PHPUnit\PhpParser\Node\Stmt;
10669class Method extends FunctionLike
10670{
10671    protected $name;
10672    protected $flags = 0;
10673    /** @var array|null */
10674    protected $stmts = [];
10675    /** @var Node\AttributeGroup[] */
10676    protected $attributeGroups = [];
10677    /**
10678     * Creates a method builder.
10679     *
10680     * @param string $name Name of the method
10681     */
10682    public function __construct(string $name)
10683    {
10684        $this->name = $name;
10685    }
10686    /**
10687     * Makes the method public.
10688     *
10689     * @return $this The builder instance (for fluid interface)
10690     */
10691    public function makePublic()
10692    {
10693        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PUBLIC);
10694        return $this;
10695    }
10696    /**
10697     * Makes the method protected.
10698     *
10699     * @return $this The builder instance (for fluid interface)
10700     */
10701    public function makeProtected()
10702    {
10703        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PROTECTED);
10704        return $this;
10705    }
10706    /**
10707     * Makes the method private.
10708     *
10709     * @return $this The builder instance (for fluid interface)
10710     */
10711    public function makePrivate()
10712    {
10713        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PRIVATE);
10714        return $this;
10715    }
10716    /**
10717     * Makes the method static.
10718     *
10719     * @return $this The builder instance (for fluid interface)
10720     */
10721    public function makeStatic()
10722    {
10723        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_STATIC);
10724        return $this;
10725    }
10726    /**
10727     * Makes the method abstract.
10728     *
10729     * @return $this The builder instance (for fluid interface)
10730     */
10731    public function makeAbstract()
10732    {
10733        if (!empty($this->stmts)) {
10734            throw new \LogicException('Cannot make method with statements abstract');
10735        }
10736        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_ABSTRACT);
10737        $this->stmts = null;
10738        // abstract methods don't have statements
10739        return $this;
10740    }
10741    /**
10742     * Makes the method final.
10743     *
10744     * @return $this The builder instance (for fluid interface)
10745     */
10746    public function makeFinal()
10747    {
10748        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_FINAL);
10749        return $this;
10750    }
10751    /**
10752     * Adds a statement.
10753     *
10754     * @param Node|PhpParser\Builder $stmt The statement to add
10755     *
10756     * @return $this The builder instance (for fluid interface)
10757     */
10758    public function addStmt($stmt)
10759    {
10760        if (null === $this->stmts) {
10761            throw new \LogicException('Cannot add statements to an abstract method');
10762        }
10763        $this->stmts[] = BuilderHelpers::normalizeStmt($stmt);
10764        return $this;
10765    }
10766    /**
10767     * Adds an attribute group.
10768     *
10769     * @param Node\Attribute|Node\AttributeGroup $attribute
10770     *
10771     * @return $this The builder instance (for fluid interface)
10772     */
10773    public function addAttribute($attribute)
10774    {
10775        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);
10776        return $this;
10777    }
10778    /**
10779     * Returns the built method node.
10780     *
10781     * @return Stmt\ClassMethod The built method node
10782     */
10783    public function getNode() : Node
10784    {
10785        return new Stmt\ClassMethod($this->name, ['flags' => $this->flags, 'byRef' => $this->returnByRef, 'params' => $this->params, 'returnType' => $this->returnType, 'stmts' => $this->stmts, 'attrGroups' => $this->attributeGroups], $this->attributes);
10786    }
10787}
10788<?php
10789
10790declare (strict_types=1);
10791namespace PHPUnit\PhpParser\Builder;
10792
10793use PHPUnit\PhpParser;
10794use PHPUnit\PhpParser\BuilderHelpers;
10795use PHPUnit\PhpParser\Node;
10796use PHPUnit\PhpParser\Node\Name;
10797use PHPUnit\PhpParser\Node\Stmt;
10798class Class_ extends Declaration
10799{
10800    protected $name;
10801    protected $extends = null;
10802    protected $implements = [];
10803    protected $flags = 0;
10804    protected $uses = [];
10805    protected $constants = [];
10806    protected $properties = [];
10807    protected $methods = [];
10808    /** @var Node\AttributeGroup[] */
10809    protected $attributeGroups = [];
10810    /**
10811     * Creates a class builder.
10812     *
10813     * @param string $name Name of the class
10814     */
10815    public function __construct(string $name)
10816    {
10817        $this->name = $name;
10818    }
10819    /**
10820     * Extends a class.
10821     *
10822     * @param Name|string $class Name of class to extend
10823     *
10824     * @return $this The builder instance (for fluid interface)
10825     */
10826    public function extend($class)
10827    {
10828        $this->extends = BuilderHelpers::normalizeName($class);
10829        return $this;
10830    }
10831    /**
10832     * Implements one or more interfaces.
10833     *
10834     * @param Name|string ...$interfaces Names of interfaces to implement
10835     *
10836     * @return $this The builder instance (for fluid interface)
10837     */
10838    public function implement(...$interfaces)
10839    {
10840        foreach ($interfaces as $interface) {
10841            $this->implements[] = BuilderHelpers::normalizeName($interface);
10842        }
10843        return $this;
10844    }
10845    /**
10846     * Makes the class abstract.
10847     *
10848     * @return $this The builder instance (for fluid interface)
10849     */
10850    public function makeAbstract()
10851    {
10852        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_ABSTRACT);
10853        return $this;
10854    }
10855    /**
10856     * Makes the class final.
10857     *
10858     * @return $this The builder instance (for fluid interface)
10859     */
10860    public function makeFinal()
10861    {
10862        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_FINAL);
10863        return $this;
10864    }
10865    /**
10866     * Adds a statement.
10867     *
10868     * @param Stmt|PhpParser\Builder $stmt The statement to add
10869     *
10870     * @return $this The builder instance (for fluid interface)
10871     */
10872    public function addStmt($stmt)
10873    {
10874        $stmt = BuilderHelpers::normalizeNode($stmt);
10875        $targets = [Stmt\TraitUse::class => &$this->uses, Stmt\ClassConst::class => &$this->constants, Stmt\Property::class => &$this->properties, Stmt\ClassMethod::class => &$this->methods];
10876        $class = \get_class($stmt);
10877        if (!isset($targets[$class])) {
10878            throw new \LogicException(\sprintf('Unexpected node of type "%s"', $stmt->getType()));
10879        }
10880        $targets[$class][] = $stmt;
10881        return $this;
10882    }
10883    /**
10884     * Adds an attribute group.
10885     *
10886     * @param Node\Attribute|Node\AttributeGroup $attribute
10887     *
10888     * @return $this The builder instance (for fluid interface)
10889     */
10890    public function addAttribute($attribute)
10891    {
10892        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);
10893        return $this;
10894    }
10895    /**
10896     * Returns the built class node.
10897     *
10898     * @return Stmt\Class_ The built class node
10899     */
10900    public function getNode() : PhpParser\Node
10901    {
10902        return new Stmt\Class_($this->name, ['flags' => $this->flags, 'extends' => $this->extends, 'implements' => $this->implements, 'stmts' => \array_merge($this->uses, $this->constants, $this->properties, $this->methods), 'attrGroups' => $this->attributeGroups], $this->attributes);
10903    }
10904}
10905<?php
10906
10907declare (strict_types=1);
10908namespace PHPUnit\PhpParser\Builder;
10909
10910use PHPUnit\PhpParser;
10911use PHPUnit\PhpParser\BuilderHelpers;
10912use PHPUnit\PhpParser\Node;
10913use PHPUnit\PhpParser\Node\Stmt;
10914class Trait_ extends Declaration
10915{
10916    protected $name;
10917    protected $uses = [];
10918    protected $properties = [];
10919    protected $methods = [];
10920    /** @var Node\AttributeGroup[] */
10921    protected $attributeGroups = [];
10922    /**
10923     * Creates an interface builder.
10924     *
10925     * @param string $name Name of the interface
10926     */
10927    public function __construct(string $name)
10928    {
10929        $this->name = $name;
10930    }
10931    /**
10932     * Adds a statement.
10933     *
10934     * @param Stmt|PhpParser\Builder $stmt The statement to add
10935     *
10936     * @return $this The builder instance (for fluid interface)
10937     */
10938    public function addStmt($stmt)
10939    {
10940        $stmt = BuilderHelpers::normalizeNode($stmt);
10941        if ($stmt instanceof Stmt\Property) {
10942            $this->properties[] = $stmt;
10943        } elseif ($stmt instanceof Stmt\ClassMethod) {
10944            $this->methods[] = $stmt;
10945        } elseif ($stmt instanceof Stmt\TraitUse) {
10946            $this->uses[] = $stmt;
10947        } else {
10948            throw new \LogicException(\sprintf('Unexpected node of type "%s"', $stmt->getType()));
10949        }
10950        return $this;
10951    }
10952    /**
10953     * Adds an attribute group.
10954     *
10955     * @param Node\Attribute|Node\AttributeGroup $attribute
10956     *
10957     * @return $this The builder instance (for fluid interface)
10958     */
10959    public function addAttribute($attribute)
10960    {
10961        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);
10962        return $this;
10963    }
10964    /**
10965     * Returns the built trait node.
10966     *
10967     * @return Stmt\Trait_ The built interface node
10968     */
10969    public function getNode() : PhpParser\Node
10970    {
10971        return new Stmt\Trait_($this->name, ['stmts' => \array_merge($this->uses, $this->properties, $this->methods), 'attrGroups' => $this->attributeGroups], $this->attributes);
10972    }
10973}
10974<?php
10975
10976declare (strict_types=1);
10977namespace PHPUnit\PhpParser\Builder;
10978
10979use PHPUnit\PhpParser\BuilderHelpers;
10980use PHPUnit\PhpParser\Node;
10981abstract class FunctionLike extends Declaration
10982{
10983    protected $returnByRef = \false;
10984    protected $params = [];
10985    /** @var string|Node\Name|Node\NullableType|null */
10986    protected $returnType = null;
10987    /**
10988     * Make the function return by reference.
10989     *
10990     * @return $this The builder instance (for fluid interface)
10991     */
10992    public function makeReturnByRef()
10993    {
10994        $this->returnByRef = \true;
10995        return $this;
10996    }
10997    /**
10998     * Adds a parameter.
10999     *
11000     * @param Node\Param|Param $param The parameter to add
11001     *
11002     * @return $this The builder instance (for fluid interface)
11003     */
11004    public function addParam($param)
11005    {
11006        $param = BuilderHelpers::normalizeNode($param);
11007        if (!$param instanceof Node\Param) {
11008            throw new \LogicException(\sprintf('Expected parameter node, got "%s"', $param->getType()));
11009        }
11010        $this->params[] = $param;
11011        return $this;
11012    }
11013    /**
11014     * Adds multiple parameters.
11015     *
11016     * @param array $params The parameters to add
11017     *
11018     * @return $this The builder instance (for fluid interface)
11019     */
11020    public function addParams(array $params)
11021    {
11022        foreach ($params as $param) {
11023            $this->addParam($param);
11024        }
11025        return $this;
11026    }
11027    /**
11028     * Sets the return type for PHP 7.
11029     *
11030     * @param string|Node\Name|Node\Identifier|Node\ComplexType $type
11031     *
11032     * @return $this The builder instance (for fluid interface)
11033     */
11034    public function setReturnType($type)
11035    {
11036        $this->returnType = BuilderHelpers::normalizeType($type);
11037        return $this;
11038    }
11039}
11040<?php
11041
11042declare (strict_types=1);
11043namespace PHPUnit\PhpParser\Builder;
11044
11045use PHPUnit\PhpParser\Builder;
11046use PHPUnit\PhpParser\BuilderHelpers;
11047use PHPUnit\PhpParser\Node;
11048use PHPUnit\PhpParser\Node\Stmt;
11049class TraitUse implements Builder
11050{
11051    protected $traits = [];
11052    protected $adaptations = [];
11053    /**
11054     * Creates a trait use builder.
11055     *
11056     * @param Node\Name|string ...$traits Names of used traits
11057     */
11058    public function __construct(...$traits)
11059    {
11060        foreach ($traits as $trait) {
11061            $this->and($trait);
11062        }
11063    }
11064    /**
11065     * Adds used trait.
11066     *
11067     * @param Node\Name|string $trait Trait name
11068     *
11069     * @return $this The builder instance (for fluid interface)
11070     */
11071    public function and($trait)
11072    {
11073        $this->traits[] = BuilderHelpers::normalizeName($trait);
11074        return $this;
11075    }
11076    /**
11077     * Adds trait adaptation.
11078     *
11079     * @param Stmt\TraitUseAdaptation|Builder\TraitUseAdaptation $adaptation Trait adaptation
11080     *
11081     * @return $this The builder instance (for fluid interface)
11082     */
11083    public function with($adaptation)
11084    {
11085        $adaptation = BuilderHelpers::normalizeNode($adaptation);
11086        if (!$adaptation instanceof Stmt\TraitUseAdaptation) {
11087            throw new \LogicException('Adaptation must have type TraitUseAdaptation');
11088        }
11089        $this->adaptations[] = $adaptation;
11090        return $this;
11091    }
11092    /**
11093     * Returns the built node.
11094     *
11095     * @return Node The built node
11096     */
11097    public function getNode() : Node
11098    {
11099        return new Stmt\TraitUse($this->traits, $this->adaptations);
11100    }
11101}
11102<?php
11103
11104declare (strict_types=1);
11105namespace PHPUnit\PhpParser\Builder;
11106
11107use PHPUnit\PhpParser;
11108use PHPUnit\PhpParser\BuilderHelpers;
11109abstract class Declaration implements PhpParser\Builder
11110{
11111    protected $attributes = [];
11112    public abstract function addStmt($stmt);
11113    /**
11114     * Adds multiple statements.
11115     *
11116     * @param array $stmts The statements to add
11117     *
11118     * @return $this The builder instance (for fluid interface)
11119     */
11120    public function addStmts(array $stmts)
11121    {
11122        foreach ($stmts as $stmt) {
11123            $this->addStmt($stmt);
11124        }
11125        return $this;
11126    }
11127    /**
11128     * Sets doc comment for the declaration.
11129     *
11130     * @param PhpParser\Comment\Doc|string $docComment Doc comment to set
11131     *
11132     * @return $this The builder instance (for fluid interface)
11133     */
11134    public function setDocComment($docComment)
11135    {
11136        $this->attributes['comments'] = [BuilderHelpers::normalizeDocComment($docComment)];
11137        return $this;
11138    }
11139}
11140<?php
11141
11142declare (strict_types=1);
11143namespace PHPUnit\PhpParser\Builder;
11144
11145use PHPUnit\PhpParser;
11146use PHPUnit\PhpParser\BuilderHelpers;
11147use PHPUnit\PhpParser\Node;
11148class Param implements PhpParser\Builder
11149{
11150    protected $name;
11151    protected $default = null;
11152    /** @var Node\Identifier|Node\Name|Node\NullableType|null */
11153    protected $type = null;
11154    protected $byRef = \false;
11155    protected $variadic = \false;
11156    /** @var Node\AttributeGroup[] */
11157    protected $attributeGroups = [];
11158    /**
11159     * Creates a parameter builder.
11160     *
11161     * @param string $name Name of the parameter
11162     */
11163    public function __construct(string $name)
11164    {
11165        $this->name = $name;
11166    }
11167    /**
11168     * Sets default value for the parameter.
11169     *
11170     * @param mixed $value Default value to use
11171     *
11172     * @return $this The builder instance (for fluid interface)
11173     */
11174    public function setDefault($value)
11175    {
11176        $this->default = BuilderHelpers::normalizeValue($value);
11177        return $this;
11178    }
11179    /**
11180     * Sets type for the parameter.
11181     *
11182     * @param string|Node\Name|Node\Identifier|Node\ComplexType $type Parameter type
11183     *
11184     * @return $this The builder instance (for fluid interface)
11185     */
11186    public function setType($type)
11187    {
11188        $this->type = BuilderHelpers::normalizeType($type);
11189        if ($this->type == 'void') {
11190            throw new \LogicException('Parameter type cannot be void');
11191        }
11192        return $this;
11193    }
11194    /**
11195     * Sets type for the parameter.
11196     *
11197     * @param string|Node\Name|Node\Identifier|Node\ComplexType $type Parameter type
11198     *
11199     * @return $this The builder instance (for fluid interface)
11200     *
11201     * @deprecated Use setType() instead
11202     */
11203    public function setTypeHint($type)
11204    {
11205        return $this->setType($type);
11206    }
11207    /**
11208     * Make the parameter accept the value by reference.
11209     *
11210     * @return $this The builder instance (for fluid interface)
11211     */
11212    public function makeByRef()
11213    {
11214        $this->byRef = \true;
11215        return $this;
11216    }
11217    /**
11218     * Make the parameter variadic
11219     *
11220     * @return $this The builder instance (for fluid interface)
11221     */
11222    public function makeVariadic()
11223    {
11224        $this->variadic = \true;
11225        return $this;
11226    }
11227    /**
11228     * Adds an attribute group.
11229     *
11230     * @param Node\Attribute|Node\AttributeGroup $attribute
11231     *
11232     * @return $this The builder instance (for fluid interface)
11233     */
11234    public function addAttribute($attribute)
11235    {
11236        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);
11237        return $this;
11238    }
11239    /**
11240     * Returns the built parameter node.
11241     *
11242     * @return Node\Param The built parameter node
11243     */
11244    public function getNode() : Node
11245    {
11246        return new Node\Param(new Node\Expr\Variable($this->name), $this->default, $this->type, $this->byRef, $this->variadic, [], 0, $this->attributeGroups);
11247    }
11248}
11249<?php
11250
11251declare (strict_types=1);
11252namespace PHPUnit\PhpParser\Builder;
11253
11254use PHPUnit\PhpParser\Builder;
11255use PHPUnit\PhpParser\BuilderHelpers;
11256use PHPUnit\PhpParser\Node;
11257use PHPUnit\PhpParser\Node\Stmt;
11258class Use_ implements Builder
11259{
11260    protected $name;
11261    protected $type;
11262    protected $alias = null;
11263    /**
11264     * Creates a name use (alias) builder.
11265     *
11266     * @param Node\Name|string $name Name of the entity (namespace, class, function, constant) to alias
11267     * @param int              $type One of the Stmt\Use_::TYPE_* constants
11268     */
11269    public function __construct($name, int $type)
11270    {
11271        $this->name = BuilderHelpers::normalizeName($name);
11272        $this->type = $type;
11273    }
11274    /**
11275     * Sets alias for used name.
11276     *
11277     * @param string $alias Alias to use (last component of full name by default)
11278     *
11279     * @return $this The builder instance (for fluid interface)
11280     */
11281    public function as(string $alias)
11282    {
11283        $this->alias = $alias;
11284        return $this;
11285    }
11286    /**
11287     * Returns the built node.
11288     *
11289     * @return Stmt\Use_ The built node
11290     */
11291    public function getNode() : Node
11292    {
11293        return new Stmt\Use_([new Stmt\UseUse($this->name, $this->alias)], $this->type);
11294    }
11295}
11296<?php
11297
11298declare (strict_types=1);
11299namespace PHPUnit\PhpParser\Builder;
11300
11301use PHPUnit\PhpParser;
11302use PHPUnit\PhpParser\BuilderHelpers;
11303use PHPUnit\PhpParser\Node;
11304use PHPUnit\PhpParser\Node\Stmt;
11305class Namespace_ extends Declaration
11306{
11307    private $name;
11308    private $stmts = [];
11309    /**
11310     * Creates a namespace builder.
11311     *
11312     * @param Node\Name|string|null $name Name of the namespace
11313     */
11314    public function __construct($name)
11315    {
11316        $this->name = null !== $name ? BuilderHelpers::normalizeName($name) : null;
11317    }
11318    /**
11319     * Adds a statement.
11320     *
11321     * @param Node|PhpParser\Builder $stmt The statement to add
11322     *
11323     * @return $this The builder instance (for fluid interface)
11324     */
11325    public function addStmt($stmt)
11326    {
11327        $this->stmts[] = BuilderHelpers::normalizeStmt($stmt);
11328        return $this;
11329    }
11330    /**
11331     * Returns the built node.
11332     *
11333     * @return Stmt\Namespace_ The built node
11334     */
11335    public function getNode() : Node
11336    {
11337        return new Stmt\Namespace_($this->name, $this->stmts, $this->attributes);
11338    }
11339}
11340<?php
11341
11342declare (strict_types=1);
11343namespace PHPUnit\PhpParser\Builder;
11344
11345use PHPUnit\PhpParser;
11346use PHPUnit\PhpParser\BuilderHelpers;
11347use PHPUnit\PhpParser\Node;
11348use PHPUnit\PhpParser\Node\Const_;
11349use PHPUnit\PhpParser\Node\Identifier;
11350use PHPUnit\PhpParser\Node\Stmt;
11351class ClassConst implements PhpParser\Builder
11352{
11353    protected $flags = 0;
11354    protected $attributes = [];
11355    protected $constants = [];
11356    /** @var Node\AttributeGroup[] */
11357    protected $attributeGroups = [];
11358    /**
11359     * Creates a class constant builder
11360     *
11361     * @param string|Identifier                          $name  Name
11362     * @param Node\Expr|bool|null|int|float|string|array $value Value
11363     */
11364    public function __construct($name, $value)
11365    {
11366        $this->constants = [new Const_($name, BuilderHelpers::normalizeValue($value))];
11367    }
11368    /**
11369     * Add another constant to const group
11370     *
11371     * @param string|Identifier                          $name  Name
11372     * @param Node\Expr|bool|null|int|float|string|array $value Value
11373     *
11374     * @return $this The builder instance (for fluid interface)
11375     */
11376    public function addConst($name, $value)
11377    {
11378        $this->constants[] = new Const_($name, BuilderHelpers::normalizeValue($value));
11379        return $this;
11380    }
11381    /**
11382     * Makes the constant public.
11383     *
11384     * @return $this The builder instance (for fluid interface)
11385     */
11386    public function makePublic()
11387    {
11388        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PUBLIC);
11389        return $this;
11390    }
11391    /**
11392     * Makes the constant protected.
11393     *
11394     * @return $this The builder instance (for fluid interface)
11395     */
11396    public function makeProtected()
11397    {
11398        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PROTECTED);
11399        return $this;
11400    }
11401    /**
11402     * Makes the constant private.
11403     *
11404     * @return $this The builder instance (for fluid interface)
11405     */
11406    public function makePrivate()
11407    {
11408        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PRIVATE);
11409        return $this;
11410    }
11411    /**
11412     * Makes the constant final.
11413     *
11414     * @return $this The builder instance (for fluid interface)
11415     */
11416    public function makeFinal()
11417    {
11418        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_FINAL);
11419        return $this;
11420    }
11421    /**
11422     * Sets doc comment for the constant.
11423     *
11424     * @param PhpParser\Comment\Doc|string $docComment Doc comment to set
11425     *
11426     * @return $this The builder instance (for fluid interface)
11427     */
11428    public function setDocComment($docComment)
11429    {
11430        $this->attributes = ['comments' => [BuilderHelpers::normalizeDocComment($docComment)]];
11431        return $this;
11432    }
11433    /**
11434     * Adds an attribute group.
11435     *
11436     * @param Node\Attribute|Node\AttributeGroup $attribute
11437     *
11438     * @return $this The builder instance (for fluid interface)
11439     */
11440    public function addAttribute($attribute)
11441    {
11442        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);
11443        return $this;
11444    }
11445    /**
11446     * Returns the built class node.
11447     *
11448     * @return Stmt\ClassConst The built constant node
11449     */
11450    public function getNode() : PhpParser\Node
11451    {
11452        return new Stmt\ClassConst($this->constants, $this->flags, $this->attributes, $this->attributeGroups);
11453    }
11454}
11455<?php
11456
11457declare (strict_types=1);
11458namespace PHPUnit\PhpParser\Builder;
11459
11460use PHPUnit\PhpParser;
11461use PHPUnit\PhpParser\BuilderHelpers;
11462use PHPUnit\PhpParser\Node;
11463use PHPUnit\PhpParser\Node\Identifier;
11464use PHPUnit\PhpParser\Node\Name;
11465use PHPUnit\PhpParser\Node\Stmt;
11466use PHPUnit\PhpParser\Node\ComplexType;
11467class Property implements PhpParser\Builder
11468{
11469    protected $name;
11470    protected $flags = 0;
11471    protected $default = null;
11472    protected $attributes = [];
11473    /** @var null|Identifier|Name|NullableType */
11474    protected $type;
11475    /** @var Node\AttributeGroup[] */
11476    protected $attributeGroups = [];
11477    /**
11478     * Creates a property builder.
11479     *
11480     * @param string $name Name of the property
11481     */
11482    public function __construct(string $name)
11483    {
11484        $this->name = $name;
11485    }
11486    /**
11487     * Makes the property public.
11488     *
11489     * @return $this The builder instance (for fluid interface)
11490     */
11491    public function makePublic()
11492    {
11493        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PUBLIC);
11494        return $this;
11495    }
11496    /**
11497     * Makes the property protected.
11498     *
11499     * @return $this The builder instance (for fluid interface)
11500     */
11501    public function makeProtected()
11502    {
11503        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PROTECTED);
11504        return $this;
11505    }
11506    /**
11507     * Makes the property private.
11508     *
11509     * @return $this The builder instance (for fluid interface)
11510     */
11511    public function makePrivate()
11512    {
11513        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PRIVATE);
11514        return $this;
11515    }
11516    /**
11517     * Makes the property static.
11518     *
11519     * @return $this The builder instance (for fluid interface)
11520     */
11521    public function makeStatic()
11522    {
11523        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_STATIC);
11524        return $this;
11525    }
11526    /**
11527     * Makes the property readonly.
11528     *
11529     * @return $this The builder instance (for fluid interface)
11530     */
11531    public function makeReadonly()
11532    {
11533        $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_READONLY);
11534        return $this;
11535    }
11536    /**
11537     * Sets default value for the property.
11538     *
11539     * @param mixed $value Default value to use
11540     *
11541     * @return $this The builder instance (for fluid interface)
11542     */
11543    public function setDefault($value)
11544    {
11545        $this->default = BuilderHelpers::normalizeValue($value);
11546        return $this;
11547    }
11548    /**
11549     * Sets doc comment for the property.
11550     *
11551     * @param PhpParser\Comment\Doc|string $docComment Doc comment to set
11552     *
11553     * @return $this The builder instance (for fluid interface)
11554     */
11555    public function setDocComment($docComment)
11556    {
11557        $this->attributes = ['comments' => [BuilderHelpers::normalizeDocComment($docComment)]];
11558        return $this;
11559    }
11560    /**
11561     * Sets the property type for PHP 7.4+.
11562     *
11563     * @param string|Name|Identifier|ComplexType $type
11564     *
11565     * @return $this
11566     */
11567    public function setType($type)
11568    {
11569        $this->type = BuilderHelpers::normalizeType($type);
11570        return $this;
11571    }
11572    /**
11573     * Adds an attribute group.
11574     *
11575     * @param Node\Attribute|Node\AttributeGroup $attribute
11576     *
11577     * @return $this The builder instance (for fluid interface)
11578     */
11579    public function addAttribute($attribute)
11580    {
11581        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);
11582        return $this;
11583    }
11584    /**
11585     * Returns the built class node.
11586     *
11587     * @return Stmt\Property The built property node
11588     */
11589    public function getNode() : PhpParser\Node
11590    {
11591        return new Stmt\Property($this->flags !== 0 ? $this->flags : Stmt\Class_::MODIFIER_PUBLIC, [new Stmt\PropertyProperty($this->name, $this->default)], $this->attributes, $this->type, $this->attributeGroups);
11592    }
11593}
11594<?php
11595
11596declare (strict_types=1);
11597namespace PHPUnit\PhpParser\Builder;
11598
11599use PHPUnit\PhpParser\Builder;
11600use PHPUnit\PhpParser\BuilderHelpers;
11601use PHPUnit\PhpParser\Node;
11602use PHPUnit\PhpParser\Node\Stmt;
11603class TraitUseAdaptation implements Builder
11604{
11605    const TYPE_UNDEFINED = 0;
11606    const TYPE_ALIAS = 1;
11607    const TYPE_PRECEDENCE = 2;
11608    /** @var int Type of building adaptation */
11609    protected $type;
11610    protected $trait;
11611    protected $method;
11612    protected $modifier = null;
11613    protected $alias = null;
11614    protected $insteadof = [];
11615    /**
11616     * Creates a trait use adaptation builder.
11617     *
11618     * @param Node\Name|string|null  $trait  Name of adaptated trait
11619     * @param Node\Identifier|string $method Name of adaptated method
11620     */
11621    public function __construct($trait, $method)
11622    {
11623        $this->type = self::TYPE_UNDEFINED;
11624        $this->trait = \is_null($trait) ? null : BuilderHelpers::normalizeName($trait);
11625        $this->method = BuilderHelpers::normalizeIdentifier($method);
11626    }
11627    /**
11628     * Sets alias of method.
11629     *
11630     * @param Node\Identifier|string $alias Alias for adaptated method
11631     *
11632     * @return $this The builder instance (for fluid interface)
11633     */
11634    public function as($alias)
11635    {
11636        if ($this->type === self::TYPE_UNDEFINED) {
11637            $this->type = self::TYPE_ALIAS;
11638        }
11639        if ($this->type !== self::TYPE_ALIAS) {
11640            throw new \LogicException('Cannot set alias for not alias adaptation buider');
11641        }
11642        $this->alias = $alias;
11643        return $this;
11644    }
11645    /**
11646     * Sets adaptated method public.
11647     *
11648     * @return $this The builder instance (for fluid interface)
11649     */
11650    public function makePublic()
11651    {
11652        $this->setModifier(Stmt\Class_::MODIFIER_PUBLIC);
11653        return $this;
11654    }
11655    /**
11656     * Sets adaptated method protected.
11657     *
11658     * @return $this The builder instance (for fluid interface)
11659     */
11660    public function makeProtected()
11661    {
11662        $this->setModifier(Stmt\Class_::MODIFIER_PROTECTED);
11663        return $this;
11664    }
11665    /**
11666     * Sets adaptated method private.
11667     *
11668     * @return $this The builder instance (for fluid interface)
11669     */
11670    public function makePrivate()
11671    {
11672        $this->setModifier(Stmt\Class_::MODIFIER_PRIVATE);
11673        return $this;
11674    }
11675    /**
11676     * Adds overwritten traits.
11677     *
11678     * @param Node\Name|string ...$traits Traits for overwrite
11679     *
11680     * @return $this The builder instance (for fluid interface)
11681     */
11682    public function insteadof(...$traits)
11683    {
11684        if ($this->type === self::TYPE_UNDEFINED) {
11685            if (\is_null($this->trait)) {
11686                throw new \LogicException('Precedence adaptation must have trait');
11687            }
11688            $this->type = self::TYPE_PRECEDENCE;
11689        }
11690        if ($this->type !== self::TYPE_PRECEDENCE) {
11691            throw new \LogicException('Cannot add overwritten traits for not precedence adaptation buider');
11692        }
11693        foreach ($traits as $trait) {
11694            $this->insteadof[] = BuilderHelpers::normalizeName($trait);
11695        }
11696        return $this;
11697    }
11698    protected function setModifier(int $modifier)
11699    {
11700        if ($this->type === self::TYPE_UNDEFINED) {
11701            $this->type = self::TYPE_ALIAS;
11702        }
11703        if ($this->type !== self::TYPE_ALIAS) {
11704            throw new \LogicException('Cannot set access modifier for not alias adaptation buider');
11705        }
11706        if (\is_null($this->modifier)) {
11707            $this->modifier = $modifier;
11708        } else {
11709            throw new \LogicException('Multiple access type modifiers are not allowed');
11710        }
11711    }
11712    /**
11713     * Returns the built node.
11714     *
11715     * @return Node The built node
11716     */
11717    public function getNode() : Node
11718    {
11719        switch ($this->type) {
11720            case self::TYPE_ALIAS:
11721                return new Stmt\TraitUseAdaptation\Alias($this->trait, $this->method, $this->modifier, $this->alias);
11722            case self::TYPE_PRECEDENCE:
11723                return new Stmt\TraitUseAdaptation\Precedence($this->trait, $this->method, $this->insteadof);
11724            default:
11725                throw new \LogicException('Type of adaptation is not defined');
11726        }
11727    }
11728}
11729<?php
11730
11731declare (strict_types=1);
11732namespace PHPUnit\PhpParser;
11733
11734class Error extends \RuntimeException
11735{
11736    protected $rawMessage;
11737    protected $attributes;
11738    /**
11739     * Creates an Exception signifying a parse error.
11740     *
11741     * @param string    $message    Error message
11742     * @param array|int $attributes Attributes of node/token where error occurred
11743     *                              (or start line of error -- deprecated)
11744     */
11745    public function __construct(string $message, $attributes = [])
11746    {
11747        $this->rawMessage = $message;
11748        if (\is_array($attributes)) {
11749            $this->attributes = $attributes;
11750        } else {
11751            $this->attributes = ['startLine' => $attributes];
11752        }
11753        $this->updateMessage();
11754    }
11755    /**
11756     * Gets the error message
11757     *
11758     * @return string Error message
11759     */
11760    public function getRawMessage() : string
11761    {
11762        return $this->rawMessage;
11763    }
11764    /**
11765     * Gets the line the error starts in.
11766     *
11767     * @return int Error start line
11768     */
11769    public function getStartLine() : int
11770    {
11771        return $this->attributes['startLine'] ?? -1;
11772    }
11773    /**
11774     * Gets the line the error ends in.
11775     *
11776     * @return int Error end line
11777     */
11778    public function getEndLine() : int
11779    {
11780        return $this->attributes['endLine'] ?? -1;
11781    }
11782    /**
11783     * Gets the attributes of the node/token the error occurred at.
11784     *
11785     * @return array
11786     */
11787    public function getAttributes() : array
11788    {
11789        return $this->attributes;
11790    }
11791    /**
11792     * Sets the attributes of the node/token the error occurred at.
11793     *
11794     * @param array $attributes
11795     */
11796    public function setAttributes(array $attributes)
11797    {
11798        $this->attributes = $attributes;
11799        $this->updateMessage();
11800    }
11801    /**
11802     * Sets the line of the PHP file the error occurred in.
11803     *
11804     * @param string $message Error message
11805     */
11806    public function setRawMessage(string $message)
11807    {
11808        $this->rawMessage = $message;
11809        $this->updateMessage();
11810    }
11811    /**
11812     * Sets the line the error starts in.
11813     *
11814     * @param int $line Error start line
11815     */
11816    public function setStartLine(int $line)
11817    {
11818        $this->attributes['startLine'] = $line;
11819        $this->updateMessage();
11820    }
11821    /**
11822     * Returns whether the error has start and end column information.
11823     *
11824     * For column information enable the startFilePos and endFilePos in the lexer options.
11825     *
11826     * @return bool
11827     */
11828    public function hasColumnInfo() : bool
11829    {
11830        return isset($this->attributes['startFilePos'], $this->attributes['endFilePos']);
11831    }
11832    /**
11833     * Gets the start column (1-based) into the line where the error started.
11834     *
11835     * @param string $code Source code of the file
11836     * @return int
11837     */
11838    public function getStartColumn(string $code) : int
11839    {
11840        if (!$this->hasColumnInfo()) {
11841            throw new \RuntimeException('Error does not have column information');
11842        }
11843        return $this->toColumn($code, $this->attributes['startFilePos']);
11844    }
11845    /**
11846     * Gets the end column (1-based) into the line where the error ended.
11847     *
11848     * @param string $code Source code of the file
11849     * @return int
11850     */
11851    public function getEndColumn(string $code) : int
11852    {
11853        if (!$this->hasColumnInfo()) {
11854            throw new \RuntimeException('Error does not have column information');
11855        }
11856        return $this->toColumn($code, $this->attributes['endFilePos']);
11857    }
11858    /**
11859     * Formats message including line and column information.
11860     *
11861     * @param string $code Source code associated with the error, for calculation of the columns
11862     *
11863     * @return string Formatted message
11864     */
11865    public function getMessageWithColumnInfo(string $code) : string
11866    {
11867        return \sprintf('%s from %d:%d to %d:%d', $this->getRawMessage(), $this->getStartLine(), $this->getStartColumn($code), $this->getEndLine(), $this->getEndColumn($code));
11868    }
11869    /**
11870     * Converts a file offset into a column.
11871     *
11872     * @param string $code Source code that $pos indexes into
11873     * @param int    $pos  0-based position in $code
11874     *
11875     * @return int 1-based column (relative to start of line)
11876     */
11877    private function toColumn(string $code, int $pos) : int
11878    {
11879        if ($pos > \strlen($code)) {
11880            throw new \RuntimeException('Invalid position information');
11881        }
11882        $lineStartPos = \strrpos($code, "\n", $pos - \strlen($code));
11883        if (\false === $lineStartPos) {
11884            $lineStartPos = -1;
11885        }
11886        return $pos - $lineStartPos;
11887    }
11888    /**
11889     * Updates the exception message after a change to rawMessage or rawLine.
11890     */
11891    protected function updateMessage()
11892    {
11893        $this->message = $this->rawMessage;
11894        if (-1 === $this->getStartLine()) {
11895            $this->message .= ' on unknown line';
11896        } else {
11897            $this->message .= ' on line ' . $this->getStartLine();
11898        }
11899    }
11900}
11901<?php
11902
11903declare (strict_types=1);
11904namespace PHPUnit\PhpParser\NodeVisitor;
11905
11906use PHPUnit\PhpParser\ErrorHandler;
11907use PHPUnit\PhpParser\NameContext;
11908use PHPUnit\PhpParser\Node;
11909use PHPUnit\PhpParser\Node\Expr;
11910use PHPUnit\PhpParser\Node\Name;
11911use PHPUnit\PhpParser\Node\Name\FullyQualified;
11912use PHPUnit\PhpParser\Node\Stmt;
11913use PHPUnit\PhpParser\NodeVisitorAbstract;
11914class NameResolver extends NodeVisitorAbstract
11915{
11916    /** @var NameContext Naming context */
11917    protected $nameContext;
11918    /** @var bool Whether to preserve original names */
11919    protected $preserveOriginalNames;
11920    /** @var bool Whether to replace resolved nodes in place, or to add resolvedNode attributes */
11921    protected $replaceNodes;
11922    /**
11923     * Constructs a name resolution visitor.
11924     *
11925     * Options:
11926     *  * preserveOriginalNames (default false): An "originalName" attribute will be added to
11927     *    all name nodes that underwent resolution.
11928     *  * replaceNodes (default true): Resolved names are replaced in-place. Otherwise, a
11929     *    resolvedName attribute is added. (Names that cannot be statically resolved receive a
11930     *    namespacedName attribute, as usual.)
11931     *
11932     * @param ErrorHandler|null $errorHandler Error handler
11933     * @param array $options Options
11934     */
11935    public function __construct(ErrorHandler $errorHandler = null, array $options = [])
11936    {
11937        $this->nameContext = new NameContext($errorHandler ?? new ErrorHandler\Throwing());
11938        $this->preserveOriginalNames = $options['preserveOriginalNames'] ?? \false;
11939        $this->replaceNodes = $options['replaceNodes'] ?? \true;
11940    }
11941    /**
11942     * Get name resolution context.
11943     *
11944     * @return NameContext
11945     */
11946    public function getNameContext() : NameContext
11947    {
11948        return $this->nameContext;
11949    }
11950    public function beforeTraverse(array $nodes)
11951    {
11952        $this->nameContext->startNamespace();
11953        return null;
11954    }
11955    public function enterNode(Node $node)
11956    {
11957        if ($node instanceof Stmt\Namespace_) {
11958            $this->nameContext->startNamespace($node->name);
11959        } elseif ($node instanceof Stmt\Use_) {
11960            foreach ($node->uses as $use) {
11961                $this->addAlias($use, $node->type, null);
11962            }
11963        } elseif ($node instanceof Stmt\GroupUse) {
11964            foreach ($node->uses as $use) {
11965                $this->addAlias($use, $node->type, $node->prefix);
11966            }
11967        } elseif ($node instanceof Stmt\Class_) {
11968            if (null !== $node->extends) {
11969                $node->extends = $this->resolveClassName($node->extends);
11970            }
11971            foreach ($node->implements as &$interface) {
11972                $interface = $this->resolveClassName($interface);
11973            }
11974            $this->resolveAttrGroups($node);
11975            if (null !== $node->name) {
11976                $this->addNamespacedName($node);
11977            }
11978        } elseif ($node instanceof Stmt\Interface_) {
11979            foreach ($node->extends as &$interface) {
11980                $interface = $this->resolveClassName($interface);
11981            }
11982            $this->resolveAttrGroups($node);
11983            $this->addNamespacedName($node);
11984        } elseif ($node instanceof Stmt\Enum_) {
11985            foreach ($node->implements as &$interface) {
11986                $interface = $this->resolveClassName($interface);
11987            }
11988            $this->resolveAttrGroups($node);
11989            if (null !== $node->name) {
11990                $this->addNamespacedName($node);
11991            }
11992        } elseif ($node instanceof Stmt\Trait_) {
11993            $this->resolveAttrGroups($node);
11994            $this->addNamespacedName($node);
11995        } elseif ($node instanceof Stmt\Function_) {
11996            $this->resolveSignature($node);
11997            $this->resolveAttrGroups($node);
11998            $this->addNamespacedName($node);
11999        } elseif ($node instanceof Stmt\ClassMethod || $node instanceof Expr\Closure || $node instanceof Expr\ArrowFunction) {
12000            $this->resolveSignature($node);
12001            $this->resolveAttrGroups($node);
12002        } elseif ($node instanceof Stmt\Property) {
12003            if (null !== $node->type) {
12004                $node->type = $this->resolveType($node->type);
12005            }
12006            $this->resolveAttrGroups($node);
12007        } elseif ($node instanceof Stmt\Const_) {
12008            foreach ($node->consts as $const) {
12009                $this->addNamespacedName($const);
12010            }
12011        } else {
12012            if ($node instanceof Stmt\ClassConst) {
12013                $this->resolveAttrGroups($node);
12014            } else {
12015                if ($node instanceof Stmt\EnumCase) {
12016                    $this->resolveAttrGroups($node);
12017                } elseif ($node instanceof Expr\StaticCall || $node instanceof Expr\StaticPropertyFetch || $node instanceof Expr\ClassConstFetch || $node instanceof Expr\New_ || $node instanceof Expr\Instanceof_) {
12018                    if ($node->class instanceof Name) {
12019                        $node->class = $this->resolveClassName($node->class);
12020                    }
12021                } elseif ($node instanceof Stmt\Catch_) {
12022                    foreach ($node->types as &$type) {
12023                        $type = $this->resolveClassName($type);
12024                    }
12025                } elseif ($node instanceof Expr\FuncCall) {
12026                    if ($node->name instanceof Name) {
12027                        $node->name = $this->resolveName($node->name, Stmt\Use_::TYPE_FUNCTION);
12028                    }
12029                } elseif ($node instanceof Expr\ConstFetch) {
12030                    $node->name = $this->resolveName($node->name, Stmt\Use_::TYPE_CONSTANT);
12031                } elseif ($node instanceof Stmt\TraitUse) {
12032                    foreach ($node->traits as &$trait) {
12033                        $trait = $this->resolveClassName($trait);
12034                    }
12035                    foreach ($node->adaptations as $adaptation) {
12036                        if (null !== $adaptation->trait) {
12037                            $adaptation->trait = $this->resolveClassName($adaptation->trait);
12038                        }
12039                        if ($adaptation instanceof Stmt\TraitUseAdaptation\Precedence) {
12040                            foreach ($adaptation->insteadof as &$insteadof) {
12041                                $insteadof = $this->resolveClassName($insteadof);
12042                            }
12043                        }
12044                    }
12045                }
12046            }
12047        }
12048        return null;
12049    }
12050    private function addAlias(Stmt\UseUse $use, $type, Name $prefix = null)
12051    {
12052        // Add prefix for group uses
12053        $name = $prefix ? Name::concat($prefix, $use->name) : $use->name;
12054        // Type is determined either by individual element or whole use declaration
12055        $type |= $use->type;
12056        $this->nameContext->addAlias($name, (string) $use->getAlias(), $type, $use->getAttributes());
12057    }
12058    /** @param Stmt\Function_|Stmt\ClassMethod|Expr\Closure $node */
12059    private function resolveSignature($node)
12060    {
12061        foreach ($node->params as $param) {
12062            $param->type = $this->resolveType($param->type);
12063            $this->resolveAttrGroups($param);
12064        }
12065        $node->returnType = $this->resolveType($node->returnType);
12066    }
12067    private function resolveType($node)
12068    {
12069        if ($node instanceof Name) {
12070            return $this->resolveClassName($node);
12071        }
12072        if ($node instanceof Node\NullableType) {
12073            $node->type = $this->resolveType($node->type);
12074            return $node;
12075        }
12076        if ($node instanceof Node\UnionType || $node instanceof Node\IntersectionType) {
12077            foreach ($node->types as &$type) {
12078                $type = $this->resolveType($type);
12079            }
12080            return $node;
12081        }
12082        return $node;
12083    }
12084    /**
12085     * Resolve name, according to name resolver options.
12086     *
12087     * @param Name $name Function or constant name to resolve
12088     * @param int  $type One of Stmt\Use_::TYPE_*
12089     *
12090     * @return Name Resolved name, or original name with attribute
12091     */
12092    protected function resolveName(Name $name, int $type) : Name
12093    {
12094        if (!$this->replaceNodes) {
12095            $resolvedName = $this->nameContext->getResolvedName($name, $type);
12096            if (null !== $resolvedName) {
12097                $name->setAttribute('resolvedName', $resolvedName);
12098            } else {
12099                $name->setAttribute('namespacedName', FullyQualified::concat($this->nameContext->getNamespace(), $name, $name->getAttributes()));
12100            }
12101            return $name;
12102        }
12103        if ($this->preserveOriginalNames) {
12104            // Save the original name
12105            $originalName = $name;
12106            $name = clone $originalName;
12107            $name->setAttribute('originalName', $originalName);
12108        }
12109        $resolvedName = $this->nameContext->getResolvedName($name, $type);
12110        if (null !== $resolvedName) {
12111            return $resolvedName;
12112        }
12113        // unqualified names inside a namespace cannot be resolved at compile-time
12114        // add the namespaced version of the name as an attribute
12115        $name->setAttribute('namespacedName', FullyQualified::concat($this->nameContext->getNamespace(), $name, $name->getAttributes()));
12116        return $name;
12117    }
12118    protected function resolveClassName(Name $name)
12119    {
12120        return $this->resolveName($name, Stmt\Use_::TYPE_NORMAL);
12121    }
12122    protected function addNamespacedName(Node $node)
12123    {
12124        $node->namespacedName = Name::concat($this->nameContext->getNamespace(), (string) $node->name);
12125    }
12126    protected function resolveAttrGroups(Node $node)
12127    {
12128        foreach ($node->attrGroups as $attrGroup) {
12129            foreach ($attrGroup->attrs as $attr) {
12130                $attr->name = $this->resolveClassName($attr->name);
12131            }
12132        }
12133    }
12134}
12135<?php
12136
12137declare (strict_types=1);
12138namespace PHPUnit\PhpParser\NodeVisitor;
12139
12140use function array_pop;
12141use function count;
12142use PHPUnit\PhpParser\Node;
12143use PHPUnit\PhpParser\NodeVisitorAbstract;
12144/**
12145 * Visitor that connects a child node to its parent node.
12146 *
12147 * On the child node, the parent node can be accessed through
12148 * <code>$node->getAttribute('parent')</code>.
12149 */
12150final class ParentConnectingVisitor extends NodeVisitorAbstract
12151{
12152    /**
12153     * @var Node[]
12154     */
12155    private $stack = [];
12156    public function beforeTraverse(array $nodes)
12157    {
12158        $this->stack = [];
12159    }
12160    public function enterNode(Node $node)
12161    {
12162        if (!empty($this->stack)) {
12163            $node->setAttribute('parent', $this->stack[count($this->stack) - 1]);
12164        }
12165        $this->stack[] = $node;
12166    }
12167    public function leaveNode(Node $node)
12168    {
12169        array_pop($this->stack);
12170    }
12171}
12172<?php
12173
12174declare (strict_types=1);
12175namespace PHPUnit\PhpParser\NodeVisitor;
12176
12177use PHPUnit\PhpParser\Node;
12178use PHPUnit\PhpParser\NodeVisitorAbstract;
12179/**
12180 * Visitor cloning all nodes and linking to the original nodes using an attribute.
12181 *
12182 * This visitor is required to perform format-preserving pretty prints.
12183 */
12184class CloningVisitor extends NodeVisitorAbstract
12185{
12186    public function enterNode(Node $origNode)
12187    {
12188        $node = clone $origNode;
12189        $node->setAttribute('origNode', $origNode);
12190        return $node;
12191    }
12192}
12193<?php
12194
12195declare (strict_types=1);
12196namespace PHPUnit\PhpParser\NodeVisitor;
12197
12198use PHPUnit\PhpParser\Node;
12199use PHPUnit\PhpParser\NodeVisitorAbstract;
12200/**
12201 * This visitor can be used to find and collect all nodes satisfying some criterion determined by
12202 * a filter callback.
12203 */
12204class FindingVisitor extends NodeVisitorAbstract
12205{
12206    /** @var callable Filter callback */
12207    protected $filterCallback;
12208    /** @var Node[] Found nodes */
12209    protected $foundNodes;
12210    public function __construct(callable $filterCallback)
12211    {
12212        $this->filterCallback = $filterCallback;
12213    }
12214    /**
12215     * Get found nodes satisfying the filter callback.
12216     *
12217     * Nodes are returned in pre-order.
12218     *
12219     * @return Node[] Found nodes
12220     */
12221    public function getFoundNodes() : array
12222    {
12223        return $this->foundNodes;
12224    }
12225    public function beforeTraverse(array $nodes)
12226    {
12227        $this->foundNodes = [];
12228        return null;
12229    }
12230    public function enterNode(Node $node)
12231    {
12232        $filterCallback = $this->filterCallback;
12233        if ($filterCallback($node)) {
12234            $this->foundNodes[] = $node;
12235        }
12236        return null;
12237    }
12238}
12239<?php
12240
12241declare (strict_types=1);
12242namespace PHPUnit\PhpParser\NodeVisitor;
12243
12244use PHPUnit\PhpParser\Node;
12245use PHPUnit\PhpParser\NodeTraverser;
12246use PHPUnit\PhpParser\NodeVisitorAbstract;
12247/**
12248 * This visitor can be used to find the first node satisfying some criterion determined by
12249 * a filter callback.
12250 */
12251class FirstFindingVisitor extends NodeVisitorAbstract
12252{
12253    /** @var callable Filter callback */
12254    protected $filterCallback;
12255    /** @var null|Node Found node */
12256    protected $foundNode;
12257    public function __construct(callable $filterCallback)
12258    {
12259        $this->filterCallback = $filterCallback;
12260    }
12261    /**
12262     * Get found node satisfying the filter callback.
12263     *
12264     * Returns null if no node satisfies the filter callback.
12265     *
12266     * @return null|Node Found node (or null if not found)
12267     */
12268    public function getFoundNode()
12269    {
12270        return $this->foundNode;
12271    }
12272    public function beforeTraverse(array $nodes)
12273    {
12274        $this->foundNode = null;
12275        return null;
12276    }
12277    public function enterNode(Node $node)
12278    {
12279        $filterCallback = $this->filterCallback;
12280        if ($filterCallback($node)) {
12281            $this->foundNode = $node;
12282            return NodeTraverser::STOP_TRAVERSAL;
12283        }
12284        return null;
12285    }
12286}
12287<?php
12288
12289declare (strict_types=1);
12290namespace PHPUnit\PhpParser\NodeVisitor;
12291
12292use PHPUnit\PhpParser\Node;
12293use PHPUnit\PhpParser\NodeVisitorAbstract;
12294/**
12295 * Visitor that connects a child node to its parent node
12296 * as well as its sibling nodes.
12297 *
12298 * On the child node, the parent node can be accessed through
12299 * <code>$node->getAttribute('parent')</code>, the previous
12300 * node can be accessed through <code>$node->getAttribute('previous')</code>,
12301 * and the next node can be accessed through <code>$node->getAttribute('next')</code>.
12302 */
12303final class NodeConnectingVisitor extends NodeVisitorAbstract
12304{
12305    /**
12306     * @var Node[]
12307     */
12308    private $stack = [];
12309    /**
12310     * @var ?Node
12311     */
12312    private $previous;
12313    public function beforeTraverse(array $nodes)
12314    {
12315        $this->stack = [];
12316        $this->previous = null;
12317    }
12318    public function enterNode(Node $node)
12319    {
12320        if (!empty($this->stack)) {
12321            $node->setAttribute('parent', $this->stack[\count($this->stack) - 1]);
12322        }
12323        if ($this->previous !== null && $this->previous->getAttribute('parent') === $node->getAttribute('parent')) {
12324            $node->setAttribute('previous', $this->previous);
12325            $this->previous->setAttribute('next', $node);
12326        }
12327        $this->stack[] = $node;
12328    }
12329    public function leaveNode(Node $node)
12330    {
12331        $this->previous = $node;
12332        \array_pop($this->stack);
12333    }
12334}
12335<?php
12336
12337declare (strict_types=1);
12338namespace PHPUnit\PhpParser;
12339
12340class ParserFactory
12341{
12342    const PREFER_PHP7 = 1;
12343    const PREFER_PHP5 = 2;
12344    const ONLY_PHP7 = 3;
12345    const ONLY_PHP5 = 4;
12346    /**
12347     * Creates a Parser instance, according to the provided kind.
12348     *
12349     * @param int        $kind  One of ::PREFER_PHP7, ::PREFER_PHP5, ::ONLY_PHP7 or ::ONLY_PHP5
12350     * @param Lexer|null $lexer Lexer to use. Defaults to emulative lexer when not specified
12351     * @param array      $parserOptions Parser options. See ParserAbstract::__construct() argument
12352     *
12353     * @return Parser The parser instance
12354     */
12355    public function create(int $kind, Lexer $lexer = null, array $parserOptions = []) : Parser
12356    {
12357        if (null === $lexer) {
12358            $lexer = new Lexer\Emulative();
12359        }
12360        switch ($kind) {
12361            case self::PREFER_PHP7:
12362                return new Parser\Multiple([new Parser\Php7($lexer, $parserOptions), new Parser\Php5($lexer, $parserOptions)]);
12363            case self::PREFER_PHP5:
12364                return new Parser\Multiple([new Parser\Php5($lexer, $parserOptions), new Parser\Php7($lexer, $parserOptions)]);
12365            case self::ONLY_PHP7:
12366                return new Parser\Php7($lexer, $parserOptions);
12367            case self::ONLY_PHP5:
12368                return new Parser\Php5($lexer, $parserOptions);
12369            default:
12370                throw new \LogicException('Kind must be one of ::PREFER_PHP7, ::PREFER_PHP5, ::ONLY_PHP7 or ::ONLY_PHP5');
12371        }
12372    }
12373}
12374<?php
12375
12376namespace PHPUnit\PhpParser;
12377
12378use PHPUnit\PhpParser\Node\Expr;
12379use PHPUnit\PhpParser\Node\Scalar;
12380/**
12381 * Evaluates constant expressions.
12382 *
12383 * This evaluator is able to evaluate all constant expressions (as defined by PHP), which can be
12384 * evaluated without further context. If a subexpression is not of this type, a user-provided
12385 * fallback evaluator is invoked. To support all constant expressions that are also supported by
12386 * PHP (and not already handled by this class), the fallback evaluator must be able to handle the
12387 * following node types:
12388 *
12389 *  * All Scalar\MagicConst\* nodes.
12390 *  * Expr\ConstFetch nodes. Only null/false/true are already handled by this class.
12391 *  * Expr\ClassConstFetch nodes.
12392 *
12393 * The fallback evaluator should throw ConstExprEvaluationException for nodes it cannot evaluate.
12394 *
12395 * The evaluation is dependent on runtime configuration in two respects: Firstly, floating
12396 * point to string conversions are affected by the precision ini setting. Secondly, they are also
12397 * affected by the LC_NUMERIC locale.
12398 */
12399class ConstExprEvaluator
12400{
12401    private $fallbackEvaluator;
12402    /**
12403     * Create a constant expression evaluator.
12404     *
12405     * The provided fallback evaluator is invoked whenever a subexpression cannot be evaluated. See
12406     * class doc comment for more information.
12407     *
12408     * @param callable|null $fallbackEvaluator To call if subexpression cannot be evaluated
12409     */
12410    public function __construct(callable $fallbackEvaluator = null)
12411    {
12412        $this->fallbackEvaluator = $fallbackEvaluator ?? function (Expr $expr) {
12413            throw new ConstExprEvaluationException("Expression of type {$expr->getType()} cannot be evaluated");
12414        };
12415    }
12416    /**
12417     * Silently evaluates a constant expression into a PHP value.
12418     *
12419     * Thrown Errors, warnings or notices will be converted into a ConstExprEvaluationException.
12420     * The original source of the exception is available through getPrevious().
12421     *
12422     * If some part of the expression cannot be evaluated, the fallback evaluator passed to the
12423     * constructor will be invoked. By default, if no fallback is provided, an exception of type
12424     * ConstExprEvaluationException is thrown.
12425     *
12426     * See class doc comment for caveats and limitations.
12427     *
12428     * @param Expr $expr Constant expression to evaluate
12429     * @return mixed Result of evaluation
12430     *
12431     * @throws ConstExprEvaluationException if the expression cannot be evaluated or an error occurred
12432     */
12433    public function evaluateSilently(Expr $expr)
12434    {
12435        \set_error_handler(function ($num, $str, $file, $line) {
12436            throw new \ErrorException($str, 0, $num, $file, $line);
12437        });
12438        try {
12439            return $this->evaluate($expr);
12440        } catch (\Throwable $e) {
12441            if (!$e instanceof ConstExprEvaluationException) {
12442                $e = new ConstExprEvaluationException("An error occurred during constant expression evaluation", 0, $e);
12443            }
12444            throw $e;
12445        } finally {
12446            \restore_error_handler();
12447        }
12448    }
12449    /**
12450     * Directly evaluates a constant expression into a PHP value.
12451     *
12452     * May generate Error exceptions, warnings or notices. Use evaluateSilently() to convert these
12453     * into a ConstExprEvaluationException.
12454     *
12455     * If some part of the expression cannot be evaluated, the fallback evaluator passed to the
12456     * constructor will be invoked. By default, if no fallback is provided, an exception of type
12457     * ConstExprEvaluationException is thrown.
12458     *
12459     * See class doc comment for caveats and limitations.
12460     *
12461     * @param Expr $expr Constant expression to evaluate
12462     * @return mixed Result of evaluation
12463     *
12464     * @throws ConstExprEvaluationException if the expression cannot be evaluated
12465     */
12466    public function evaluateDirectly(Expr $expr)
12467    {
12468        return $this->evaluate($expr);
12469    }
12470    private function evaluate(Expr $expr)
12471    {
12472        if ($expr instanceof Scalar\LNumber || $expr instanceof Scalar\DNumber || $expr instanceof Scalar\String_) {
12473            return $expr->value;
12474        }
12475        if ($expr instanceof Expr\Array_) {
12476            return $this->evaluateArray($expr);
12477        }
12478        // Unary operators
12479        if ($expr instanceof Expr\UnaryPlus) {
12480            return +$this->evaluate($expr->expr);
12481        }
12482        if ($expr instanceof Expr\UnaryMinus) {
12483            return -$this->evaluate($expr->expr);
12484        }
12485        if ($expr instanceof Expr\BooleanNot) {
12486            return !$this->evaluate($expr->expr);
12487        }
12488        if ($expr instanceof Expr\BitwiseNot) {
12489            return ~$this->evaluate($expr->expr);
12490        }
12491        if ($expr instanceof Expr\BinaryOp) {
12492            return $this->evaluateBinaryOp($expr);
12493        }
12494        if ($expr instanceof Expr\Ternary) {
12495            return $this->evaluateTernary($expr);
12496        }
12497        if ($expr instanceof Expr\ArrayDimFetch && null !== $expr->dim) {
12498            return $this->evaluate($expr->var)[$this->evaluate($expr->dim)];
12499        }
12500        if ($expr instanceof Expr\ConstFetch) {
12501            return $this->evaluateConstFetch($expr);
12502        }
12503        return ($this->fallbackEvaluator)($expr);
12504    }
12505    private function evaluateArray(Expr\Array_ $expr)
12506    {
12507        $array = [];
12508        foreach ($expr->items as $item) {
12509            if (null !== $item->key) {
12510                $array[$this->evaluate($item->key)] = $this->evaluate($item->value);
12511            } else {
12512                $array[] = $this->evaluate($item->value);
12513            }
12514        }
12515        return $array;
12516    }
12517    private function evaluateTernary(Expr\Ternary $expr)
12518    {
12519        if (null === $expr->if) {
12520            return $this->evaluate($expr->cond) ?: $this->evaluate($expr->else);
12521        }
12522        return $this->evaluate($expr->cond) ? $this->evaluate($expr->if) : $this->evaluate($expr->else);
12523    }
12524    private function evaluateBinaryOp(Expr\BinaryOp $expr)
12525    {
12526        if ($expr instanceof Expr\BinaryOp\Coalesce && $expr->left instanceof Expr\ArrayDimFetch) {
12527            // This needs to be special cased to respect BP_VAR_IS fetch semantics
12528            return $this->evaluate($expr->left->var)[$this->evaluate($expr->left->dim)] ?? $this->evaluate($expr->right);
12529        }
12530        // The evaluate() calls are repeated in each branch, because some of the operators are
12531        // short-circuiting and evaluating the RHS in advance may be illegal in that case
12532        $l = $expr->left;
12533        $r = $expr->right;
12534        switch ($expr->getOperatorSigil()) {
12535            case '&':
12536                return $this->evaluate($l) & $this->evaluate($r);
12537            case '|':
12538                return $this->evaluate($l) | $this->evaluate($r);
12539            case '^':
12540                return $this->evaluate($l) ^ $this->evaluate($r);
12541            case '&&':
12542                return $this->evaluate($l) && $this->evaluate($r);
12543            case '||':
12544                return $this->evaluate($l) || $this->evaluate($r);
12545            case '??':
12546                return $this->evaluate($l) ?? $this->evaluate($r);
12547            case '.':
12548                return $this->evaluate($l) . $this->evaluate($r);
12549            case '/':
12550                return $this->evaluate($l) / $this->evaluate($r);
12551            case '==':
12552                return $this->evaluate($l) == $this->evaluate($r);
12553            case '>':
12554                return $this->evaluate($l) > $this->evaluate($r);
12555            case '>=':
12556                return $this->evaluate($l) >= $this->evaluate($r);
12557            case '===':
12558                return $this->evaluate($l) === $this->evaluate($r);
12559            case 'and':
12560                return $this->evaluate($l) and $this->evaluate($r);
12561            case 'or':
12562                return $this->evaluate($l) or $this->evaluate($r);
12563            case 'xor':
12564                return $this->evaluate($l) xor $this->evaluate($r);
12565            case '-':
12566                return $this->evaluate($l) - $this->evaluate($r);
12567            case '%':
12568                return $this->evaluate($l) % $this->evaluate($r);
12569            case '*':
12570                return $this->evaluate($l) * $this->evaluate($r);
12571            case '!=':
12572                return $this->evaluate($l) != $this->evaluate($r);
12573            case '!==':
12574                return $this->evaluate($l) !== $this->evaluate($r);
12575            case '+':
12576                return $this->evaluate($l) + $this->evaluate($r);
12577            case '**':
12578                return $this->evaluate($l) ** $this->evaluate($r);
12579            case '<<':
12580                return $this->evaluate($l) << $this->evaluate($r);
12581            case '>>':
12582                return $this->evaluate($l) >> $this->evaluate($r);
12583            case '<':
12584                return $this->evaluate($l) < $this->evaluate($r);
12585            case '<=':
12586                return $this->evaluate($l) <= $this->evaluate($r);
12587            case '<=>':
12588                return $this->evaluate($l) <=> $this->evaluate($r);
12589        }
12590        throw new \Exception('Should not happen');
12591    }
12592    private function evaluateConstFetch(Expr\ConstFetch $expr)
12593    {
12594        $name = $expr->name->toLowerString();
12595        switch ($name) {
12596            case 'null':
12597                return null;
12598            case 'false':
12599                return \false;
12600            case 'true':
12601                return \true;
12602        }
12603        return ($this->fallbackEvaluator)($expr);
12604    }
12605}
12606<?php
12607
12608declare (strict_types=1);
12609namespace PHPUnit\PhpParser\Lexer\TokenEmulator;
12610
12611use PHPUnit\PhpParser\Lexer\Emulative;
12612class ExplicitOctalEmulator extends TokenEmulator
12613{
12614    public function getPhpVersion() : string
12615    {
12616        return Emulative::PHP_8_1;
12617    }
12618    public function isEmulationNeeded(string $code) : bool
12619    {
12620        return \strpos($code, '0o') !== \false || \strpos($code, '0O') !== \false;
12621    }
12622    public function emulate(string $code, array $tokens) : array
12623    {
12624        for ($i = 0, $c = \count($tokens); $i < $c; ++$i) {
12625            if ($tokens[$i][0] == \T_LNUMBER && $tokens[$i][1] === '0' && isset($tokens[$i + 1]) && $tokens[$i + 1][0] == \T_STRING && \preg_match('/[oO][0-7]+(?:_[0-7]+)*/', $tokens[$i + 1][1])) {
12626                $tokenKind = $this->resolveIntegerOrFloatToken($tokens[$i + 1][1]);
12627                \array_splice($tokens, $i, 2, [[$tokenKind, '0' . $tokens[$i + 1][1], $tokens[$i][2]]]);
12628                $c--;
12629            }
12630        }
12631        return $tokens;
12632    }
12633    private function resolveIntegerOrFloatToken(string $str) : int
12634    {
12635        $str = \substr($str, 1);
12636        $str = \str_replace('_', '', $str);
12637        $num = \octdec($str);
12638        return \is_float($num) ? \T_DNUMBER : \T_LNUMBER;
12639    }
12640    public function reverseEmulate(string $code, array $tokens) : array
12641    {
12642        // Explicit octals were not legal code previously, don't bother.
12643        return $tokens;
12644    }
12645}
12646<?php
12647
12648declare (strict_types=1);
12649namespace PHPUnit\PhpParser\Lexer\TokenEmulator;
12650
12651use PHPUnit\PhpParser\Lexer\Emulative;
12652final class EnumTokenEmulator extends KeywordEmulator
12653{
12654    public function getPhpVersion() : string
12655    {
12656        return Emulative::PHP_8_1;
12657    }
12658    public function getKeywordString() : string
12659    {
12660        return 'enum';
12661    }
12662    public function getKeywordToken() : int
12663    {
12664        return \T_ENUM;
12665    }
12666    protected function isKeywordContext(array $tokens, int $pos) : bool
12667    {
12668        return parent::isKeywordContext($tokens, $pos) && isset($tokens[$pos + 2]) && $tokens[$pos + 1][0] === \T_WHITESPACE && $tokens[$pos + 2][0] === \T_STRING;
12669    }
12670}
12671<?php
12672
12673declare (strict_types=1);
12674namespace PHPUnit\PhpParser\Lexer\TokenEmulator;
12675
12676use PHPUnit\PhpParser\Lexer\Emulative;
12677final class CoaleseEqualTokenEmulator extends TokenEmulator
12678{
12679    public function getPhpVersion() : string
12680    {
12681        return Emulative::PHP_7_4;
12682    }
12683    public function isEmulationNeeded(string $code) : bool
12684    {
12685        return \strpos($code, '??=') !== \false;
12686    }
12687    public function emulate(string $code, array $tokens) : array
12688    {
12689        // We need to manually iterate and manage a count because we'll change
12690        // the tokens array on the way
12691        $line = 1;
12692        for ($i = 0, $c = \count($tokens); $i < $c; ++$i) {
12693            if (isset($tokens[$i + 1])) {
12694                if ($tokens[$i][0] === \T_COALESCE && $tokens[$i + 1] === '=') {
12695                    \array_splice($tokens, $i, 2, [[\T_COALESCE_EQUAL, '??=', $line]]);
12696                    $c--;
12697                    continue;
12698                }
12699            }
12700            if (\is_array($tokens[$i])) {
12701                $line += \substr_count($tokens[$i][1], "\n");
12702            }
12703        }
12704        return $tokens;
12705    }
12706    public function reverseEmulate(string $code, array $tokens) : array
12707    {
12708        // ??= was not valid code previously, don't bother.
12709        return $tokens;
12710    }
12711}
12712<?php
12713
12714declare (strict_types=1);
12715namespace PHPUnit\PhpParser\Lexer\TokenEmulator;
12716
12717/** @internal */
12718abstract class TokenEmulator
12719{
12720    public abstract function getPhpVersion() : string;
12721    public abstract function isEmulationNeeded(string $code) : bool;
12722    /**
12723     * @return array Modified Tokens
12724     */
12725    public abstract function emulate(string $code, array $tokens) : array;
12726    /**
12727     * @return array Modified Tokens
12728     */
12729    public abstract function reverseEmulate(string $code, array $tokens) : array;
12730    public function preprocessCode(string $code, array &$patches) : string
12731    {
12732        return $code;
12733    }
12734}
12735<?php
12736
12737declare (strict_types=1);
12738namespace PHPUnit\PhpParser\Lexer\TokenEmulator;
12739
12740use PHPUnit\PhpParser\Lexer\Emulative;
12741final class AttributeEmulator extends TokenEmulator
12742{
12743    public function getPhpVersion() : string
12744    {
12745        return Emulative::PHP_8_0;
12746    }
12747    public function isEmulationNeeded(string $code) : bool
12748    {
12749        return \strpos($code, '#[') !== \false;
12750    }
12751    public function emulate(string $code, array $tokens) : array
12752    {
12753        // We need to manually iterate and manage a count because we'll change
12754        // the tokens array on the way.
12755        $line = 1;
12756        for ($i = 0, $c = \count($tokens); $i < $c; ++$i) {
12757            if ($tokens[$i] === '#' && isset($tokens[$i + 1]) && $tokens[$i + 1] === '[') {
12758                \array_splice($tokens, $i, 2, [[\T_ATTRIBUTE, '#[', $line]]);
12759                $c--;
12760                continue;
12761            }
12762            if (\is_array($tokens[$i])) {
12763                $line += \substr_count($tokens[$i][1], "\n");
12764            }
12765        }
12766        return $tokens;
12767    }
12768    public function reverseEmulate(string $code, array $tokens) : array
12769    {
12770        // TODO
12771        return $tokens;
12772    }
12773    public function preprocessCode(string $code, array &$patches) : string
12774    {
12775        $pos = 0;
12776        while (\false !== ($pos = \strpos($code, '#[', $pos))) {
12777            // Replace #[ with %[
12778            $code[$pos] = '%';
12779            $patches[] = [$pos, 'replace', '#'];
12780            $pos += 2;
12781        }
12782        return $code;
12783    }
12784}
12785<?php
12786
12787declare (strict_types=1);
12788namespace PHPUnit\PhpParser\Lexer\TokenEmulator;
12789
12790/**
12791 * Reverses emulation direction of the inner emulator.
12792 */
12793final class ReverseEmulator extends TokenEmulator
12794{
12795    /** @var TokenEmulator Inner emulator */
12796    private $emulator;
12797    public function __construct(TokenEmulator $emulator)
12798    {
12799        $this->emulator = $emulator;
12800    }
12801    public function getPhpVersion() : string
12802    {
12803        return $this->emulator->getPhpVersion();
12804    }
12805    public function isEmulationNeeded(string $code) : bool
12806    {
12807        return $this->emulator->isEmulationNeeded($code);
12808    }
12809    public function emulate(string $code, array $tokens) : array
12810    {
12811        return $this->emulator->reverseEmulate($code, $tokens);
12812    }
12813    public function reverseEmulate(string $code, array $tokens) : array
12814    {
12815        return $this->emulator->emulate($code, $tokens);
12816    }
12817    public function preprocessCode(string $code, array &$patches) : string
12818    {
12819        return $code;
12820    }
12821}
12822<?php
12823
12824declare (strict_types=1);
12825namespace PHPUnit\PhpParser\Lexer\TokenEmulator;
12826
12827use PHPUnit\PhpParser\Lexer\Emulative;
12828final class FnTokenEmulator extends KeywordEmulator
12829{
12830    public function getPhpVersion() : string
12831    {
12832        return Emulative::PHP_7_4;
12833    }
12834    public function getKeywordString() : string
12835    {
12836        return 'fn';
12837    }
12838    public function getKeywordToken() : int
12839    {
12840        return \T_FN;
12841    }
12842}
12843<?php
12844
12845declare (strict_types=1);
12846namespace PHPUnit\PhpParser\Lexer\TokenEmulator;
12847
12848use PHPUnit\PhpParser\Lexer\Emulative;
12849final class ReadonlyTokenEmulator extends KeywordEmulator
12850{
12851    public function getPhpVersion() : string
12852    {
12853        return Emulative::PHP_8_1;
12854    }
12855    public function getKeywordString() : string
12856    {
12857        return 'readonly';
12858    }
12859    public function getKeywordToken() : int
12860    {
12861        return \T_READONLY;
12862    }
12863}
12864<?php
12865
12866declare (strict_types=1);
12867namespace PHPUnit\PhpParser\Lexer\TokenEmulator;
12868
12869use PHPUnit\PhpParser\Lexer\Emulative;
12870final class MatchTokenEmulator extends KeywordEmulator
12871{
12872    public function getPhpVersion() : string
12873    {
12874        return Emulative::PHP_8_0;
12875    }
12876    public function getKeywordString() : string
12877    {
12878        return 'match';
12879    }
12880    public function getKeywordToken() : int
12881    {
12882        return \T_MATCH;
12883    }
12884}
12885<?php
12886
12887declare (strict_types=1);
12888namespace PHPUnit\PhpParser\Lexer\TokenEmulator;
12889
12890use PHPUnit\PhpParser\Lexer\Emulative;
12891final class FlexibleDocStringEmulator extends TokenEmulator
12892{
12893    const FLEXIBLE_DOC_STRING_REGEX = <<<'REGEX'
12894/<<<[ \t]*(['"]?)([a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*)\1\r?\n
12895(?:.*\r?\n)*?
12896(?<indentation>\h*)\2(?![a-zA-Z0-9_\x80-\xff])(?<separator>(?:;?[\r\n])?)/x
12897REGEX;
12898    public function getPhpVersion() : string
12899    {
12900        return Emulative::PHP_7_3;
12901    }
12902    public function isEmulationNeeded(string $code) : bool
12903    {
12904        return \strpos($code, '<<<') !== \false;
12905    }
12906    public function emulate(string $code, array $tokens) : array
12907    {
12908        // Handled by preprocessing + fixup.
12909        return $tokens;
12910    }
12911    public function reverseEmulate(string $code, array $tokens) : array
12912    {
12913        // Not supported.
12914        return $tokens;
12915    }
12916    public function preprocessCode(string $code, array &$patches) : string
12917    {
12918        if (!\preg_match_all(self::FLEXIBLE_DOC_STRING_REGEX, $code, $matches, \PREG_SET_ORDER | \PREG_OFFSET_CAPTURE)) {
12919            // No heredoc/nowdoc found
12920            return $code;
12921        }
12922        // Keep track of how much we need to adjust string offsets due to the modifications we
12923        // already made
12924        $posDelta = 0;
12925        foreach ($matches as $match) {
12926            $indentation = $match['indentation'][0];
12927            $indentationStart = $match['indentation'][1];
12928            $separator = $match['separator'][0];
12929            $separatorStart = $match['separator'][1];
12930            if ($indentation === '' && $separator !== '') {
12931                // Ordinary heredoc/nowdoc
12932                continue;
12933            }
12934            if ($indentation !== '') {
12935                // Remove indentation
12936                $indentationLen = \strlen($indentation);
12937                $code = \substr_replace($code, '', $indentationStart + $posDelta, $indentationLen);
12938                $patches[] = [$indentationStart + $posDelta, 'add', $indentation];
12939                $posDelta -= $indentationLen;
12940            }
12941            if ($separator === '') {
12942                // Insert newline as separator
12943                $code = \substr_replace($code, "\n", $separatorStart + $posDelta, 0);
12944                $patches[] = [$separatorStart + $posDelta, 'remove', "\n"];
12945                $posDelta += 1;
12946            }
12947        }
12948        return $code;
12949    }
12950}
12951<?php
12952
12953declare (strict_types=1);
12954namespace PHPUnit\PhpParser\Lexer\TokenEmulator;
12955
12956use PHPUnit\PhpParser\Lexer\Emulative;
12957final class NumericLiteralSeparatorEmulator extends TokenEmulator
12958{
12959    const BIN = '(?:0b[01]+(?:_[01]+)*)';
12960    const HEX = '(?:0x[0-9a-f]+(?:_[0-9a-f]+)*)';
12961    const DEC = '(?:[0-9]+(?:_[0-9]+)*)';
12962    const SIMPLE_FLOAT = '(?:' . self::DEC . '\\.' . self::DEC . '?|\\.' . self::DEC . ')';
12963    const EXP = '(?:e[+-]?' . self::DEC . ')';
12964    const FLOAT = '(?:' . self::SIMPLE_FLOAT . self::EXP . '?|' . self::DEC . self::EXP . ')';
12965    const NUMBER = '~' . self::FLOAT . '|' . self::BIN . '|' . self::HEX . '|' . self::DEC . '~iA';
12966    public function getPhpVersion() : string
12967    {
12968        return Emulative::PHP_7_4;
12969    }
12970    public function isEmulationNeeded(string $code) : bool
12971    {
12972        return \preg_match('~[0-9]_[0-9]~', $code) || \preg_match('~0x[0-9a-f]+_[0-9a-f]~i', $code);
12973    }
12974    public function emulate(string $code, array $tokens) : array
12975    {
12976        // We need to manually iterate and manage a count because we'll change
12977        // the tokens array on the way
12978        $codeOffset = 0;
12979        for ($i = 0, $c = \count($tokens); $i < $c; ++$i) {
12980            $token = $tokens[$i];
12981            $tokenLen = \strlen(\is_array($token) ? $token[1] : $token);
12982            if ($token[0] !== \T_LNUMBER && $token[0] !== \T_DNUMBER) {
12983                $codeOffset += $tokenLen;
12984                continue;
12985            }
12986            $res = \preg_match(self::NUMBER, $code, $matches, 0, $codeOffset);
12987            \assert($res, "No number at number token position");
12988            $match = $matches[0];
12989            $matchLen = \strlen($match);
12990            if ($matchLen === $tokenLen) {
12991                // Original token already holds the full number.
12992                $codeOffset += $tokenLen;
12993                continue;
12994            }
12995            $tokenKind = $this->resolveIntegerOrFloatToken($match);
12996            $newTokens = [[$tokenKind, $match, $token[2]]];
12997            $numTokens = 1;
12998            $len = $tokenLen;
12999            while ($matchLen > $len) {
13000                $nextToken = $tokens[$i + $numTokens];
13001                $nextTokenText = \is_array($nextToken) ? $nextToken[1] : $nextToken;
13002                $nextTokenLen = \strlen($nextTokenText);
13003                $numTokens++;
13004                if ($matchLen < $len + $nextTokenLen) {
13005                    // Split trailing characters into a partial token.
13006                    \assert(\is_array($nextToken), "Partial token should be an array token");
13007                    $partialText = \substr($nextTokenText, $matchLen - $len);
13008                    $newTokens[] = [$nextToken[0], $partialText, $nextToken[2]];
13009                    break;
13010                }
13011                $len += $nextTokenLen;
13012            }
13013            \array_splice($tokens, $i, $numTokens, $newTokens);
13014            $c -= $numTokens - \count($newTokens);
13015            $codeOffset += $matchLen;
13016        }
13017        return $tokens;
13018    }
13019    private function resolveIntegerOrFloatToken(string $str) : int
13020    {
13021        $str = \str_replace('_', '', $str);
13022        if (\stripos($str, '0b') === 0) {
13023            $num = \bindec($str);
13024        } elseif (\stripos($str, '0x') === 0) {
13025            $num = \hexdec($str);
13026        } elseif (\stripos($str, '0') === 0 && \ctype_digit($str)) {
13027            $num = \octdec($str);
13028        } else {
13029            $num = +$str;
13030        }
13031        return \is_float($num) ? \T_DNUMBER : \T_LNUMBER;
13032    }
13033    public function reverseEmulate(string $code, array $tokens) : array
13034    {
13035        // Numeric separators were not legal code previously, don't bother.
13036        return $tokens;
13037    }
13038}
13039<?php
13040
13041declare (strict_types=1);
13042namespace PHPUnit\PhpParser\Lexer\TokenEmulator;
13043
13044abstract class KeywordEmulator extends TokenEmulator
13045{
13046    abstract function getKeywordString() : string;
13047    abstract function getKeywordToken() : int;
13048    public function isEmulationNeeded(string $code) : bool
13049    {
13050        return \strpos(\strtolower($code), $this->getKeywordString()) !== \false;
13051    }
13052    protected function isKeywordContext(array $tokens, int $pos) : bool
13053    {
13054        $previousNonSpaceToken = $this->getPreviousNonSpaceToken($tokens, $pos);
13055        return $previousNonSpaceToken === null || $previousNonSpaceToken[0] !== \T_OBJECT_OPERATOR;
13056    }
13057    public function emulate(string $code, array $tokens) : array
13058    {
13059        $keywordString = $this->getKeywordString();
13060        foreach ($tokens as $i => $token) {
13061            if ($token[0] === \T_STRING && \strtolower($token[1]) === $keywordString && $this->isKeywordContext($tokens, $i)) {
13062                $tokens[$i][0] = $this->getKeywordToken();
13063            }
13064        }
13065        return $tokens;
13066    }
13067    /**
13068     * @param mixed[] $tokens
13069     * @return mixed[]|null
13070     */
13071    private function getPreviousNonSpaceToken(array $tokens, int $start)
13072    {
13073        for ($i = $start - 1; $i >= 0; --$i) {
13074            if ($tokens[$i][0] === \T_WHITESPACE) {
13075                continue;
13076            }
13077            return $tokens[$i];
13078        }
13079        return null;
13080    }
13081    public function reverseEmulate(string $code, array $tokens) : array
13082    {
13083        $keywordToken = $this->getKeywordToken();
13084        foreach ($tokens as $i => $token) {
13085            if ($token[0] === $keywordToken) {
13086                $tokens[$i][0] = \T_STRING;
13087            }
13088        }
13089        return $tokens;
13090    }
13091}
13092<?php
13093
13094declare (strict_types=1);
13095namespace PHPUnit\PhpParser\Lexer\TokenEmulator;
13096
13097use PHPUnit\PhpParser\Lexer\Emulative;
13098final class NullsafeTokenEmulator extends TokenEmulator
13099{
13100    public function getPhpVersion() : string
13101    {
13102        return Emulative::PHP_8_0;
13103    }
13104    public function isEmulationNeeded(string $code) : bool
13105    {
13106        return \strpos($code, '?->') !== \false;
13107    }
13108    public function emulate(string $code, array $tokens) : array
13109    {
13110        // We need to manually iterate and manage a count because we'll change
13111        // the tokens array on the way
13112        $line = 1;
13113        for ($i = 0, $c = \count($tokens); $i < $c; ++$i) {
13114            if ($tokens[$i] === '?' && isset($tokens[$i + 1]) && $tokens[$i + 1][0] === \T_OBJECT_OPERATOR) {
13115                \array_splice($tokens, $i, 2, [[\T_NULLSAFE_OBJECT_OPERATOR, '?->', $line]]);
13116                $c--;
13117                continue;
13118            }
13119            // Handle ?-> inside encapsed string.
13120            if ($tokens[$i][0] === \T_ENCAPSED_AND_WHITESPACE && isset($tokens[$i - 1]) && $tokens[$i - 1][0] === \T_VARIABLE && \preg_match('/^\\?->([a-zA-Z_\\x80-\\xff][a-zA-Z0-9_\\x80-\\xff]*)/', $tokens[$i][1], $matches)) {
13121                $replacement = [[\T_NULLSAFE_OBJECT_OPERATOR, '?->', $line], [\T_STRING, $matches[1], $line]];
13122                if (\strlen($matches[0]) !== \strlen($tokens[$i][1])) {
13123                    $replacement[] = [\T_ENCAPSED_AND_WHITESPACE, \substr($tokens[$i][1], \strlen($matches[0])), $line];
13124                }
13125                \array_splice($tokens, $i, 1, $replacement);
13126                $c += \count($replacement) - 1;
13127                continue;
13128            }
13129            if (\is_array($tokens[$i])) {
13130                $line += \substr_count($tokens[$i][1], "\n");
13131            }
13132        }
13133        return $tokens;
13134    }
13135    public function reverseEmulate(string $code, array $tokens) : array
13136    {
13137        // ?-> was not valid code previously, don't bother.
13138        return $tokens;
13139    }
13140}
13141<?php
13142
13143declare (strict_types=1);
13144namespace PHPUnit\PhpParser\Lexer;
13145
13146use PHPUnit\PhpParser\Error;
13147use PHPUnit\PhpParser\ErrorHandler;
13148use PHPUnit\PhpParser\Lexer;
13149use PHPUnit\PhpParser\Lexer\TokenEmulator\AttributeEmulator;
13150use PHPUnit\PhpParser\Lexer\TokenEmulator\EnumTokenEmulator;
13151use PHPUnit\PhpParser\Lexer\TokenEmulator\CoaleseEqualTokenEmulator;
13152use PHPUnit\PhpParser\Lexer\TokenEmulator\ExplicitOctalEmulator;
13153use PHPUnit\PhpParser\Lexer\TokenEmulator\FlexibleDocStringEmulator;
13154use PHPUnit\PhpParser\Lexer\TokenEmulator\FnTokenEmulator;
13155use PHPUnit\PhpParser\Lexer\TokenEmulator\MatchTokenEmulator;
13156use PHPUnit\PhpParser\Lexer\TokenEmulator\NullsafeTokenEmulator;
13157use PHPUnit\PhpParser\Lexer\TokenEmulator\NumericLiteralSeparatorEmulator;
13158use PHPUnit\PhpParser\Lexer\TokenEmulator\ReadonlyTokenEmulator;
13159use PHPUnit\PhpParser\Lexer\TokenEmulator\ReverseEmulator;
13160use PHPUnit\PhpParser\Lexer\TokenEmulator\TokenEmulator;
13161class Emulative extends Lexer
13162{
13163    const PHP_7_3 = '7.3dev';
13164    const PHP_7_4 = '7.4dev';
13165    const PHP_8_0 = '8.0dev';
13166    const PHP_8_1 = '8.1dev';
13167    /** @var mixed[] Patches used to reverse changes introduced in the code */
13168    private $patches = [];
13169    /** @var TokenEmulator[] */
13170    private $emulators = [];
13171    /** @var string */
13172    private $targetPhpVersion;
13173    /**
13174     * @param mixed[] $options Lexer options. In addition to the usual options,
13175     *                         accepts a 'phpVersion' string that specifies the
13176     *                         version to emulated. Defaults to newest supported.
13177     */
13178    public function __construct(array $options = [])
13179    {
13180        $this->targetPhpVersion = $options['phpVersion'] ?? Emulative::PHP_8_1;
13181        unset($options['phpVersion']);
13182        parent::__construct($options);
13183        $emulators = [new FlexibleDocStringEmulator(), new FnTokenEmulator(), new MatchTokenEmulator(), new CoaleseEqualTokenEmulator(), new NumericLiteralSeparatorEmulator(), new NullsafeTokenEmulator(), new AttributeEmulator(), new EnumTokenEmulator(), new ReadonlyTokenEmulator(), new ExplicitOctalEmulator()];
13184        // Collect emulators that are relevant for the PHP version we're running
13185        // and the PHP version we're targeting for emulation.
13186        foreach ($emulators as $emulator) {
13187            $emulatorPhpVersion = $emulator->getPhpVersion();
13188            if ($this->isForwardEmulationNeeded($emulatorPhpVersion)) {
13189                $this->emulators[] = $emulator;
13190            } else {
13191                if ($this->isReverseEmulationNeeded($emulatorPhpVersion)) {
13192                    $this->emulators[] = new ReverseEmulator($emulator);
13193                }
13194            }
13195        }
13196    }
13197    public function startLexing(string $code, ErrorHandler $errorHandler = null)
13198    {
13199        $emulators = \array_filter($this->emulators, function ($emulator) use($code) {
13200            return $emulator->isEmulationNeeded($code);
13201        });
13202        if (empty($emulators)) {
13203            // Nothing to emulate, yay
13204            parent::startLexing($code, $errorHandler);
13205            return;
13206        }
13207        $this->patches = [];
13208        foreach ($emulators as $emulator) {
13209            $code = $emulator->preprocessCode($code, $this->patches);
13210        }
13211        $collector = new ErrorHandler\Collecting();
13212        parent::startLexing($code, $collector);
13213        $this->sortPatches();
13214        $this->fixupTokens();
13215        $errors = $collector->getErrors();
13216        if (!empty($errors)) {
13217            $this->fixupErrors($errors);
13218            foreach ($errors as $error) {
13219                $errorHandler->handleError($error);
13220            }
13221        }
13222        foreach ($emulators as $emulator) {
13223            $this->tokens = $emulator->emulate($code, $this->tokens);
13224        }
13225    }
13226    private function isForwardEmulationNeeded(string $emulatorPhpVersion) : bool
13227    {
13228        return \version_compare(\PHP_VERSION, $emulatorPhpVersion, '<') && \version_compare($this->targetPhpVersion, $emulatorPhpVersion, '>=');
13229    }
13230    private function isReverseEmulationNeeded(string $emulatorPhpVersion) : bool
13231    {
13232        return \version_compare(\PHP_VERSION, $emulatorPhpVersion, '>=') && \version_compare($this->targetPhpVersion, $emulatorPhpVersion, '<');
13233    }
13234    private function sortPatches()
13235    {
13236        // Patches may be contributed by different emulators.
13237        // Make sure they are sorted by increasing patch position.
13238        \usort($this->patches, function ($p1, $p2) {
13239            return $p1[0] <=> $p2[0];
13240        });
13241    }
13242    private function fixupTokens()
13243    {
13244        if (\count($this->patches) === 0) {
13245            return;
13246        }
13247        // Load first patch
13248        $patchIdx = 0;
13249        list($patchPos, $patchType, $patchText) = $this->patches[$patchIdx];
13250        // We use a manual loop over the tokens, because we modify the array on the fly
13251        $pos = 0;
13252        for ($i = 0, $c = \count($this->tokens); $i < $c; $i++) {
13253            $token = $this->tokens[$i];
13254            if (\is_string($token)) {
13255                if ($patchPos === $pos) {
13256                    // Only support replacement for string tokens.
13257                    \assert($patchType === 'replace');
13258                    $this->tokens[$i] = $patchText;
13259                    // Fetch the next patch
13260                    $patchIdx++;
13261                    if ($patchIdx >= \count($this->patches)) {
13262                        // No more patches, we're done
13263                        return;
13264                    }
13265                    list($patchPos, $patchType, $patchText) = $this->patches[$patchIdx];
13266                }
13267                $pos += \strlen($token);
13268                continue;
13269            }
13270            $len = \strlen($token[1]);
13271            $posDelta = 0;
13272            while ($patchPos >= $pos && $patchPos < $pos + $len) {
13273                $patchTextLen = \strlen($patchText);
13274                if ($patchType === 'remove') {
13275                    if ($patchPos === $pos && $patchTextLen === $len) {
13276                        // Remove token entirely
13277                        \array_splice($this->tokens, $i, 1, []);
13278                        $i--;
13279                        $c--;
13280                    } else {
13281                        // Remove from token string
13282                        $this->tokens[$i][1] = \substr_replace($token[1], '', $patchPos - $pos + $posDelta, $patchTextLen);
13283                        $posDelta -= $patchTextLen;
13284                    }
13285                } elseif ($patchType === 'add') {
13286                    // Insert into the token string
13287                    $this->tokens[$i][1] = \substr_replace($token[1], $patchText, $patchPos - $pos + $posDelta, 0);
13288                    $posDelta += $patchTextLen;
13289                } else {
13290                    if ($patchType === 'replace') {
13291                        // Replace inside the token string
13292                        $this->tokens[$i][1] = \substr_replace($token[1], $patchText, $patchPos - $pos + $posDelta, $patchTextLen);
13293                    } else {
13294                        \assert(\false);
13295                    }
13296                }
13297                // Fetch the next patch
13298                $patchIdx++;
13299                if ($patchIdx >= \count($this->patches)) {
13300                    // No more patches, we're done
13301                    return;
13302                }
13303                list($patchPos, $patchType, $patchText) = $this->patches[$patchIdx];
13304                // Multiple patches may apply to the same token. Reload the current one to check
13305                // If the new patch applies
13306                $token = $this->tokens[$i];
13307            }
13308            $pos += $len;
13309        }
13310        // A patch did not apply
13311        \assert(\false);
13312    }
13313    /**
13314     * Fixup line and position information in errors.
13315     *
13316     * @param Error[] $errors
13317     */
13318    private function fixupErrors(array $errors)
13319    {
13320        foreach ($errors as $error) {
13321            $attrs = $error->getAttributes();
13322            $posDelta = 0;
13323            $lineDelta = 0;
13324            foreach ($this->patches as $patch) {
13325                list($patchPos, $patchType, $patchText) = $patch;
13326                if ($patchPos >= $attrs['startFilePos']) {
13327                    // No longer relevant
13328                    break;
13329                }
13330                if ($patchType === 'add') {
13331                    $posDelta += \strlen($patchText);
13332                    $lineDelta += \substr_count($patchText, "\n");
13333                } else {
13334                    if ($patchType === 'remove') {
13335                        $posDelta -= \strlen($patchText);
13336                        $lineDelta -= \substr_count($patchText, "\n");
13337                    }
13338                }
13339            }
13340            $attrs['startFilePos'] += $posDelta;
13341            $attrs['endFilePos'] += $posDelta;
13342            $attrs['startLine'] += $lineDelta;
13343            $attrs['endLine'] += $lineDelta;
13344            $error->setAttributes($attrs);
13345        }
13346    }
13347}
13348<?php
13349
13350declare (strict_types=1);
13351namespace PHPUnit\PhpParser;
13352
13353use PHPUnit\PhpParser\Node\Name;
13354use PHPUnit\PhpParser\Node\Name\FullyQualified;
13355use PHPUnit\PhpParser\Node\Stmt;
13356class NameContext
13357{
13358    /** @var null|Name Current namespace */
13359    protected $namespace;
13360    /** @var Name[][] Map of format [aliasType => [aliasName => originalName]] */
13361    protected $aliases = [];
13362    /** @var Name[][] Same as $aliases but preserving original case */
13363    protected $origAliases = [];
13364    /** @var ErrorHandler Error handler */
13365    protected $errorHandler;
13366    /**
13367     * Create a name context.
13368     *
13369     * @param ErrorHandler $errorHandler Error handling used to report errors
13370     */
13371    public function __construct(ErrorHandler $errorHandler)
13372    {
13373        $this->errorHandler = $errorHandler;
13374    }
13375    /**
13376     * Start a new namespace.
13377     *
13378     * This also resets the alias table.
13379     *
13380     * @param Name|null $namespace Null is the global namespace
13381     */
13382    public function startNamespace(Name $namespace = null)
13383    {
13384        $this->namespace = $namespace;
13385        $this->origAliases = $this->aliases = [Stmt\Use_::TYPE_NORMAL => [], Stmt\Use_::TYPE_FUNCTION => [], Stmt\Use_::TYPE_CONSTANT => []];
13386    }
13387    /**
13388     * Add an alias / import.
13389     *
13390     * @param Name   $name        Original name
13391     * @param string $aliasName   Aliased name
13392     * @param int    $type        One of Stmt\Use_::TYPE_*
13393     * @param array  $errorAttrs Attributes to use to report an error
13394     */
13395    public function addAlias(Name $name, string $aliasName, int $type, array $errorAttrs = [])
13396    {
13397        // Constant names are case sensitive, everything else case insensitive
13398        if ($type === Stmt\Use_::TYPE_CONSTANT) {
13399            $aliasLookupName = $aliasName;
13400        } else {
13401            $aliasLookupName = \strtolower($aliasName);
13402        }
13403        if (isset($this->aliases[$type][$aliasLookupName])) {
13404            $typeStringMap = [Stmt\Use_::TYPE_NORMAL => '', Stmt\Use_::TYPE_FUNCTION => 'function ', Stmt\Use_::TYPE_CONSTANT => 'const '];
13405            $this->errorHandler->handleError(new Error(\sprintf('Cannot use %s%s as %s because the name is already in use', $typeStringMap[$type], $name, $aliasName), $errorAttrs));
13406            return;
13407        }
13408        $this->aliases[$type][$aliasLookupName] = $name;
13409        $this->origAliases[$type][$aliasName] = $name;
13410    }
13411    /**
13412     * Get current namespace.
13413     *
13414     * @return null|Name Namespace (or null if global namespace)
13415     */
13416    public function getNamespace()
13417    {
13418        return $this->namespace;
13419    }
13420    /**
13421     * Get resolved name.
13422     *
13423     * @param Name $name Name to resolve
13424     * @param int  $type One of Stmt\Use_::TYPE_{FUNCTION|CONSTANT}
13425     *
13426     * @return null|Name Resolved name, or null if static resolution is not possible
13427     */
13428    public function getResolvedName(Name $name, int $type)
13429    {
13430        // don't resolve special class names
13431        if ($type === Stmt\Use_::TYPE_NORMAL && $name->isSpecialClassName()) {
13432            if (!$name->isUnqualified()) {
13433                $this->errorHandler->handleError(new Error(\sprintf("'\\%s' is an invalid class name", $name->toString()), $name->getAttributes()));
13434            }
13435            return $name;
13436        }
13437        // fully qualified names are already resolved
13438        if ($name->isFullyQualified()) {
13439            return $name;
13440        }
13441        // Try to resolve aliases
13442        if (null !== ($resolvedName = $this->resolveAlias($name, $type))) {
13443            return $resolvedName;
13444        }
13445        if ($type !== Stmt\Use_::TYPE_NORMAL && $name->isUnqualified()) {
13446            if (null === $this->namespace) {
13447                // outside of a namespace unaliased unqualified is same as fully qualified
13448                return new FullyQualified($name, $name->getAttributes());
13449            }
13450            // Cannot resolve statically
13451            return null;
13452        }
13453        // if no alias exists prepend current namespace
13454        return FullyQualified::concat($this->namespace, $name, $name->getAttributes());
13455    }
13456    /**
13457     * Get resolved class name.
13458     *
13459     * @param Name $name Class ame to resolve
13460     *
13461     * @return Name Resolved name
13462     */
13463    public function getResolvedClassName(Name $name) : Name
13464    {
13465        return $this->getResolvedName($name, Stmt\Use_::TYPE_NORMAL);
13466    }
13467    /**
13468     * Get possible ways of writing a fully qualified name (e.g., by making use of aliases).
13469     *
13470     * @param string $name Fully-qualified name (without leading namespace separator)
13471     * @param int    $type One of Stmt\Use_::TYPE_*
13472     *
13473     * @return Name[] Possible representations of the name
13474     */
13475    public function getPossibleNames(string $name, int $type) : array
13476    {
13477        $lcName = \strtolower($name);
13478        if ($type === Stmt\Use_::TYPE_NORMAL) {
13479            // self, parent and static must always be unqualified
13480            if ($lcName === "self" || $lcName === "parent" || $lcName === "static") {
13481                return [new Name($name)];
13482            }
13483        }
13484        // Collect possible ways to write this name, starting with the fully-qualified name
13485        $possibleNames = [new FullyQualified($name)];
13486        if (null !== ($nsRelativeName = $this->getNamespaceRelativeName($name, $lcName, $type))) {
13487            // Make sure there is no alias that makes the normally namespace-relative name
13488            // into something else
13489            if (null === $this->resolveAlias($nsRelativeName, $type)) {
13490                $possibleNames[] = $nsRelativeName;
13491            }
13492        }
13493        // Check for relevant namespace use statements
13494        foreach ($this->origAliases[Stmt\Use_::TYPE_NORMAL] as $alias => $orig) {
13495            $lcOrig = $orig->toLowerString();
13496            if (0 === \strpos($lcName, $lcOrig . '\\')) {
13497                $possibleNames[] = new Name($alias . \substr($name, \strlen($lcOrig)));
13498            }
13499        }
13500        // Check for relevant type-specific use statements
13501        foreach ($this->origAliases[$type] as $alias => $orig) {
13502            if ($type === Stmt\Use_::TYPE_CONSTANT) {
13503                // Constants are are complicated-sensitive
13504                $normalizedOrig = $this->normalizeConstName($orig->toString());
13505                if ($normalizedOrig === $this->normalizeConstName($name)) {
13506                    $possibleNames[] = new Name($alias);
13507                }
13508            } else {
13509                // Everything else is case-insensitive
13510                if ($orig->toLowerString() === $lcName) {
13511                    $possibleNames[] = new Name($alias);
13512                }
13513            }
13514        }
13515        return $possibleNames;
13516    }
13517    /**
13518     * Get shortest representation of this fully-qualified name.
13519     *
13520     * @param string $name Fully-qualified name (without leading namespace separator)
13521     * @param int    $type One of Stmt\Use_::TYPE_*
13522     *
13523     * @return Name Shortest representation
13524     */
13525    public function getShortName(string $name, int $type) : Name
13526    {
13527        $possibleNames = $this->getPossibleNames($name, $type);
13528        // Find shortest name
13529        $shortestName = null;
13530        $shortestLength = \INF;
13531        foreach ($possibleNames as $possibleName) {
13532            $length = \strlen($possibleName->toCodeString());
13533            if ($length < $shortestLength) {
13534                $shortestName = $possibleName;
13535                $shortestLength = $length;
13536            }
13537        }
13538        return $shortestName;
13539    }
13540    private function resolveAlias(Name $name, $type)
13541    {
13542        $firstPart = $name->getFirst();
13543        if ($name->isQualified()) {
13544            // resolve aliases for qualified names, always against class alias table
13545            $checkName = \strtolower($firstPart);
13546            if (isset($this->aliases[Stmt\Use_::TYPE_NORMAL][$checkName])) {
13547                $alias = $this->aliases[Stmt\Use_::TYPE_NORMAL][$checkName];
13548                return FullyQualified::concat($alias, $name->slice(1), $name->getAttributes());
13549            }
13550        } elseif ($name->isUnqualified()) {
13551            // constant aliases are case-sensitive, function aliases case-insensitive
13552            $checkName = $type === Stmt\Use_::TYPE_CONSTANT ? $firstPart : \strtolower($firstPart);
13553            if (isset($this->aliases[$type][$checkName])) {
13554                // resolve unqualified aliases
13555                return new FullyQualified($this->aliases[$type][$checkName], $name->getAttributes());
13556            }
13557        }
13558        // No applicable aliases
13559        return null;
13560    }
13561    private function getNamespaceRelativeName(string $name, string $lcName, int $type)
13562    {
13563        if (null === $this->namespace) {
13564            return new Name($name);
13565        }
13566        if ($type === Stmt\Use_::TYPE_CONSTANT) {
13567            // The constants true/false/null always resolve to the global symbols, even inside a
13568            // namespace, so they may be used without qualification
13569            if ($lcName === "true" || $lcName === "false" || $lcName === "null") {
13570                return new Name($name);
13571            }
13572        }
13573        $namespacePrefix = \strtolower($this->namespace . '\\');
13574        if (0 === \strpos($lcName, $namespacePrefix)) {
13575            return new Name(\substr($name, \strlen($namespacePrefix)));
13576        }
13577        return null;
13578    }
13579    private function normalizeConstName(string $name)
13580    {
13581        $nsSep = \strrpos($name, '\\');
13582        if (\false === $nsSep) {
13583            return $name;
13584        }
13585        // Constants have case-insensitive namespace and case-sensitive short-name
13586        $ns = \substr($name, 0, $nsSep);
13587        $shortName = \substr($name, $nsSep + 1);
13588        return \strtolower($ns) . '\\' . $shortName;
13589    }
13590}
13591<?php
13592
13593declare (strict_types=1);
13594namespace PHPUnit\PhpParser;
13595
13596class Comment implements \JsonSerializable
13597{
13598    protected $text;
13599    protected $startLine;
13600    protected $startFilePos;
13601    protected $startTokenPos;
13602    protected $endLine;
13603    protected $endFilePos;
13604    protected $endTokenPos;
13605    /**
13606     * Constructs a comment node.
13607     *
13608     * @param string $text          Comment text (including comment delimiters like /*)
13609     * @param int    $startLine     Line number the comment started on
13610     * @param int    $startFilePos  File offset the comment started on
13611     * @param int    $startTokenPos Token offset the comment started on
13612     */
13613    public function __construct(string $text, int $startLine = -1, int $startFilePos = -1, int $startTokenPos = -1, int $endLine = -1, int $endFilePos = -1, int $endTokenPos = -1)
13614    {
13615        $this->text = $text;
13616        $this->startLine = $startLine;
13617        $this->startFilePos = $startFilePos;
13618        $this->startTokenPos = $startTokenPos;
13619        $this->endLine = $endLine;
13620        $this->endFilePos = $endFilePos;
13621        $this->endTokenPos = $endTokenPos;
13622    }
13623    /**
13624     * Gets the comment text.
13625     *
13626     * @return string The comment text (including comment delimiters like /*)
13627     */
13628    public function getText() : string
13629    {
13630        return $this->text;
13631    }
13632    /**
13633     * Gets the line number the comment started on.
13634     *
13635     * @return int Line number (or -1 if not available)
13636     */
13637    public function getStartLine() : int
13638    {
13639        return $this->startLine;
13640    }
13641    /**
13642     * Gets the file offset the comment started on.
13643     *
13644     * @return int File offset (or -1 if not available)
13645     */
13646    public function getStartFilePos() : int
13647    {
13648        return $this->startFilePos;
13649    }
13650    /**
13651     * Gets the token offset the comment started on.
13652     *
13653     * @return int Token offset (or -1 if not available)
13654     */
13655    public function getStartTokenPos() : int
13656    {
13657        return $this->startTokenPos;
13658    }
13659    /**
13660     * Gets the line number the comment ends on.
13661     *
13662     * @return int Line number (or -1 if not available)
13663     */
13664    public function getEndLine() : int
13665    {
13666        return $this->endLine;
13667    }
13668    /**
13669     * Gets the file offset the comment ends on.
13670     *
13671     * @return int File offset (or -1 if not available)
13672     */
13673    public function getEndFilePos() : int
13674    {
13675        return $this->endFilePos;
13676    }
13677    /**
13678     * Gets the token offset the comment ends on.
13679     *
13680     * @return int Token offset (or -1 if not available)
13681     */
13682    public function getEndTokenPos() : int
13683    {
13684        return $this->endTokenPos;
13685    }
13686    /**
13687     * Gets the line number the comment started on.
13688     *
13689     * @deprecated Use getStartLine() instead
13690     *
13691     * @return int Line number
13692     */
13693    public function getLine() : int
13694    {
13695        return $this->startLine;
13696    }
13697    /**
13698     * Gets the file offset the comment started on.
13699     *
13700     * @deprecated Use getStartFilePos() instead
13701     *
13702     * @return int File offset
13703     */
13704    public function getFilePos() : int
13705    {
13706        return $this->startFilePos;
13707    }
13708    /**
13709     * Gets the token offset the comment started on.
13710     *
13711     * @deprecated Use getStartTokenPos() instead
13712     *
13713     * @return int Token offset
13714     */
13715    public function getTokenPos() : int
13716    {
13717        return $this->startTokenPos;
13718    }
13719    /**
13720     * Gets the comment text.
13721     *
13722     * @return string The comment text (including comment delimiters like /*)
13723     */
13724    public function __toString() : string
13725    {
13726        return $this->text;
13727    }
13728    /**
13729     * Gets the reformatted comment text.
13730     *
13731     * "Reformatted" here means that we try to clean up the whitespace at the
13732     * starts of the lines. This is necessary because we receive the comments
13733     * without trailing whitespace on the first line, but with trailing whitespace
13734     * on all subsequent lines.
13735     *
13736     * @return mixed|string
13737     */
13738    public function getReformattedText()
13739    {
13740        $text = \trim($this->text);
13741        $newlinePos = \strpos($text, "\n");
13742        if (\false === $newlinePos) {
13743            // Single line comments don't need further processing
13744            return $text;
13745        } elseif (\preg_match('((*BSR_ANYCRLF)(*ANYCRLF)^.*(?:\\R\\s+\\*.*)+$)', $text)) {
13746            // Multi line comment of the type
13747            //
13748            //     /*
13749            //      * Some text.
13750            //      * Some more text.
13751            //      */
13752            //
13753            // is handled by replacing the whitespace sequences before the * by a single space
13754            return \preg_replace('(^\\s+\\*)m', ' *', $this->text);
13755        } elseif (\preg_match('(^/\\*\\*?\\s*[\\r\\n])', $text) && \preg_match('(\\n(\\s*)\\*/$)', $text, $matches)) {
13756            // Multi line comment of the type
13757            //
13758            //    /*
13759            //        Some text.
13760            //        Some more text.
13761            //    */
13762            //
13763            // is handled by removing the whitespace sequence on the line before the closing
13764            // */ on all lines. So if the last line is "    */", then "    " is removed at the
13765            // start of all lines.
13766            return \preg_replace('(^' . \preg_quote($matches[1]) . ')m', '', $text);
13767        } elseif (\preg_match('(^/\\*\\*?\\s*(?!\\s))', $text, $matches)) {
13768            // Multi line comment of the type
13769            //
13770            //     /* Some text.
13771            //        Some more text.
13772            //          Indented text.
13773            //        Even more text. */
13774            //
13775            // is handled by removing the difference between the shortest whitespace prefix on all
13776            // lines and the length of the "/* " opening sequence.
13777            $prefixLen = $this->getShortestWhitespacePrefixLen(\substr($text, $newlinePos + 1));
13778            $removeLen = $prefixLen - \strlen($matches[0]);
13779            return \preg_replace('(^\\s{' . $removeLen . '})m', '', $text);
13780        }
13781        // No idea how to format this comment, so simply return as is
13782        return $text;
13783    }
13784    /**
13785     * Get length of shortest whitespace prefix (at the start of a line).
13786     *
13787     * If there is a line with no prefix whitespace, 0 is a valid return value.
13788     *
13789     * @param string $str String to check
13790     * @return int Length in characters. Tabs count as single characters.
13791     */
13792    private function getShortestWhitespacePrefixLen(string $str) : int
13793    {
13794        $lines = \explode("\n", $str);
13795        $shortestPrefixLen = \INF;
13796        foreach ($lines as $line) {
13797            \preg_match('(^\\s*)', $line, $matches);
13798            $prefixLen = \strlen($matches[0]);
13799            if ($prefixLen < $shortestPrefixLen) {
13800                $shortestPrefixLen = $prefixLen;
13801            }
13802        }
13803        return $shortestPrefixLen;
13804    }
13805    /**
13806     * @return       array
13807     * @psalm-return array{nodeType:string, text:mixed, line:mixed, filePos:mixed}
13808     */
13809    public function jsonSerialize() : array
13810    {
13811        // Technically not a node, but we make it look like one anyway
13812        $type = $this instanceof Comment\Doc ? 'Comment_Doc' : 'Comment';
13813        return [
13814            'nodeType' => $type,
13815            'text' => $this->text,
13816            // TODO: Rename these to include "start".
13817            'line' => $this->startLine,
13818            'filePos' => $this->startFilePos,
13819            'tokenPos' => $this->startTokenPos,
13820            'endLine' => $this->endLine,
13821            'endFilePos' => $this->endFilePos,
13822            'endTokenPos' => $this->endTokenPos,
13823        ];
13824    }
13825}
13826<?php
13827
13828declare (strict_types=1);
13829namespace PHPUnit\PhpParser;
13830
13831/*
13832 * This parser is based on a skeleton written by Moriyoshi Koizumi, which in
13833 * turn is based on work by Masato Bito.
13834 */
13835use PHPUnit\PhpParser\Node\Expr;
13836use PHPUnit\PhpParser\Node\Expr\Cast\Double;
13837use PHPUnit\PhpParser\Node\Name;
13838use PHPUnit\PhpParser\Node\Param;
13839use PHPUnit\PhpParser\Node\Scalar\Encapsed;
13840use PHPUnit\PhpParser\Node\Scalar\LNumber;
13841use PHPUnit\PhpParser\Node\Scalar\String_;
13842use PHPUnit\PhpParser\Node\Stmt\Class_;
13843use PHPUnit\PhpParser\Node\Stmt\ClassConst;
13844use PHPUnit\PhpParser\Node\Stmt\ClassMethod;
13845use PHPUnit\PhpParser\Node\Stmt\Enum_;
13846use PHPUnit\PhpParser\Node\Stmt\Interface_;
13847use PHPUnit\PhpParser\Node\Stmt\Namespace_;
13848use PHPUnit\PhpParser\Node\Stmt\Property;
13849use PHPUnit\PhpParser\Node\Stmt\TryCatch;
13850use PHPUnit\PhpParser\Node\Stmt\UseUse;
13851use PHPUnit\PhpParser\Node\VarLikeIdentifier;
13852abstract class ParserAbstract implements Parser
13853{
13854    const SYMBOL_NONE = -1;
13855    /*
13856     * The following members will be filled with generated parsing data:
13857     */
13858    /** @var int Size of $tokenToSymbol map */
13859    protected $tokenToSymbolMapSize;
13860    /** @var int Size of $action table */
13861    protected $actionTableSize;
13862    /** @var int Size of $goto table */
13863    protected $gotoTableSize;
13864    /** @var int Symbol number signifying an invalid token */
13865    protected $invalidSymbol;
13866    /** @var int Symbol number of error recovery token */
13867    protected $errorSymbol;
13868    /** @var int Action number signifying default action */
13869    protected $defaultAction;
13870    /** @var int Rule number signifying that an unexpected token was encountered */
13871    protected $unexpectedTokenRule;
13872    protected $YY2TBLSTATE;
13873    /** @var int Number of non-leaf states */
13874    protected $numNonLeafStates;
13875    /** @var int[] Map of lexer tokens to internal symbols */
13876    protected $tokenToSymbol;
13877    /** @var string[] Map of symbols to their names */
13878    protected $symbolToName;
13879    /** @var array Names of the production rules (only necessary for debugging) */
13880    protected $productions;
13881    /** @var int[] Map of states to a displacement into the $action table. The corresponding action for this
13882     *             state/symbol pair is $action[$actionBase[$state] + $symbol]. If $actionBase[$state] is 0, the
13883     *             action is defaulted, i.e. $actionDefault[$state] should be used instead. */
13884    protected $actionBase;
13885    /** @var int[] Table of actions. Indexed according to $actionBase comment. */
13886    protected $action;
13887    /** @var int[] Table indexed analogously to $action. If $actionCheck[$actionBase[$state] + $symbol] != $symbol
13888     *             then the action is defaulted, i.e. $actionDefault[$state] should be used instead. */
13889    protected $actionCheck;
13890    /** @var int[] Map of states to their default action */
13891    protected $actionDefault;
13892    /** @var callable[] Semantic action callbacks */
13893    protected $reduceCallbacks;
13894    /** @var int[] Map of non-terminals to a displacement into the $goto table. The corresponding goto state for this
13895     *             non-terminal/state pair is $goto[$gotoBase[$nonTerminal] + $state] (unless defaulted) */
13896    protected $gotoBase;
13897    /** @var int[] Table of states to goto after reduction. Indexed according to $gotoBase comment. */
13898    protected $goto;
13899    /** @var int[] Table indexed analogously to $goto. If $gotoCheck[$gotoBase[$nonTerminal] + $state] != $nonTerminal
13900     *             then the goto state is defaulted, i.e. $gotoDefault[$nonTerminal] should be used. */
13901    protected $gotoCheck;
13902    /** @var int[] Map of non-terminals to the default state to goto after their reduction */
13903    protected $gotoDefault;
13904    /** @var int[] Map of rules to the non-terminal on their left-hand side, i.e. the non-terminal to use for
13905     *             determining the state to goto after reduction. */
13906    protected $ruleToNonTerminal;
13907    /** @var int[] Map of rules to the length of their right-hand side, which is the number of elements that have to
13908     *             be popped from the stack(s) on reduction. */
13909    protected $ruleToLength;
13910    /*
13911     * The following members are part of the parser state:
13912     */
13913    /** @var Lexer Lexer that is used when parsing */
13914    protected $lexer;
13915    /** @var mixed Temporary value containing the result of last semantic action (reduction) */
13916    protected $semValue;
13917    /** @var array Semantic value stack (contains values of tokens and semantic action results) */
13918    protected $semStack;
13919    /** @var array[] Start attribute stack */
13920    protected $startAttributeStack;
13921    /** @var array[] End attribute stack */
13922    protected $endAttributeStack;
13923    /** @var array End attributes of last *shifted* token */
13924    protected $endAttributes;
13925    /** @var array Start attributes of last *read* token */
13926    protected $lookaheadStartAttributes;
13927    /** @var ErrorHandler Error handler */
13928    protected $errorHandler;
13929    /** @var int Error state, used to avoid error floods */
13930    protected $errorState;
13931    /**
13932     * Initialize $reduceCallbacks map.
13933     */
13934    protected abstract function initReduceCallbacks();
13935    /**
13936     * Creates a parser instance.
13937     *
13938     * Options: Currently none.
13939     *
13940     * @param Lexer $lexer A lexer
13941     * @param array $options Options array.
13942     */
13943    public function __construct(Lexer $lexer, array $options = [])
13944    {
13945        $this->lexer = $lexer;
13946        if (isset($options['throwOnError'])) {
13947            throw new \LogicException('"throwOnError" is no longer supported, use "errorHandler" instead');
13948        }
13949        $this->initReduceCallbacks();
13950    }
13951    /**
13952     * Parses PHP code into a node tree.
13953     *
13954     * If a non-throwing error handler is used, the parser will continue parsing after an error
13955     * occurred and attempt to build a partial AST.
13956     *
13957     * @param string $code The source code to parse
13958     * @param ErrorHandler|null $errorHandler Error handler to use for lexer/parser errors, defaults
13959     *                                        to ErrorHandler\Throwing.
13960     *
13961     * @return Node\Stmt[]|null Array of statements (or null non-throwing error handler is used and
13962     *                          the parser was unable to recover from an error).
13963     */
13964    public function parse(string $code, ErrorHandler $errorHandler = null)
13965    {
13966        $this->errorHandler = $errorHandler ?: new ErrorHandler\Throwing();
13967        $this->lexer->startLexing($code, $this->errorHandler);
13968        $result = $this->doParse();
13969        // Clear out some of the interior state, so we don't hold onto unnecessary
13970        // memory between uses of the parser
13971        $this->startAttributeStack = [];
13972        $this->endAttributeStack = [];
13973        $this->semStack = [];
13974        $this->semValue = null;
13975        return $result;
13976    }
13977    protected function doParse()
13978    {
13979        // We start off with no lookahead-token
13980        $symbol = self::SYMBOL_NONE;
13981        // The attributes for a node are taken from the first and last token of the node.
13982        // From the first token only the startAttributes are taken and from the last only
13983        // the endAttributes. Both are merged using the array union operator (+).
13984        $startAttributes = [];
13985        $endAttributes = [];
13986        $this->endAttributes = $endAttributes;
13987        // Keep stack of start and end attributes
13988        $this->startAttributeStack = [];
13989        $this->endAttributeStack = [$endAttributes];
13990        // Start off in the initial state and keep a stack of previous states
13991        $state = 0;
13992        $stateStack = [$state];
13993        // Semantic value stack (contains values of tokens and semantic action results)
13994        $this->semStack = [];
13995        // Current position in the stack(s)
13996        $stackPos = 0;
13997        $this->errorState = 0;
13998        for (;;) {
13999            //$this->traceNewState($state, $symbol);
14000            if ($this->actionBase[$state] === 0) {
14001                $rule = $this->actionDefault[$state];
14002            } else {
14003                if ($symbol === self::SYMBOL_NONE) {
14004                    // Fetch the next token id from the lexer and fetch additional info by-ref.
14005                    // The end attributes are fetched into a temporary variable and only set once the token is really
14006                    // shifted (not during read). Otherwise you would sometimes get off-by-one errors, when a rule is
14007                    // reduced after a token was read but not yet shifted.
14008                    $tokenId = $this->lexer->getNextToken($tokenValue, $startAttributes, $endAttributes);
14009                    // map the lexer token id to the internally used symbols
14010                    $symbol = $tokenId >= 0 && $tokenId < $this->tokenToSymbolMapSize ? $this->tokenToSymbol[$tokenId] : $this->invalidSymbol;
14011                    if ($symbol === $this->invalidSymbol) {
14012                        throw new \RangeException(\sprintf('The lexer returned an invalid token (id=%d, value=%s)', $tokenId, $tokenValue));
14013                    }
14014                    // Allow productions to access the start attributes of the lookahead token.
14015                    $this->lookaheadStartAttributes = $startAttributes;
14016                    //$this->traceRead($symbol);
14017                }
14018                $idx = $this->actionBase[$state] + $symbol;
14019                if (($idx >= 0 && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol || $state < $this->YY2TBLSTATE && ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $symbol) >= 0 && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol) && ($action = $this->action[$idx]) !== $this->defaultAction) {
14020                    /*
14021                     * >= numNonLeafStates: shift and reduce
14022                     * > 0: shift
14023                     * = 0: accept
14024                     * < 0: reduce
14025                     * = -YYUNEXPECTED: error
14026                     */
14027                    if ($action > 0) {
14028                        /* shift */
14029                        //$this->traceShift($symbol);
14030                        ++$stackPos;
14031                        $stateStack[$stackPos] = $state = $action;
14032                        $this->semStack[$stackPos] = $tokenValue;
14033                        $this->startAttributeStack[$stackPos] = $startAttributes;
14034                        $this->endAttributeStack[$stackPos] = $endAttributes;
14035                        $this->endAttributes = $endAttributes;
14036                        $symbol = self::SYMBOL_NONE;
14037                        if ($this->errorState) {
14038                            --$this->errorState;
14039                        }
14040                        if ($action < $this->numNonLeafStates) {
14041                            continue;
14042                        }
14043                        /* $yyn >= numNonLeafStates means shift-and-reduce */
14044                        $rule = $action - $this->numNonLeafStates;
14045                    } else {
14046                        $rule = -$action;
14047                    }
14048                } else {
14049                    $rule = $this->actionDefault[$state];
14050                }
14051            }
14052            for (;;) {
14053                if ($rule === 0) {
14054                    /* accept */
14055                    //$this->traceAccept();
14056                    return $this->semValue;
14057                } elseif ($rule !== $this->unexpectedTokenRule) {
14058                    /* reduce */
14059                    //$this->traceReduce($rule);
14060                    try {
14061                        $this->reduceCallbacks[$rule]($stackPos);
14062                    } catch (Error $e) {
14063                        if (-1 === $e->getStartLine() && isset($startAttributes['startLine'])) {
14064                            $e->setStartLine($startAttributes['startLine']);
14065                        }
14066                        $this->emitError($e);
14067                        // Can't recover from this type of error
14068                        return null;
14069                    }
14070                    /* Goto - shift nonterminal */
14071                    $lastEndAttributes = $this->endAttributeStack[$stackPos];
14072                    $ruleLength = $this->ruleToLength[$rule];
14073                    $stackPos -= $ruleLength;
14074                    $nonTerminal = $this->ruleToNonTerminal[$rule];
14075                    $idx = $this->gotoBase[$nonTerminal] + $stateStack[$stackPos];
14076                    if ($idx >= 0 && $idx < $this->gotoTableSize && $this->gotoCheck[$idx] === $nonTerminal) {
14077                        $state = $this->goto[$idx];
14078                    } else {
14079                        $state = $this->gotoDefault[$nonTerminal];
14080                    }
14081                    ++$stackPos;
14082                    $stateStack[$stackPos] = $state;
14083                    $this->semStack[$stackPos] = $this->semValue;
14084                    $this->endAttributeStack[$stackPos] = $lastEndAttributes;
14085                    if ($ruleLength === 0) {
14086                        // Empty productions use the start attributes of the lookahead token.
14087                        $this->startAttributeStack[$stackPos] = $this->lookaheadStartAttributes;
14088                    }
14089                } else {
14090                    /* error */
14091                    switch ($this->errorState) {
14092                        case 0:
14093                            $msg = $this->getErrorMessage($symbol, $state);
14094                            $this->emitError(new Error($msg, $startAttributes + $endAttributes));
14095                        // Break missing intentionally
14096                        case 1:
14097                        case 2:
14098                            $this->errorState = 3;
14099                            // Pop until error-expecting state uncovered
14100                            while (!(($idx = $this->actionBase[$state] + $this->errorSymbol) >= 0 && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $this->errorSymbol || $state < $this->YY2TBLSTATE && ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $this->errorSymbol) >= 0 && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $this->errorSymbol) || ($action = $this->action[$idx]) === $this->defaultAction) {
14101                                // Not totally sure about this
14102                                if ($stackPos <= 0) {
14103                                    // Could not recover from error
14104                                    return null;
14105                                }
14106                                $state = $stateStack[--$stackPos];
14107                                //$this->tracePop($state);
14108                            }
14109                            //$this->traceShift($this->errorSymbol);
14110                            ++$stackPos;
14111                            $stateStack[$stackPos] = $state = $action;
14112                            // We treat the error symbol as being empty, so we reset the end attributes
14113                            // to the end attributes of the last non-error symbol
14114                            $this->startAttributeStack[$stackPos] = $this->lookaheadStartAttributes;
14115                            $this->endAttributeStack[$stackPos] = $this->endAttributeStack[$stackPos - 1];
14116                            $this->endAttributes = $this->endAttributeStack[$stackPos - 1];
14117                            break;
14118                        case 3:
14119                            if ($symbol === 0) {
14120                                // Reached EOF without recovering from error
14121                                return null;
14122                            }
14123                            //$this->traceDiscard($symbol);
14124                            $symbol = self::SYMBOL_NONE;
14125                            break 2;
14126                    }
14127                }
14128                if ($state < $this->numNonLeafStates) {
14129                    break;
14130                }
14131                /* >= numNonLeafStates means shift-and-reduce */
14132                $rule = $state - $this->numNonLeafStates;
14133            }
14134        }
14135        throw new \RuntimeException('Reached end of parser loop');
14136    }
14137    protected function emitError(Error $error)
14138    {
14139        $this->errorHandler->handleError($error);
14140    }
14141    /**
14142     * Format error message including expected tokens.
14143     *
14144     * @param int $symbol Unexpected symbol
14145     * @param int $state  State at time of error
14146     *
14147     * @return string Formatted error message
14148     */
14149    protected function getErrorMessage(int $symbol, int $state) : string
14150    {
14151        $expectedString = '';
14152        if ($expected = $this->getExpectedTokens($state)) {
14153            $expectedString = ', expecting ' . \implode(' or ', $expected);
14154        }
14155        return 'Syntax error, unexpected ' . $this->symbolToName[$symbol] . $expectedString;
14156    }
14157    /**
14158     * Get limited number of expected tokens in given state.
14159     *
14160     * @param int $state State
14161     *
14162     * @return string[] Expected tokens. If too many, an empty array is returned.
14163     */
14164    protected function getExpectedTokens(int $state) : array
14165    {
14166        $expected = [];
14167        $base = $this->actionBase[$state];
14168        foreach ($this->symbolToName as $symbol => $name) {
14169            $idx = $base + $symbol;
14170            if ($idx >= 0 && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol || $state < $this->YY2TBLSTATE && ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $symbol) >= 0 && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol) {
14171                if ($this->action[$idx] !== $this->unexpectedTokenRule && $this->action[$idx] !== $this->defaultAction && $symbol !== $this->errorSymbol) {
14172                    if (\count($expected) === 4) {
14173                        /* Too many expected tokens */
14174                        return [];
14175                    }
14176                    $expected[] = $name;
14177                }
14178            }
14179        }
14180        return $expected;
14181    }
14182    /*
14183     * Tracing functions used for debugging the parser.
14184     */
14185    /*
14186    protected function traceNewState($state, $symbol) {
14187        echo '% State ' . $state
14188            . ', Lookahead ' . ($symbol == self::SYMBOL_NONE ? '--none--' : $this->symbolToName[$symbol]) . "\n";
14189    }
14190
14191    protected function traceRead($symbol) {
14192        echo '% Reading ' . $this->symbolToName[$symbol] . "\n";
14193    }
14194
14195    protected function traceShift($symbol) {
14196        echo '% Shift ' . $this->symbolToName[$symbol] . "\n";
14197    }
14198
14199    protected function traceAccept() {
14200        echo "% Accepted.\n";
14201    }
14202
14203    protected function traceReduce($n) {
14204        echo '% Reduce by (' . $n . ') ' . $this->productions[$n] . "\n";
14205    }
14206
14207    protected function tracePop($state) {
14208        echo '% Recovering, uncovered state ' . $state . "\n";
14209    }
14210
14211    protected function traceDiscard($symbol) {
14212        echo '% Discard ' . $this->symbolToName[$symbol] . "\n";
14213    }
14214    */
14215    /*
14216     * Helper functions invoked by semantic actions
14217     */
14218    /**
14219     * Moves statements of semicolon-style namespaces into $ns->stmts and checks various error conditions.
14220     *
14221     * @param Node\Stmt[] $stmts
14222     * @return Node\Stmt[]
14223     */
14224    protected function handleNamespaces(array $stmts) : array
14225    {
14226        $hasErrored = \false;
14227        $style = $this->getNamespacingStyle($stmts);
14228        if (null === $style) {
14229            // not namespaced, nothing to do
14230            return $stmts;
14231        } elseif ('brace' === $style) {
14232            // For braced namespaces we only have to check that there are no invalid statements between the namespaces
14233            $afterFirstNamespace = \false;
14234            foreach ($stmts as $stmt) {
14235                if ($stmt instanceof Node\Stmt\Namespace_) {
14236                    $afterFirstNamespace = \true;
14237                } elseif (!$stmt instanceof Node\Stmt\HaltCompiler && !$stmt instanceof Node\Stmt\Nop && $afterFirstNamespace && !$hasErrored) {
14238                    $this->emitError(new Error('No code may exist outside of namespace {}', $stmt->getAttributes()));
14239                    $hasErrored = \true;
14240                    // Avoid one error for every statement
14241                }
14242            }
14243            return $stmts;
14244        } else {
14245            // For semicolon namespaces we have to move the statements after a namespace declaration into ->stmts
14246            $resultStmts = [];
14247            $targetStmts =& $resultStmts;
14248            $lastNs = null;
14249            foreach ($stmts as $stmt) {
14250                if ($stmt instanceof Node\Stmt\Namespace_) {
14251                    if ($lastNs !== null) {
14252                        $this->fixupNamespaceAttributes($lastNs);
14253                    }
14254                    if ($stmt->stmts === null) {
14255                        $stmt->stmts = [];
14256                        $targetStmts =& $stmt->stmts;
14257                        $resultStmts[] = $stmt;
14258                    } else {
14259                        // This handles the invalid case of mixed style namespaces
14260                        $resultStmts[] = $stmt;
14261                        $targetStmts =& $resultStmts;
14262                    }
14263                    $lastNs = $stmt;
14264                } elseif ($stmt instanceof Node\Stmt\HaltCompiler) {
14265                    // __halt_compiler() is not moved into the namespace
14266                    $resultStmts[] = $stmt;
14267                } else {
14268                    $targetStmts[] = $stmt;
14269                }
14270            }
14271            if ($lastNs !== null) {
14272                $this->fixupNamespaceAttributes($lastNs);
14273            }
14274            return $resultStmts;
14275        }
14276    }
14277    private function fixupNamespaceAttributes(Node\Stmt\Namespace_ $stmt)
14278    {
14279        // We moved the statements into the namespace node, as such the end of the namespace node
14280        // needs to be extended to the end of the statements.
14281        if (empty($stmt->stmts)) {
14282            return;
14283        }
14284        // We only move the builtin end attributes here. This is the best we can do with the
14285        // knowledge we have.
14286        $endAttributes = ['endLine', 'endFilePos', 'endTokenPos'];
14287        $lastStmt = $stmt->stmts[\count($stmt->stmts) - 1];
14288        foreach ($endAttributes as $endAttribute) {
14289            if ($lastStmt->hasAttribute($endAttribute)) {
14290                $stmt->setAttribute($endAttribute, $lastStmt->getAttribute($endAttribute));
14291            }
14292        }
14293    }
14294    /**
14295     * Determine namespacing style (semicolon or brace)
14296     *
14297     * @param Node[] $stmts Top-level statements.
14298     *
14299     * @return null|string One of "semicolon", "brace" or null (no namespaces)
14300     */
14301    private function getNamespacingStyle(array $stmts)
14302    {
14303        $style = null;
14304        $hasNotAllowedStmts = \false;
14305        foreach ($stmts as $i => $stmt) {
14306            if ($stmt instanceof Node\Stmt\Namespace_) {
14307                $currentStyle = null === $stmt->stmts ? 'semicolon' : 'brace';
14308                if (null === $style) {
14309                    $style = $currentStyle;
14310                    if ($hasNotAllowedStmts) {
14311                        $this->emitError(new Error('Namespace declaration statement has to be the very first statement in the script', $stmt->getLine()));
14312                    }
14313                } elseif ($style !== $currentStyle) {
14314                    $this->emitError(new Error('Cannot mix bracketed namespace declarations with unbracketed namespace declarations', $stmt->getLine()));
14315                    // Treat like semicolon style for namespace normalization
14316                    return 'semicolon';
14317                }
14318                continue;
14319            }
14320            /* declare(), __halt_compiler() and nops can be used before a namespace declaration */
14321            if ($stmt instanceof Node\Stmt\Declare_ || $stmt instanceof Node\Stmt\HaltCompiler || $stmt instanceof Node\Stmt\Nop) {
14322                continue;
14323            }
14324            /* There may be a hashbang line at the very start of the file */
14325            if ($i === 0 && $stmt instanceof Node\Stmt\InlineHTML && \preg_match('/\\A#!.*\\r?\\n\\z/', $stmt->value)) {
14326                continue;
14327            }
14328            /* Everything else if forbidden before namespace declarations */
14329            $hasNotAllowedStmts = \true;
14330        }
14331        return $style;
14332    }
14333    /**
14334     * Fix up parsing of static property calls in PHP 5.
14335     *
14336     * In PHP 5 A::$b[c][d] and A::$b[c][d]() have very different interpretation. The former is
14337     * interpreted as (A::$b)[c][d], while the latter is the same as A::{$b[c][d]}(). We parse the
14338     * latter as the former initially and this method fixes the AST into the correct form when we
14339     * encounter the "()".
14340     *
14341     * @param  Node\Expr\StaticPropertyFetch|Node\Expr\ArrayDimFetch $prop
14342     * @param  Node\Arg[] $args
14343     * @param  array      $attributes
14344     *
14345     * @return Expr\StaticCall
14346     */
14347    protected function fixupPhp5StaticPropCall($prop, array $args, array $attributes) : Expr\StaticCall
14348    {
14349        if ($prop instanceof Node\Expr\StaticPropertyFetch) {
14350            $name = $prop->name instanceof VarLikeIdentifier ? $prop->name->toString() : $prop->name;
14351            $var = new Expr\Variable($name, $prop->name->getAttributes());
14352            return new Expr\StaticCall($prop->class, $var, $args, $attributes);
14353        } elseif ($prop instanceof Node\Expr\ArrayDimFetch) {
14354            $tmp = $prop;
14355            while ($tmp->var instanceof Node\Expr\ArrayDimFetch) {
14356                $tmp = $tmp->var;
14357            }
14358            /** @var Expr\StaticPropertyFetch $staticProp */
14359            $staticProp = $tmp->var;
14360            // Set start attributes to attributes of innermost node
14361            $tmp = $prop;
14362            $this->fixupStartAttributes($tmp, $staticProp->name);
14363            while ($tmp->var instanceof Node\Expr\ArrayDimFetch) {
14364                $tmp = $tmp->var;
14365                $this->fixupStartAttributes($tmp, $staticProp->name);
14366            }
14367            $name = $staticProp->name instanceof VarLikeIdentifier ? $staticProp->name->toString() : $staticProp->name;
14368            $tmp->var = new Expr\Variable($name, $staticProp->name->getAttributes());
14369            return new Expr\StaticCall($staticProp->class, $prop, $args, $attributes);
14370        } else {
14371            throw new \Exception();
14372        }
14373    }
14374    protected function fixupStartAttributes(Node $to, Node $from)
14375    {
14376        $startAttributes = ['startLine', 'startFilePos', 'startTokenPos'];
14377        foreach ($startAttributes as $startAttribute) {
14378            if ($from->hasAttribute($startAttribute)) {
14379                $to->setAttribute($startAttribute, $from->getAttribute($startAttribute));
14380            }
14381        }
14382    }
14383    protected function handleBuiltinTypes(Name $name)
14384    {
14385        $builtinTypes = ['bool' => \true, 'int' => \true, 'float' => \true, 'string' => \true, 'iterable' => \true, 'void' => \true, 'object' => \true, 'null' => \true, 'false' => \true, 'mixed' => \true, 'never' => \true];
14386        if (!$name->isUnqualified()) {
14387            return $name;
14388        }
14389        $lowerName = $name->toLowerString();
14390        if (!isset($builtinTypes[$lowerName])) {
14391            return $name;
14392        }
14393        return new Node\Identifier($lowerName, $name->getAttributes());
14394    }
14395    /**
14396     * Get combined start and end attributes at a stack location
14397     *
14398     * @param int $pos Stack location
14399     *
14400     * @return array Combined start and end attributes
14401     */
14402    protected function getAttributesAt(int $pos) : array
14403    {
14404        return $this->startAttributeStack[$pos] + $this->endAttributeStack[$pos];
14405    }
14406    protected function getFloatCastKind(string $cast) : int
14407    {
14408        $cast = \strtolower($cast);
14409        if (\strpos($cast, 'float') !== \false) {
14410            return Double::KIND_FLOAT;
14411        }
14412        if (\strpos($cast, 'real') !== \false) {
14413            return Double::KIND_REAL;
14414        }
14415        return Double::KIND_DOUBLE;
14416    }
14417    protected function parseLNumber($str, $attributes, $allowInvalidOctal = \false)
14418    {
14419        try {
14420            return LNumber::fromString($str, $attributes, $allowInvalidOctal);
14421        } catch (Error $error) {
14422            $this->emitError($error);
14423            // Use dummy value
14424            return new LNumber(0, $attributes);
14425        }
14426    }
14427    /**
14428     * Parse a T_NUM_STRING token into either an integer or string node.
14429     *
14430     * @param string $str        Number string
14431     * @param array  $attributes Attributes
14432     *
14433     * @return LNumber|String_ Integer or string node.
14434     */
14435    protected function parseNumString(string $str, array $attributes)
14436    {
14437        if (!\preg_match('/^(?:0|-?[1-9][0-9]*)$/', $str)) {
14438            return new String_($str, $attributes);
14439        }
14440        $num = +$str;
14441        if (!\is_int($num)) {
14442            return new String_($str, $attributes);
14443        }
14444        return new LNumber($num, $attributes);
14445    }
14446    protected function stripIndentation(string $string, int $indentLen, string $indentChar, bool $newlineAtStart, bool $newlineAtEnd, array $attributes)
14447    {
14448        if ($indentLen === 0) {
14449            return $string;
14450        }
14451        $start = $newlineAtStart ? '(?:(?<=\\n)|\\A)' : '(?<=\\n)';
14452        $end = $newlineAtEnd ? '(?:(?=[\\r\\n])|\\z)' : '(?=[\\r\\n])';
14453        $regex = '/' . $start . '([ \\t]*)(' . $end . ')?/';
14454        return \preg_replace_callback($regex, function ($matches) use($indentLen, $indentChar, $attributes) {
14455            $prefix = \substr($matches[1], 0, $indentLen);
14456            if (\false !== \strpos($prefix, $indentChar === " " ? "\t" : " ")) {
14457                $this->emitError(new Error('Invalid indentation - tabs and spaces cannot be mixed', $attributes));
14458            } elseif (\strlen($prefix) < $indentLen && !isset($matches[2])) {
14459                $this->emitError(new Error('Invalid body indentation level ' . '(expecting an indentation level of at least ' . $indentLen . ')', $attributes));
14460            }
14461            return \substr($matches[0], \strlen($prefix));
14462        }, $string);
14463    }
14464    protected function parseDocString(string $startToken, $contents, string $endToken, array $attributes, array $endTokenAttributes, bool $parseUnicodeEscape)
14465    {
14466        $kind = \strpos($startToken, "'") === \false ? String_::KIND_HEREDOC : String_::KIND_NOWDOC;
14467        $regex = '/\\A[bB]?<<<[ \\t]*[\'"]?([a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*)[\'"]?(?:\\r\\n|\\n|\\r)\\z/';
14468        $result = \preg_match($regex, $startToken, $matches);
14469        \assert($result === 1);
14470        $label = $matches[1];
14471        $result = \preg_match('/\\A[ \\t]*/', $endToken, $matches);
14472        \assert($result === 1);
14473        $indentation = $matches[0];
14474        $attributes['kind'] = $kind;
14475        $attributes['docLabel'] = $label;
14476        $attributes['docIndentation'] = $indentation;
14477        $indentHasSpaces = \false !== \strpos($indentation, " ");
14478        $indentHasTabs = \false !== \strpos($indentation, "\t");
14479        if ($indentHasSpaces && $indentHasTabs) {
14480            $this->emitError(new Error('Invalid indentation - tabs and spaces cannot be mixed', $endTokenAttributes));
14481            // Proceed processing as if this doc string is not indented
14482            $indentation = '';
14483        }
14484        $indentLen = \strlen($indentation);
14485        $indentChar = $indentHasSpaces ? " " : "\t";
14486        if (\is_string($contents)) {
14487            if ($contents === '') {
14488                return new String_('', $attributes);
14489            }
14490            $contents = $this->stripIndentation($contents, $indentLen, $indentChar, \true, \true, $attributes);
14491            $contents = \preg_replace('~(\\r\\n|\\n|\\r)\\z~', '', $contents);
14492            if ($kind === String_::KIND_HEREDOC) {
14493                $contents = String_::parseEscapeSequences($contents, null, $parseUnicodeEscape);
14494            }
14495            return new String_($contents, $attributes);
14496        } else {
14497            \assert(\count($contents) > 0);
14498            if (!$contents[0] instanceof Node\Scalar\EncapsedStringPart) {
14499                // If there is no leading encapsed string part, pretend there is an empty one
14500                $this->stripIndentation('', $indentLen, $indentChar, \true, \false, $contents[0]->getAttributes());
14501            }
14502            $newContents = [];
14503            foreach ($contents as $i => $part) {
14504                if ($part instanceof Node\Scalar\EncapsedStringPart) {
14505                    $isLast = $i === \count($contents) - 1;
14506                    $part->value = $this->stripIndentation($part->value, $indentLen, $indentChar, $i === 0, $isLast, $part->getAttributes());
14507                    $part->value = String_::parseEscapeSequences($part->value, null, $parseUnicodeEscape);
14508                    if ($isLast) {
14509                        $part->value = \preg_replace('~(\\r\\n|\\n|\\r)\\z~', '', $part->value);
14510                    }
14511                    if ('' === $part->value) {
14512                        continue;
14513                    }
14514                }
14515                $newContents[] = $part;
14516            }
14517            return new Encapsed($newContents, $attributes);
14518        }
14519    }
14520    /**
14521     * Create attributes for a zero-length common-capturing nop.
14522     *
14523     * @param Comment[] $comments
14524     * @return array
14525     */
14526    protected function createCommentNopAttributes(array $comments)
14527    {
14528        $comment = $comments[\count($comments) - 1];
14529        $commentEndLine = $comment->getEndLine();
14530        $commentEndFilePos = $comment->getEndFilePos();
14531        $commentEndTokenPos = $comment->getEndTokenPos();
14532        $attributes = ['comments' => $comments];
14533        if (-1 !== $commentEndLine) {
14534            $attributes['startLine'] = $commentEndLine;
14535            $attributes['endLine'] = $commentEndLine;
14536        }
14537        if (-1 !== $commentEndFilePos) {
14538            $attributes['startFilePos'] = $commentEndFilePos + 1;
14539            $attributes['endFilePos'] = $commentEndFilePos;
14540        }
14541        if (-1 !== $commentEndTokenPos) {
14542            $attributes['startTokenPos'] = $commentEndTokenPos + 1;
14543            $attributes['endTokenPos'] = $commentEndTokenPos;
14544        }
14545        return $attributes;
14546    }
14547    protected function checkModifier($a, $b, $modifierPos)
14548    {
14549        // Jumping through some hoops here because verifyModifier() is also used elsewhere
14550        try {
14551            Class_::verifyModifier($a, $b);
14552        } catch (Error $error) {
14553            $error->setAttributes($this->getAttributesAt($modifierPos));
14554            $this->emitError($error);
14555        }
14556    }
14557    protected function checkParam(Param $node)
14558    {
14559        if ($node->variadic && null !== $node->default) {
14560            $this->emitError(new Error('Variadic parameter cannot have a default value', $node->default->getAttributes()));
14561        }
14562    }
14563    protected function checkTryCatch(TryCatch $node)
14564    {
14565        if (empty($node->catches) && null === $node->finally) {
14566            $this->emitError(new Error('Cannot use try without catch or finally', $node->getAttributes()));
14567        }
14568    }
14569    protected function checkNamespace(Namespace_ $node)
14570    {
14571        if (null !== $node->stmts) {
14572            foreach ($node->stmts as $stmt) {
14573                if ($stmt instanceof Namespace_) {
14574                    $this->emitError(new Error('Namespace declarations cannot be nested', $stmt->getAttributes()));
14575                }
14576            }
14577        }
14578    }
14579    private function checkClassName($name, $namePos)
14580    {
14581        if (null !== $name && $name->isSpecialClassName()) {
14582            $this->emitError(new Error(\sprintf('Cannot use \'%s\' as class name as it is reserved', $name), $this->getAttributesAt($namePos)));
14583        }
14584    }
14585    private function checkImplementedInterfaces(array $interfaces)
14586    {
14587        foreach ($interfaces as $interface) {
14588            if ($interface->isSpecialClassName()) {
14589                $this->emitError(new Error(\sprintf('Cannot use \'%s\' as interface name as it is reserved', $interface), $interface->getAttributes()));
14590            }
14591        }
14592    }
14593    protected function checkClass(Class_ $node, $namePos)
14594    {
14595        $this->checkClassName($node->name, $namePos);
14596        if ($node->extends && $node->extends->isSpecialClassName()) {
14597            $this->emitError(new Error(\sprintf('Cannot use \'%s\' as class name as it is reserved', $node->extends), $node->extends->getAttributes()));
14598        }
14599        $this->checkImplementedInterfaces($node->implements);
14600    }
14601    protected function checkInterface(Interface_ $node, $namePos)
14602    {
14603        $this->checkClassName($node->name, $namePos);
14604        $this->checkImplementedInterfaces($node->extends);
14605    }
14606    protected function checkEnum(Enum_ $node, $namePos)
14607    {
14608        $this->checkClassName($node->name, $namePos);
14609        $this->checkImplementedInterfaces($node->implements);
14610    }
14611    protected function checkClassMethod(ClassMethod $node, $modifierPos)
14612    {
14613        if ($node->flags & Class_::MODIFIER_STATIC) {
14614            switch ($node->name->toLowerString()) {
14615                case '__construct':
14616                    $this->emitError(new Error(\sprintf('Constructor %s() cannot be static', $node->name), $this->getAttributesAt($modifierPos)));
14617                    break;
14618                case '__destruct':
14619                    $this->emitError(new Error(\sprintf('Destructor %s() cannot be static', $node->name), $this->getAttributesAt($modifierPos)));
14620                    break;
14621                case '__clone':
14622                    $this->emitError(new Error(\sprintf('Clone method %s() cannot be static', $node->name), $this->getAttributesAt($modifierPos)));
14623                    break;
14624            }
14625        }
14626        if ($node->flags & Class_::MODIFIER_READONLY) {
14627            $this->emitError(new Error(\sprintf('Method %s() cannot be readonly', $node->name), $this->getAttributesAt($modifierPos)));
14628        }
14629    }
14630    protected function checkClassConst(ClassConst $node, $modifierPos)
14631    {
14632        if ($node->flags & Class_::MODIFIER_STATIC) {
14633            $this->emitError(new Error("Cannot use 'static' as constant modifier", $this->getAttributesAt($modifierPos)));
14634        }
14635        if ($node->flags & Class_::MODIFIER_ABSTRACT) {
14636            $this->emitError(new Error("Cannot use 'abstract' as constant modifier", $this->getAttributesAt($modifierPos)));
14637        }
14638        if ($node->flags & Class_::MODIFIER_READONLY) {
14639            $this->emitError(new Error("Cannot use 'readonly' as constant modifier", $this->getAttributesAt($modifierPos)));
14640        }
14641    }
14642    protected function checkProperty(Property $node, $modifierPos)
14643    {
14644        if ($node->flags & Class_::MODIFIER_ABSTRACT) {
14645            $this->emitError(new Error('Properties cannot be declared abstract', $this->getAttributesAt($modifierPos)));
14646        }
14647        if ($node->flags & Class_::MODIFIER_FINAL) {
14648            $this->emitError(new Error('Properties cannot be declared final', $this->getAttributesAt($modifierPos)));
14649        }
14650    }
14651    protected function checkUseUse(UseUse $node, $namePos)
14652    {
14653        if ($node->alias && $node->alias->isSpecialClassName()) {
14654            $this->emitError(new Error(\sprintf('Cannot use %s as %s because \'%2$s\' is a special class name', $node->name, $node->alias), $this->getAttributesAt($namePos)));
14655        }
14656    }
14657}
14658<?php
14659
14660namespace PHPUnit\PhpParser;
14661
14662class ConstExprEvaluationException extends \Exception
14663{
14664}
14665<?php
14666
14667declare (strict_types=1);
14668namespace PHPUnit\PhpParser;
14669
14670/**
14671 * @codeCoverageIgnore
14672 */
14673class NodeVisitorAbstract implements NodeVisitor
14674{
14675    public function beforeTraverse(array $nodes)
14676    {
14677        return null;
14678    }
14679    public function enterNode(Node $node)
14680    {
14681        return null;
14682    }
14683    public function leaveNode(Node $node)
14684    {
14685        return null;
14686    }
14687    public function afterTraverse(array $nodes)
14688    {
14689        return null;
14690    }
14691}
14692<?php
14693
14694declare (strict_types=1);
14695namespace PHPUnit\PhpParser;
14696
14697use PHPUnit\PhpParser\Node\Arg;
14698use PHPUnit\PhpParser\Node\Expr;
14699use PHPUnit\PhpParser\Node\Expr\BinaryOp\Concat;
14700use PHPUnit\PhpParser\Node\Identifier;
14701use PHPUnit\PhpParser\Node\Name;
14702use PHPUnit\PhpParser\Node\Scalar\String_;
14703use PHPUnit\PhpParser\Node\Stmt\Use_;
14704class BuilderFactory
14705{
14706    /**
14707     * Creates an attribute node.
14708     *
14709     * @param string|Name $name Name of the attribute
14710     * @param array       $args Attribute named arguments
14711     *
14712     * @return Node\Attribute
14713     */
14714    public function attribute($name, array $args = []) : Node\Attribute
14715    {
14716        return new Node\Attribute(BuilderHelpers::normalizeName($name), $this->args($args));
14717    }
14718    /**
14719     * Creates a namespace builder.
14720     *
14721     * @param null|string|Node\Name $name Name of the namespace
14722     *
14723     * @return Builder\Namespace_ The created namespace builder
14724     */
14725    public function namespace($name) : Builder\Namespace_
14726    {
14727        return new Builder\Namespace_($name);
14728    }
14729    /**
14730     * Creates a class builder.
14731     *
14732     * @param string $name Name of the class
14733     *
14734     * @return Builder\Class_ The created class builder
14735     */
14736    public function class(string $name) : Builder\Class_
14737    {
14738        return new Builder\Class_($name);
14739    }
14740    /**
14741     * Creates an interface builder.
14742     *
14743     * @param string $name Name of the interface
14744     *
14745     * @return Builder\Interface_ The created interface builder
14746     */
14747    public function interface(string $name) : Builder\Interface_
14748    {
14749        return new Builder\Interface_($name);
14750    }
14751    /**
14752     * Creates a trait builder.
14753     *
14754     * @param string $name Name of the trait
14755     *
14756     * @return Builder\Trait_ The created trait builder
14757     */
14758    public function trait(string $name) : Builder\Trait_
14759    {
14760        return new Builder\Trait_($name);
14761    }
14762    /**
14763     * Creates a trait use builder.
14764     *
14765     * @param Node\Name|string ...$traits Trait names
14766     *
14767     * @return Builder\TraitUse The create trait use builder
14768     */
14769    public function useTrait(...$traits) : Builder\TraitUse
14770    {
14771        return new Builder\TraitUse(...$traits);
14772    }
14773    /**
14774     * Creates a trait use adaptation builder.
14775     *
14776     * @param Node\Name|string|null  $trait  Trait name
14777     * @param Node\Identifier|string $method Method name
14778     *
14779     * @return Builder\TraitUseAdaptation The create trait use adaptation builder
14780     */
14781    public function traitUseAdaptation($trait, $method = null) : Builder\TraitUseAdaptation
14782    {
14783        if ($method === null) {
14784            $method = $trait;
14785            $trait = null;
14786        }
14787        return new Builder\TraitUseAdaptation($trait, $method);
14788    }
14789    /**
14790     * Creates a method builder.
14791     *
14792     * @param string $name Name of the method
14793     *
14794     * @return Builder\Method The created method builder
14795     */
14796    public function method(string $name) : Builder\Method
14797    {
14798        return new Builder\Method($name);
14799    }
14800    /**
14801     * Creates a parameter builder.
14802     *
14803     * @param string $name Name of the parameter
14804     *
14805     * @return Builder\Param The created parameter builder
14806     */
14807    public function param(string $name) : Builder\Param
14808    {
14809        return new Builder\Param($name);
14810    }
14811    /**
14812     * Creates a property builder.
14813     *
14814     * @param string $name Name of the property
14815     *
14816     * @return Builder\Property The created property builder
14817     */
14818    public function property(string $name) : Builder\Property
14819    {
14820        return new Builder\Property($name);
14821    }
14822    /**
14823     * Creates a function builder.
14824     *
14825     * @param string $name Name of the function
14826     *
14827     * @return Builder\Function_ The created function builder
14828     */
14829    public function function(string $name) : Builder\Function_
14830    {
14831        return new Builder\Function_($name);
14832    }
14833    /**
14834     * Creates a namespace/class use builder.
14835     *
14836     * @param Node\Name|string $name Name of the entity (namespace or class) to alias
14837     *
14838     * @return Builder\Use_ The created use builder
14839     */
14840    public function use($name) : Builder\Use_
14841    {
14842        return new Builder\Use_($name, Use_::TYPE_NORMAL);
14843    }
14844    /**
14845     * Creates a function use builder.
14846     *
14847     * @param Node\Name|string $name Name of the function to alias
14848     *
14849     * @return Builder\Use_ The created use function builder
14850     */
14851    public function useFunction($name) : Builder\Use_
14852    {
14853        return new Builder\Use_($name, Use_::TYPE_FUNCTION);
14854    }
14855    /**
14856     * Creates a constant use builder.
14857     *
14858     * @param Node\Name|string $name Name of the const to alias
14859     *
14860     * @return Builder\Use_ The created use const builder
14861     */
14862    public function useConst($name) : Builder\Use_
14863    {
14864        return new Builder\Use_($name, Use_::TYPE_CONSTANT);
14865    }
14866    /**
14867     * Creates a class constant builder.
14868     *
14869     * @param string|Identifier                          $name  Name
14870     * @param Node\Expr|bool|null|int|float|string|array $value Value
14871     *
14872     * @return Builder\ClassConst The created use const builder
14873     */
14874    public function classConst($name, $value) : Builder\ClassConst
14875    {
14876        return new Builder\ClassConst($name, $value);
14877    }
14878    /**
14879     * Creates node a for a literal value.
14880     *
14881     * @param Expr|bool|null|int|float|string|array $value $value
14882     *
14883     * @return Expr
14884     */
14885    public function val($value) : Expr
14886    {
14887        return BuilderHelpers::normalizeValue($value);
14888    }
14889    /**
14890     * Creates variable node.
14891     *
14892     * @param string|Expr $name Name
14893     *
14894     * @return Expr\Variable
14895     */
14896    public function var($name) : Expr\Variable
14897    {
14898        if (!\is_string($name) && !$name instanceof Expr) {
14899            throw new \LogicException('Variable name must be string or Expr');
14900        }
14901        return new Expr\Variable($name);
14902    }
14903    /**
14904     * Normalizes an argument list.
14905     *
14906     * Creates Arg nodes for all arguments and converts literal values to expressions.
14907     *
14908     * @param array $args List of arguments to normalize
14909     *
14910     * @return Arg[]
14911     */
14912    public function args(array $args) : array
14913    {
14914        $normalizedArgs = [];
14915        foreach ($args as $key => $arg) {
14916            if (!$arg instanceof Arg) {
14917                $arg = new Arg(BuilderHelpers::normalizeValue($arg));
14918            }
14919            if (\is_string($key)) {
14920                $arg->name = BuilderHelpers::normalizeIdentifier($key);
14921            }
14922            $normalizedArgs[] = $arg;
14923        }
14924        return $normalizedArgs;
14925    }
14926    /**
14927     * Creates a function call node.
14928     *
14929     * @param string|Name|Expr $name Function name
14930     * @param array            $args Function arguments
14931     *
14932     * @return Expr\FuncCall
14933     */
14934    public function funcCall($name, array $args = []) : Expr\FuncCall
14935    {
14936        return new Expr\FuncCall(BuilderHelpers::normalizeNameOrExpr($name), $this->args($args));
14937    }
14938    /**
14939     * Creates a method call node.
14940     *
14941     * @param Expr                   $var  Variable the method is called on
14942     * @param string|Identifier|Expr $name Method name
14943     * @param array                  $args Method arguments
14944     *
14945     * @return Expr\MethodCall
14946     */
14947    public function methodCall(Expr $var, $name, array $args = []) : Expr\MethodCall
14948    {
14949        return new Expr\MethodCall($var, BuilderHelpers::normalizeIdentifierOrExpr($name), $this->args($args));
14950    }
14951    /**
14952     * Creates a static method call node.
14953     *
14954     * @param string|Name|Expr       $class Class name
14955     * @param string|Identifier|Expr $name  Method name
14956     * @param array                  $args  Method arguments
14957     *
14958     * @return Expr\StaticCall
14959     */
14960    public function staticCall($class, $name, array $args = []) : Expr\StaticCall
14961    {
14962        return new Expr\StaticCall(BuilderHelpers::normalizeNameOrExpr($class), BuilderHelpers::normalizeIdentifierOrExpr($name), $this->args($args));
14963    }
14964    /**
14965     * Creates an object creation node.
14966     *
14967     * @param string|Name|Expr $class Class name
14968     * @param array            $args  Constructor arguments
14969     *
14970     * @return Expr\New_
14971     */
14972    public function new($class, array $args = []) : Expr\New_
14973    {
14974        return new Expr\New_(BuilderHelpers::normalizeNameOrExpr($class), $this->args($args));
14975    }
14976    /**
14977     * Creates a constant fetch node.
14978     *
14979     * @param string|Name $name Constant name
14980     *
14981     * @return Expr\ConstFetch
14982     */
14983    public function constFetch($name) : Expr\ConstFetch
14984    {
14985        return new Expr\ConstFetch(BuilderHelpers::normalizeName($name));
14986    }
14987    /**
14988     * Creates a property fetch node.
14989     *
14990     * @param Expr                   $var  Variable holding object
14991     * @param string|Identifier|Expr $name Property name
14992     *
14993     * @return Expr\PropertyFetch
14994     */
14995    public function propertyFetch(Expr $var, $name) : Expr\PropertyFetch
14996    {
14997        return new Expr\PropertyFetch($var, BuilderHelpers::normalizeIdentifierOrExpr($name));
14998    }
14999    /**
15000     * Creates a class constant fetch node.
15001     *
15002     * @param string|Name|Expr  $class Class name
15003     * @param string|Identifier $name  Constant name
15004     *
15005     * @return Expr\ClassConstFetch
15006     */
15007    public function classConstFetch($class, $name) : Expr\ClassConstFetch
15008    {
15009        return new Expr\ClassConstFetch(BuilderHelpers::normalizeNameOrExpr($class), BuilderHelpers::normalizeIdentifier($name));
15010    }
15011    /**
15012     * Creates nested Concat nodes from a list of expressions.
15013     *
15014     * @param Expr|string ...$exprs Expressions or literal strings
15015     *
15016     * @return Concat
15017     */
15018    public function concat(...$exprs) : Concat
15019    {
15020        $numExprs = \count($exprs);
15021        if ($numExprs < 2) {
15022            throw new \LogicException('Expected at least two expressions');
15023        }
15024        $lastConcat = $this->normalizeStringExpr($exprs[0]);
15025        for ($i = 1; $i < $numExprs; $i++) {
15026            $lastConcat = new Concat($lastConcat, $this->normalizeStringExpr($exprs[$i]));
15027        }
15028        return $lastConcat;
15029    }
15030    /**
15031     * @param string|Expr $expr
15032     * @return Expr
15033     */
15034    private function normalizeStringExpr($expr) : Expr
15035    {
15036        if ($expr instanceof Expr) {
15037            return $expr;
15038        }
15039        if (\is_string($expr)) {
15040            return new String_($expr);
15041        }
15042        throw new \LogicException('Expected string or Expr');
15043    }
15044}
15045<?php
15046
15047declare (strict_types=1);
15048namespace PHPUnit\PhpParser;
15049
15050interface NodeTraverserInterface
15051{
15052    /**
15053     * Adds a visitor.
15054     *
15055     * @param NodeVisitor $visitor Visitor to add
15056     */
15057    public function addVisitor(NodeVisitor $visitor);
15058    /**
15059     * Removes an added visitor.
15060     *
15061     * @param NodeVisitor $visitor
15062     */
15063    public function removeVisitor(NodeVisitor $visitor);
15064    /**
15065     * Traverses an array of nodes using the registered visitors.
15066     *
15067     * @param Node[] $nodes Array of nodes
15068     *
15069     * @return Node[] Traversed array of nodes
15070     */
15071    public function traverse(array $nodes) : array;
15072}
15073<?php
15074
15075declare (strict_types=1);
15076namespace PHPUnit\PhpParser;
15077
15078interface Builder
15079{
15080    /**
15081     * Returns the built node.
15082     *
15083     * @return Node The built node
15084     */
15085    public function getNode() : Node;
15086}
15087<?php
15088
15089declare (strict_types=1);
15090namespace PHPUnit\PhpParser\ErrorHandler;
15091
15092use PHPUnit\PhpParser\Error;
15093use PHPUnit\PhpParser\ErrorHandler;
15094/**
15095 * Error handler that handles all errors by throwing them.
15096 *
15097 * This is the default strategy used by all components.
15098 */
15099class Throwing implements ErrorHandler
15100{
15101    public function handleError(Error $error)
15102    {
15103        throw $error;
15104    }
15105}
15106<?php
15107
15108declare (strict_types=1);
15109namespace PHPUnit\PhpParser\ErrorHandler;
15110
15111use PHPUnit\PhpParser\Error;
15112use PHPUnit\PhpParser\ErrorHandler;
15113/**
15114 * Error handler that collects all errors into an array.
15115 *
15116 * This allows graceful handling of errors.
15117 */
15118class Collecting implements ErrorHandler
15119{
15120    /** @var Error[] Collected errors */
15121    private $errors = [];
15122    public function handleError(Error $error)
15123    {
15124        $this->errors[] = $error;
15125    }
15126    /**
15127     * Get collected errors.
15128     *
15129     * @return Error[]
15130     */
15131    public function getErrors() : array
15132    {
15133        return $this->errors;
15134    }
15135    /**
15136     * Check whether there are any errors.
15137     *
15138     * @return bool
15139     */
15140    public function hasErrors() : bool
15141    {
15142        return !empty($this->errors);
15143    }
15144    /**
15145     * Reset/clear collected errors.
15146     */
15147    public function clearErrors()
15148    {
15149        $this->errors = [];
15150    }
15151}
15152<?php
15153
15154declare (strict_types=1);
15155namespace PHPUnit\PhpParser;
15156
15157use PHPUnit\PhpParser\NodeVisitor\FindingVisitor;
15158use PHPUnit\PhpParser\NodeVisitor\FirstFindingVisitor;
15159class NodeFinder
15160{
15161    /**
15162     * Find all nodes satisfying a filter callback.
15163     *
15164     * @param Node|Node[] $nodes  Single node or array of nodes to search in
15165     * @param callable    $filter Filter callback: function(Node $node) : bool
15166     *
15167     * @return Node[] Found nodes satisfying the filter callback
15168     */
15169    public function find($nodes, callable $filter) : array
15170    {
15171        if (!\is_array($nodes)) {
15172            $nodes = [$nodes];
15173        }
15174        $visitor = new FindingVisitor($filter);
15175        $traverser = new NodeTraverser();
15176        $traverser->addVisitor($visitor);
15177        $traverser->traverse($nodes);
15178        return $visitor->getFoundNodes();
15179    }
15180    /**
15181     * Find all nodes that are instances of a certain class.
15182     *
15183     * @param Node|Node[] $nodes Single node or array of nodes to search in
15184     * @param string      $class Class name
15185     *
15186     * @return Node[] Found nodes (all instances of $class)
15187     */
15188    public function findInstanceOf($nodes, string $class) : array
15189    {
15190        return $this->find($nodes, function ($node) use($class) {
15191            return $node instanceof $class;
15192        });
15193    }
15194    /**
15195     * Find first node satisfying a filter callback.
15196     *
15197     * @param Node|Node[] $nodes  Single node or array of nodes to search in
15198     * @param callable    $filter Filter callback: function(Node $node) : bool
15199     *
15200     * @return null|Node Found node (or null if none found)
15201     */
15202    public function findFirst($nodes, callable $filter)
15203    {
15204        if (!\is_array($nodes)) {
15205            $nodes = [$nodes];
15206        }
15207        $visitor = new FirstFindingVisitor($filter);
15208        $traverser = new NodeTraverser();
15209        $traverser->addVisitor($visitor);
15210        $traverser->traverse($nodes);
15211        return $visitor->getFoundNode();
15212    }
15213    /**
15214     * Find first node that is an instance of a certain class.
15215     *
15216     * @param Node|Node[] $nodes  Single node or array of nodes to search in
15217     * @param string      $class Class name
15218     *
15219     * @return null|Node Found node, which is an instance of $class (or null if none found)
15220     */
15221    public function findFirstInstanceOf($nodes, string $class)
15222    {
15223        return $this->findFirst($nodes, function ($node) use($class) {
15224            return $node instanceof $class;
15225        });
15226    }
15227}
15228<?php
15229
15230declare (strict_types=1);
15231namespace PHPUnit\PhpParser;
15232
15233interface Node
15234{
15235    /**
15236     * Gets the type of the node.
15237     *
15238     * @return string Type of the node
15239     */
15240    public function getType() : string;
15241    /**
15242     * Gets the names of the sub nodes.
15243     *
15244     * @return array Names of sub nodes
15245     */
15246    public function getSubNodeNames() : array;
15247    /**
15248     * Gets line the node started in (alias of getStartLine).
15249     *
15250     * @return int Start line (or -1 if not available)
15251     */
15252    public function getLine() : int;
15253    /**
15254     * Gets line the node started in.
15255     *
15256     * Requires the 'startLine' attribute to be enabled in the lexer (enabled by default).
15257     *
15258     * @return int Start line (or -1 if not available)
15259     */
15260    public function getStartLine() : int;
15261    /**
15262     * Gets the line the node ended in.
15263     *
15264     * Requires the 'endLine' attribute to be enabled in the lexer (enabled by default).
15265     *
15266     * @return int End line (or -1 if not available)
15267     */
15268    public function getEndLine() : int;
15269    /**
15270     * Gets the token offset of the first token that is part of this node.
15271     *
15272     * The offset is an index into the array returned by Lexer::getTokens().
15273     *
15274     * Requires the 'startTokenPos' attribute to be enabled in the lexer (DISABLED by default).
15275     *
15276     * @return int Token start position (or -1 if not available)
15277     */
15278    public function getStartTokenPos() : int;
15279    /**
15280     * Gets the token offset of the last token that is part of this node.
15281     *
15282     * The offset is an index into the array returned by Lexer::getTokens().
15283     *
15284     * Requires the 'endTokenPos' attribute to be enabled in the lexer (DISABLED by default).
15285     *
15286     * @return int Token end position (or -1 if not available)
15287     */
15288    public function getEndTokenPos() : int;
15289    /**
15290     * Gets the file offset of the first character that is part of this node.
15291     *
15292     * Requires the 'startFilePos' attribute to be enabled in the lexer (DISABLED by default).
15293     *
15294     * @return int File start position (or -1 if not available)
15295     */
15296    public function getStartFilePos() : int;
15297    /**
15298     * Gets the file offset of the last character that is part of this node.
15299     *
15300     * Requires the 'endFilePos' attribute to be enabled in the lexer (DISABLED by default).
15301     *
15302     * @return int File end position (or -1 if not available)
15303     */
15304    public function getEndFilePos() : int;
15305    /**
15306     * Gets all comments directly preceding this node.
15307     *
15308     * The comments are also available through the "comments" attribute.
15309     *
15310     * @return Comment[]
15311     */
15312    public function getComments() : array;
15313    /**
15314     * Gets the doc comment of the node.
15315     *
15316     * @return null|Comment\Doc Doc comment object or null
15317     */
15318    public function getDocComment();
15319    /**
15320     * Sets the doc comment of the node.
15321     *
15322     * This will either replace an existing doc comment or add it to the comments array.
15323     *
15324     * @param Comment\Doc $docComment Doc comment to set
15325     */
15326    public function setDocComment(Comment\Doc $docComment);
15327    /**
15328     * Sets an attribute on a node.
15329     *
15330     * @param string $key
15331     * @param mixed  $value
15332     */
15333    public function setAttribute(string $key, $value);
15334    /**
15335     * Returns whether an attribute exists.
15336     *
15337     * @param string $key
15338     *
15339     * @return bool
15340     */
15341    public function hasAttribute(string $key) : bool;
15342    /**
15343     * Returns the value of an attribute.
15344     *
15345     * @param string $key
15346     * @param mixed  $default
15347     *
15348     * @return mixed
15349     */
15350    public function getAttribute(string $key, $default = null);
15351    /**
15352     * Returns all the attributes of this node.
15353     *
15354     * @return array
15355     */
15356    public function getAttributes() : array;
15357    /**
15358     * Replaces all the attributes of this node.
15359     *
15360     * @param array $attributes
15361     */
15362    public function setAttributes(array $attributes);
15363}
15364<?php
15365
15366declare (strict_types=1);
15367namespace PHPUnit\PhpParser;
15368
15369use PHPUnit\PhpParser\Node\ComplexType;
15370use PHPUnit\PhpParser\Node\Expr;
15371use PHPUnit\PhpParser\Node\Identifier;
15372use PHPUnit\PhpParser\Node\Name;
15373use PHPUnit\PhpParser\Node\NullableType;
15374use PHPUnit\PhpParser\Node\Scalar;
15375use PHPUnit\PhpParser\Node\Stmt;
15376/**
15377 * This class defines helpers used in the implementation of builders. Don't use it directly.
15378 *
15379 * @internal
15380 */
15381final class BuilderHelpers
15382{
15383    /**
15384     * Normalizes a node: Converts builder objects to nodes.
15385     *
15386     * @param Node|Builder $node The node to normalize
15387     *
15388     * @return Node The normalized node
15389     */
15390    public static function normalizeNode($node) : Node
15391    {
15392        if ($node instanceof Builder) {
15393            return $node->getNode();
15394        }
15395        if ($node instanceof Node) {
15396            return $node;
15397        }
15398        throw new \LogicException('Expected node or builder object');
15399    }
15400    /**
15401     * Normalizes a node to a statement.
15402     *
15403     * Expressions are wrapped in a Stmt\Expression node.
15404     *
15405     * @param Node|Builder $node The node to normalize
15406     *
15407     * @return Stmt The normalized statement node
15408     */
15409    public static function normalizeStmt($node) : Stmt
15410    {
15411        $node = self::normalizeNode($node);
15412        if ($node instanceof Stmt) {
15413            return $node;
15414        }
15415        if ($node instanceof Expr) {
15416            return new Stmt\Expression($node);
15417        }
15418        throw new \LogicException('Expected statement or expression node');
15419    }
15420    /**
15421     * Normalizes strings to Identifier.
15422     *
15423     * @param string|Identifier $name The identifier to normalize
15424     *
15425     * @return Identifier The normalized identifier
15426     */
15427    public static function normalizeIdentifier($name) : Identifier
15428    {
15429        if ($name instanceof Identifier) {
15430            return $name;
15431        }
15432        if (\is_string($name)) {
15433            return new Identifier($name);
15434        }
15435        throw new \LogicException('PHPUnit\\Expected string or instance of Node\\Identifier');
15436    }
15437    /**
15438     * Normalizes strings to Identifier, also allowing expressions.
15439     *
15440     * @param string|Identifier|Expr $name The identifier to normalize
15441     *
15442     * @return Identifier|Expr The normalized identifier or expression
15443     */
15444    public static function normalizeIdentifierOrExpr($name)
15445    {
15446        if ($name instanceof Identifier || $name instanceof Expr) {
15447            return $name;
15448        }
15449        if (\is_string($name)) {
15450            return new Identifier($name);
15451        }
15452        throw new \LogicException('PHPUnit\\Expected string or instance of Node\\Identifier or Node\\Expr');
15453    }
15454    /**
15455     * Normalizes a name: Converts string names to Name nodes.
15456     *
15457     * @param Name|string $name The name to normalize
15458     *
15459     * @return Name The normalized name
15460     */
15461    public static function normalizeName($name) : Name
15462    {
15463        if ($name instanceof Name) {
15464            return $name;
15465        }
15466        if (\is_string($name)) {
15467            if (!$name) {
15468                throw new \LogicException('Name cannot be empty');
15469            }
15470            if ($name[0] === '\\') {
15471                return new Name\FullyQualified(\substr($name, 1));
15472            }
15473            if (0 === \strpos($name, 'namespace\\')) {
15474                return new Name\Relative(\substr($name, \strlen('namespace\\')));
15475            }
15476            return new Name($name);
15477        }
15478        throw new \LogicException('PHPUnit\\Name must be a string or an instance of Node\\Name');
15479    }
15480    /**
15481     * Normalizes a name: Converts string names to Name nodes, while also allowing expressions.
15482     *
15483     * @param Expr|Name|string $name The name to normalize
15484     *
15485     * @return Name|Expr The normalized name or expression
15486     */
15487    public static function normalizeNameOrExpr($name)
15488    {
15489        if ($name instanceof Expr) {
15490            return $name;
15491        }
15492        if (!\is_string($name) && !$name instanceof Name) {
15493            throw new \LogicException('PHPUnit\\Name must be a string or an instance of Node\\Name or Node\\Expr');
15494        }
15495        return self::normalizeName($name);
15496    }
15497    /**
15498     * Normalizes a type: Converts plain-text type names into proper AST representation.
15499     *
15500     * In particular, builtin types become Identifiers, custom types become Names and nullables
15501     * are wrapped in NullableType nodes.
15502     *
15503     * @param string|Name|Identifier|ComplexType $type The type to normalize
15504     *
15505     * @return Name|Identifier|ComplexType The normalized type
15506     */
15507    public static function normalizeType($type)
15508    {
15509        if (!\is_string($type)) {
15510            if (!$type instanceof Name && !$type instanceof Identifier && !$type instanceof ComplexType) {
15511                throw new \LogicException('Type must be a string, or an instance of Name, Identifier or ComplexType');
15512            }
15513            return $type;
15514        }
15515        $nullable = \false;
15516        if (\strlen($type) > 0 && $type[0] === '?') {
15517            $nullable = \true;
15518            $type = \substr($type, 1);
15519        }
15520        $builtinTypes = ['array', 'callable', 'string', 'int', 'float', 'bool', 'iterable', 'void', 'object', 'mixed', 'never'];
15521        $lowerType = \strtolower($type);
15522        if (\in_array($lowerType, $builtinTypes)) {
15523            $type = new Identifier($lowerType);
15524        } else {
15525            $type = self::normalizeName($type);
15526        }
15527        $notNullableTypes = ['void', 'mixed', 'never'];
15528        if ($nullable && \in_array((string) $type, $notNullableTypes)) {
15529            throw new \LogicException(\sprintf('%s type cannot be nullable', $type));
15530        }
15531        return $nullable ? new NullableType($type) : $type;
15532    }
15533    /**
15534     * Normalizes a value: Converts nulls, booleans, integers,
15535     * floats, strings and arrays into their respective nodes
15536     *
15537     * @param Node\Expr|bool|null|int|float|string|array $value The value to normalize
15538     *
15539     * @return Expr The normalized value
15540     */
15541    public static function normalizeValue($value) : Expr
15542    {
15543        if ($value instanceof Node\Expr) {
15544            return $value;
15545        }
15546        if (\is_null($value)) {
15547            return new Expr\ConstFetch(new Name('null'));
15548        }
15549        if (\is_bool($value)) {
15550            return new Expr\ConstFetch(new Name($value ? 'true' : 'false'));
15551        }
15552        if (\is_int($value)) {
15553            return new Scalar\LNumber($value);
15554        }
15555        if (\is_float($value)) {
15556            return new Scalar\DNumber($value);
15557        }
15558        if (\is_string($value)) {
15559            return new Scalar\String_($value);
15560        }
15561        if (\is_array($value)) {
15562            $items = [];
15563            $lastKey = -1;
15564            foreach ($value as $itemKey => $itemValue) {
15565                // for consecutive, numeric keys don't generate keys
15566                if (null !== $lastKey && ++$lastKey === $itemKey) {
15567                    $items[] = new Expr\ArrayItem(self::normalizeValue($itemValue));
15568                } else {
15569                    $lastKey = null;
15570                    $items[] = new Expr\ArrayItem(self::normalizeValue($itemValue), self::normalizeValue($itemKey));
15571                }
15572            }
15573            return new Expr\Array_($items);
15574        }
15575        throw new \LogicException('Invalid value');
15576    }
15577    /**
15578     * Normalizes a doc comment: Converts plain strings to PhpParser\Comment\Doc.
15579     *
15580     * @param Comment\Doc|string $docComment The doc comment to normalize
15581     *
15582     * @return Comment\Doc The normalized doc comment
15583     */
15584    public static function normalizeDocComment($docComment) : Comment\Doc
15585    {
15586        if ($docComment instanceof Comment\Doc) {
15587            return $docComment;
15588        }
15589        if (\is_string($docComment)) {
15590            return new Comment\Doc($docComment);
15591        }
15592        throw new \LogicException('PHPUnit\\Doc comment must be a string or an instance of PhpParser\\Comment\\Doc');
15593    }
15594    /**
15595     * Normalizes a attribute: Converts attribute to the Attribute Group if needed.
15596     *
15597     * @param Node\Attribute|Node\AttributeGroup $attribute
15598     *
15599     * @return Node\AttributeGroup The Attribute Group
15600     */
15601    public static function normalizeAttribute($attribute) : Node\AttributeGroup
15602    {
15603        if ($attribute instanceof Node\AttributeGroup) {
15604            return $attribute;
15605        }
15606        if (!$attribute instanceof Node\Attribute) {
15607            throw new \LogicException('PHPUnit\\Attribute must be an instance of PhpParser\\Node\\Attribute or PhpParser\\Node\\AttributeGroup');
15608        }
15609        return new Node\AttributeGroup([$attribute]);
15610    }
15611    /**
15612     * Adds a modifier and returns new modifier bitmask.
15613     *
15614     * @param int $modifiers Existing modifiers
15615     * @param int $modifier  Modifier to set
15616     *
15617     * @return int New modifiers
15618     */
15619    public static function addModifier(int $modifiers, int $modifier) : int
15620    {
15621        Stmt\Class_::verifyModifier($modifiers, $modifier);
15622        return $modifiers | $modifier;
15623    }
15624}
15625<?php
15626
15627declare (strict_types=1);
15628namespace PHPUnit\PhpParser\PrettyPrinter;
15629
15630use PHPUnit\PhpParser\Node;
15631use PHPUnit\PhpParser\Node\Expr;
15632use PHPUnit\PhpParser\Node\Expr\AssignOp;
15633use PHPUnit\PhpParser\Node\Expr\BinaryOp;
15634use PHPUnit\PhpParser\Node\Expr\Cast;
15635use PHPUnit\PhpParser\Node\Name;
15636use PHPUnit\PhpParser\Node\Scalar;
15637use PHPUnit\PhpParser\Node\Scalar\MagicConst;
15638use PHPUnit\PhpParser\Node\Stmt;
15639use PHPUnit\PhpParser\PrettyPrinterAbstract;
15640class Standard extends PrettyPrinterAbstract
15641{
15642    // Special nodes
15643    protected function pParam(Node\Param $node)
15644    {
15645        return $this->pAttrGroups($node->attrGroups, \true) . $this->pModifiers($node->flags) . ($node->type ? $this->p($node->type) . ' ' : '') . ($node->byRef ? '&' : '') . ($node->variadic ? '...' : '') . $this->p($node->var) . ($node->default ? ' = ' . $this->p($node->default) : '');
15646    }
15647    protected function pArg(Node\Arg $node)
15648    {
15649        return ($node->name ? $node->name->toString() . ': ' : '') . ($node->byRef ? '&' : '') . ($node->unpack ? '...' : '') . $this->p($node->value);
15650    }
15651    protected function pVariadicPlaceholder(Node\VariadicPlaceholder $node)
15652    {
15653        return '...';
15654    }
15655    protected function pConst(Node\Const_ $node)
15656    {
15657        return $node->name . ' = ' . $this->p($node->value);
15658    }
15659    protected function pNullableType(Node\NullableType $node)
15660    {
15661        return '?' . $this->p($node->type);
15662    }
15663    protected function pUnionType(Node\UnionType $node)
15664    {
15665        return $this->pImplode($node->types, '|');
15666    }
15667    protected function pIntersectionType(Node\IntersectionType $node)
15668    {
15669        return $this->pImplode($node->types, '&');
15670    }
15671    protected function pIdentifier(Node\Identifier $node)
15672    {
15673        return $node->name;
15674    }
15675    protected function pVarLikeIdentifier(Node\VarLikeIdentifier $node)
15676    {
15677        return '$' . $node->name;
15678    }
15679    protected function pAttribute(Node\Attribute $node)
15680    {
15681        return $this->p($node->name) . ($node->args ? '(' . $this->pCommaSeparated($node->args) . ')' : '');
15682    }
15683    protected function pAttributeGroup(Node\AttributeGroup $node)
15684    {
15685        return '#[' . $this->pCommaSeparated($node->attrs) . ']';
15686    }
15687    // Names
15688    protected function pName(Name $node)
15689    {
15690        return \implode('\\', $node->parts);
15691    }
15692    protected function pName_FullyQualified(Name\FullyQualified $node)
15693    {
15694        return '\\' . \implode('\\', $node->parts);
15695    }
15696    protected function pName_Relative(Name\Relative $node)
15697    {
15698        return 'namespace\\' . \implode('\\', $node->parts);
15699    }
15700    // Magic Constants
15701    protected function pScalar_MagicConst_Class(MagicConst\Class_ $node)
15702    {
15703        return '__CLASS__';
15704    }
15705    protected function pScalar_MagicConst_Dir(MagicConst\Dir $node)
15706    {
15707        return '__DIR__';
15708    }
15709    protected function pScalar_MagicConst_File(MagicConst\File $node)
15710    {
15711        return '__FILE__';
15712    }
15713    protected function pScalar_MagicConst_Function(MagicConst\Function_ $node)
15714    {
15715        return '__FUNCTION__';
15716    }
15717    protected function pScalar_MagicConst_Line(MagicConst\Line $node)
15718    {
15719        return '__LINE__';
15720    }
15721    protected function pScalar_MagicConst_Method(MagicConst\Method $node)
15722    {
15723        return '__METHOD__';
15724    }
15725    protected function pScalar_MagicConst_Namespace(MagicConst\Namespace_ $node)
15726    {
15727        return '__NAMESPACE__';
15728    }
15729    protected function pScalar_MagicConst_Trait(MagicConst\Trait_ $node)
15730    {
15731        return '__TRAIT__';
15732    }
15733    // Scalars
15734    protected function pScalar_String(Scalar\String_ $node)
15735    {
15736        $kind = $node->getAttribute('kind', Scalar\String_::KIND_SINGLE_QUOTED);
15737        switch ($kind) {
15738            case Scalar\String_::KIND_NOWDOC:
15739                $label = $node->getAttribute('docLabel');
15740                if ($label && !$this->containsEndLabel($node->value, $label)) {
15741                    if ($node->value === '') {
15742                        return "<<<'{$label}'\n{$label}" . $this->docStringEndToken;
15743                    }
15744                    return "<<<'{$label}'\n{$node->value}\n{$label}" . $this->docStringEndToken;
15745                }
15746            /* break missing intentionally */
15747            case Scalar\String_::KIND_SINGLE_QUOTED:
15748                return $this->pSingleQuotedString($node->value);
15749            case Scalar\String_::KIND_HEREDOC:
15750                $label = $node->getAttribute('docLabel');
15751                if ($label && !$this->containsEndLabel($node->value, $label)) {
15752                    if ($node->value === '') {
15753                        return "<<<{$label}\n{$label}" . $this->docStringEndToken;
15754                    }
15755                    $escaped = $this->escapeString($node->value, null);
15756                    return "<<<{$label}\n" . $escaped . "\n{$label}" . $this->docStringEndToken;
15757                }
15758            /* break missing intentionally */
15759            case Scalar\String_::KIND_DOUBLE_QUOTED:
15760                return '"' . $this->escapeString($node->value, '"') . '"';
15761        }
15762        throw new \Exception('Invalid string kind');
15763    }
15764    protected function pScalar_Encapsed(Scalar\Encapsed $node)
15765    {
15766        if ($node->getAttribute('kind') === Scalar\String_::KIND_HEREDOC) {
15767            $label = $node->getAttribute('docLabel');
15768            if ($label && !$this->encapsedContainsEndLabel($node->parts, $label)) {
15769                if (\count($node->parts) === 1 && $node->parts[0] instanceof Scalar\EncapsedStringPart && $node->parts[0]->value === '') {
15770                    return "<<<{$label}\n{$label}" . $this->docStringEndToken;
15771                }
15772                return "<<<{$label}\n" . $this->pEncapsList($node->parts, null) . "\n{$label}" . $this->docStringEndToken;
15773            }
15774        }
15775        return '"' . $this->pEncapsList($node->parts, '"') . '"';
15776    }
15777    protected function pScalar_LNumber(Scalar\LNumber $node)
15778    {
15779        if ($node->value === -\PHP_INT_MAX - 1) {
15780            // PHP_INT_MIN cannot be represented as a literal,
15781            // because the sign is not part of the literal
15782            return '(-' . \PHP_INT_MAX . '-1)';
15783        }
15784        $kind = $node->getAttribute('kind', Scalar\LNumber::KIND_DEC);
15785        if (Scalar\LNumber::KIND_DEC === $kind) {
15786            return (string) $node->value;
15787        }
15788        if ($node->value < 0) {
15789            $sign = '-';
15790            $str = (string) -$node->value;
15791        } else {
15792            $sign = '';
15793            $str = (string) $node->value;
15794        }
15795        switch ($kind) {
15796            case Scalar\LNumber::KIND_BIN:
15797                return $sign . '0b' . \base_convert($str, 10, 2);
15798            case Scalar\LNumber::KIND_OCT:
15799                return $sign . '0' . \base_convert($str, 10, 8);
15800            case Scalar\LNumber::KIND_HEX:
15801                return $sign . '0x' . \base_convert($str, 10, 16);
15802        }
15803        throw new \Exception('Invalid number kind');
15804    }
15805    protected function pScalar_DNumber(Scalar\DNumber $node)
15806    {
15807        if (!\is_finite($node->value)) {
15808            if ($node->value === \INF) {
15809                return '\\INF';
15810            } elseif ($node->value === -\INF) {
15811                return '-\\INF';
15812            } else {
15813                return '\\NAN';
15814            }
15815        }
15816        // Try to find a short full-precision representation
15817        $stringValue = \sprintf('%.16G', $node->value);
15818        if ($node->value !== (double) $stringValue) {
15819            $stringValue = \sprintf('%.17G', $node->value);
15820        }
15821        // %G is locale dependent and there exists no locale-independent alternative. We don't want
15822        // mess with switching locales here, so let's assume that a comma is the only non-standard
15823        // decimal separator we may encounter...
15824        $stringValue = \str_replace(',', '.', $stringValue);
15825        // ensure that number is really printed as float
15826        return \preg_match('/^-?[0-9]+$/', $stringValue) ? $stringValue . '.0' : $stringValue;
15827    }
15828    protected function pScalar_EncapsedStringPart(Scalar\EncapsedStringPart $node)
15829    {
15830        throw new \LogicException('Cannot directly print EncapsedStringPart');
15831    }
15832    // Assignments
15833    protected function pExpr_Assign(Expr\Assign $node)
15834    {
15835        return $this->pInfixOp(Expr\Assign::class, $node->var, ' = ', $node->expr);
15836    }
15837    protected function pExpr_AssignRef(Expr\AssignRef $node)
15838    {
15839        return $this->pInfixOp(Expr\AssignRef::class, $node->var, ' =& ', $node->expr);
15840    }
15841    protected function pExpr_AssignOp_Plus(AssignOp\Plus $node)
15842    {
15843        return $this->pInfixOp(AssignOp\Plus::class, $node->var, ' += ', $node->expr);
15844    }
15845    protected function pExpr_AssignOp_Minus(AssignOp\Minus $node)
15846    {
15847        return $this->pInfixOp(AssignOp\Minus::class, $node->var, ' -= ', $node->expr);
15848    }
15849    protected function pExpr_AssignOp_Mul(AssignOp\Mul $node)
15850    {
15851        return $this->pInfixOp(AssignOp\Mul::class, $node->var, ' *= ', $node->expr);
15852    }
15853    protected function pExpr_AssignOp_Div(AssignOp\Div $node)
15854    {
15855        return $this->pInfixOp(AssignOp\Div::class, $node->var, ' /= ', $node->expr);
15856    }
15857    protected function pExpr_AssignOp_Concat(AssignOp\Concat $node)
15858    {
15859        return $this->pInfixOp(AssignOp\Concat::class, $node->var, ' .= ', $node->expr);
15860    }
15861    protected function pExpr_AssignOp_Mod(AssignOp\Mod $node)
15862    {
15863        return $this->pInfixOp(AssignOp\Mod::class, $node->var, ' %= ', $node->expr);
15864    }
15865    protected function pExpr_AssignOp_BitwiseAnd(AssignOp\BitwiseAnd $node)
15866    {
15867        return $this->pInfixOp(AssignOp\BitwiseAnd::class, $node->var, ' &= ', $node->expr);
15868    }
15869    protected function pExpr_AssignOp_BitwiseOr(AssignOp\BitwiseOr $node)
15870    {
15871        return $this->pInfixOp(AssignOp\BitwiseOr::class, $node->var, ' |= ', $node->expr);
15872    }
15873    protected function pExpr_AssignOp_BitwiseXor(AssignOp\BitwiseXor $node)
15874    {
15875        return $this->pInfixOp(AssignOp\BitwiseXor::class, $node->var, ' ^= ', $node->expr);
15876    }
15877    protected function pExpr_AssignOp_ShiftLeft(AssignOp\ShiftLeft $node)
15878    {
15879        return $this->pInfixOp(AssignOp\ShiftLeft::class, $node->var, ' <<= ', $node->expr);
15880    }
15881    protected function pExpr_AssignOp_ShiftRight(AssignOp\ShiftRight $node)
15882    {
15883        return $this->pInfixOp(AssignOp\ShiftRight::class, $node->var, ' >>= ', $node->expr);
15884    }
15885    protected function pExpr_AssignOp_Pow(AssignOp\Pow $node)
15886    {
15887        return $this->pInfixOp(AssignOp\Pow::class, $node->var, ' **= ', $node->expr);
15888    }
15889    protected function pExpr_AssignOp_Coalesce(AssignOp\Coalesce $node)
15890    {
15891        return $this->pInfixOp(AssignOp\Coalesce::class, $node->var, ' ??= ', $node->expr);
15892    }
15893    // Binary expressions
15894    protected function pExpr_BinaryOp_Plus(BinaryOp\Plus $node)
15895    {
15896        return $this->pInfixOp(BinaryOp\Plus::class, $node->left, ' + ', $node->right);
15897    }
15898    protected function pExpr_BinaryOp_Minus(BinaryOp\Minus $node)
15899    {
15900        return $this->pInfixOp(BinaryOp\Minus::class, $node->left, ' - ', $node->right);
15901    }
15902    protected function pExpr_BinaryOp_Mul(BinaryOp\Mul $node)
15903    {
15904        return $this->pInfixOp(BinaryOp\Mul::class, $node->left, ' * ', $node->right);
15905    }
15906    protected function pExpr_BinaryOp_Div(BinaryOp\Div $node)
15907    {
15908        return $this->pInfixOp(BinaryOp\Div::class, $node->left, ' / ', $node->right);
15909    }
15910    protected function pExpr_BinaryOp_Concat(BinaryOp\Concat $node)
15911    {
15912        return $this->pInfixOp(BinaryOp\Concat::class, $node->left, ' . ', $node->right);
15913    }
15914    protected function pExpr_BinaryOp_Mod(BinaryOp\Mod $node)
15915    {
15916        return $this->pInfixOp(BinaryOp\Mod::class, $node->left, ' % ', $node->right);
15917    }
15918    protected function pExpr_BinaryOp_BooleanAnd(BinaryOp\BooleanAnd $node)
15919    {
15920        return $this->pInfixOp(BinaryOp\BooleanAnd::class, $node->left, ' && ', $node->right);
15921    }
15922    protected function pExpr_BinaryOp_BooleanOr(BinaryOp\BooleanOr $node)
15923    {
15924        return $this->pInfixOp(BinaryOp\BooleanOr::class, $node->left, ' || ', $node->right);
15925    }
15926    protected function pExpr_BinaryOp_BitwiseAnd(BinaryOp\BitwiseAnd $node)
15927    {
15928        return $this->pInfixOp(BinaryOp\BitwiseAnd::class, $node->left, ' & ', $node->right);
15929    }
15930    protected function pExpr_BinaryOp_BitwiseOr(BinaryOp\BitwiseOr $node)
15931    {
15932        return $this->pInfixOp(BinaryOp\BitwiseOr::class, $node->left, ' | ', $node->right);
15933    }
15934    protected function pExpr_BinaryOp_BitwiseXor(BinaryOp\BitwiseXor $node)
15935    {
15936        return $this->pInfixOp(BinaryOp\BitwiseXor::class, $node->left, ' ^ ', $node->right);
15937    }
15938    protected function pExpr_BinaryOp_ShiftLeft(BinaryOp\ShiftLeft $node)
15939    {
15940        return $this->pInfixOp(BinaryOp\ShiftLeft::class, $node->left, ' << ', $node->right);
15941    }
15942    protected function pExpr_BinaryOp_ShiftRight(BinaryOp\ShiftRight $node)
15943    {
15944        return $this->pInfixOp(BinaryOp\ShiftRight::class, $node->left, ' >> ', $node->right);
15945    }
15946    protected function pExpr_BinaryOp_Pow(BinaryOp\Pow $node)
15947    {
15948        return $this->pInfixOp(BinaryOp\Pow::class, $node->left, ' ** ', $node->right);
15949    }
15950    protected function pExpr_BinaryOp_LogicalAnd(BinaryOp\LogicalAnd $node)
15951    {
15952        return $this->pInfixOp(BinaryOp\LogicalAnd::class, $node->left, ' and ', $node->right);
15953    }
15954    protected function pExpr_BinaryOp_LogicalOr(BinaryOp\LogicalOr $node)
15955    {
15956        return $this->pInfixOp(BinaryOp\LogicalOr::class, $node->left, ' or ', $node->right);
15957    }
15958    protected function pExpr_BinaryOp_LogicalXor(BinaryOp\LogicalXor $node)
15959    {
15960        return $this->pInfixOp(BinaryOp\LogicalXor::class, $node->left, ' xor ', $node->right);
15961    }
15962    protected function pExpr_BinaryOp_Equal(BinaryOp\Equal $node)
15963    {
15964        return $this->pInfixOp(BinaryOp\Equal::class, $node->left, ' == ', $node->right);
15965    }
15966    protected function pExpr_BinaryOp_NotEqual(BinaryOp\NotEqual $node)
15967    {
15968        return $this->pInfixOp(BinaryOp\NotEqual::class, $node->left, ' != ', $node->right);
15969    }
15970    protected function pExpr_BinaryOp_Identical(BinaryOp\Identical $node)
15971    {
15972        return $this->pInfixOp(BinaryOp\Identical::class, $node->left, ' === ', $node->right);
15973    }
15974    protected function pExpr_BinaryOp_NotIdentical(BinaryOp\NotIdentical $node)
15975    {
15976        return $this->pInfixOp(BinaryOp\NotIdentical::class, $node->left, ' !== ', $node->right);
15977    }
15978    protected function pExpr_BinaryOp_Spaceship(BinaryOp\Spaceship $node)
15979    {
15980        return $this->pInfixOp(BinaryOp\Spaceship::class, $node->left, ' <=> ', $node->right);
15981    }
15982    protected function pExpr_BinaryOp_Greater(BinaryOp\Greater $node)
15983    {
15984        return $this->pInfixOp(BinaryOp\Greater::class, $node->left, ' > ', $node->right);
15985    }
15986    protected function pExpr_BinaryOp_GreaterOrEqual(BinaryOp\GreaterOrEqual $node)
15987    {
15988        return $this->pInfixOp(BinaryOp\GreaterOrEqual::class, $node->left, ' >= ', $node->right);
15989    }
15990    protected function pExpr_BinaryOp_Smaller(BinaryOp\Smaller $node)
15991    {
15992        return $this->pInfixOp(BinaryOp\Smaller::class, $node->left, ' < ', $node->right);
15993    }
15994    protected function pExpr_BinaryOp_SmallerOrEqual(BinaryOp\SmallerOrEqual $node)
15995    {
15996        return $this->pInfixOp(BinaryOp\SmallerOrEqual::class, $node->left, ' <= ', $node->right);
15997    }
15998    protected function pExpr_BinaryOp_Coalesce(BinaryOp\Coalesce $node)
15999    {
16000        return $this->pInfixOp(BinaryOp\Coalesce::class, $node->left, ' ?? ', $node->right);
16001    }
16002    protected function pExpr_Instanceof(Expr\Instanceof_ $node)
16003    {
16004        list($precedence, $associativity) = $this->precedenceMap[Expr\Instanceof_::class];
16005        return $this->pPrec($node->expr, $precedence, $associativity, -1) . ' instanceof ' . $this->pNewVariable($node->class);
16006    }
16007    // Unary expressions
16008    protected function pExpr_BooleanNot(Expr\BooleanNot $node)
16009    {
16010        return $this->pPrefixOp(Expr\BooleanNot::class, '!', $node->expr);
16011    }
16012    protected function pExpr_BitwiseNot(Expr\BitwiseNot $node)
16013    {
16014        return $this->pPrefixOp(Expr\BitwiseNot::class, '~', $node->expr);
16015    }
16016    protected function pExpr_UnaryMinus(Expr\UnaryMinus $node)
16017    {
16018        if ($node->expr instanceof Expr\UnaryMinus || $node->expr instanceof Expr\PreDec) {
16019            // Enforce -(-$expr) instead of --$expr
16020            return '-(' . $this->p($node->expr) . ')';
16021        }
16022        return $this->pPrefixOp(Expr\UnaryMinus::class, '-', $node->expr);
16023    }
16024    protected function pExpr_UnaryPlus(Expr\UnaryPlus $node)
16025    {
16026        if ($node->expr instanceof Expr\UnaryPlus || $node->expr instanceof Expr\PreInc) {
16027            // Enforce +(+$expr) instead of ++$expr
16028            return '+(' . $this->p($node->expr) . ')';
16029        }
16030        return $this->pPrefixOp(Expr\UnaryPlus::class, '+', $node->expr);
16031    }
16032    protected function pExpr_PreInc(Expr\PreInc $node)
16033    {
16034        return $this->pPrefixOp(Expr\PreInc::class, '++', $node->var);
16035    }
16036    protected function pExpr_PreDec(Expr\PreDec $node)
16037    {
16038        return $this->pPrefixOp(Expr\PreDec::class, '--', $node->var);
16039    }
16040    protected function pExpr_PostInc(Expr\PostInc $node)
16041    {
16042        return $this->pPostfixOp(Expr\PostInc::class, $node->var, '++');
16043    }
16044    protected function pExpr_PostDec(Expr\PostDec $node)
16045    {
16046        return $this->pPostfixOp(Expr\PostDec::class, $node->var, '--');
16047    }
16048    protected function pExpr_ErrorSuppress(Expr\ErrorSuppress $node)
16049    {
16050        return $this->pPrefixOp(Expr\ErrorSuppress::class, '@', $node->expr);
16051    }
16052    protected function pExpr_YieldFrom(Expr\YieldFrom $node)
16053    {
16054        return $this->pPrefixOp(Expr\YieldFrom::class, 'yield from ', $node->expr);
16055    }
16056    protected function pExpr_Print(Expr\Print_ $node)
16057    {
16058        return $this->pPrefixOp(Expr\Print_::class, 'print ', $node->expr);
16059    }
16060    // Casts
16061    protected function pExpr_Cast_Int(Cast\Int_ $node)
16062    {
16063        return $this->pPrefixOp(Cast\Int_::class, '(int) ', $node->expr);
16064    }
16065    protected function pExpr_Cast_Double(Cast\Double $node)
16066    {
16067        $kind = $node->getAttribute('kind', Cast\Double::KIND_DOUBLE);
16068        if ($kind === Cast\Double::KIND_DOUBLE) {
16069            $cast = '(double)';
16070        } elseif ($kind === Cast\Double::KIND_FLOAT) {
16071            $cast = '(float)';
16072        } elseif ($kind === Cast\Double::KIND_REAL) {
16073            $cast = '(real)';
16074        }
16075        return $this->pPrefixOp(Cast\Double::class, $cast . ' ', $node->expr);
16076    }
16077    protected function pExpr_Cast_String(Cast\String_ $node)
16078    {
16079        return $this->pPrefixOp(Cast\String_::class, '(string) ', $node->expr);
16080    }
16081    protected function pExpr_Cast_Array(Cast\Array_ $node)
16082    {
16083        return $this->pPrefixOp(Cast\Array_::class, '(array) ', $node->expr);
16084    }
16085    protected function pExpr_Cast_Object(Cast\Object_ $node)
16086    {
16087        return $this->pPrefixOp(Cast\Object_::class, '(object) ', $node->expr);
16088    }
16089    protected function pExpr_Cast_Bool(Cast\Bool_ $node)
16090    {
16091        return $this->pPrefixOp(Cast\Bool_::class, '(bool) ', $node->expr);
16092    }
16093    protected function pExpr_Cast_Unset(Cast\Unset_ $node)
16094    {
16095        return $this->pPrefixOp(Cast\Unset_::class, '(unset) ', $node->expr);
16096    }
16097    // Function calls and similar constructs
16098    protected function pExpr_FuncCall(Expr\FuncCall $node)
16099    {
16100        return $this->pCallLhs($node->name) . '(' . $this->pMaybeMultiline($node->args) . ')';
16101    }
16102    protected function pExpr_MethodCall(Expr\MethodCall $node)
16103    {
16104        return $this->pDereferenceLhs($node->var) . '->' . $this->pObjectProperty($node->name) . '(' . $this->pMaybeMultiline($node->args) . ')';
16105    }
16106    protected function pExpr_NullsafeMethodCall(Expr\NullsafeMethodCall $node)
16107    {
16108        return $this->pDereferenceLhs($node->var) . '?->' . $this->pObjectProperty($node->name) . '(' . $this->pMaybeMultiline($node->args) . ')';
16109    }
16110    protected function pExpr_StaticCall(Expr\StaticCall $node)
16111    {
16112        return $this->pDereferenceLhs($node->class) . '::' . ($node->name instanceof Expr ? $node->name instanceof Expr\Variable ? $this->p($node->name) : '{' . $this->p($node->name) . '}' : $node->name) . '(' . $this->pMaybeMultiline($node->args) . ')';
16113    }
16114    protected function pExpr_Empty(Expr\Empty_ $node)
16115    {
16116        return 'empty(' . $this->p($node->expr) . ')';
16117    }
16118    protected function pExpr_Isset(Expr\Isset_ $node)
16119    {
16120        return 'isset(' . $this->pCommaSeparated($node->vars) . ')';
16121    }
16122    protected function pExpr_Eval(Expr\Eval_ $node)
16123    {
16124        return 'eval(' . $this->p($node->expr) . ')';
16125    }
16126    protected function pExpr_Include(Expr\Include_ $node)
16127    {
16128        static $map = [Expr\Include_::TYPE_INCLUDE => 'include', Expr\Include_::TYPE_INCLUDE_ONCE => 'include_once', Expr\Include_::TYPE_REQUIRE => 'require', Expr\Include_::TYPE_REQUIRE_ONCE => 'require_once'];
16129        return $map[$node->type] . ' ' . $this->p($node->expr);
16130    }
16131    protected function pExpr_List(Expr\List_ $node)
16132    {
16133        return 'list(' . $this->pCommaSeparated($node->items) . ')';
16134    }
16135    // Other
16136    protected function pExpr_Error(Expr\Error $node)
16137    {
16138        throw new \LogicException('Cannot pretty-print AST with Error nodes');
16139    }
16140    protected function pExpr_Variable(Expr\Variable $node)
16141    {
16142        if ($node->name instanceof Expr) {
16143            return '${' . $this->p($node->name) . '}';
16144        } else {
16145            return '$' . $node->name;
16146        }
16147    }
16148    protected function pExpr_Array(Expr\Array_ $node)
16149    {
16150        $syntax = $node->getAttribute('kind', $this->options['shortArraySyntax'] ? Expr\Array_::KIND_SHORT : Expr\Array_::KIND_LONG);
16151        if ($syntax === Expr\Array_::KIND_SHORT) {
16152            return '[' . $this->pMaybeMultiline($node->items, \true) . ']';
16153        } else {
16154            return 'array(' . $this->pMaybeMultiline($node->items, \true) . ')';
16155        }
16156    }
16157    protected function pExpr_ArrayItem(Expr\ArrayItem $node)
16158    {
16159        return (null !== $node->key ? $this->p($node->key) . ' => ' : '') . ($node->byRef ? '&' : '') . ($node->unpack ? '...' : '') . $this->p($node->value);
16160    }
16161    protected function pExpr_ArrayDimFetch(Expr\ArrayDimFetch $node)
16162    {
16163        return $this->pDereferenceLhs($node->var) . '[' . (null !== $node->dim ? $this->p($node->dim) : '') . ']';
16164    }
16165    protected function pExpr_ConstFetch(Expr\ConstFetch $node)
16166    {
16167        return $this->p($node->name);
16168    }
16169    protected function pExpr_ClassConstFetch(Expr\ClassConstFetch $node)
16170    {
16171        return $this->pDereferenceLhs($node->class) . '::' . $this->p($node->name);
16172    }
16173    protected function pExpr_PropertyFetch(Expr\PropertyFetch $node)
16174    {
16175        return $this->pDereferenceLhs($node->var) . '->' . $this->pObjectProperty($node->name);
16176    }
16177    protected function pExpr_NullsafePropertyFetch(Expr\NullsafePropertyFetch $node)
16178    {
16179        return $this->pDereferenceLhs($node->var) . '?->' . $this->pObjectProperty($node->name);
16180    }
16181    protected function pExpr_StaticPropertyFetch(Expr\StaticPropertyFetch $node)
16182    {
16183        return $this->pDereferenceLhs($node->class) . '::$' . $this->pObjectProperty($node->name);
16184    }
16185    protected function pExpr_ShellExec(Expr\ShellExec $node)
16186    {
16187        return '`' . $this->pEncapsList($node->parts, '`') . '`';
16188    }
16189    protected function pExpr_Closure(Expr\Closure $node)
16190    {
16191        return $this->pAttrGroups($node->attrGroups, \true) . ($node->static ? 'static ' : '') . 'function ' . ($node->byRef ? '&' : '') . '(' . $this->pCommaSeparated($node->params) . ')' . (!empty($node->uses) ? ' use(' . $this->pCommaSeparated($node->uses) . ')' : '') . (null !== $node->returnType ? ' : ' . $this->p($node->returnType) : '') . ' {' . $this->pStmts($node->stmts) . $this->nl . '}';
16192    }
16193    protected function pExpr_Match(Expr\Match_ $node)
16194    {
16195        return 'match (' . $this->p($node->cond) . ') {' . $this->pCommaSeparatedMultiline($node->arms, \true) . $this->nl . '}';
16196    }
16197    protected function pMatchArm(Node\MatchArm $node)
16198    {
16199        return ($node->conds ? $this->pCommaSeparated($node->conds) : 'default') . ' => ' . $this->p($node->body);
16200    }
16201    protected function pExpr_ArrowFunction(Expr\ArrowFunction $node)
16202    {
16203        return $this->pAttrGroups($node->attrGroups, \true) . ($node->static ? 'static ' : '') . 'fn' . ($node->byRef ? '&' : '') . '(' . $this->pCommaSeparated($node->params) . ')' . (null !== $node->returnType ? ': ' . $this->p($node->returnType) : '') . ' => ' . $this->p($node->expr);
16204    }
16205    protected function pExpr_ClosureUse(Expr\ClosureUse $node)
16206    {
16207        return ($node->byRef ? '&' : '') . $this->p($node->var);
16208    }
16209    protected function pExpr_New(Expr\New_ $node)
16210    {
16211        if ($node->class instanceof Stmt\Class_) {
16212            $args = $node->args ? '(' . $this->pMaybeMultiline($node->args) . ')' : '';
16213            return 'new ' . $this->pClassCommon($node->class, $args);
16214        }
16215        return 'new ' . $this->pNewVariable($node->class) . '(' . $this->pMaybeMultiline($node->args) . ')';
16216    }
16217    protected function pExpr_Clone(Expr\Clone_ $node)
16218    {
16219        return 'clone ' . $this->p($node->expr);
16220    }
16221    protected function pExpr_Ternary(Expr\Ternary $node)
16222    {
16223        // a bit of cheating: we treat the ternary as a binary op where the ?...: part is the operator.
16224        // this is okay because the part between ? and : never needs parentheses.
16225        return $this->pInfixOp(Expr\Ternary::class, $node->cond, ' ?' . (null !== $node->if ? ' ' . $this->p($node->if) . ' ' : '') . ': ', $node->else);
16226    }
16227    protected function pExpr_Exit(Expr\Exit_ $node)
16228    {
16229        $kind = $node->getAttribute('kind', Expr\Exit_::KIND_DIE);
16230        return ($kind === Expr\Exit_::KIND_EXIT ? 'exit' : 'die') . (null !== $node->expr ? '(' . $this->p($node->expr) . ')' : '');
16231    }
16232    protected function pExpr_Throw(Expr\Throw_ $node)
16233    {
16234        return 'throw ' . $this->p($node->expr);
16235    }
16236    protected function pExpr_Yield(Expr\Yield_ $node)
16237    {
16238        if ($node->value === null) {
16239            return 'yield';
16240        } else {
16241            // this is a bit ugly, but currently there is no way to detect whether the parentheses are necessary
16242            return '(yield ' . ($node->key !== null ? $this->p($node->key) . ' => ' : '') . $this->p($node->value) . ')';
16243        }
16244    }
16245    // Declarations
16246    protected function pStmt_Namespace(Stmt\Namespace_ $node)
16247    {
16248        if ($this->canUseSemicolonNamespaces) {
16249            return 'namespace ' . $this->p($node->name) . ';' . $this->nl . $this->pStmts($node->stmts, \false);
16250        } else {
16251            return 'namespace' . (null !== $node->name ? ' ' . $this->p($node->name) : '') . ' {' . $this->pStmts($node->stmts) . $this->nl . '}';
16252        }
16253    }
16254    protected function pStmt_Use(Stmt\Use_ $node)
16255    {
16256        return 'use ' . $this->pUseType($node->type) . $this->pCommaSeparated($node->uses) . ';';
16257    }
16258    protected function pStmt_GroupUse(Stmt\GroupUse $node)
16259    {
16260        return 'use ' . $this->pUseType($node->type) . $this->pName($node->prefix) . '\\{' . $this->pCommaSeparated($node->uses) . '};';
16261    }
16262    protected function pStmt_UseUse(Stmt\UseUse $node)
16263    {
16264        return $this->pUseType($node->type) . $this->p($node->name) . (null !== $node->alias ? ' as ' . $node->alias : '');
16265    }
16266    protected function pUseType($type)
16267    {
16268        return $type === Stmt\Use_::TYPE_FUNCTION ? 'function ' : ($type === Stmt\Use_::TYPE_CONSTANT ? 'const ' : '');
16269    }
16270    protected function pStmt_Interface(Stmt\Interface_ $node)
16271    {
16272        return $this->pAttrGroups($node->attrGroups) . 'interface ' . $node->name . (!empty($node->extends) ? ' extends ' . $this->pCommaSeparated($node->extends) : '') . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}';
16273    }
16274    protected function pStmt_Enum(Stmt\Enum_ $node)
16275    {
16276        return $this->pAttrGroups($node->attrGroups) . 'enum ' . $node->name . ($node->scalarType ? " : {$node->scalarType}" : '') . (!empty($node->implements) ? ' implements ' . $this->pCommaSeparated($node->implements) : '') . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}';
16277    }
16278    protected function pStmt_Class(Stmt\Class_ $node)
16279    {
16280        return $this->pClassCommon($node, ' ' . $node->name);
16281    }
16282    protected function pStmt_Trait(Stmt\Trait_ $node)
16283    {
16284        return $this->pAttrGroups($node->attrGroups) . 'trait ' . $node->name . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}';
16285    }
16286    protected function pStmt_EnumCase(Stmt\EnumCase $node)
16287    {
16288        return $this->pAttrGroups($node->attrGroups) . 'case ' . $node->name . ($node->expr ? ' = ' . $this->p($node->expr) : '') . ';';
16289    }
16290    protected function pStmt_TraitUse(Stmt\TraitUse $node)
16291    {
16292        return 'use ' . $this->pCommaSeparated($node->traits) . (empty($node->adaptations) ? ';' : ' {' . $this->pStmts($node->adaptations) . $this->nl . '}');
16293    }
16294    protected function pStmt_TraitUseAdaptation_Precedence(Stmt\TraitUseAdaptation\Precedence $node)
16295    {
16296        return $this->p($node->trait) . '::' . $node->method . ' insteadof ' . $this->pCommaSeparated($node->insteadof) . ';';
16297    }
16298    protected function pStmt_TraitUseAdaptation_Alias(Stmt\TraitUseAdaptation\Alias $node)
16299    {
16300        return (null !== $node->trait ? $this->p($node->trait) . '::' : '') . $node->method . ' as' . (null !== $node->newModifier ? ' ' . \rtrim($this->pModifiers($node->newModifier), ' ') : '') . (null !== $node->newName ? ' ' . $node->newName : '') . ';';
16301    }
16302    protected function pStmt_Property(Stmt\Property $node)
16303    {
16304        return $this->pAttrGroups($node->attrGroups) . (0 === $node->flags ? 'var ' : $this->pModifiers($node->flags)) . ($node->type ? $this->p($node->type) . ' ' : '') . $this->pCommaSeparated($node->props) . ';';
16305    }
16306    protected function pStmt_PropertyProperty(Stmt\PropertyProperty $node)
16307    {
16308        return '$' . $node->name . (null !== $node->default ? ' = ' . $this->p($node->default) : '');
16309    }
16310    protected function pStmt_ClassMethod(Stmt\ClassMethod $node)
16311    {
16312        return $this->pAttrGroups($node->attrGroups) . $this->pModifiers($node->flags) . 'function ' . ($node->byRef ? '&' : '') . $node->name . '(' . $this->pMaybeMultiline($node->params) . ')' . (null !== $node->returnType ? ' : ' . $this->p($node->returnType) : '') . (null !== $node->stmts ? $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}' : ';');
16313    }
16314    protected function pStmt_ClassConst(Stmt\ClassConst $node)
16315    {
16316        return $this->pAttrGroups($node->attrGroups) . $this->pModifiers($node->flags) . 'const ' . $this->pCommaSeparated($node->consts) . ';';
16317    }
16318    protected function pStmt_Function(Stmt\Function_ $node)
16319    {
16320        return $this->pAttrGroups($node->attrGroups) . 'function ' . ($node->byRef ? '&' : '') . $node->name . '(' . $this->pCommaSeparated($node->params) . ')' . (null !== $node->returnType ? ' : ' . $this->p($node->returnType) : '') . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}';
16321    }
16322    protected function pStmt_Const(Stmt\Const_ $node)
16323    {
16324        return 'const ' . $this->pCommaSeparated($node->consts) . ';';
16325    }
16326    protected function pStmt_Declare(Stmt\Declare_ $node)
16327    {
16328        return 'declare (' . $this->pCommaSeparated($node->declares) . ')' . (null !== $node->stmts ? ' {' . $this->pStmts($node->stmts) . $this->nl . '}' : ';');
16329    }
16330    protected function pStmt_DeclareDeclare(Stmt\DeclareDeclare $node)
16331    {
16332        return $node->key . '=' . $this->p($node->value);
16333    }
16334    // Control flow
16335    protected function pStmt_If(Stmt\If_ $node)
16336    {
16337        return 'if (' . $this->p($node->cond) . ') {' . $this->pStmts($node->stmts) . $this->nl . '}' . ($node->elseifs ? ' ' . $this->pImplode($node->elseifs, ' ') : '') . (null !== $node->else ? ' ' . $this->p($node->else) : '');
16338    }
16339    protected function pStmt_ElseIf(Stmt\ElseIf_ $node)
16340    {
16341        return 'elseif (' . $this->p($node->cond) . ') {' . $this->pStmts($node->stmts) . $this->nl . '}';
16342    }
16343    protected function pStmt_Else(Stmt\Else_ $node)
16344    {
16345        return 'else {' . $this->pStmts($node->stmts) . $this->nl . '}';
16346    }
16347    protected function pStmt_For(Stmt\For_ $node)
16348    {
16349        return 'for (' . $this->pCommaSeparated($node->init) . ';' . (!empty($node->cond) ? ' ' : '') . $this->pCommaSeparated($node->cond) . ';' . (!empty($node->loop) ? ' ' : '') . $this->pCommaSeparated($node->loop) . ') {' . $this->pStmts($node->stmts) . $this->nl . '}';
16350    }
16351    protected function pStmt_Foreach(Stmt\Foreach_ $node)
16352    {
16353        return 'foreach (' . $this->p($node->expr) . ' as ' . (null !== $node->keyVar ? $this->p($node->keyVar) . ' => ' : '') . ($node->byRef ? '&' : '') . $this->p($node->valueVar) . ') {' . $this->pStmts($node->stmts) . $this->nl . '}';
16354    }
16355    protected function pStmt_While(Stmt\While_ $node)
16356    {
16357        return 'while (' . $this->p($node->cond) . ') {' . $this->pStmts($node->stmts) . $this->nl . '}';
16358    }
16359    protected function pStmt_Do(Stmt\Do_ $node)
16360    {
16361        return 'do {' . $this->pStmts($node->stmts) . $this->nl . '} while (' . $this->p($node->cond) . ');';
16362    }
16363    protected function pStmt_Switch(Stmt\Switch_ $node)
16364    {
16365        return 'switch (' . $this->p($node->cond) . ') {' . $this->pStmts($node->cases) . $this->nl . '}';
16366    }
16367    protected function pStmt_Case(Stmt\Case_ $node)
16368    {
16369        return (null !== $node->cond ? 'case ' . $this->p($node->cond) : 'default') . ':' . $this->pStmts($node->stmts);
16370    }
16371    protected function pStmt_TryCatch(Stmt\TryCatch $node)
16372    {
16373        return 'try {' . $this->pStmts($node->stmts) . $this->nl . '}' . ($node->catches ? ' ' . $this->pImplode($node->catches, ' ') : '') . ($node->finally !== null ? ' ' . $this->p($node->finally) : '');
16374    }
16375    protected function pStmt_Catch(Stmt\Catch_ $node)
16376    {
16377        return 'catch (' . $this->pImplode($node->types, '|') . ($node->var !== null ? ' ' . $this->p($node->var) : '') . ') {' . $this->pStmts($node->stmts) . $this->nl . '}';
16378    }
16379    protected function pStmt_Finally(Stmt\Finally_ $node)
16380    {
16381        return 'finally {' . $this->pStmts($node->stmts) . $this->nl . '}';
16382    }
16383    protected function pStmt_Break(Stmt\Break_ $node)
16384    {
16385        return 'break' . ($node->num !== null ? ' ' . $this->p($node->num) : '') . ';';
16386    }
16387    protected function pStmt_Continue(Stmt\Continue_ $node)
16388    {
16389        return 'continue' . ($node->num !== null ? ' ' . $this->p($node->num) : '') . ';';
16390    }
16391    protected function pStmt_Return(Stmt\Return_ $node)
16392    {
16393        return 'return' . (null !== $node->expr ? ' ' . $this->p($node->expr) : '') . ';';
16394    }
16395    protected function pStmt_Throw(Stmt\Throw_ $node)
16396    {
16397        return 'throw ' . $this->p($node->expr) . ';';
16398    }
16399    protected function pStmt_Label(Stmt\Label $node)
16400    {
16401        return $node->name . ':';
16402    }
16403    protected function pStmt_Goto(Stmt\Goto_ $node)
16404    {
16405        return 'goto ' . $node->name . ';';
16406    }
16407    // Other
16408    protected function pStmt_Expression(Stmt\Expression $node)
16409    {
16410        return $this->p($node->expr) . ';';
16411    }
16412    protected function pStmt_Echo(Stmt\Echo_ $node)
16413    {
16414        return 'echo ' . $this->pCommaSeparated($node->exprs) . ';';
16415    }
16416    protected function pStmt_Static(Stmt\Static_ $node)
16417    {
16418        return 'static ' . $this->pCommaSeparated($node->vars) . ';';
16419    }
16420    protected function pStmt_Global(Stmt\Global_ $node)
16421    {
16422        return 'global ' . $this->pCommaSeparated($node->vars) . ';';
16423    }
16424    protected function pStmt_StaticVar(Stmt\StaticVar $node)
16425    {
16426        return $this->p($node->var) . (null !== $node->default ? ' = ' . $this->p($node->default) : '');
16427    }
16428    protected function pStmt_Unset(Stmt\Unset_ $node)
16429    {
16430        return 'unset(' . $this->pCommaSeparated($node->vars) . ');';
16431    }
16432    protected function pStmt_InlineHTML(Stmt\InlineHTML $node)
16433    {
16434        $newline = $node->getAttribute('hasLeadingNewline', \true) ? "\n" : '';
16435        return '?>' . $newline . $node->value . '<?php ';
16436    }
16437    protected function pStmt_HaltCompiler(Stmt\HaltCompiler $node)
16438    {
16439        return '__halt_compiler();' . $node->remaining;
16440    }
16441    protected function pStmt_Nop(Stmt\Nop $node)
16442    {
16443        return '';
16444    }
16445    // Helpers
16446    protected function pClassCommon(Stmt\Class_ $node, $afterClassToken)
16447    {
16448        return $this->pAttrGroups($node->attrGroups, $node->name === null) . $this->pModifiers($node->flags) . 'class' . $afterClassToken . (null !== $node->extends ? ' extends ' . $this->p($node->extends) : '') . (!empty($node->implements) ? ' implements ' . $this->pCommaSeparated($node->implements) : '') . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}';
16449    }
16450    protected function pObjectProperty($node)
16451    {
16452        if ($node instanceof Expr) {
16453            return '{' . $this->p($node) . '}';
16454        } else {
16455            return $node;
16456        }
16457    }
16458    protected function pEncapsList(array $encapsList, $quote)
16459    {
16460        $return = '';
16461        foreach ($encapsList as $element) {
16462            if ($element instanceof Scalar\EncapsedStringPart) {
16463                $return .= $this->escapeString($element->value, $quote);
16464            } else {
16465                $return .= '{' . $this->p($element) . '}';
16466            }
16467        }
16468        return $return;
16469    }
16470    protected function pSingleQuotedString(string $string)
16471    {
16472        return '\'' . \addcslashes($string, '\'\\') . '\'';
16473    }
16474    protected function escapeString($string, $quote)
16475    {
16476        if (null === $quote) {
16477            // For doc strings, don't escape newlines
16478            $escaped = \addcslashes($string, "\t\f\v\$\\");
16479        } else {
16480            $escaped = \addcslashes($string, "\n\r\t\f\v\$" . $quote . "\\");
16481        }
16482        // Escape control characters and non-UTF-8 characters.
16483        // Regex based on https://stackoverflow.com/a/11709412/385378.
16484        $regex = '/(
16485              [\\x00-\\x08\\x0E-\\x1F] # Control characters
16486            | [\\xC0-\\xC1] # Invalid UTF-8 Bytes
16487            | [\\xF5-\\xFF] # Invalid UTF-8 Bytes
16488            | \\xE0(?=[\\x80-\\x9F]) # Overlong encoding of prior code point
16489            | \\xF0(?=[\\x80-\\x8F]) # Overlong encoding of prior code point
16490            | [\\xC2-\\xDF](?![\\x80-\\xBF]) # Invalid UTF-8 Sequence Start
16491            | [\\xE0-\\xEF](?![\\x80-\\xBF]{2}) # Invalid UTF-8 Sequence Start
16492            | [\\xF0-\\xF4](?![\\x80-\\xBF]{3}) # Invalid UTF-8 Sequence Start
16493            | (?<=[\\x00-\\x7F\\xF5-\\xFF])[\\x80-\\xBF] # Invalid UTF-8 Sequence Middle
16494            | (?<![\\xC2-\\xDF]|[\\xE0-\\xEF]|[\\xE0-\\xEF][\\x80-\\xBF]|[\\xF0-\\xF4]|[\\xF0-\\xF4][\\x80-\\xBF]|[\\xF0-\\xF4][\\x80-\\xBF]{2})[\\x80-\\xBF] # Overlong Sequence
16495            | (?<=[\\xE0-\\xEF])[\\x80-\\xBF](?![\\x80-\\xBF]) # Short 3 byte sequence
16496            | (?<=[\\xF0-\\xF4])[\\x80-\\xBF](?![\\x80-\\xBF]{2}) # Short 4 byte sequence
16497            | (?<=[\\xF0-\\xF4][\\x80-\\xBF])[\\x80-\\xBF](?![\\x80-\\xBF]) # Short 4 byte sequence (2)
16498        )/x';
16499        return \preg_replace_callback($regex, function ($matches) {
16500            \assert(\strlen($matches[0]) === 1);
16501            $hex = \dechex(\ord($matches[0]));
16502            return '\\x' . \str_pad($hex, 2, '0', \STR_PAD_LEFT);
16503        }, $escaped);
16504    }
16505    protected function containsEndLabel($string, $label, $atStart = \true, $atEnd = \true)
16506    {
16507        $start = $atStart ? '(?:^|[\\r\\n])' : '[\\r\\n]';
16508        $end = $atEnd ? '(?:$|[;\\r\\n])' : '[;\\r\\n]';
16509        return \false !== \strpos($string, $label) && \preg_match('/' . $start . $label . $end . '/', $string);
16510    }
16511    protected function encapsedContainsEndLabel(array $parts, $label)
16512    {
16513        foreach ($parts as $i => $part) {
16514            $atStart = $i === 0;
16515            $atEnd = $i === \count($parts) - 1;
16516            if ($part instanceof Scalar\EncapsedStringPart && $this->containsEndLabel($part->value, $label, $atStart, $atEnd)) {
16517                return \true;
16518            }
16519        }
16520        return \false;
16521    }
16522    protected function pDereferenceLhs(Node $node)
16523    {
16524        if (!$this->dereferenceLhsRequiresParens($node)) {
16525            return $this->p($node);
16526        } else {
16527            return '(' . $this->p($node) . ')';
16528        }
16529    }
16530    protected function pCallLhs(Node $node)
16531    {
16532        if (!$this->callLhsRequiresParens($node)) {
16533            return $this->p($node);
16534        } else {
16535            return '(' . $this->p($node) . ')';
16536        }
16537    }
16538    protected function pNewVariable(Node $node)
16539    {
16540        // TODO: This is not fully accurate.
16541        return $this->pDereferenceLhs($node);
16542    }
16543    /**
16544     * @param Node[] $nodes
16545     * @return bool
16546     */
16547    protected function hasNodeWithComments(array $nodes)
16548    {
16549        foreach ($nodes as $node) {
16550            if ($node && $node->getComments()) {
16551                return \true;
16552            }
16553        }
16554        return \false;
16555    }
16556    protected function pMaybeMultiline(array $nodes, bool $trailingComma = \false)
16557    {
16558        if (!$this->hasNodeWithComments($nodes)) {
16559            return $this->pCommaSeparated($nodes);
16560        } else {
16561            return $this->pCommaSeparatedMultiline($nodes, $trailingComma) . $this->nl;
16562        }
16563    }
16564    protected function pAttrGroups(array $nodes, bool $inline = \false) : string
16565    {
16566        $result = '';
16567        $sep = $inline ? ' ' : $this->nl;
16568        foreach ($nodes as $node) {
16569            $result .= $this->p($node) . $sep;
16570        }
16571        return $result;
16572    }
16573}
16574<?php
16575
16576declare (strict_types=1);
16577namespace PHPUnit\PhpParser;
16578
16579interface ErrorHandler
16580{
16581    /**
16582     * Handle an error generated during lexing, parsing or some other operation.
16583     *
16584     * @param Error $error The error that needs to be handled
16585     */
16586    public function handleError(Error $error);
16587}
16588<?php
16589
16590declare (strict_types=1);
16591namespace PHPUnit\PhpParser\Node;
16592
16593use PHPUnit\PhpParser\Node;
16594use PHPUnit\PhpParser\NodeAbstract;
16595class Attribute extends NodeAbstract
16596{
16597    /** @var Name Attribute name */
16598    public $name;
16599    /** @var Arg[] Attribute arguments */
16600    public $args;
16601    /**
16602     * @param Node\Name $name       Attribute name
16603     * @param Arg[]     $args       Attribute arguments
16604     * @param array     $attributes Additional node attributes
16605     */
16606    public function __construct(Name $name, array $args = [], array $attributes = [])
16607    {
16608        $this->attributes = $attributes;
16609        $this->name = $name;
16610        $this->args = $args;
16611    }
16612    public function getSubNodeNames() : array
16613    {
16614        return ['name', 'args'];
16615    }
16616    public function getType() : string
16617    {
16618        return 'Attribute';
16619    }
16620}
16621<?php
16622
16623declare (strict_types=1);
16624namespace PHPUnit\PhpParser\Node;
16625
16626/**
16627 * Represents a name that is written in source code with a leading dollar,
16628 * but is not a proper variable. The leading dollar is not stored as part of the name.
16629 *
16630 * Examples: Names in property declarations are formatted as variables. Names in static property
16631 * lookups are also formatted as variables.
16632 */
16633class VarLikeIdentifier extends Identifier
16634{
16635    public function getType() : string
16636    {
16637        return 'VarLikeIdentifier';
16638    }
16639}
16640<?php
16641
16642declare (strict_types=1);
16643namespace PHPUnit\PhpParser\Node;
16644
16645use PHPUnit\PhpParser\Node\VariadicPlaceholder;
16646use PHPUnit\PhpParser\NodeAbstract;
16647class Arg extends NodeAbstract
16648{
16649    /** @var Identifier|null Parameter name (for named parameters) */
16650    public $name;
16651    /** @var Expr Value to pass */
16652    public $value;
16653    /** @var bool Whether to pass by ref */
16654    public $byRef;
16655    /** @var bool Whether to unpack the argument */
16656    public $unpack;
16657    /**
16658     * Constructs a function call argument node.
16659     *
16660     * @param Expr  $value      Value to pass
16661     * @param bool  $byRef      Whether to pass by ref
16662     * @param bool  $unpack     Whether to unpack the argument
16663     * @param array $attributes Additional attributes
16664     * @param Identifier|null $name Parameter name (for named parameters)
16665     */
16666    public function __construct(Expr $value, bool $byRef = \false, bool $unpack = \false, array $attributes = [], Identifier $name = null)
16667    {
16668        $this->attributes = $attributes;
16669        $this->name = $name;
16670        $this->value = $value;
16671        $this->byRef = $byRef;
16672        $this->unpack = $unpack;
16673    }
16674    public function getSubNodeNames() : array
16675    {
16676        return ['name', 'value', 'byRef', 'unpack'];
16677    }
16678    public function getType() : string
16679    {
16680        return 'Arg';
16681    }
16682}
16683<?php
16684
16685declare (strict_types=1);
16686namespace PHPUnit\PhpParser\Node;
16687
16688class UnionType extends ComplexType
16689{
16690    /** @var (Identifier|Name)[] Types */
16691    public $types;
16692    /**
16693     * Constructs a union type.
16694     *
16695     * @param (Identifier|Name)[] $types      Types
16696     * @param array               $attributes Additional attributes
16697     */
16698    public function __construct(array $types, array $attributes = [])
16699    {
16700        $this->attributes = $attributes;
16701        $this->types = $types;
16702    }
16703    public function getSubNodeNames() : array
16704    {
16705        return ['types'];
16706    }
16707    public function getType() : string
16708    {
16709        return 'UnionType';
16710    }
16711}
16712<?php
16713
16714declare (strict_types=1);
16715namespace PHPUnit\PhpParser\Node;
16716
16717use PHPUnit\PhpParser\NodeAbstract;
16718/**
16719 * This is a base class for complex types, including nullable types and union types.
16720 *
16721 * It does not provide any shared behavior and exists only for type-checking purposes.
16722 */
16723abstract class ComplexType extends NodeAbstract
16724{
16725}
16726<?php
16727
16728declare (strict_types=1);
16729namespace PHPUnit\PhpParser\Node;
16730
16731use PHPUnit\PhpParser\Node;
16732interface FunctionLike extends Node
16733{
16734    /**
16735     * Whether to return by reference
16736     *
16737     * @return bool
16738     */
16739    public function returnsByRef() : bool;
16740    /**
16741     * List of parameters
16742     *
16743     * @return Param[]
16744     */
16745    public function getParams() : array;
16746    /**
16747     * Get the declared return type or null
16748     *
16749     * @return null|Identifier|Name|ComplexType
16750     */
16751    public function getReturnType();
16752    /**
16753     * The function body
16754     *
16755     * @return Stmt[]|null
16756     */
16757    public function getStmts();
16758    /**
16759     * Get PHP attribute groups.
16760     *
16761     * @return AttributeGroup[]
16762     */
16763    public function getAttrGroups() : array;
16764}
16765<?php
16766
16767declare (strict_types=1);
16768namespace PHPUnit\PhpParser\Node\Stmt;
16769
16770use PHPUnit\PhpParser\Node\Stmt;
16771class HaltCompiler extends Stmt
16772{
16773    /** @var string Remaining text after halt compiler statement. */
16774    public $remaining;
16775    /**
16776     * Constructs a __halt_compiler node.
16777     *
16778     * @param string $remaining  Remaining text after halt compiler statement.
16779     * @param array  $attributes Additional attributes
16780     */
16781    public function __construct(string $remaining, array $attributes = [])
16782    {
16783        $this->attributes = $attributes;
16784        $this->remaining = $remaining;
16785    }
16786    public function getSubNodeNames() : array
16787    {
16788        return ['remaining'];
16789    }
16790    public function getType() : string
16791    {
16792        return 'Stmt_HaltCompiler';
16793    }
16794}
16795<?php
16796
16797declare (strict_types=1);
16798namespace PHPUnit\PhpParser\Node\Stmt;
16799
16800use PHPUnit\PhpParser\Node;
16801class Break_ extends Node\Stmt
16802{
16803    /** @var null|Node\Expr Number of loops to break */
16804    public $num;
16805    /**
16806     * Constructs a break node.
16807     *
16808     * @param null|Node\Expr $num        Number of loops to break
16809     * @param array          $attributes Additional attributes
16810     */
16811    public function __construct(Node\Expr $num = null, array $attributes = [])
16812    {
16813        $this->attributes = $attributes;
16814        $this->num = $num;
16815    }
16816    public function getSubNodeNames() : array
16817    {
16818        return ['num'];
16819    }
16820    public function getType() : string
16821    {
16822        return 'Stmt_Break';
16823    }
16824}
16825<?php
16826
16827declare (strict_types=1);
16828namespace PHPUnit\PhpParser\Node\Stmt;
16829
16830use PHPUnit\PhpParser\Node;
16831class If_ extends Node\Stmt
16832{
16833    /** @var Node\Expr Condition expression */
16834    public $cond;
16835    /** @var Node\Stmt[] Statements */
16836    public $stmts;
16837    /** @var ElseIf_[] Elseif clauses */
16838    public $elseifs;
16839    /** @var null|Else_ Else clause */
16840    public $else;
16841    /**
16842     * Constructs an if node.
16843     *
16844     * @param Node\Expr $cond       Condition
16845     * @param array     $subNodes   Array of the following optional subnodes:
16846     *                              'stmts'   => array(): Statements
16847     *                              'elseifs' => array(): Elseif clauses
16848     *                              'else'    => null   : Else clause
16849     * @param array     $attributes Additional attributes
16850     */
16851    public function __construct(Node\Expr $cond, array $subNodes = [], array $attributes = [])
16852    {
16853        $this->attributes = $attributes;
16854        $this->cond = $cond;
16855        $this->stmts = $subNodes['stmts'] ?? [];
16856        $this->elseifs = $subNodes['elseifs'] ?? [];
16857        $this->else = $subNodes['else'] ?? null;
16858    }
16859    public function getSubNodeNames() : array
16860    {
16861        return ['cond', 'stmts', 'elseifs', 'else'];
16862    }
16863    public function getType() : string
16864    {
16865        return 'Stmt_If';
16866    }
16867}
16868<?php
16869
16870declare (strict_types=1);
16871namespace PHPUnit\PhpParser\Node\Stmt;
16872
16873use PHPUnit\PhpParser\Node;
16874class While_ extends Node\Stmt
16875{
16876    /** @var Node\Expr Condition */
16877    public $cond;
16878    /** @var Node\Stmt[] Statements */
16879    public $stmts;
16880    /**
16881     * Constructs a while node.
16882     *
16883     * @param Node\Expr   $cond       Condition
16884     * @param Node\Stmt[] $stmts      Statements
16885     * @param array       $attributes Additional attributes
16886     */
16887    public function __construct(Node\Expr $cond, array $stmts = [], array $attributes = [])
16888    {
16889        $this->attributes = $attributes;
16890        $this->cond = $cond;
16891        $this->stmts = $stmts;
16892    }
16893    public function getSubNodeNames() : array
16894    {
16895        return ['cond', 'stmts'];
16896    }
16897    public function getType() : string
16898    {
16899        return 'Stmt_While';
16900    }
16901}
16902<?php
16903
16904declare (strict_types=1);
16905namespace PHPUnit\PhpParser\Node\Stmt;
16906
16907use PHPUnit\PhpParser\Node;
16908use PHPUnit\PhpParser\Node\FunctionLike;
16909/**
16910 * @property Node\Name $namespacedName Namespaced name (if using NameResolver)
16911 */
16912class Function_ extends Node\Stmt implements FunctionLike
16913{
16914    /** @var bool Whether function returns by reference */
16915    public $byRef;
16916    /** @var Node\Identifier Name */
16917    public $name;
16918    /** @var Node\Param[] Parameters */
16919    public $params;
16920    /** @var null|Node\Identifier|Node\Name|Node\ComplexType Return type */
16921    public $returnType;
16922    /** @var Node\Stmt[] Statements */
16923    public $stmts;
16924    /** @var Node\AttributeGroup[] PHP attribute groups */
16925    public $attrGroups;
16926    /**
16927     * Constructs a function node.
16928     *
16929     * @param string|Node\Identifier $name Name
16930     * @param array  $subNodes   Array of the following optional subnodes:
16931     *                           'byRef'      => false  : Whether to return by reference
16932     *                           'params'     => array(): Parameters
16933     *                           'returnType' => null   : Return type
16934     *                           'stmts'      => array(): Statements
16935     *                           'attrGroups' => array(): PHP attribute groups
16936     * @param array  $attributes Additional attributes
16937     */
16938    public function __construct($name, array $subNodes = [], array $attributes = [])
16939    {
16940        $this->attributes = $attributes;
16941        $this->byRef = $subNodes['byRef'] ?? \false;
16942        $this->name = \is_string($name) ? new Node\Identifier($name) : $name;
16943        $this->params = $subNodes['params'] ?? [];
16944        $returnType = $subNodes['returnType'] ?? null;
16945        $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType;
16946        $this->stmts = $subNodes['stmts'] ?? [];
16947        $this->attrGroups = $subNodes['attrGroups'] ?? [];
16948    }
16949    public function getSubNodeNames() : array
16950    {
16951        return ['attrGroups', 'byRef', 'name', 'params', 'returnType', 'stmts'];
16952    }
16953    public function returnsByRef() : bool
16954    {
16955        return $this->byRef;
16956    }
16957    public function getParams() : array
16958    {
16959        return $this->params;
16960    }
16961    public function getReturnType()
16962    {
16963        return $this->returnType;
16964    }
16965    public function getAttrGroups() : array
16966    {
16967        return $this->attrGroups;
16968    }
16969    /** @return Node\Stmt[] */
16970    public function getStmts() : array
16971    {
16972        return $this->stmts;
16973    }
16974    public function getType() : string
16975    {
16976        return 'Stmt_Function';
16977    }
16978}
16979<?php
16980
16981declare (strict_types=1);
16982namespace PHPUnit\PhpParser\Node\Stmt;
16983
16984use PHPUnit\PhpParser\Node;
16985class ElseIf_ extends Node\Stmt
16986{
16987    /** @var Node\Expr Condition */
16988    public $cond;
16989    /** @var Node\Stmt[] Statements */
16990    public $stmts;
16991    /**
16992     * Constructs an elseif node.
16993     *
16994     * @param Node\Expr   $cond       Condition
16995     * @param Node\Stmt[] $stmts      Statements
16996     * @param array       $attributes Additional attributes
16997     */
16998    public function __construct(Node\Expr $cond, array $stmts = [], array $attributes = [])
16999    {
17000        $this->attributes = $attributes;
17001        $this->cond = $cond;
17002        $this->stmts = $stmts;
17003    }
17004    public function getSubNodeNames() : array
17005    {
17006        return ['cond', 'stmts'];
17007    }
17008    public function getType() : string
17009    {
17010        return 'Stmt_ElseIf';
17011    }
17012}
17013<?php
17014
17015declare (strict_types=1);
17016namespace PHPUnit\PhpParser\Node\Stmt;
17017
17018use PHPUnit\PhpParser\Node;
17019class Interface_ extends ClassLike
17020{
17021    /** @var Node\Name[] Extended interfaces */
17022    public $extends;
17023    /**
17024     * Constructs a class node.
17025     *
17026     * @param string|Node\Identifier $name Name
17027     * @param array  $subNodes   Array of the following optional subnodes:
17028     *                           'extends'    => array(): Name of extended interfaces
17029     *                           'stmts'      => array(): Statements
17030     *                           'attrGroups' => array(): PHP attribute groups
17031     * @param array  $attributes Additional attributes
17032     */
17033    public function __construct($name, array $subNodes = [], array $attributes = [])
17034    {
17035        $this->attributes = $attributes;
17036        $this->name = \is_string($name) ? new Node\Identifier($name) : $name;
17037        $this->extends = $subNodes['extends'] ?? [];
17038        $this->stmts = $subNodes['stmts'] ?? [];
17039        $this->attrGroups = $subNodes['attrGroups'] ?? [];
17040    }
17041    public function getSubNodeNames() : array
17042    {
17043        return ['attrGroups', 'name', 'extends', 'stmts'];
17044    }
17045    public function getType() : string
17046    {
17047        return 'Stmt_Interface';
17048    }
17049}
17050<?php
17051
17052declare (strict_types=1);
17053namespace PHPUnit\PhpParser\Node\Stmt;
17054
17055use PHPUnit\PhpParser\Error;
17056use PHPUnit\PhpParser\Node;
17057class Class_ extends ClassLike
17058{
17059    const MODIFIER_PUBLIC = 1;
17060    const MODIFIER_PROTECTED = 2;
17061    const MODIFIER_PRIVATE = 4;
17062    const MODIFIER_STATIC = 8;
17063    const MODIFIER_ABSTRACT = 16;
17064    const MODIFIER_FINAL = 32;
17065    const MODIFIER_READONLY = 64;
17066    const VISIBILITY_MODIFIER_MASK = 7;
17067    // 1 | 2 | 4
17068    /** @var int Type */
17069    public $flags;
17070    /** @var null|Node\Name Name of extended class */
17071    public $extends;
17072    /** @var Node\Name[] Names of implemented interfaces */
17073    public $implements;
17074    /**
17075     * Constructs a class node.
17076     *
17077     * @param string|Node\Identifier|null $name Name
17078     * @param array       $subNodes   Array of the following optional subnodes:
17079     *                                'flags'       => 0      : Flags
17080     *                                'extends'     => null   : Name of extended class
17081     *                                'implements'  => array(): Names of implemented interfaces
17082     *                                'stmts'       => array(): Statements
17083     *                                'attrGroups'  => array(): PHP attribute groups
17084     * @param array       $attributes Additional attributes
17085     */
17086    public function __construct($name, array $subNodes = [], array $attributes = [])
17087    {
17088        $this->attributes = $attributes;
17089        $this->flags = $subNodes['flags'] ?? $subNodes['type'] ?? 0;
17090        $this->name = \is_string($name) ? new Node\Identifier($name) : $name;
17091        $this->extends = $subNodes['extends'] ?? null;
17092        $this->implements = $subNodes['implements'] ?? [];
17093        $this->stmts = $subNodes['stmts'] ?? [];
17094        $this->attrGroups = $subNodes['attrGroups'] ?? [];
17095    }
17096    public function getSubNodeNames() : array
17097    {
17098        return ['attrGroups', 'flags', 'name', 'extends', 'implements', 'stmts'];
17099    }
17100    /**
17101     * Whether the class is explicitly abstract.
17102     *
17103     * @return bool
17104     */
17105    public function isAbstract() : bool
17106    {
17107        return (bool) ($this->flags & self::MODIFIER_ABSTRACT);
17108    }
17109    /**
17110     * Whether the class is final.
17111     *
17112     * @return bool
17113     */
17114    public function isFinal() : bool
17115    {
17116        return (bool) ($this->flags & self::MODIFIER_FINAL);
17117    }
17118    /**
17119     * Whether the class is anonymous.
17120     *
17121     * @return bool
17122     */
17123    public function isAnonymous() : bool
17124    {
17125        return null === $this->name;
17126    }
17127    /**
17128     * @internal
17129     */
17130    public static function verifyModifier($a, $b)
17131    {
17132        if ($a & self::VISIBILITY_MODIFIER_MASK && $b & self::VISIBILITY_MODIFIER_MASK) {
17133            throw new Error('Multiple access type modifiers are not allowed');
17134        }
17135        if ($a & self::MODIFIER_ABSTRACT && $b & self::MODIFIER_ABSTRACT) {
17136            throw new Error('Multiple abstract modifiers are not allowed');
17137        }
17138        if ($a & self::MODIFIER_STATIC && $b & self::MODIFIER_STATIC) {
17139            throw new Error('Multiple static modifiers are not allowed');
17140        }
17141        if ($a & self::MODIFIER_FINAL && $b & self::MODIFIER_FINAL) {
17142            throw new Error('Multiple final modifiers are not allowed');
17143        }
17144        if ($a & self::MODIFIER_READONLY && $b & self::MODIFIER_READONLY) {
17145            throw new Error('Multiple readonly modifiers are not allowed');
17146        }
17147        if ($a & 48 && $b & 48) {
17148            throw new Error('Cannot use the final modifier on an abstract class member');
17149        }
17150    }
17151    public function getType() : string
17152    {
17153        return 'Stmt_Class';
17154    }
17155}
17156<?php
17157
17158declare (strict_types=1);
17159namespace PHPUnit\PhpParser\Node\Stmt;
17160
17161use PHPUnit\PhpParser\Node\Name;
17162use PHPUnit\PhpParser\Node\Stmt;
17163class GroupUse extends Stmt
17164{
17165    /** @var int Type of group use */
17166    public $type;
17167    /** @var Name Prefix for uses */
17168    public $prefix;
17169    /** @var UseUse[] Uses */
17170    public $uses;
17171    /**
17172     * Constructs a group use node.
17173     *
17174     * @param Name     $prefix     Prefix for uses
17175     * @param UseUse[] $uses       Uses
17176     * @param int      $type       Type of group use
17177     * @param array    $attributes Additional attributes
17178     */
17179    public function __construct(Name $prefix, array $uses, int $type = Use_::TYPE_NORMAL, array $attributes = [])
17180    {
17181        $this->attributes = $attributes;
17182        $this->type = $type;
17183        $this->prefix = $prefix;
17184        $this->uses = $uses;
17185    }
17186    public function getSubNodeNames() : array
17187    {
17188        return ['type', 'prefix', 'uses'];
17189    }
17190    public function getType() : string
17191    {
17192        return 'Stmt_GroupUse';
17193    }
17194}
17195<?php
17196
17197declare (strict_types=1);
17198namespace PHPUnit\PhpParser\Node\Stmt;
17199
17200use PHPUnit\PhpParser\Node;
17201class Throw_ extends Node\Stmt
17202{
17203    /** @var Node\Expr Expression */
17204    public $expr;
17205    /**
17206     * Constructs a legacy throw statement node.
17207     *
17208     * @param Node\Expr $expr       Expression
17209     * @param array     $attributes Additional attributes
17210     */
17211    public function __construct(Node\Expr $expr, array $attributes = [])
17212    {
17213        $this->attributes = $attributes;
17214        $this->expr = $expr;
17215    }
17216    public function getSubNodeNames() : array
17217    {
17218        return ['expr'];
17219    }
17220    public function getType() : string
17221    {
17222        return 'Stmt_Throw';
17223    }
17224}
17225<?php
17226
17227declare (strict_types=1);
17228namespace PHPUnit\PhpParser\Node\Stmt;
17229
17230use PHPUnit\PhpParser\Node;
17231class Continue_ extends Node\Stmt
17232{
17233    /** @var null|Node\Expr Number of loops to continue */
17234    public $num;
17235    /**
17236     * Constructs a continue node.
17237     *
17238     * @param null|Node\Expr $num        Number of loops to continue
17239     * @param array          $attributes Additional attributes
17240     */
17241    public function __construct(Node\Expr $num = null, array $attributes = [])
17242    {
17243        $this->attributes = $attributes;
17244        $this->num = $num;
17245    }
17246    public function getSubNodeNames() : array
17247    {
17248        return ['num'];
17249    }
17250    public function getType() : string
17251    {
17252        return 'Stmt_Continue';
17253    }
17254}
17255<?php
17256
17257declare (strict_types=1);
17258namespace PHPUnit\PhpParser\Node\Stmt;
17259
17260use PHPUnit\PhpParser\Node;
17261class Else_ extends Node\Stmt
17262{
17263    /** @var Node\Stmt[] Statements */
17264    public $stmts;
17265    /**
17266     * Constructs an else node.
17267     *
17268     * @param Node\Stmt[] $stmts      Statements
17269     * @param array       $attributes Additional attributes
17270     */
17271    public function __construct(array $stmts = [], array $attributes = [])
17272    {
17273        $this->attributes = $attributes;
17274        $this->stmts = $stmts;
17275    }
17276    public function getSubNodeNames() : array
17277    {
17278        return ['stmts'];
17279    }
17280    public function getType() : string
17281    {
17282        return 'Stmt_Else';
17283    }
17284}
17285<?php
17286
17287declare (strict_types=1);
17288namespace PHPUnit\PhpParser\Node\Stmt;
17289
17290use PHPUnit\PhpParser\Node;
17291class Trait_ extends ClassLike
17292{
17293    /**
17294     * Constructs a trait node.
17295     *
17296     * @param string|Node\Identifier $name Name
17297     * @param array  $subNodes   Array of the following optional subnodes:
17298     *                           'stmts'      => array(): Statements
17299     *                           'attrGroups' => array(): PHP attribute groups
17300     * @param array  $attributes Additional attributes
17301     */
17302    public function __construct($name, array $subNodes = [], array $attributes = [])
17303    {
17304        $this->attributes = $attributes;
17305        $this->name = \is_string($name) ? new Node\Identifier($name) : $name;
17306        $this->stmts = $subNodes['stmts'] ?? [];
17307        $this->attrGroups = $subNodes['attrGroups'] ?? [];
17308    }
17309    public function getSubNodeNames() : array
17310    {
17311        return ['attrGroups', 'name', 'stmts'];
17312    }
17313    public function getType() : string
17314    {
17315        return 'Stmt_Trait';
17316    }
17317}
17318<?php
17319
17320declare (strict_types=1);
17321namespace PHPUnit\PhpParser\Node\Stmt;
17322
17323use PHPUnit\PhpParser\Node;
17324class Unset_ extends Node\Stmt
17325{
17326    /** @var Node\Expr[] Variables to unset */
17327    public $vars;
17328    /**
17329     * Constructs an unset node.
17330     *
17331     * @param Node\Expr[] $vars       Variables to unset
17332     * @param array       $attributes Additional attributes
17333     */
17334    public function __construct(array $vars, array $attributes = [])
17335    {
17336        $this->attributes = $attributes;
17337        $this->vars = $vars;
17338    }
17339    public function getSubNodeNames() : array
17340    {
17341        return ['vars'];
17342    }
17343    public function getType() : string
17344    {
17345        return 'Stmt_Unset';
17346    }
17347}
17348<?php
17349
17350declare (strict_types=1);
17351namespace PHPUnit\PhpParser\Node\Stmt;
17352
17353use PHPUnit\PhpParser\Node;
17354class Echo_ extends Node\Stmt
17355{
17356    /** @var Node\Expr[] Expressions */
17357    public $exprs;
17358    /**
17359     * Constructs an echo node.
17360     *
17361     * @param Node\Expr[] $exprs      Expressions
17362     * @param array       $attributes Additional attributes
17363     */
17364    public function __construct(array $exprs, array $attributes = [])
17365    {
17366        $this->attributes = $attributes;
17367        $this->exprs = $exprs;
17368    }
17369    public function getSubNodeNames() : array
17370    {
17371        return ['exprs'];
17372    }
17373    public function getType() : string
17374    {
17375        return 'Stmt_Echo';
17376    }
17377}
17378<?php
17379
17380declare (strict_types=1);
17381namespace PHPUnit\PhpParser\Node\Stmt;
17382
17383use PHPUnit\PhpParser\Node\Identifier;
17384use PHPUnit\PhpParser\Node\Stmt;
17385class Label extends Stmt
17386{
17387    /** @var Identifier Name */
17388    public $name;
17389    /**
17390     * Constructs a label node.
17391     *
17392     * @param string|Identifier $name       Name
17393     * @param array             $attributes Additional attributes
17394     */
17395    public function __construct($name, array $attributes = [])
17396    {
17397        $this->attributes = $attributes;
17398        $this->name = \is_string($name) ? new Identifier($name) : $name;
17399    }
17400    public function getSubNodeNames() : array
17401    {
17402        return ['name'];
17403    }
17404    public function getType() : string
17405    {
17406        return 'Stmt_Label';
17407    }
17408}
17409<?php
17410
17411declare (strict_types=1);
17412namespace PHPUnit\PhpParser\Node\Stmt;
17413
17414use PHPUnit\PhpParser\Node;
17415class Do_ extends Node\Stmt
17416{
17417    /** @var Node\Stmt[] Statements */
17418    public $stmts;
17419    /** @var Node\Expr Condition */
17420    public $cond;
17421    /**
17422     * Constructs a do while node.
17423     *
17424     * @param Node\Expr   $cond       Condition
17425     * @param Node\Stmt[] $stmts      Statements
17426     * @param array       $attributes Additional attributes
17427     */
17428    public function __construct(Node\Expr $cond, array $stmts = [], array $attributes = [])
17429    {
17430        $this->attributes = $attributes;
17431        $this->cond = $cond;
17432        $this->stmts = $stmts;
17433    }
17434    public function getSubNodeNames() : array
17435    {
17436        return ['stmts', 'cond'];
17437    }
17438    public function getType() : string
17439    {
17440        return 'Stmt_Do';
17441    }
17442}
17443<?php
17444
17445declare (strict_types=1);
17446namespace PHPUnit\PhpParser\Node\Stmt;
17447
17448use PHPUnit\PhpParser\Node;
17449class DeclareDeclare extends Node\Stmt
17450{
17451    /** @var Node\Identifier Key */
17452    public $key;
17453    /** @var Node\Expr Value */
17454    public $value;
17455    /**
17456     * Constructs a declare key=>value pair node.
17457     *
17458     * @param string|Node\Identifier $key        Key
17459     * @param Node\Expr              $value      Value
17460     * @param array                  $attributes Additional attributes
17461     */
17462    public function __construct($key, Node\Expr $value, array $attributes = [])
17463    {
17464        $this->attributes = $attributes;
17465        $this->key = \is_string($key) ? new Node\Identifier($key) : $key;
17466        $this->value = $value;
17467    }
17468    public function getSubNodeNames() : array
17469    {
17470        return ['key', 'value'];
17471    }
17472    public function getType() : string
17473    {
17474        return 'Stmt_DeclareDeclare';
17475    }
17476}
17477<?php
17478
17479declare (strict_types=1);
17480namespace PHPUnit\PhpParser\Node\Stmt;
17481
17482use PHPUnit\PhpParser\Node;
17483class Finally_ extends Node\Stmt
17484{
17485    /** @var Node\Stmt[] Statements */
17486    public $stmts;
17487    /**
17488     * Constructs a finally node.
17489     *
17490     * @param Node\Stmt[] $stmts      Statements
17491     * @param array       $attributes Additional attributes
17492     */
17493    public function __construct(array $stmts = [], array $attributes = [])
17494    {
17495        $this->attributes = $attributes;
17496        $this->stmts = $stmts;
17497    }
17498    public function getSubNodeNames() : array
17499    {
17500        return ['stmts'];
17501    }
17502    public function getType() : string
17503    {
17504        return 'Stmt_Finally';
17505    }
17506}
17507<?php
17508
17509declare (strict_types=1);
17510namespace PHPUnit\PhpParser\Node\Stmt\TraitUseAdaptation;
17511
17512use PHPUnit\PhpParser\Node;
17513class Alias extends Node\Stmt\TraitUseAdaptation
17514{
17515    /** @var null|int New modifier */
17516    public $newModifier;
17517    /** @var null|Node\Identifier New name */
17518    public $newName;
17519    /**
17520     * Constructs a trait use precedence adaptation node.
17521     *
17522     * @param null|Node\Name              $trait       Trait name
17523     * @param string|Node\Identifier      $method      Method name
17524     * @param null|int                    $newModifier New modifier
17525     * @param null|string|Node\Identifier $newName     New name
17526     * @param array                       $attributes  Additional attributes
17527     */
17528    public function __construct($trait, $method, $newModifier, $newName, array $attributes = [])
17529    {
17530        $this->attributes = $attributes;
17531        $this->trait = $trait;
17532        $this->method = \is_string($method) ? new Node\Identifier($method) : $method;
17533        $this->newModifier = $newModifier;
17534        $this->newName = \is_string($newName) ? new Node\Identifier($newName) : $newName;
17535    }
17536    public function getSubNodeNames() : array
17537    {
17538        return ['trait', 'method', 'newModifier', 'newName'];
17539    }
17540    public function getType() : string
17541    {
17542        return 'Stmt_TraitUseAdaptation_Alias';
17543    }
17544}
17545<?php
17546
17547declare (strict_types=1);
17548namespace PHPUnit\PhpParser\Node\Stmt\TraitUseAdaptation;
17549
17550use PHPUnit\PhpParser\Node;
17551class Precedence extends Node\Stmt\TraitUseAdaptation
17552{
17553    /** @var Node\Name[] Overwritten traits */
17554    public $insteadof;
17555    /**
17556     * Constructs a trait use precedence adaptation node.
17557     *
17558     * @param Node\Name              $trait       Trait name
17559     * @param string|Node\Identifier $method      Method name
17560     * @param Node\Name[]            $insteadof   Overwritten traits
17561     * @param array                  $attributes  Additional attributes
17562     */
17563    public function __construct(Node\Name $trait, $method, array $insteadof, array $attributes = [])
17564    {
17565        $this->attributes = $attributes;
17566        $this->trait = $trait;
17567        $this->method = \is_string($method) ? new Node\Identifier($method) : $method;
17568        $this->insteadof = $insteadof;
17569    }
17570    public function getSubNodeNames() : array
17571    {
17572        return ['trait', 'method', 'insteadof'];
17573    }
17574    public function getType() : string
17575    {
17576        return 'Stmt_TraitUseAdaptation_Precedence';
17577    }
17578}
17579<?php
17580
17581declare (strict_types=1);
17582namespace PHPUnit\PhpParser\Node\Stmt;
17583
17584use PHPUnit\PhpParser\Node;
17585class Switch_ extends Node\Stmt
17586{
17587    /** @var Node\Expr Condition */
17588    public $cond;
17589    /** @var Case_[] Case list */
17590    public $cases;
17591    /**
17592     * Constructs a case node.
17593     *
17594     * @param Node\Expr $cond       Condition
17595     * @param Case_[]   $cases      Case list
17596     * @param array     $attributes Additional attributes
17597     */
17598    public function __construct(Node\Expr $cond, array $cases, array $attributes = [])
17599    {
17600        $this->attributes = $attributes;
17601        $this->cond = $cond;
17602        $this->cases = $cases;
17603    }
17604    public function getSubNodeNames() : array
17605    {
17606        return ['cond', 'cases'];
17607    }
17608    public function getType() : string
17609    {
17610        return 'Stmt_Switch';
17611    }
17612}
17613<?php
17614
17615declare (strict_types=1);
17616namespace PHPUnit\PhpParser\Node\Stmt;
17617
17618use PHPUnit\PhpParser\Node;
17619class TraitUse extends Node\Stmt
17620{
17621    /** @var Node\Name[] Traits */
17622    public $traits;
17623    /** @var TraitUseAdaptation[] Adaptations */
17624    public $adaptations;
17625    /**
17626     * Constructs a trait use node.
17627     *
17628     * @param Node\Name[]          $traits      Traits
17629     * @param TraitUseAdaptation[] $adaptations Adaptations
17630     * @param array                $attributes  Additional attributes
17631     */
17632    public function __construct(array $traits, array $adaptations = [], array $attributes = [])
17633    {
17634        $this->attributes = $attributes;
17635        $this->traits = $traits;
17636        $this->adaptations = $adaptations;
17637    }
17638    public function getSubNodeNames() : array
17639    {
17640        return ['traits', 'adaptations'];
17641    }
17642    public function getType() : string
17643    {
17644        return 'Stmt_TraitUse';
17645    }
17646}
17647<?php
17648
17649declare (strict_types=1);
17650namespace PHPUnit\PhpParser\Node\Stmt;
17651
17652use PHPUnit\PhpParser\Node\Stmt;
17653class InlineHTML extends Stmt
17654{
17655    /** @var string String */
17656    public $value;
17657    /**
17658     * Constructs an inline HTML node.
17659     *
17660     * @param string $value      String
17661     * @param array  $attributes Additional attributes
17662     */
17663    public function __construct(string $value, array $attributes = [])
17664    {
17665        $this->attributes = $attributes;
17666        $this->value = $value;
17667    }
17668    public function getSubNodeNames() : array
17669    {
17670        return ['value'];
17671    }
17672    public function getType() : string
17673    {
17674        return 'Stmt_InlineHTML';
17675    }
17676}
17677<?php
17678
17679declare (strict_types=1);
17680namespace PHPUnit\PhpParser\Node\Stmt;
17681
17682use PHPUnit\PhpParser\Node;
17683/**
17684 * @property Node\Name $namespacedName Namespaced name (if using NameResolver)
17685 */
17686abstract class ClassLike extends Node\Stmt
17687{
17688    /** @var Node\Identifier|null Name */
17689    public $name;
17690    /** @var Node\Stmt[] Statements */
17691    public $stmts;
17692    /** @var Node\AttributeGroup[] PHP attribute groups */
17693    public $attrGroups;
17694    /**
17695     * @return TraitUse[]
17696     */
17697    public function getTraitUses() : array
17698    {
17699        $traitUses = [];
17700        foreach ($this->stmts as $stmt) {
17701            if ($stmt instanceof TraitUse) {
17702                $traitUses[] = $stmt;
17703            }
17704        }
17705        return $traitUses;
17706    }
17707    /**
17708     * @return ClassConst[]
17709     */
17710    public function getConstants() : array
17711    {
17712        $constants = [];
17713        foreach ($this->stmts as $stmt) {
17714            if ($stmt instanceof ClassConst) {
17715                $constants[] = $stmt;
17716            }
17717        }
17718        return $constants;
17719    }
17720    /**
17721     * @return Property[]
17722     */
17723    public function getProperties() : array
17724    {
17725        $properties = [];
17726        foreach ($this->stmts as $stmt) {
17727            if ($stmt instanceof Property) {
17728                $properties[] = $stmt;
17729            }
17730        }
17731        return $properties;
17732    }
17733    /**
17734     * Gets property with the given name defined directly in this class/interface/trait.
17735     *
17736     * @param string $name Name of the property
17737     *
17738     * @return Property|null Property node or null if the property does not exist
17739     */
17740    public function getProperty(string $name)
17741    {
17742        foreach ($this->stmts as $stmt) {
17743            if ($stmt instanceof Property) {
17744                foreach ($stmt->props as $prop) {
17745                    if ($prop instanceof PropertyProperty && $name === $prop->name->toString()) {
17746                        return $stmt;
17747                    }
17748                }
17749            }
17750        }
17751        return null;
17752    }
17753    /**
17754     * Gets all methods defined directly in this class/interface/trait
17755     *
17756     * @return ClassMethod[]
17757     */
17758    public function getMethods() : array
17759    {
17760        $methods = [];
17761        foreach ($this->stmts as $stmt) {
17762            if ($stmt instanceof ClassMethod) {
17763                $methods[] = $stmt;
17764            }
17765        }
17766        return $methods;
17767    }
17768    /**
17769     * Gets method with the given name defined directly in this class/interface/trait.
17770     *
17771     * @param string $name Name of the method (compared case-insensitively)
17772     *
17773     * @return ClassMethod|null Method node or null if the method does not exist
17774     */
17775    public function getMethod(string $name)
17776    {
17777        $lowerName = \strtolower($name);
17778        foreach ($this->stmts as $stmt) {
17779            if ($stmt instanceof ClassMethod && $lowerName === $stmt->name->toLowerString()) {
17780                return $stmt;
17781            }
17782        }
17783        return null;
17784    }
17785}
17786<?php
17787
17788declare (strict_types=1);
17789namespace PHPUnit\PhpParser\Node\Stmt;
17790
17791use PHPUnit\PhpParser\Node\Identifier;
17792use PHPUnit\PhpParser\Node\Stmt;
17793class Goto_ extends Stmt
17794{
17795    /** @var Identifier Name of label to jump to */
17796    public $name;
17797    /**
17798     * Constructs a goto node.
17799     *
17800     * @param string|Identifier $name       Name of label to jump to
17801     * @param array             $attributes Additional attributes
17802     */
17803    public function __construct($name, array $attributes = [])
17804    {
17805        $this->attributes = $attributes;
17806        $this->name = \is_string($name) ? new Identifier($name) : $name;
17807    }
17808    public function getSubNodeNames() : array
17809    {
17810        return ['name'];
17811    }
17812    public function getType() : string
17813    {
17814        return 'Stmt_Goto';
17815    }
17816}
17817<?php
17818
17819declare (strict_types=1);
17820namespace PHPUnit\PhpParser\Node\Stmt;
17821
17822use PHPUnit\PhpParser\Node;
17823class Return_ extends Node\Stmt
17824{
17825    /** @var null|Node\Expr Expression */
17826    public $expr;
17827    /**
17828     * Constructs a return node.
17829     *
17830     * @param null|Node\Expr $expr       Expression
17831     * @param array          $attributes Additional attributes
17832     */
17833    public function __construct(Node\Expr $expr = null, array $attributes = [])
17834    {
17835        $this->attributes = $attributes;
17836        $this->expr = $expr;
17837    }
17838    public function getSubNodeNames() : array
17839    {
17840        return ['expr'];
17841    }
17842    public function getType() : string
17843    {
17844        return 'Stmt_Return';
17845    }
17846}
17847<?php
17848
17849declare (strict_types=1);
17850namespace PHPUnit\PhpParser\Node\Stmt;
17851
17852use PHPUnit\PhpParser\Node;
17853class Declare_ extends Node\Stmt
17854{
17855    /** @var DeclareDeclare[] List of declares */
17856    public $declares;
17857    /** @var Node\Stmt[]|null Statements */
17858    public $stmts;
17859    /**
17860     * Constructs a declare node.
17861     *
17862     * @param DeclareDeclare[] $declares   List of declares
17863     * @param Node\Stmt[]|null $stmts      Statements
17864     * @param array            $attributes Additional attributes
17865     */
17866    public function __construct(array $declares, array $stmts = null, array $attributes = [])
17867    {
17868        $this->attributes = $attributes;
17869        $this->declares = $declares;
17870        $this->stmts = $stmts;
17871    }
17872    public function getSubNodeNames() : array
17873    {
17874        return ['declares', 'stmts'];
17875    }
17876    public function getType() : string
17877    {
17878        return 'Stmt_Declare';
17879    }
17880}
17881<?php
17882
17883declare (strict_types=1);
17884namespace PHPUnit\PhpParser\Node\Stmt;
17885
17886use PHPUnit\PhpParser\Node;
17887use PHPUnit\PhpParser\Node\Expr;
17888class StaticVar extends Node\Stmt
17889{
17890    /** @var Expr\Variable Variable */
17891    public $var;
17892    /** @var null|Node\Expr Default value */
17893    public $default;
17894    /**
17895     * Constructs a static variable node.
17896     *
17897     * @param Expr\Variable  $var         Name
17898     * @param null|Node\Expr $default    Default value
17899     * @param array          $attributes Additional attributes
17900     */
17901    public function __construct(Expr\Variable $var, Node\Expr $default = null, array $attributes = [])
17902    {
17903        $this->attributes = $attributes;
17904        $this->var = $var;
17905        $this->default = $default;
17906    }
17907    public function getSubNodeNames() : array
17908    {
17909        return ['var', 'default'];
17910    }
17911    public function getType() : string
17912    {
17913        return 'Stmt_StaticVar';
17914    }
17915}
17916<?php
17917
17918declare (strict_types=1);
17919namespace PHPUnit\PhpParser\Node\Stmt;
17920
17921use PHPUnit\PhpParser\Node;
17922class Case_ extends Node\Stmt
17923{
17924    /** @var null|Node\Expr Condition (null for default) */
17925    public $cond;
17926    /** @var Node\Stmt[] Statements */
17927    public $stmts;
17928    /**
17929     * Constructs a case node.
17930     *
17931     * @param null|Node\Expr $cond       Condition (null for default)
17932     * @param Node\Stmt[]    $stmts      Statements
17933     * @param array          $attributes Additional attributes
17934     */
17935    public function __construct($cond, array $stmts = [], array $attributes = [])
17936    {
17937        $this->attributes = $attributes;
17938        $this->cond = $cond;
17939        $this->stmts = $stmts;
17940    }
17941    public function getSubNodeNames() : array
17942    {
17943        return ['cond', 'stmts'];
17944    }
17945    public function getType() : string
17946    {
17947        return 'Stmt_Case';
17948    }
17949}
17950<?php
17951
17952declare (strict_types=1);
17953namespace PHPUnit\PhpParser\Node\Stmt;
17954
17955use PHPUnit\PhpParser\Node;
17956class Const_ extends Node\Stmt
17957{
17958    /** @var Node\Const_[] Constant declarations */
17959    public $consts;
17960    /**
17961     * Constructs a const list node.
17962     *
17963     * @param Node\Const_[] $consts     Constant declarations
17964     * @param array         $attributes Additional attributes
17965     */
17966    public function __construct(array $consts, array $attributes = [])
17967    {
17968        $this->attributes = $attributes;
17969        $this->consts = $consts;
17970    }
17971    public function getSubNodeNames() : array
17972    {
17973        return ['consts'];
17974    }
17975    public function getType() : string
17976    {
17977        return 'Stmt_Const';
17978    }
17979}
17980<?php
17981
17982declare (strict_types=1);
17983namespace PHPUnit\PhpParser\Node\Stmt;
17984
17985use PHPUnit\PhpParser\Node;
17986/** Nop/empty statement (;). */
17987class Nop extends Node\Stmt
17988{
17989    public function getSubNodeNames() : array
17990    {
17991        return [];
17992    }
17993    public function getType() : string
17994    {
17995        return 'Stmt_Nop';
17996    }
17997}
17998<?php
17999
18000declare (strict_types=1);
18001namespace PHPUnit\PhpParser\Node\Stmt;
18002
18003use PHPUnit\PhpParser\Node\Stmt;
18004class Static_ extends Stmt
18005{
18006    /** @var StaticVar[] Variable definitions */
18007    public $vars;
18008    /**
18009     * Constructs a static variables list node.
18010     *
18011     * @param StaticVar[] $vars       Variable definitions
18012     * @param array       $attributes Additional attributes
18013     */
18014    public function __construct(array $vars, array $attributes = [])
18015    {
18016        $this->attributes = $attributes;
18017        $this->vars = $vars;
18018    }
18019    public function getSubNodeNames() : array
18020    {
18021        return ['vars'];
18022    }
18023    public function getType() : string
18024    {
18025        return 'Stmt_Static';
18026    }
18027}
18028<?php
18029
18030declare (strict_types=1);
18031namespace PHPUnit\PhpParser\Node\Stmt;
18032
18033use PHPUnit\PhpParser\Node;
18034class TryCatch extends Node\Stmt
18035{
18036    /** @var Node\Stmt[] Statements */
18037    public $stmts;
18038    /** @var Catch_[] Catches */
18039    public $catches;
18040    /** @var null|Finally_ Optional finally node */
18041    public $finally;
18042    /**
18043     * Constructs a try catch node.
18044     *
18045     * @param Node\Stmt[]   $stmts      Statements
18046     * @param Catch_[]      $catches    Catches
18047     * @param null|Finally_ $finally    Optional finally node
18048     * @param array         $attributes Additional attributes
18049     */
18050    public function __construct(array $stmts, array $catches, Finally_ $finally = null, array $attributes = [])
18051    {
18052        $this->attributes = $attributes;
18053        $this->stmts = $stmts;
18054        $this->catches = $catches;
18055        $this->finally = $finally;
18056    }
18057    public function getSubNodeNames() : array
18058    {
18059        return ['stmts', 'catches', 'finally'];
18060    }
18061    public function getType() : string
18062    {
18063        return 'Stmt_TryCatch';
18064    }
18065}
18066<?php
18067
18068declare (strict_types=1);
18069namespace PHPUnit\PhpParser\Node\Stmt;
18070
18071use PHPUnit\PhpParser\Node;
18072use PHPUnit\PhpParser\Node\AttributeGroup;
18073class EnumCase extends Node\Stmt
18074{
18075    /** @var Node\Identifier Enum case name */
18076    public $name;
18077    /** @var Node\Expr|null Enum case expression */
18078    public $expr;
18079    /** @var Node\AttributeGroup[] PHP attribute groups */
18080    public $attrGroups;
18081    /**
18082     * @param string|Node\Identifier    $name       Enum case name
18083     * @param Node\Expr|null            $expr       Enum case expression
18084     * @param AttributeGroup[]          $attrGroups PHP attribute groups
18085     * @param array                     $attributes Additional attributes
18086     */
18087    public function __construct($name, Node\Expr $expr = null, array $attrGroups = [], array $attributes = [])
18088    {
18089        parent::__construct($attributes);
18090        $this->name = \is_string($name) ? new Node\Identifier($name) : $name;
18091        $this->expr = $expr;
18092        $this->attrGroups = $attrGroups;
18093    }
18094    public function getSubNodeNames() : array
18095    {
18096        return ['attrGroups', 'name', 'expr'];
18097    }
18098    public function getType() : string
18099    {
18100        return 'Stmt_EnumCase';
18101    }
18102}
18103<?php
18104
18105declare (strict_types=1);
18106namespace PHPUnit\PhpParser\Node\Stmt;
18107
18108use PHPUnit\PhpParser\Node;
18109class Foreach_ extends Node\Stmt
18110{
18111    /** @var Node\Expr Expression to iterate */
18112    public $expr;
18113    /** @var null|Node\Expr Variable to assign key to */
18114    public $keyVar;
18115    /** @var bool Whether to assign value by reference */
18116    public $byRef;
18117    /** @var Node\Expr Variable to assign value to */
18118    public $valueVar;
18119    /** @var Node\Stmt[] Statements */
18120    public $stmts;
18121    /**
18122     * Constructs a foreach node.
18123     *
18124     * @param Node\Expr $expr       Expression to iterate
18125     * @param Node\Expr $valueVar   Variable to assign value to
18126     * @param array     $subNodes   Array of the following optional subnodes:
18127     *                              'keyVar' => null   : Variable to assign key to
18128     *                              'byRef'  => false  : Whether to assign value by reference
18129     *                              'stmts'  => array(): Statements
18130     * @param array     $attributes Additional attributes
18131     */
18132    public function __construct(Node\Expr $expr, Node\Expr $valueVar, array $subNodes = [], array $attributes = [])
18133    {
18134        $this->attributes = $attributes;
18135        $this->expr = $expr;
18136        $this->keyVar = $subNodes['keyVar'] ?? null;
18137        $this->byRef = $subNodes['byRef'] ?? \false;
18138        $this->valueVar = $valueVar;
18139        $this->stmts = $subNodes['stmts'] ?? [];
18140    }
18141    public function getSubNodeNames() : array
18142    {
18143        return ['expr', 'keyVar', 'byRef', 'valueVar', 'stmts'];
18144    }
18145    public function getType() : string
18146    {
18147        return 'Stmt_Foreach';
18148    }
18149}
18150<?php
18151
18152declare (strict_types=1);
18153namespace PHPUnit\PhpParser\Node\Stmt;
18154
18155use PHPUnit\PhpParser\Node;
18156use PHPUnit\PhpParser\Node\Identifier;
18157class UseUse extends Node\Stmt
18158{
18159    /** @var int One of the Stmt\Use_::TYPE_* constants. Will only differ from TYPE_UNKNOWN for mixed group uses */
18160    public $type;
18161    /** @var Node\Name Namespace, class, function or constant to alias */
18162    public $name;
18163    /** @var Identifier|null Alias */
18164    public $alias;
18165    /**
18166     * Constructs an alias (use) node.
18167     *
18168     * @param Node\Name              $name       Namespace/Class to alias
18169     * @param null|string|Identifier $alias      Alias
18170     * @param int                    $type       Type of the use element (for mixed group use only)
18171     * @param array                  $attributes Additional attributes
18172     */
18173    public function __construct(Node\Name $name, $alias = null, int $type = Use_::TYPE_UNKNOWN, array $attributes = [])
18174    {
18175        $this->attributes = $attributes;
18176        $this->type = $type;
18177        $this->name = $name;
18178        $this->alias = \is_string($alias) ? new Identifier($alias) : $alias;
18179    }
18180    public function getSubNodeNames() : array
18181    {
18182        return ['type', 'name', 'alias'];
18183    }
18184    /**
18185     * Get alias. If not explicitly given this is the last component of the used name.
18186     *
18187     * @return Identifier
18188     */
18189    public function getAlias() : Identifier
18190    {
18191        if (null !== $this->alias) {
18192            return $this->alias;
18193        }
18194        return new Identifier($this->name->getLast());
18195    }
18196    public function getType() : string
18197    {
18198        return 'Stmt_UseUse';
18199    }
18200}
18201<?php
18202
18203declare (strict_types=1);
18204namespace PHPUnit\PhpParser\Node\Stmt;
18205
18206use PHPUnit\PhpParser\Node;
18207class Enum_ extends ClassLike
18208{
18209    /** @var null|Node\Identifier Scalar Type */
18210    public $scalarType;
18211    /** @var Node\Name[] Names of implemented interfaces */
18212    public $implements;
18213    /**
18214     * @param string|Node\Identifier|null $name       Name
18215     * @param array                       $subNodes   Array of the following optional subnodes:
18216     *                                                'scalarType'  => null    : Scalar type
18217     *                                                'implements'  => array() : Names of implemented interfaces
18218     *                                                'stmts'       => array() : Statements
18219     *                                                'attrGroups'  => array() : PHP attribute groups
18220     * @param array                       $attributes Additional attributes
18221     */
18222    public function __construct($name, array $subNodes = [], array $attributes = [])
18223    {
18224        $this->name = \is_string($name) ? new Node\Identifier($name) : $name;
18225        $this->scalarType = $subNodes['scalarType'] ?? null;
18226        $this->implements = $subNodes['implements'] ?? [];
18227        $this->stmts = $subNodes['stmts'] ?? [];
18228        $this->attrGroups = $subNodes['attrGroups'] ?? [];
18229        parent::__construct($attributes);
18230    }
18231    public function getSubNodeNames() : array
18232    {
18233        return ['attrGroups', 'name', 'scalarType', 'implements', 'stmts'];
18234    }
18235    public function getType() : string
18236    {
18237        return 'Stmt_Enum';
18238    }
18239}
18240<?php
18241
18242declare (strict_types=1);
18243namespace PHPUnit\PhpParser\Node\Stmt;
18244
18245use PHPUnit\PhpParser\Node;
18246/**
18247 * Represents statements of type "expr;"
18248 */
18249class Expression extends Node\Stmt
18250{
18251    /** @var Node\Expr Expression */
18252    public $expr;
18253    /**
18254     * Constructs an expression statement.
18255     *
18256     * @param Node\Expr $expr       Expression
18257     * @param array     $attributes Additional attributes
18258     */
18259    public function __construct(Node\Expr $expr, array $attributes = [])
18260    {
18261        $this->attributes = $attributes;
18262        $this->expr = $expr;
18263    }
18264    public function getSubNodeNames() : array
18265    {
18266        return ['expr'];
18267    }
18268    public function getType() : string
18269    {
18270        return 'Stmt_Expression';
18271    }
18272}
18273<?php
18274
18275declare (strict_types=1);
18276namespace PHPUnit\PhpParser\Node\Stmt;
18277
18278use PHPUnit\PhpParser\Node;
18279use PHPUnit\PhpParser\Node\FunctionLike;
18280class ClassMethod extends Node\Stmt implements FunctionLike
18281{
18282    /** @var int Flags */
18283    public $flags;
18284    /** @var bool Whether to return by reference */
18285    public $byRef;
18286    /** @var Node\Identifier Name */
18287    public $name;
18288    /** @var Node\Param[] Parameters */
18289    public $params;
18290    /** @var null|Node\Identifier|Node\Name|Node\ComplexType Return type */
18291    public $returnType;
18292    /** @var Node\Stmt[]|null Statements */
18293    public $stmts;
18294    /** @var Node\AttributeGroup[] PHP attribute groups */
18295    public $attrGroups;
18296    private static $magicNames = ['__construct' => \true, '__destruct' => \true, '__call' => \true, '__callstatic' => \true, '__get' => \true, '__set' => \true, '__isset' => \true, '__unset' => \true, '__sleep' => \true, '__wakeup' => \true, '__tostring' => \true, '__set_state' => \true, '__clone' => \true, '__invoke' => \true, '__debuginfo' => \true];
18297    /**
18298     * Constructs a class method node.
18299     *
18300     * @param string|Node\Identifier $name Name
18301     * @param array $subNodes   Array of the following optional subnodes:
18302     *                          'flags       => MODIFIER_PUBLIC: Flags
18303     *                          'byRef'      => false          : Whether to return by reference
18304     *                          'params'     => array()        : Parameters
18305     *                          'returnType' => null           : Return type
18306     *                          'stmts'      => array()        : Statements
18307     *                          'attrGroups' => array()        : PHP attribute groups
18308     * @param array $attributes Additional attributes
18309     */
18310    public function __construct($name, array $subNodes = [], array $attributes = [])
18311    {
18312        $this->attributes = $attributes;
18313        $this->flags = $subNodes['flags'] ?? $subNodes['type'] ?? 0;
18314        $this->byRef = $subNodes['byRef'] ?? \false;
18315        $this->name = \is_string($name) ? new Node\Identifier($name) : $name;
18316        $this->params = $subNodes['params'] ?? [];
18317        $returnType = $subNodes['returnType'] ?? null;
18318        $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType;
18319        $this->stmts = \array_key_exists('stmts', $subNodes) ? $subNodes['stmts'] : [];
18320        $this->attrGroups = $subNodes['attrGroups'] ?? [];
18321    }
18322    public function getSubNodeNames() : array
18323    {
18324        return ['attrGroups', 'flags', 'byRef', 'name', 'params', 'returnType', 'stmts'];
18325    }
18326    public function returnsByRef() : bool
18327    {
18328        return $this->byRef;
18329    }
18330    public function getParams() : array
18331    {
18332        return $this->params;
18333    }
18334    public function getReturnType()
18335    {
18336        return $this->returnType;
18337    }
18338    public function getStmts()
18339    {
18340        return $this->stmts;
18341    }
18342    public function getAttrGroups() : array
18343    {
18344        return $this->attrGroups;
18345    }
18346    /**
18347     * Whether the method is explicitly or implicitly public.
18348     *
18349     * @return bool
18350     */
18351    public function isPublic() : bool
18352    {
18353        return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0 || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0;
18354    }
18355    /**
18356     * Whether the method is protected.
18357     *
18358     * @return bool
18359     */
18360    public function isProtected() : bool
18361    {
18362        return (bool) ($this->flags & Class_::MODIFIER_PROTECTED);
18363    }
18364    /**
18365     * Whether the method is private.
18366     *
18367     * @return bool
18368     */
18369    public function isPrivate() : bool
18370    {
18371        return (bool) ($this->flags & Class_::MODIFIER_PRIVATE);
18372    }
18373    /**
18374     * Whether the method is abstract.
18375     *
18376     * @return bool
18377     */
18378    public function isAbstract() : bool
18379    {
18380        return (bool) ($this->flags & Class_::MODIFIER_ABSTRACT);
18381    }
18382    /**
18383     * Whether the method is final.
18384     *
18385     * @return bool
18386     */
18387    public function isFinal() : bool
18388    {
18389        return (bool) ($this->flags & Class_::MODIFIER_FINAL);
18390    }
18391    /**
18392     * Whether the method is static.
18393     *
18394     * @return bool
18395     */
18396    public function isStatic() : bool
18397    {
18398        return (bool) ($this->flags & Class_::MODIFIER_STATIC);
18399    }
18400    /**
18401     * Whether the method is magic.
18402     *
18403     * @return bool
18404     */
18405    public function isMagic() : bool
18406    {
18407        return isset(self::$magicNames[$this->name->toLowerString()]);
18408    }
18409    public function getType() : string
18410    {
18411        return 'Stmt_ClassMethod';
18412    }
18413}
18414<?php
18415
18416declare (strict_types=1);
18417namespace PHPUnit\PhpParser\Node\Stmt;
18418
18419use PHPUnit\PhpParser\Node;
18420use PHPUnit\PhpParser\Node\Expr;
18421class Catch_ extends Node\Stmt
18422{
18423    /** @var Node\Name[] Types of exceptions to catch */
18424    public $types;
18425    /** @var Expr\Variable|null Variable for exception */
18426    public $var;
18427    /** @var Node\Stmt[] Statements */
18428    public $stmts;
18429    /**
18430     * Constructs a catch node.
18431     *
18432     * @param Node\Name[]           $types      Types of exceptions to catch
18433     * @param Expr\Variable|null    $var        Variable for exception
18434     * @param Node\Stmt[]           $stmts      Statements
18435     * @param array                 $attributes Additional attributes
18436     */
18437    public function __construct(array $types, Expr\Variable $var = null, array $stmts = [], array $attributes = [])
18438    {
18439        $this->attributes = $attributes;
18440        $this->types = $types;
18441        $this->var = $var;
18442        $this->stmts = $stmts;
18443    }
18444    public function getSubNodeNames() : array
18445    {
18446        return ['types', 'var', 'stmts'];
18447    }
18448    public function getType() : string
18449    {
18450        return 'Stmt_Catch';
18451    }
18452}
18453<?php
18454
18455declare (strict_types=1);
18456namespace PHPUnit\PhpParser\Node\Stmt;
18457
18458use PHPUnit\PhpParser\Node;
18459class Global_ extends Node\Stmt
18460{
18461    /** @var Node\Expr[] Variables */
18462    public $vars;
18463    /**
18464     * Constructs a global variables list node.
18465     *
18466     * @param Node\Expr[] $vars       Variables to unset
18467     * @param array       $attributes Additional attributes
18468     */
18469    public function __construct(array $vars, array $attributes = [])
18470    {
18471        $this->attributes = $attributes;
18472        $this->vars = $vars;
18473    }
18474    public function getSubNodeNames() : array
18475    {
18476        return ['vars'];
18477    }
18478    public function getType() : string
18479    {
18480        return 'Stmt_Global';
18481    }
18482}
18483<?php
18484
18485declare (strict_types=1);
18486namespace PHPUnit\PhpParser\Node\Stmt;
18487
18488use PHPUnit\PhpParser\Node;
18489class PropertyProperty extends Node\Stmt
18490{
18491    /** @var Node\VarLikeIdentifier Name */
18492    public $name;
18493    /** @var null|Node\Expr Default */
18494    public $default;
18495    /**
18496     * Constructs a class property node.
18497     *
18498     * @param string|Node\VarLikeIdentifier $name       Name
18499     * @param null|Node\Expr                $default    Default value
18500     * @param array                         $attributes Additional attributes
18501     */
18502    public function __construct($name, Node\Expr $default = null, array $attributes = [])
18503    {
18504        $this->attributes = $attributes;
18505        $this->name = \is_string($name) ? new Node\VarLikeIdentifier($name) : $name;
18506        $this->default = $default;
18507    }
18508    public function getSubNodeNames() : array
18509    {
18510        return ['name', 'default'];
18511    }
18512    public function getType() : string
18513    {
18514        return 'Stmt_PropertyProperty';
18515    }
18516}
18517<?php
18518
18519declare (strict_types=1);
18520namespace PHPUnit\PhpParser\Node\Stmt;
18521
18522use PHPUnit\PhpParser\Node;
18523class For_ extends Node\Stmt
18524{
18525    /** @var Node\Expr[] Init expressions */
18526    public $init;
18527    /** @var Node\Expr[] Loop conditions */
18528    public $cond;
18529    /** @var Node\Expr[] Loop expressions */
18530    public $loop;
18531    /** @var Node\Stmt[] Statements */
18532    public $stmts;
18533    /**
18534     * Constructs a for loop node.
18535     *
18536     * @param array $subNodes   Array of the following optional subnodes:
18537     *                          'init'  => array(): Init expressions
18538     *                          'cond'  => array(): Loop conditions
18539     *                          'loop'  => array(): Loop expressions
18540     *                          'stmts' => array(): Statements
18541     * @param array $attributes Additional attributes
18542     */
18543    public function __construct(array $subNodes = [], array $attributes = [])
18544    {
18545        $this->attributes = $attributes;
18546        $this->init = $subNodes['init'] ?? [];
18547        $this->cond = $subNodes['cond'] ?? [];
18548        $this->loop = $subNodes['loop'] ?? [];
18549        $this->stmts = $subNodes['stmts'] ?? [];
18550    }
18551    public function getSubNodeNames() : array
18552    {
18553        return ['init', 'cond', 'loop', 'stmts'];
18554    }
18555    public function getType() : string
18556    {
18557        return 'Stmt_For';
18558    }
18559}
18560<?php
18561
18562declare (strict_types=1);
18563namespace PHPUnit\PhpParser\Node\Stmt;
18564
18565use PHPUnit\PhpParser\Node\Stmt;
18566class Use_ extends Stmt
18567{
18568    /**
18569     * Unknown type. Both Stmt\Use_ / Stmt\GroupUse and Stmt\UseUse have a $type property, one of them will always be
18570     * TYPE_UNKNOWN while the other has one of the three other possible types. For normal use statements the type on the
18571     * Stmt\UseUse is unknown. It's only the other way around for mixed group use declarations.
18572     */
18573    const TYPE_UNKNOWN = 0;
18574    /** Class or namespace import */
18575    const TYPE_NORMAL = 1;
18576    /** Function import */
18577    const TYPE_FUNCTION = 2;
18578    /** Constant import */
18579    const TYPE_CONSTANT = 3;
18580    /** @var int Type of alias */
18581    public $type;
18582    /** @var UseUse[] Aliases */
18583    public $uses;
18584    /**
18585     * Constructs an alias (use) list node.
18586     *
18587     * @param UseUse[] $uses       Aliases
18588     * @param int      $type       Type of alias
18589     * @param array    $attributes Additional attributes
18590     */
18591    public function __construct(array $uses, int $type = self::TYPE_NORMAL, array $attributes = [])
18592    {
18593        $this->attributes = $attributes;
18594        $this->type = $type;
18595        $this->uses = $uses;
18596    }
18597    public function getSubNodeNames() : array
18598    {
18599        return ['type', 'uses'];
18600    }
18601    public function getType() : string
18602    {
18603        return 'Stmt_Use';
18604    }
18605}
18606<?php
18607
18608declare (strict_types=1);
18609namespace PHPUnit\PhpParser\Node\Stmt;
18610
18611use PHPUnit\PhpParser\Node;
18612class Namespace_ extends Node\Stmt
18613{
18614    /* For use in the "kind" attribute */
18615    const KIND_SEMICOLON = 1;
18616    const KIND_BRACED = 2;
18617    /** @var null|Node\Name Name */
18618    public $name;
18619    /** @var Node\Stmt[] Statements */
18620    public $stmts;
18621    /**
18622     * Constructs a namespace node.
18623     *
18624     * @param null|Node\Name   $name       Name
18625     * @param null|Node\Stmt[] $stmts      Statements
18626     * @param array            $attributes Additional attributes
18627     */
18628    public function __construct(Node\Name $name = null, $stmts = [], array $attributes = [])
18629    {
18630        $this->attributes = $attributes;
18631        $this->name = $name;
18632        $this->stmts = $stmts;
18633    }
18634    public function getSubNodeNames() : array
18635    {
18636        return ['name', 'stmts'];
18637    }
18638    public function getType() : string
18639    {
18640        return 'Stmt_Namespace';
18641    }
18642}
18643<?php
18644
18645declare (strict_types=1);
18646namespace PHPUnit\PhpParser\Node\Stmt;
18647
18648use PHPUnit\PhpParser\Node;
18649class ClassConst extends Node\Stmt
18650{
18651    /** @var int Modifiers */
18652    public $flags;
18653    /** @var Node\Const_[] Constant declarations */
18654    public $consts;
18655    /** @var Node\AttributeGroup[] */
18656    public $attrGroups;
18657    /**
18658     * Constructs a class const list node.
18659     *
18660     * @param Node\Const_[]         $consts     Constant declarations
18661     * @param int                   $flags      Modifiers
18662     * @param array                 $attributes Additional attributes
18663     * @param Node\AttributeGroup[] $attrGroups PHP attribute groups
18664     */
18665    public function __construct(array $consts, int $flags = 0, array $attributes = [], array $attrGroups = [])
18666    {
18667        $this->attributes = $attributes;
18668        $this->flags = $flags;
18669        $this->consts = $consts;
18670        $this->attrGroups = $attrGroups;
18671    }
18672    public function getSubNodeNames() : array
18673    {
18674        return ['attrGroups', 'flags', 'consts'];
18675    }
18676    /**
18677     * Whether constant is explicitly or implicitly public.
18678     *
18679     * @return bool
18680     */
18681    public function isPublic() : bool
18682    {
18683        return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0 || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0;
18684    }
18685    /**
18686     * Whether constant is protected.
18687     *
18688     * @return bool
18689     */
18690    public function isProtected() : bool
18691    {
18692        return (bool) ($this->flags & Class_::MODIFIER_PROTECTED);
18693    }
18694    /**
18695     * Whether constant is private.
18696     *
18697     * @return bool
18698     */
18699    public function isPrivate() : bool
18700    {
18701        return (bool) ($this->flags & Class_::MODIFIER_PRIVATE);
18702    }
18703    /**
18704     * Whether constant is final.
18705     *
18706     * @return bool
18707     */
18708    public function isFinal() : bool
18709    {
18710        return (bool) ($this->flags & Class_::MODIFIER_FINAL);
18711    }
18712    public function getType() : string
18713    {
18714        return 'Stmt_ClassConst';
18715    }
18716}
18717<?php
18718
18719declare (strict_types=1);
18720namespace PHPUnit\PhpParser\Node\Stmt;
18721
18722use PHPUnit\PhpParser\Node;
18723use PHPUnit\PhpParser\Node\ComplexType;
18724use PHPUnit\PhpParser\Node\Identifier;
18725use PHPUnit\PhpParser\Node\Name;
18726class Property extends Node\Stmt
18727{
18728    /** @var int Modifiers */
18729    public $flags;
18730    /** @var PropertyProperty[] Properties */
18731    public $props;
18732    /** @var null|Identifier|Name|ComplexType Type declaration */
18733    public $type;
18734    /** @var Node\AttributeGroup[] PHP attribute groups */
18735    public $attrGroups;
18736    /**
18737     * Constructs a class property list node.
18738     *
18739     * @param int                                     $flags      Modifiers
18740     * @param PropertyProperty[]                      $props      Properties
18741     * @param array                                   $attributes Additional attributes
18742     * @param null|string|Identifier|Name|ComplexType $type       Type declaration
18743     * @param Node\AttributeGroup[]                   $attrGroups PHP attribute groups
18744     */
18745    public function __construct(int $flags, array $props, array $attributes = [], $type = null, array $attrGroups = [])
18746    {
18747        $this->attributes = $attributes;
18748        $this->flags = $flags;
18749        $this->props = $props;
18750        $this->type = \is_string($type) ? new Identifier($type) : $type;
18751        $this->attrGroups = $attrGroups;
18752    }
18753    public function getSubNodeNames() : array
18754    {
18755        return ['attrGroups', 'flags', 'type', 'props'];
18756    }
18757    /**
18758     * Whether the property is explicitly or implicitly public.
18759     *
18760     * @return bool
18761     */
18762    public function isPublic() : bool
18763    {
18764        return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0 || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0;
18765    }
18766    /**
18767     * Whether the property is protected.
18768     *
18769     * @return bool
18770     */
18771    public function isProtected() : bool
18772    {
18773        return (bool) ($this->flags & Class_::MODIFIER_PROTECTED);
18774    }
18775    /**
18776     * Whether the property is private.
18777     *
18778     * @return bool
18779     */
18780    public function isPrivate() : bool
18781    {
18782        return (bool) ($this->flags & Class_::MODIFIER_PRIVATE);
18783    }
18784    /**
18785     * Whether the property is static.
18786     *
18787     * @return bool
18788     */
18789    public function isStatic() : bool
18790    {
18791        return (bool) ($this->flags & Class_::MODIFIER_STATIC);
18792    }
18793    /**
18794     * Whether the property is readonly.
18795     *
18796     * @return bool
18797     */
18798    public function isReadonly() : bool
18799    {
18800        return (bool) ($this->flags & Class_::MODIFIER_READONLY);
18801    }
18802    public function getType() : string
18803    {
18804        return 'Stmt_Property';
18805    }
18806}
18807<?php
18808
18809declare (strict_types=1);
18810namespace PHPUnit\PhpParser\Node\Stmt;
18811
18812use PHPUnit\PhpParser\Node;
18813abstract class TraitUseAdaptation extends Node\Stmt
18814{
18815    /** @var Node\Name|null Trait name */
18816    public $trait;
18817    /** @var Node\Identifier Method name */
18818    public $method;
18819}
18820<?php
18821
18822declare (strict_types=1);
18823namespace PHPUnit\PhpParser\Node\Expr;
18824
18825use PHPUnit\PhpParser\Node\Expr;
18826use PHPUnit\PhpParser\Node\Identifier;
18827class NullsafePropertyFetch extends Expr
18828{
18829    /** @var Expr Variable holding object */
18830    public $var;
18831    /** @var Identifier|Expr Property name */
18832    public $name;
18833    /**
18834     * Constructs a nullsafe property fetch node.
18835     *
18836     * @param Expr                   $var        Variable holding object
18837     * @param string|Identifier|Expr $name       Property name
18838     * @param array                  $attributes Additional attributes
18839     */
18840    public function __construct(Expr $var, $name, array $attributes = [])
18841    {
18842        $this->attributes = $attributes;
18843        $this->var = $var;
18844        $this->name = \is_string($name) ? new Identifier($name) : $name;
18845    }
18846    public function getSubNodeNames() : array
18847    {
18848        return ['var', 'name'];
18849    }
18850    public function getType() : string
18851    {
18852        return 'Expr_NullsafePropertyFetch';
18853    }
18854}
18855<?php
18856
18857declare (strict_types=1);
18858namespace PHPUnit\PhpParser\Node\Expr;
18859
18860use PHPUnit\PhpParser\Node\Expr;
18861class ArrayItem extends Expr
18862{
18863    /** @var null|Expr Key */
18864    public $key;
18865    /** @var Expr Value */
18866    public $value;
18867    /** @var bool Whether to assign by reference */
18868    public $byRef;
18869    /** @var bool Whether to unpack the argument */
18870    public $unpack;
18871    /**
18872     * Constructs an array item node.
18873     *
18874     * @param Expr      $value      Value
18875     * @param null|Expr $key        Key
18876     * @param bool      $byRef      Whether to assign by reference
18877     * @param array     $attributes Additional attributes
18878     */
18879    public function __construct(Expr $value, Expr $key = null, bool $byRef = \false, array $attributes = [], bool $unpack = \false)
18880    {
18881        $this->attributes = $attributes;
18882        $this->key = $key;
18883        $this->value = $value;
18884        $this->byRef = $byRef;
18885        $this->unpack = $unpack;
18886    }
18887    public function getSubNodeNames() : array
18888    {
18889        return ['key', 'value', 'byRef', 'unpack'];
18890    }
18891    public function getType() : string
18892    {
18893        return 'Expr_ArrayItem';
18894    }
18895}
18896<?php
18897
18898declare (strict_types=1);
18899namespace PHPUnit\PhpParser\Node\Expr;
18900
18901use PHPUnit\PhpParser\Node\Expr;
18902class PreDec extends Expr
18903{
18904    /** @var Expr Variable */
18905    public $var;
18906    /**
18907     * Constructs a pre decrement node.
18908     *
18909     * @param Expr  $var        Variable
18910     * @param array $attributes Additional attributes
18911     */
18912    public function __construct(Expr $var, array $attributes = [])
18913    {
18914        $this->attributes = $attributes;
18915        $this->var = $var;
18916    }
18917    public function getSubNodeNames() : array
18918    {
18919        return ['var'];
18920    }
18921    public function getType() : string
18922    {
18923        return 'Expr_PreDec';
18924    }
18925}
18926<?php
18927
18928declare (strict_types=1);
18929namespace PHPUnit\PhpParser\Node\Expr;
18930
18931use PHPUnit\PhpParser\Node\Expr;
18932abstract class Cast extends Expr
18933{
18934    /** @var Expr Expression */
18935    public $expr;
18936    /**
18937     * Constructs a cast node.
18938     *
18939     * @param Expr  $expr       Expression
18940     * @param array $attributes Additional attributes
18941     */
18942    public function __construct(Expr $expr, array $attributes = [])
18943    {
18944        $this->attributes = $attributes;
18945        $this->expr = $expr;
18946    }
18947    public function getSubNodeNames() : array
18948    {
18949        return ['expr'];
18950    }
18951}
18952<?php
18953
18954declare (strict_types=1);
18955namespace PHPUnit\PhpParser\Node\Expr;
18956
18957use PHPUnit\PhpParser\Node\Expr;
18958class Clone_ extends Expr
18959{
18960    /** @var Expr Expression */
18961    public $expr;
18962    /**
18963     * Constructs a clone node.
18964     *
18965     * @param Expr  $expr       Expression
18966     * @param array $attributes Additional attributes
18967     */
18968    public function __construct(Expr $expr, array $attributes = [])
18969    {
18970        $this->attributes = $attributes;
18971        $this->expr = $expr;
18972    }
18973    public function getSubNodeNames() : array
18974    {
18975        return ['expr'];
18976    }
18977    public function getType() : string
18978    {
18979        return 'Expr_Clone';
18980    }
18981}
18982<?php
18983
18984declare (strict_types=1);
18985namespace PHPUnit\PhpParser\Node\Expr;
18986
18987use PHPUnit\PhpParser\Node\Expr;
18988class UnaryPlus extends Expr
18989{
18990    /** @var Expr Expression */
18991    public $expr;
18992    /**
18993     * Constructs a unary plus node.
18994     *
18995     * @param Expr $expr       Expression
18996     * @param array               $attributes Additional attributes
18997     */
18998    public function __construct(Expr $expr, array $attributes = [])
18999    {
19000        $this->attributes = $attributes;
19001        $this->expr = $expr;
19002    }
19003    public function getSubNodeNames() : array
19004    {
19005        return ['expr'];
19006    }
19007    public function getType() : string
19008    {
19009        return 'Expr_UnaryPlus';
19010    }
19011}
19012<?php
19013
19014declare (strict_types=1);
19015namespace PHPUnit\PhpParser\Node\Expr;
19016
19017use PHPUnit\PhpParser\Node\Expr;
19018abstract class AssignOp extends Expr
19019{
19020    /** @var Expr Variable */
19021    public $var;
19022    /** @var Expr Expression */
19023    public $expr;
19024    /**
19025     * Constructs a compound assignment operation node.
19026     *
19027     * @param Expr  $var        Variable
19028     * @param Expr  $expr       Expression
19029     * @param array $attributes Additional attributes
19030     */
19031    public function __construct(Expr $var, Expr $expr, array $attributes = [])
19032    {
19033        $this->attributes = $attributes;
19034        $this->var = $var;
19035        $this->expr = $expr;
19036    }
19037    public function getSubNodeNames() : array
19038    {
19039        return ['var', 'expr'];
19040    }
19041}
19042<?php
19043
19044declare (strict_types=1);
19045namespace PHPUnit\PhpParser\Node\Expr;
19046
19047use PHPUnit\PhpParser\Node\Arg;
19048use PHPUnit\PhpParser\Node\Expr;
19049use PHPUnit\PhpParser\Node\VariadicPlaceholder;
19050abstract class CallLike extends Expr
19051{
19052    /**
19053     * Return raw arguments, which may be actual Args, or VariadicPlaceholders for first-class
19054     * callables.
19055     *
19056     * @return array<Arg|VariadicPlaceholder>
19057     */
19058    public abstract function getRawArgs() : array;
19059    /**
19060     * Returns whether this call expression is actually a first class callable.
19061     */
19062    public function isFirstClassCallable() : bool
19063    {
19064        foreach ($this->getRawArgs() as $arg) {
19065            if ($arg instanceof VariadicPlaceholder) {
19066                return \true;
19067            }
19068        }
19069        return \false;
19070    }
19071    /**
19072     * Assert that this is not a first-class callable and return only ordinary Args.
19073     *
19074     * @return Arg[]
19075     */
19076    public function getArgs() : array
19077    {
19078        \assert(!$this->isFirstClassCallable());
19079        return $this->getRawArgs();
19080    }
19081}
19082<?php
19083
19084declare (strict_types=1);
19085namespace PHPUnit\PhpParser\Node\Expr;
19086
19087use PHPUnit\PhpParser\Node;
19088class Throw_ extends Node\Expr
19089{
19090    /** @var Node\Expr Expression */
19091    public $expr;
19092    /**
19093     * Constructs a throw expression node.
19094     *
19095     * @param Node\Expr $expr       Expression
19096     * @param array     $attributes Additional attributes
19097     */
19098    public function __construct(Node\Expr $expr, array $attributes = [])
19099    {
19100        $this->attributes = $attributes;
19101        $this->expr = $expr;
19102    }
19103    public function getSubNodeNames() : array
19104    {
19105        return ['expr'];
19106    }
19107    public function getType() : string
19108    {
19109        return 'Expr_Throw';
19110    }
19111}
19112<?php
19113
19114declare (strict_types=1);
19115namespace PHPUnit\PhpParser\Node\Expr;
19116
19117use PHPUnit\PhpParser\Node\Expr;
19118class Yield_ extends Expr
19119{
19120    /** @var null|Expr Key expression */
19121    public $key;
19122    /** @var null|Expr Value expression */
19123    public $value;
19124    /**
19125     * Constructs a yield expression node.
19126     *
19127     * @param null|Expr $value      Value expression
19128     * @param null|Expr $key        Key expression
19129     * @param array     $attributes Additional attributes
19130     */
19131    public function __construct(Expr $value = null, Expr $key = null, array $attributes = [])
19132    {
19133        $this->attributes = $attributes;
19134        $this->key = $key;
19135        $this->value = $value;
19136    }
19137    public function getSubNodeNames() : array
19138    {
19139        return ['key', 'value'];
19140    }
19141    public function getType() : string
19142    {
19143        return 'Expr_Yield';
19144    }
19145}
19146<?php
19147
19148declare (strict_types=1);
19149namespace PHPUnit\PhpParser\Node\Expr;
19150
19151use PHPUnit\PhpParser\Node;
19152use PHPUnit\PhpParser\Node\MatchArm;
19153class Match_ extends Node\Expr
19154{
19155    /** @var Node\Expr */
19156    public $cond;
19157    /** @var MatchArm[] */
19158    public $arms;
19159    /**
19160     * @param MatchArm[] $arms
19161     */
19162    public function __construct(Node\Expr $cond, array $arms = [], array $attributes = [])
19163    {
19164        $this->attributes = $attributes;
19165        $this->cond = $cond;
19166        $this->arms = $arms;
19167    }
19168    public function getSubNodeNames() : array
19169    {
19170        return ['cond', 'arms'];
19171    }
19172    public function getType() : string
19173    {
19174        return 'Expr_Match';
19175    }
19176}
19177<?php
19178
19179declare (strict_types=1);
19180namespace PHPUnit\PhpParser\Node\Expr;
19181
19182use PHPUnit\PhpParser\Node\Expr;
19183class Print_ extends Expr
19184{
19185    /** @var Expr Expression */
19186    public $expr;
19187    /**
19188     * Constructs an print() node.
19189     *
19190     * @param Expr  $expr       Expression
19191     * @param array $attributes Additional attributes
19192     */
19193    public function __construct(Expr $expr, array $attributes = [])
19194    {
19195        $this->attributes = $attributes;
19196        $this->expr = $expr;
19197    }
19198    public function getSubNodeNames() : array
19199    {
19200        return ['expr'];
19201    }
19202    public function getType() : string
19203    {
19204        return 'Expr_Print';
19205    }
19206}
19207<?php
19208
19209declare (strict_types=1);
19210namespace PHPUnit\PhpParser\Node\Expr;
19211
19212use PHPUnit\PhpParser\Node\Expr;
19213class Variable extends Expr
19214{
19215    /** @var string|Expr Name */
19216    public $name;
19217    /**
19218     * Constructs a variable node.
19219     *
19220     * @param string|Expr $name       Name
19221     * @param array       $attributes Additional attributes
19222     */
19223    public function __construct($name, array $attributes = [])
19224    {
19225        $this->attributes = $attributes;
19226        $this->name = $name;
19227    }
19228    public function getSubNodeNames() : array
19229    {
19230        return ['name'];
19231    }
19232    public function getType() : string
19233    {
19234        return 'Expr_Variable';
19235    }
19236}
19237<?php
19238
19239declare (strict_types=1);
19240namespace PHPUnit\PhpParser\Node\Expr;
19241
19242use PHPUnit\PhpParser\Node\Expr;
19243/**
19244 * Error node used during parsing with error recovery.
19245 *
19246 * An error node may be placed at a position where an expression is required, but an error occurred.
19247 * Error nodes will not be present if the parser is run in throwOnError mode (the default).
19248 */
19249class Error extends Expr
19250{
19251    /**
19252     * Constructs an error node.
19253     *
19254     * @param array $attributes Additional attributes
19255     */
19256    public function __construct(array $attributes = [])
19257    {
19258        $this->attributes = $attributes;
19259    }
19260    public function getSubNodeNames() : array
19261    {
19262        return [];
19263    }
19264    public function getType() : string
19265    {
19266        return 'Expr_Error';
19267    }
19268}
19269<?php
19270
19271declare (strict_types=1);
19272namespace PHPUnit\PhpParser\Node\Expr;
19273
19274use PHPUnit\PhpParser\Node\Expr;
19275class PostDec extends Expr
19276{
19277    /** @var Expr Variable */
19278    public $var;
19279    /**
19280     * Constructs a post decrement node.
19281     *
19282     * @param Expr  $var        Variable
19283     * @param array $attributes Additional attributes
19284     */
19285    public function __construct(Expr $var, array $attributes = [])
19286    {
19287        $this->attributes = $attributes;
19288        $this->var = $var;
19289    }
19290    public function getSubNodeNames() : array
19291    {
19292        return ['var'];
19293    }
19294    public function getType() : string
19295    {
19296        return 'Expr_PostDec';
19297    }
19298}
19299<?php
19300
19301declare (strict_types=1);
19302namespace PHPUnit\PhpParser\Node\Expr;
19303
19304use PHPUnit\PhpParser\Node\Expr;
19305class Eval_ extends Expr
19306{
19307    /** @var Expr Expression */
19308    public $expr;
19309    /**
19310     * Constructs an eval() node.
19311     *
19312     * @param Expr  $expr       Expression
19313     * @param array $attributes Additional attributes
19314     */
19315    public function __construct(Expr $expr, array $attributes = [])
19316    {
19317        $this->attributes = $attributes;
19318        $this->expr = $expr;
19319    }
19320    public function getSubNodeNames() : array
19321    {
19322        return ['expr'];
19323    }
19324    public function getType() : string
19325    {
19326        return 'Expr_Eval';
19327    }
19328}
19329<?php
19330
19331declare (strict_types=1);
19332namespace PHPUnit\PhpParser\Node\Expr;
19333
19334use PHPUnit\PhpParser\Node;
19335use PHPUnit\PhpParser\Node\Arg;
19336use PHPUnit\PhpParser\Node\Expr;
19337use PHPUnit\PhpParser\Node\VariadicPlaceholder;
19338class New_ extends CallLike
19339{
19340    /** @var Node\Name|Expr|Node\Stmt\Class_ Class name */
19341    public $class;
19342    /** @var array<Arg|VariadicPlaceholder> Arguments */
19343    public $args;
19344    /**
19345     * Constructs a function call node.
19346     *
19347     * @param Node\Name|Expr|Node\Stmt\Class_ $class      Class name (or class node for anonymous classes)
19348     * @param array<Arg|VariadicPlaceholder>  $args       Arguments
19349     * @param array                           $attributes Additional attributes
19350     */
19351    public function __construct($class, array $args = [], array $attributes = [])
19352    {
19353        $this->attributes = $attributes;
19354        $this->class = $class;
19355        $this->args = $args;
19356    }
19357    public function getSubNodeNames() : array
19358    {
19359        return ['class', 'args'];
19360    }
19361    public function getType() : string
19362    {
19363        return 'Expr_New';
19364    }
19365    public function getRawArgs() : array
19366    {
19367        return $this->args;
19368    }
19369}
19370<?php
19371
19372declare (strict_types=1);
19373namespace PHPUnit\PhpParser\Node\Expr;
19374
19375use PHPUnit\PhpParser\Node;
19376use PHPUnit\PhpParser\Node\Expr;
19377use PHPUnit\PhpParser\Node\FunctionLike;
19378class ArrowFunction extends Expr implements FunctionLike
19379{
19380    /** @var bool */
19381    public $static;
19382    /** @var bool */
19383    public $byRef;
19384    /** @var Node\Param[] */
19385    public $params = [];
19386    /** @var null|Node\Identifier|Node\Name|Node\ComplexType */
19387    public $returnType;
19388    /** @var Expr */
19389    public $expr;
19390    /** @var Node\AttributeGroup[] */
19391    public $attrGroups;
19392    /**
19393     * @param array $subNodes   Array of the following optional subnodes:
19394     *                          'static'     => false   : Whether the closure is static
19395     *                          'byRef'      => false   : Whether to return by reference
19396     *                          'params'     => array() : Parameters
19397     *                          'returnType' => null    : Return type
19398     *                          'expr'       => Expr    : Expression body
19399     *                          'attrGroups' => array() : PHP attribute groups
19400     * @param array $attributes Additional attributes
19401     */
19402    public function __construct(array $subNodes = [], array $attributes = [])
19403    {
19404        $this->attributes = $attributes;
19405        $this->static = $subNodes['static'] ?? \false;
19406        $this->byRef = $subNodes['byRef'] ?? \false;
19407        $this->params = $subNodes['params'] ?? [];
19408        $returnType = $subNodes['returnType'] ?? null;
19409        $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType;
19410        $this->expr = $subNodes['expr'] ?? null;
19411        $this->attrGroups = $subNodes['attrGroups'] ?? [];
19412    }
19413    public function getSubNodeNames() : array
19414    {
19415        return ['attrGroups', 'static', 'byRef', 'params', 'returnType', 'expr'];
19416    }
19417    public function returnsByRef() : bool
19418    {
19419        return $this->byRef;
19420    }
19421    public function getParams() : array
19422    {
19423        return $this->params;
19424    }
19425    public function getReturnType()
19426    {
19427        return $this->returnType;
19428    }
19429    public function getAttrGroups() : array
19430    {
19431        return $this->attrGroups;
19432    }
19433    /**
19434     * @return Node\Stmt\Return_[]
19435     */
19436    public function getStmts() : array
19437    {
19438        return [new Node\Stmt\Return_($this->expr)];
19439    }
19440    public function getType() : string
19441    {
19442        return 'Expr_ArrowFunction';
19443    }
19444}
19445<?php
19446
19447declare (strict_types=1);
19448namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19449
19450use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19451class Mul extends BinaryOp
19452{
19453    public function getOperatorSigil() : string
19454    {
19455        return '*';
19456    }
19457    public function getType() : string
19458    {
19459        return 'Expr_BinaryOp_Mul';
19460    }
19461}
19462<?php
19463
19464declare (strict_types=1);
19465namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19466
19467use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19468class BooleanOr extends BinaryOp
19469{
19470    public function getOperatorSigil() : string
19471    {
19472        return '||';
19473    }
19474    public function getType() : string
19475    {
19476        return 'Expr_BinaryOp_BooleanOr';
19477    }
19478}
19479<?php
19480
19481declare (strict_types=1);
19482namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19483
19484use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19485class Smaller extends BinaryOp
19486{
19487    public function getOperatorSigil() : string
19488    {
19489        return '<';
19490    }
19491    public function getType() : string
19492    {
19493        return 'Expr_BinaryOp_Smaller';
19494    }
19495}
19496<?php
19497
19498declare (strict_types=1);
19499namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19500
19501use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19502class LogicalXor extends BinaryOp
19503{
19504    public function getOperatorSigil() : string
19505    {
19506        return 'xor';
19507    }
19508    public function getType() : string
19509    {
19510        return 'Expr_BinaryOp_LogicalXor';
19511    }
19512}
19513<?php
19514
19515declare (strict_types=1);
19516namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19517
19518use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19519class Pow extends BinaryOp
19520{
19521    public function getOperatorSigil() : string
19522    {
19523        return '**';
19524    }
19525    public function getType() : string
19526    {
19527        return 'Expr_BinaryOp_Pow';
19528    }
19529}
19530<?php
19531
19532declare (strict_types=1);
19533namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19534
19535use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19536class Identical extends BinaryOp
19537{
19538    public function getOperatorSigil() : string
19539    {
19540        return '===';
19541    }
19542    public function getType() : string
19543    {
19544        return 'Expr_BinaryOp_Identical';
19545    }
19546}
19547<?php
19548
19549declare (strict_types=1);
19550namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19551
19552use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19553class BitwiseOr extends BinaryOp
19554{
19555    public function getOperatorSigil() : string
19556    {
19557        return '|';
19558    }
19559    public function getType() : string
19560    {
19561        return 'Expr_BinaryOp_BitwiseOr';
19562    }
19563}
19564<?php
19565
19566declare (strict_types=1);
19567namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19568
19569use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19570class Equal extends BinaryOp
19571{
19572    public function getOperatorSigil() : string
19573    {
19574        return '==';
19575    }
19576    public function getType() : string
19577    {
19578        return 'Expr_BinaryOp_Equal';
19579    }
19580}
19581<?php
19582
19583declare (strict_types=1);
19584namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19585
19586use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19587class Spaceship extends BinaryOp
19588{
19589    public function getOperatorSigil() : string
19590    {
19591        return '<=>';
19592    }
19593    public function getType() : string
19594    {
19595        return 'Expr_BinaryOp_Spaceship';
19596    }
19597}
19598<?php
19599
19600declare (strict_types=1);
19601namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19602
19603use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19604class Plus extends BinaryOp
19605{
19606    public function getOperatorSigil() : string
19607    {
19608        return '+';
19609    }
19610    public function getType() : string
19611    {
19612        return 'Expr_BinaryOp_Plus';
19613    }
19614}
19615<?php
19616
19617declare (strict_types=1);
19618namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19619
19620use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19621class SmallerOrEqual extends BinaryOp
19622{
19623    public function getOperatorSigil() : string
19624    {
19625        return '<=';
19626    }
19627    public function getType() : string
19628    {
19629        return 'Expr_BinaryOp_SmallerOrEqual';
19630    }
19631}
19632<?php
19633
19634declare (strict_types=1);
19635namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19636
19637use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19638class BitwiseAnd extends BinaryOp
19639{
19640    public function getOperatorSigil() : string
19641    {
19642        return '&';
19643    }
19644    public function getType() : string
19645    {
19646        return 'Expr_BinaryOp_BitwiseAnd';
19647    }
19648}
19649<?php
19650
19651declare (strict_types=1);
19652namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19653
19654use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19655class BitwiseXor extends BinaryOp
19656{
19657    public function getOperatorSigil() : string
19658    {
19659        return '^';
19660    }
19661    public function getType() : string
19662    {
19663        return 'Expr_BinaryOp_BitwiseXor';
19664    }
19665}
19666<?php
19667
19668declare (strict_types=1);
19669namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19670
19671use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19672class LogicalOr extends BinaryOp
19673{
19674    public function getOperatorSigil() : string
19675    {
19676        return 'or';
19677    }
19678    public function getType() : string
19679    {
19680        return 'Expr_BinaryOp_LogicalOr';
19681    }
19682}
19683<?php
19684
19685declare (strict_types=1);
19686namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19687
19688use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19689class BooleanAnd extends BinaryOp
19690{
19691    public function getOperatorSigil() : string
19692    {
19693        return '&&';
19694    }
19695    public function getType() : string
19696    {
19697        return 'Expr_BinaryOp_BooleanAnd';
19698    }
19699}
19700<?php
19701
19702declare (strict_types=1);
19703namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19704
19705use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19706class LogicalAnd extends BinaryOp
19707{
19708    public function getOperatorSigil() : string
19709    {
19710        return 'and';
19711    }
19712    public function getType() : string
19713    {
19714        return 'Expr_BinaryOp_LogicalAnd';
19715    }
19716}
19717<?php
19718
19719declare (strict_types=1);
19720namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19721
19722use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19723class Greater extends BinaryOp
19724{
19725    public function getOperatorSigil() : string
19726    {
19727        return '>';
19728    }
19729    public function getType() : string
19730    {
19731        return 'Expr_BinaryOp_Greater';
19732    }
19733}
19734<?php
19735
19736declare (strict_types=1);
19737namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19738
19739use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19740class Div extends BinaryOp
19741{
19742    public function getOperatorSigil() : string
19743    {
19744        return '/';
19745    }
19746    public function getType() : string
19747    {
19748        return 'Expr_BinaryOp_Div';
19749    }
19750}
19751<?php
19752
19753declare (strict_types=1);
19754namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19755
19756use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19757class ShiftRight extends BinaryOp
19758{
19759    public function getOperatorSigil() : string
19760    {
19761        return '>>';
19762    }
19763    public function getType() : string
19764    {
19765        return 'Expr_BinaryOp_ShiftRight';
19766    }
19767}
19768<?php
19769
19770declare (strict_types=1);
19771namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19772
19773use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19774class Coalesce extends BinaryOp
19775{
19776    public function getOperatorSigil() : string
19777    {
19778        return '??';
19779    }
19780    public function getType() : string
19781    {
19782        return 'Expr_BinaryOp_Coalesce';
19783    }
19784}
19785<?php
19786
19787declare (strict_types=1);
19788namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19789
19790use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19791class ShiftLeft extends BinaryOp
19792{
19793    public function getOperatorSigil() : string
19794    {
19795        return '<<';
19796    }
19797    public function getType() : string
19798    {
19799        return 'Expr_BinaryOp_ShiftLeft';
19800    }
19801}
19802<?php
19803
19804declare (strict_types=1);
19805namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19806
19807use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19808class Mod extends BinaryOp
19809{
19810    public function getOperatorSigil() : string
19811    {
19812        return '%';
19813    }
19814    public function getType() : string
19815    {
19816        return 'Expr_BinaryOp_Mod';
19817    }
19818}
19819<?php
19820
19821declare (strict_types=1);
19822namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19823
19824use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19825class NotEqual extends BinaryOp
19826{
19827    public function getOperatorSigil() : string
19828    {
19829        return '!=';
19830    }
19831    public function getType() : string
19832    {
19833        return 'Expr_BinaryOp_NotEqual';
19834    }
19835}
19836<?php
19837
19838declare (strict_types=1);
19839namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19840
19841use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19842class Minus extends BinaryOp
19843{
19844    public function getOperatorSigil() : string
19845    {
19846        return '-';
19847    }
19848    public function getType() : string
19849    {
19850        return 'Expr_BinaryOp_Minus';
19851    }
19852}
19853<?php
19854
19855declare (strict_types=1);
19856namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19857
19858use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19859class NotIdentical extends BinaryOp
19860{
19861    public function getOperatorSigil() : string
19862    {
19863        return '!==';
19864    }
19865    public function getType() : string
19866    {
19867        return 'Expr_BinaryOp_NotIdentical';
19868    }
19869}
19870<?php
19871
19872declare (strict_types=1);
19873namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19874
19875use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19876class GreaterOrEqual extends BinaryOp
19877{
19878    public function getOperatorSigil() : string
19879    {
19880        return '>=';
19881    }
19882    public function getType() : string
19883    {
19884        return 'Expr_BinaryOp_GreaterOrEqual';
19885    }
19886}
19887<?php
19888
19889declare (strict_types=1);
19890namespace PHPUnit\PhpParser\Node\Expr\BinaryOp;
19891
19892use PHPUnit\PhpParser\Node\Expr\BinaryOp;
19893class Concat extends BinaryOp
19894{
19895    public function getOperatorSigil() : string
19896    {
19897        return '.';
19898    }
19899    public function getType() : string
19900    {
19901        return 'Expr_BinaryOp_Concat';
19902    }
19903}
19904<?php
19905
19906declare (strict_types=1);
19907namespace PHPUnit\PhpParser\Node\Expr;
19908
19909use PHPUnit\PhpParser\Node\Expr;
19910class PostInc extends Expr
19911{
19912    /** @var Expr Variable */
19913    public $var;
19914    /**
19915     * Constructs a post increment node.
19916     *
19917     * @param Expr  $var        Variable
19918     * @param array $attributes Additional attributes
19919     */
19920    public function __construct(Expr $var, array $attributes = [])
19921    {
19922        $this->attributes = $attributes;
19923        $this->var = $var;
19924    }
19925    public function getSubNodeNames() : array
19926    {
19927        return ['var'];
19928    }
19929    public function getType() : string
19930    {
19931        return 'Expr_PostInc';
19932    }
19933}
19934<?php
19935
19936declare (strict_types=1);
19937namespace PHPUnit\PhpParser\Node\Expr;
19938
19939use PHPUnit\PhpParser\Node\Expr;
19940class Ternary extends Expr
19941{
19942    /** @var Expr Condition */
19943    public $cond;
19944    /** @var null|Expr Expression for true */
19945    public $if;
19946    /** @var Expr Expression for false */
19947    public $else;
19948    /**
19949     * Constructs a ternary operator node.
19950     *
19951     * @param Expr      $cond       Condition
19952     * @param null|Expr $if         Expression for true
19953     * @param Expr      $else       Expression for false
19954     * @param array                    $attributes Additional attributes
19955     */
19956    public function __construct(Expr $cond, $if, Expr $else, array $attributes = [])
19957    {
19958        $this->attributes = $attributes;
19959        $this->cond = $cond;
19960        $this->if = $if;
19961        $this->else = $else;
19962    }
19963    public function getSubNodeNames() : array
19964    {
19965        return ['cond', 'if', 'else'];
19966    }
19967    public function getType() : string
19968    {
19969        return 'Expr_Ternary';
19970    }
19971}
19972<?php
19973
19974declare (strict_types=1);
19975namespace PHPUnit\PhpParser\Node\Expr;
19976
19977use PHPUnit\PhpParser\Node\Arg;
19978use PHPUnit\PhpParser\Node\Expr;
19979use PHPUnit\PhpParser\Node\Identifier;
19980class NullsafeMethodCall extends Expr
19981{
19982    /** @var Expr Variable holding object */
19983    public $var;
19984    /** @var Identifier|Expr Method name */
19985    public $name;
19986    /** @var Arg[] Arguments */
19987    public $args;
19988    /**
19989     * Constructs a nullsafe method call node.
19990     *
19991     * @param Expr                   $var        Variable holding object
19992     * @param string|Identifier|Expr $name       Method name
19993     * @param Arg[]                  $args       Arguments
19994     * @param array                  $attributes Additional attributes
19995     */
19996    public function __construct(Expr $var, $name, array $args = [], array $attributes = [])
19997    {
19998        $this->attributes = $attributes;
19999        $this->var = $var;
20000        $this->name = \is_string($name) ? new Identifier($name) : $name;
20001        $this->args = $args;
20002    }
20003    public function getSubNodeNames() : array
20004    {
20005        return ['var', 'name', 'args'];
20006    }
20007    public function getType() : string
20008    {
20009        return 'Expr_NullsafeMethodCall';
20010    }
20011}
20012<?php
20013
20014declare (strict_types=1);
20015namespace PHPUnit\PhpParser\Node\Expr;
20016
20017use PHPUnit\PhpParser\Node\Expr;
20018use PHPUnit\PhpParser\Node\Identifier;
20019class PropertyFetch extends Expr
20020{
20021    /** @var Expr Variable holding object */
20022    public $var;
20023    /** @var Identifier|Expr Property name */
20024    public $name;
20025    /**
20026     * Constructs a function call node.
20027     *
20028     * @param Expr                   $var        Variable holding object
20029     * @param string|Identifier|Expr $name       Property name
20030     * @param array                  $attributes Additional attributes
20031     */
20032    public function __construct(Expr $var, $name, array $attributes = [])
20033    {
20034        $this->attributes = $attributes;
20035        $this->var = $var;
20036        $this->name = \is_string($name) ? new Identifier($name) : $name;
20037    }
20038    public function getSubNodeNames() : array
20039    {
20040        return ['var', 'name'];
20041    }
20042    public function getType() : string
20043    {
20044        return 'Expr_PropertyFetch';
20045    }
20046}
20047<?php
20048
20049declare (strict_types=1);
20050namespace PHPUnit\PhpParser\Node\Expr;
20051
20052use PHPUnit\PhpParser\Node\Expr;
20053use PHPUnit\PhpParser\Node\Name;
20054class Instanceof_ extends Expr
20055{
20056    /** @var Expr Expression */
20057    public $expr;
20058    /** @var Name|Expr Class name */
20059    public $class;
20060    /**
20061     * Constructs an instanceof check node.
20062     *
20063     * @param Expr      $expr       Expression
20064     * @param Name|Expr $class      Class name
20065     * @param array     $attributes Additional attributes
20066     */
20067    public function __construct(Expr $expr, $class, array $attributes = [])
20068    {
20069        $this->attributes = $attributes;
20070        $this->expr = $expr;
20071        $this->class = $class;
20072    }
20073    public function getSubNodeNames() : array
20074    {
20075        return ['expr', 'class'];
20076    }
20077    public function getType() : string
20078    {
20079        return 'Expr_Instanceof';
20080    }
20081}
20082<?php
20083
20084declare (strict_types=1);
20085namespace PHPUnit\PhpParser\Node\Expr;
20086
20087use PHPUnit\PhpParser\Node\Expr;
20088class Empty_ extends Expr
20089{
20090    /** @var Expr Expression */
20091    public $expr;
20092    /**
20093     * Constructs an empty() node.
20094     *
20095     * @param Expr  $expr       Expression
20096     * @param array $attributes Additional attributes
20097     */
20098    public function __construct(Expr $expr, array $attributes = [])
20099    {
20100        $this->attributes = $attributes;
20101        $this->expr = $expr;
20102    }
20103    public function getSubNodeNames() : array
20104    {
20105        return ['expr'];
20106    }
20107    public function getType() : string
20108    {
20109        return 'Expr_Empty';
20110    }
20111}
20112<?php
20113
20114declare (strict_types=1);
20115namespace PHPUnit\PhpParser\Node\Expr;
20116
20117use PHPUnit\PhpParser\Node\Expr;
20118class ArrayDimFetch extends Expr
20119{
20120    /** @var Expr Variable */
20121    public $var;
20122    /** @var null|Expr Array index / dim */
20123    public $dim;
20124    /**
20125     * Constructs an array index fetch node.
20126     *
20127     * @param Expr      $var        Variable
20128     * @param null|Expr $dim        Array index / dim
20129     * @param array     $attributes Additional attributes
20130     */
20131    public function __construct(Expr $var, Expr $dim = null, array $attributes = [])
20132    {
20133        $this->attributes = $attributes;
20134        $this->var = $var;
20135        $this->dim = $dim;
20136    }
20137    public function getSubNodeNames() : array
20138    {
20139        return ['var', 'dim'];
20140    }
20141    public function getType() : string
20142    {
20143        return 'Expr_ArrayDimFetch';
20144    }
20145}
20146<?php
20147
20148declare (strict_types=1);
20149namespace PHPUnit\PhpParser\Node\Expr;
20150
20151use PHPUnit\PhpParser\Node\Expr;
20152use PHPUnit\PhpParser\Node\Identifier;
20153use PHPUnit\PhpParser\Node\Name;
20154class ClassConstFetch extends Expr
20155{
20156    /** @var Name|Expr Class name */
20157    public $class;
20158    /** @var Identifier|Error Constant name */
20159    public $name;
20160    /**
20161     * Constructs a class const fetch node.
20162     *
20163     * @param Name|Expr               $class      Class name
20164     * @param string|Identifier|Error $name       Constant name
20165     * @param array                   $attributes Additional attributes
20166     */
20167    public function __construct($class, $name, array $attributes = [])
20168    {
20169        $this->attributes = $attributes;
20170        $this->class = $class;
20171        $this->name = \is_string($name) ? new Identifier($name) : $name;
20172    }
20173    public function getSubNodeNames() : array
20174    {
20175        return ['class', 'name'];
20176    }
20177    public function getType() : string
20178    {
20179        return 'Expr_ClassConstFetch';
20180    }
20181}
20182<?php
20183
20184declare (strict_types=1);
20185namespace PHPUnit\PhpParser\Node\Expr;
20186
20187use PHPUnit\PhpParser\Node\Expr;
20188use PHPUnit\PhpParser\Node\Name;
20189class ConstFetch extends Expr
20190{
20191    /** @var Name Constant name */
20192    public $name;
20193    /**
20194     * Constructs a const fetch node.
20195     *
20196     * @param Name  $name       Constant name
20197     * @param array $attributes Additional attributes
20198     */
20199    public function __construct(Name $name, array $attributes = [])
20200    {
20201        $this->attributes = $attributes;
20202        $this->name = $name;
20203    }
20204    public function getSubNodeNames() : array
20205    {
20206        return ['name'];
20207    }
20208    public function getType() : string
20209    {
20210        return 'Expr_ConstFetch';
20211    }
20212}
20213<?php
20214
20215declare (strict_types=1);
20216namespace PHPUnit\PhpParser\Node\Expr;
20217
20218use PHPUnit\PhpParser\Node;
20219use PHPUnit\PhpParser\Node\Arg;
20220use PHPUnit\PhpParser\Node\Expr;
20221use PHPUnit\PhpParser\Node\Identifier;
20222use PHPUnit\PhpParser\Node\VariadicPlaceholder;
20223class StaticCall extends CallLike
20224{
20225    /** @var Node\Name|Expr Class name */
20226    public $class;
20227    /** @var Identifier|Expr Method name */
20228    public $name;
20229    /** @var array<Arg|VariadicPlaceholder> Arguments */
20230    public $args;
20231    /**
20232     * Constructs a static method call node.
20233     *
20234     * @param Node\Name|Expr                 $class      Class name
20235     * @param string|Identifier|Expr         $name       Method name
20236     * @param array<Arg|VariadicPlaceholder> $args       Arguments
20237     * @param array                          $attributes Additional attributes
20238     */
20239    public function __construct($class, $name, array $args = [], array $attributes = [])
20240    {
20241        $this->attributes = $attributes;
20242        $this->class = $class;
20243        $this->name = \is_string($name) ? new Identifier($name) : $name;
20244        $this->args = $args;
20245    }
20246    public function getSubNodeNames() : array
20247    {
20248        return ['class', 'name', 'args'];
20249    }
20250    public function getType() : string
20251    {
20252        return 'Expr_StaticCall';
20253    }
20254    public function getRawArgs() : array
20255    {
20256        return $this->args;
20257    }
20258}
20259<?php
20260
20261declare (strict_types=1);
20262namespace PHPUnit\PhpParser\Node\Expr;
20263
20264use PHPUnit\PhpParser\Node;
20265use PHPUnit\PhpParser\Node\Expr;
20266class FuncCall extends CallLike
20267{
20268    /** @var Node\Name|Expr Function name */
20269    public $name;
20270    /** @var array<Node\Arg|Node\VariadicPlaceholder> Arguments */
20271    public $args;
20272    /**
20273     * Constructs a function call node.
20274     *
20275     * @param Node\Name|Expr                           $name       Function name
20276     * @param array<Node\Arg|Node\VariadicPlaceholder> $args       Arguments
20277     * @param array                                    $attributes Additional attributes
20278     */
20279    public function __construct($name, array $args = [], array $attributes = [])
20280    {
20281        $this->attributes = $attributes;
20282        $this->name = $name;
20283        $this->args = $args;
20284    }
20285    public function getSubNodeNames() : array
20286    {
20287        return ['name', 'args'];
20288    }
20289    public function getType() : string
20290    {
20291        return 'Expr_FuncCall';
20292    }
20293    public function getRawArgs() : array
20294    {
20295        return $this->args;
20296    }
20297}
20298<?php
20299
20300declare (strict_types=1);
20301namespace PHPUnit\PhpParser\Node\Expr;
20302
20303use PHPUnit\PhpParser\Node\Expr;
20304class List_ extends Expr
20305{
20306    /** @var (ArrayItem|null)[] List of items to assign to */
20307    public $items;
20308    /**
20309     * Constructs a list() destructuring node.
20310     *
20311     * @param (ArrayItem|null)[] $items      List of items to assign to
20312     * @param array              $attributes Additional attributes
20313     */
20314    public function __construct(array $items, array $attributes = [])
20315    {
20316        $this->attributes = $attributes;
20317        $this->items = $items;
20318    }
20319    public function getSubNodeNames() : array
20320    {
20321        return ['items'];
20322    }
20323    public function getType() : string
20324    {
20325        return 'Expr_List';
20326    }
20327}
20328<?php
20329
20330declare (strict_types=1);
20331namespace PHPUnit\PhpParser\Node\Expr;
20332
20333use PHPUnit\PhpParser\Node\Expr;
20334class Isset_ extends Expr
20335{
20336    /** @var Expr[] Variables */
20337    public $vars;
20338    /**
20339     * Constructs an array node.
20340     *
20341     * @param Expr[] $vars       Variables
20342     * @param array  $attributes Additional attributes
20343     */
20344    public function __construct(array $vars, array $attributes = [])
20345    {
20346        $this->attributes = $attributes;
20347        $this->vars = $vars;
20348    }
20349    public function getSubNodeNames() : array
20350    {
20351        return ['vars'];
20352    }
20353    public function getType() : string
20354    {
20355        return 'Expr_Isset';
20356    }
20357}
20358<?php
20359
20360declare (strict_types=1);
20361namespace PHPUnit\PhpParser\Node\Expr\AssignOp;
20362
20363use PHPUnit\PhpParser\Node\Expr\AssignOp;
20364class Mul extends AssignOp
20365{
20366    public function getType() : string
20367    {
20368        return 'Expr_AssignOp_Mul';
20369    }
20370}
20371<?php
20372
20373declare (strict_types=1);
20374namespace PHPUnit\PhpParser\Node\Expr\AssignOp;
20375
20376use PHPUnit\PhpParser\Node\Expr\AssignOp;
20377class Pow extends AssignOp
20378{
20379    public function getType() : string
20380    {
20381        return 'Expr_AssignOp_Pow';
20382    }
20383}
20384<?php
20385
20386declare (strict_types=1);
20387namespace PHPUnit\PhpParser\Node\Expr\AssignOp;
20388
20389use PHPUnit\PhpParser\Node\Expr\AssignOp;
20390class BitwiseOr extends AssignOp
20391{
20392    public function getType() : string
20393    {
20394        return 'Expr_AssignOp_BitwiseOr';
20395    }
20396}
20397<?php
20398
20399declare (strict_types=1);
20400namespace PHPUnit\PhpParser\Node\Expr\AssignOp;
20401
20402use PHPUnit\PhpParser\Node\Expr\AssignOp;
20403class Plus extends AssignOp
20404{
20405    public function getType() : string
20406    {
20407        return 'Expr_AssignOp_Plus';
20408    }
20409}
20410<?php
20411
20412declare (strict_types=1);
20413namespace PHPUnit\PhpParser\Node\Expr\AssignOp;
20414
20415use PHPUnit\PhpParser\Node\Expr\AssignOp;
20416class BitwiseAnd extends AssignOp
20417{
20418    public function getType() : string
20419    {
20420        return 'Expr_AssignOp_BitwiseAnd';
20421    }
20422}
20423<?php
20424
20425declare (strict_types=1);
20426namespace PHPUnit\PhpParser\Node\Expr\AssignOp;
20427
20428use PHPUnit\PhpParser\Node\Expr\AssignOp;
20429class BitwiseXor extends AssignOp
20430{
20431    public function getType() : string
20432    {
20433        return 'Expr_AssignOp_BitwiseXor';
20434    }
20435}
20436<?php
20437
20438declare (strict_types=1);
20439namespace PHPUnit\PhpParser\Node\Expr\AssignOp;
20440
20441use PHPUnit\PhpParser\Node\Expr\AssignOp;
20442class Div extends AssignOp
20443{
20444    public function getType() : string
20445    {
20446        return 'Expr_AssignOp_Div';
20447    }
20448}
20449<?php
20450
20451declare (strict_types=1);
20452namespace PHPUnit\PhpParser\Node\Expr\AssignOp;
20453
20454use PHPUnit\PhpParser\Node\Expr\AssignOp;
20455class ShiftRight extends AssignOp
20456{
20457    public function getType() : string
20458    {
20459        return 'Expr_AssignOp_ShiftRight';
20460    }
20461}
20462<?php
20463
20464declare (strict_types=1);
20465namespace PHPUnit\PhpParser\Node\Expr\AssignOp;
20466
20467use PHPUnit\PhpParser\Node\Expr\AssignOp;
20468class Coalesce extends AssignOp
20469{
20470    public function getType() : string
20471    {
20472        return 'Expr_AssignOp_Coalesce';
20473    }
20474}
20475<?php
20476
20477declare (strict_types=1);
20478namespace PHPUnit\PhpParser\Node\Expr\AssignOp;
20479
20480use PHPUnit\PhpParser\Node\Expr\AssignOp;
20481class ShiftLeft extends AssignOp
20482{
20483    public function getType() : string
20484    {
20485        return 'Expr_AssignOp_ShiftLeft';
20486    }
20487}
20488<?php
20489
20490declare (strict_types=1);
20491namespace PHPUnit\PhpParser\Node\Expr\AssignOp;
20492
20493use PHPUnit\PhpParser\Node\Expr\AssignOp;
20494class Mod extends AssignOp
20495{
20496    public function getType() : string
20497    {
20498        return 'Expr_AssignOp_Mod';
20499    }
20500}
20501<?php
20502
20503declare (strict_types=1);
20504namespace PHPUnit\PhpParser\Node\Expr\AssignOp;
20505
20506use PHPUnit\PhpParser\Node\Expr\AssignOp;
20507class Minus extends AssignOp
20508{
20509    public function getType() : string
20510    {
20511        return 'Expr_AssignOp_Minus';
20512    }
20513}
20514<?php
20515
20516declare (strict_types=1);
20517namespace PHPUnit\PhpParser\Node\Expr\AssignOp;
20518
20519use PHPUnit\PhpParser\Node\Expr\AssignOp;
20520class Concat extends AssignOp
20521{
20522    public function getType() : string
20523    {
20524        return 'Expr_AssignOp_Concat';
20525    }
20526}
20527<?php
20528
20529declare (strict_types=1);
20530namespace PHPUnit\PhpParser\Node\Expr;
20531
20532use PHPUnit\PhpParser\Node\Expr;
20533class ErrorSuppress extends Expr
20534{
20535    /** @var Expr Expression */
20536    public $expr;
20537    /**
20538     * Constructs an error suppress node.
20539     *
20540     * @param Expr  $expr       Expression
20541     * @param array $attributes Additional attributes
20542     */
20543    public function __construct(Expr $expr, array $attributes = [])
20544    {
20545        $this->attributes = $attributes;
20546        $this->expr = $expr;
20547    }
20548    public function getSubNodeNames() : array
20549    {
20550        return ['expr'];
20551    }
20552    public function getType() : string
20553    {
20554        return 'Expr_ErrorSuppress';
20555    }
20556}
20557<?php
20558
20559declare (strict_types=1);
20560namespace PHPUnit\PhpParser\Node\Expr;
20561
20562use PHPUnit\PhpParser\Node\Expr;
20563class BooleanNot extends Expr
20564{
20565    /** @var Expr Expression */
20566    public $expr;
20567    /**
20568     * Constructs a boolean not node.
20569     *
20570     * @param Expr $expr       Expression
20571     * @param array               $attributes Additional attributes
20572     */
20573    public function __construct(Expr $expr, array $attributes = [])
20574    {
20575        $this->attributes = $attributes;
20576        $this->expr = $expr;
20577    }
20578    public function getSubNodeNames() : array
20579    {
20580        return ['expr'];
20581    }
20582    public function getType() : string
20583    {
20584        return 'Expr_BooleanNot';
20585    }
20586}
20587<?php
20588
20589declare (strict_types=1);
20590namespace PHPUnit\PhpParser\Node\Expr;
20591
20592use PHPUnit\PhpParser\Node\Expr;
20593class Array_ extends Expr
20594{
20595    // For use in "kind" attribute
20596    const KIND_LONG = 1;
20597    // array() syntax
20598    const KIND_SHORT = 2;
20599    // [] syntax
20600    /** @var (ArrayItem|null)[] Items */
20601    public $items;
20602    /**
20603     * Constructs an array node.
20604     *
20605     * @param (ArrayItem|null)[] $items      Items of the array
20606     * @param array       $attributes Additional attributes
20607     */
20608    public function __construct(array $items = [], array $attributes = [])
20609    {
20610        $this->attributes = $attributes;
20611        $this->items = $items;
20612    }
20613    public function getSubNodeNames() : array
20614    {
20615        return ['items'];
20616    }
20617    public function getType() : string
20618    {
20619        return 'Expr_Array';
20620    }
20621}
20622<?php
20623
20624declare (strict_types=1);
20625namespace PHPUnit\PhpParser\Node\Expr;
20626
20627use PHPUnit\PhpParser\Node\Expr;
20628class UnaryMinus extends Expr
20629{
20630    /** @var Expr Expression */
20631    public $expr;
20632    /**
20633     * Constructs a unary minus node.
20634     *
20635     * @param Expr  $expr       Expression
20636     * @param array $attributes Additional attributes
20637     */
20638    public function __construct(Expr $expr, array $attributes = [])
20639    {
20640        $this->attributes = $attributes;
20641        $this->expr = $expr;
20642    }
20643    public function getSubNodeNames() : array
20644    {
20645        return ['expr'];
20646    }
20647    public function getType() : string
20648    {
20649        return 'Expr_UnaryMinus';
20650    }
20651}
20652<?php
20653
20654declare (strict_types=1);
20655namespace PHPUnit\PhpParser\Node\Expr;
20656
20657use PHPUnit\PhpParser\Node;
20658use PHPUnit\PhpParser\Node\Expr;
20659use PHPUnit\PhpParser\Node\FunctionLike;
20660class Closure extends Expr implements FunctionLike
20661{
20662    /** @var bool Whether the closure is static */
20663    public $static;
20664    /** @var bool Whether to return by reference */
20665    public $byRef;
20666    /** @var Node\Param[] Parameters */
20667    public $params;
20668    /** @var ClosureUse[] use()s */
20669    public $uses;
20670    /** @var null|Node\Identifier|Node\Name|Node\ComplexType Return type */
20671    public $returnType;
20672    /** @var Node\Stmt[] Statements */
20673    public $stmts;
20674    /** @var Node\AttributeGroup[] PHP attribute groups */
20675    public $attrGroups;
20676    /**
20677     * Constructs a lambda function node.
20678     *
20679     * @param array $subNodes   Array of the following optional subnodes:
20680     *                          'static'     => false  : Whether the closure is static
20681     *                          'byRef'      => false  : Whether to return by reference
20682     *                          'params'     => array(): Parameters
20683     *                          'uses'       => array(): use()s
20684     *                          'returnType' => null   : Return type
20685     *                          'stmts'      => array(): Statements
20686     *                          'attrGroups' => array(): PHP attributes groups
20687     * @param array $attributes Additional attributes
20688     */
20689    public function __construct(array $subNodes = [], array $attributes = [])
20690    {
20691        $this->attributes = $attributes;
20692        $this->static = $subNodes['static'] ?? \false;
20693        $this->byRef = $subNodes['byRef'] ?? \false;
20694        $this->params = $subNodes['params'] ?? [];
20695        $this->uses = $subNodes['uses'] ?? [];
20696        $returnType = $subNodes['returnType'] ?? null;
20697        $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType;
20698        $this->stmts = $subNodes['stmts'] ?? [];
20699        $this->attrGroups = $subNodes['attrGroups'] ?? [];
20700    }
20701    public function getSubNodeNames() : array
20702    {
20703        return ['attrGroups', 'static', 'byRef', 'params', 'uses', 'returnType', 'stmts'];
20704    }
20705    public function returnsByRef() : bool
20706    {
20707        return $this->byRef;
20708    }
20709    public function getParams() : array
20710    {
20711        return $this->params;
20712    }
20713    public function getReturnType()
20714    {
20715        return $this->returnType;
20716    }
20717    /** @return Node\Stmt[] */
20718    public function getStmts() : array
20719    {
20720        return $this->stmts;
20721    }
20722    public function getAttrGroups() : array
20723    {
20724        return $this->attrGroups;
20725    }
20726    public function getType() : string
20727    {
20728        return 'Expr_Closure';
20729    }
20730}
20731<?php
20732
20733declare (strict_types=1);
20734namespace PHPUnit\PhpParser\Node\Expr\Cast;
20735
20736use PHPUnit\PhpParser\Node\Expr\Cast;
20737class Double extends Cast
20738{
20739    // For use in "kind" attribute
20740    const KIND_DOUBLE = 1;
20741    // "double" syntax
20742    const KIND_FLOAT = 2;
20743    // "float" syntax
20744    const KIND_REAL = 3;
20745    // "real" syntax
20746    public function getType() : string
20747    {
20748        return 'Expr_Cast_Double';
20749    }
20750}
20751<?php
20752
20753declare (strict_types=1);
20754namespace PHPUnit\PhpParser\Node\Expr\Cast;
20755
20756use PHPUnit\PhpParser\Node\Expr\Cast;
20757class Unset_ extends Cast
20758{
20759    public function getType() : string
20760    {
20761        return 'Expr_Cast_Unset';
20762    }
20763}
20764<?php
20765
20766declare (strict_types=1);
20767namespace PHPUnit\PhpParser\Node\Expr\Cast;
20768
20769use PHPUnit\PhpParser\Node\Expr\Cast;
20770class Int_ extends Cast
20771{
20772    public function getType() : string
20773    {
20774        return 'Expr_Cast_Int';
20775    }
20776}
20777<?php
20778
20779declare (strict_types=1);
20780namespace PHPUnit\PhpParser\Node\Expr\Cast;
20781
20782use PHPUnit\PhpParser\Node\Expr\Cast;
20783class String_ extends Cast
20784{
20785    public function getType() : string
20786    {
20787        return 'Expr_Cast_String';
20788    }
20789}
20790<?php
20791
20792declare (strict_types=1);
20793namespace PHPUnit\PhpParser\Node\Expr\Cast;
20794
20795use PHPUnit\PhpParser\Node\Expr\Cast;
20796class Bool_ extends Cast
20797{
20798    public function getType() : string
20799    {
20800        return 'Expr_Cast_Bool';
20801    }
20802}
20803<?php
20804
20805declare (strict_types=1);
20806namespace PHPUnit\PhpParser\Node\Expr\Cast;
20807
20808use PHPUnit\PhpParser\Node\Expr\Cast;
20809class Array_ extends Cast
20810{
20811    public function getType() : string
20812    {
20813        return 'Expr_Cast_Array';
20814    }
20815}
20816<?php
20817
20818declare (strict_types=1);
20819namespace PHPUnit\PhpParser\Node\Expr\Cast;
20820
20821use PHPUnit\PhpParser\Node\Expr\Cast;
20822class Object_ extends Cast
20823{
20824    public function getType() : string
20825    {
20826        return 'Expr_Cast_Object';
20827    }
20828}
20829<?php
20830
20831declare (strict_types=1);
20832namespace PHPUnit\PhpParser\Node\Expr;
20833
20834use PHPUnit\PhpParser\Node\Expr;
20835class PreInc extends Expr
20836{
20837    /** @var Expr Variable */
20838    public $var;
20839    /**
20840     * Constructs a pre increment node.
20841     *
20842     * @param Expr  $var        Variable
20843     * @param array $attributes Additional attributes
20844     */
20845    public function __construct(Expr $var, array $attributes = [])
20846    {
20847        $this->attributes = $attributes;
20848        $this->var = $var;
20849    }
20850    public function getSubNodeNames() : array
20851    {
20852        return ['var'];
20853    }
20854    public function getType() : string
20855    {
20856        return 'Expr_PreInc';
20857    }
20858}
20859<?php
20860
20861declare (strict_types=1);
20862namespace PHPUnit\PhpParser\Node\Expr;
20863
20864use PHPUnit\PhpParser\Node\Expr;
20865class Assign extends Expr
20866{
20867    /** @var Expr Variable */
20868    public $var;
20869    /** @var Expr Expression */
20870    public $expr;
20871    /**
20872     * Constructs an assignment node.
20873     *
20874     * @param Expr  $var        Variable
20875     * @param Expr  $expr       Expression
20876     * @param array $attributes Additional attributes
20877     */
20878    public function __construct(Expr $var, Expr $expr, array $attributes = [])
20879    {
20880        $this->attributes = $attributes;
20881        $this->var = $var;
20882        $this->expr = $expr;
20883    }
20884    public function getSubNodeNames() : array
20885    {
20886        return ['var', 'expr'];
20887    }
20888    public function getType() : string
20889    {
20890        return 'Expr_Assign';
20891    }
20892}
20893<?php
20894
20895declare (strict_types=1);
20896namespace PHPUnit\PhpParser\Node\Expr;
20897
20898use PHPUnit\PhpParser\Node\Expr;
20899abstract class BinaryOp extends Expr
20900{
20901    /** @var Expr The left hand side expression */
20902    public $left;
20903    /** @var Expr The right hand side expression */
20904    public $right;
20905    /**
20906     * Constructs a binary operator node.
20907     *
20908     * @param Expr  $left       The left hand side expression
20909     * @param Expr  $right      The right hand side expression
20910     * @param array $attributes Additional attributes
20911     */
20912    public function __construct(Expr $left, Expr $right, array $attributes = [])
20913    {
20914        $this->attributes = $attributes;
20915        $this->left = $left;
20916        $this->right = $right;
20917    }
20918    public function getSubNodeNames() : array
20919    {
20920        return ['left', 'right'];
20921    }
20922    /**
20923     * Get the operator sigil for this binary operation.
20924     *
20925     * In the case there are multiple possible sigils for an operator, this method does not
20926     * necessarily return the one used in the parsed code.
20927     *
20928     * @return string
20929     */
20930    public abstract function getOperatorSigil() : string;
20931}
20932<?php
20933
20934declare (strict_types=1);
20935namespace PHPUnit\PhpParser\Node\Expr;
20936
20937use PHPUnit\PhpParser\Node\Expr;
20938class YieldFrom extends Expr
20939{
20940    /** @var Expr Expression to yield from */
20941    public $expr;
20942    /**
20943     * Constructs an "yield from" node.
20944     *
20945     * @param Expr  $expr       Expression
20946     * @param array $attributes Additional attributes
20947     */
20948    public function __construct(Expr $expr, array $attributes = [])
20949    {
20950        $this->attributes = $attributes;
20951        $this->expr = $expr;
20952    }
20953    public function getSubNodeNames() : array
20954    {
20955        return ['expr'];
20956    }
20957    public function getType() : string
20958    {
20959        return 'Expr_YieldFrom';
20960    }
20961}
20962<?php
20963
20964declare (strict_types=1);
20965namespace PHPUnit\PhpParser\Node\Expr;
20966
20967use PHPUnit\PhpParser\Node\Expr;
20968use PHPUnit\PhpParser\Node\Name;
20969use PHPUnit\PhpParser\Node\VarLikeIdentifier;
20970class StaticPropertyFetch extends Expr
20971{
20972    /** @var Name|Expr Class name */
20973    public $class;
20974    /** @var VarLikeIdentifier|Expr Property name */
20975    public $name;
20976    /**
20977     * Constructs a static property fetch node.
20978     *
20979     * @param Name|Expr                     $class      Class name
20980     * @param string|VarLikeIdentifier|Expr $name       Property name
20981     * @param array                         $attributes Additional attributes
20982     */
20983    public function __construct($class, $name, array $attributes = [])
20984    {
20985        $this->attributes = $attributes;
20986        $this->class = $class;
20987        $this->name = \is_string($name) ? new VarLikeIdentifier($name) : $name;
20988    }
20989    public function getSubNodeNames() : array
20990    {
20991        return ['class', 'name'];
20992    }
20993    public function getType() : string
20994    {
20995        return 'Expr_StaticPropertyFetch';
20996    }
20997}
20998<?php
20999
21000declare (strict_types=1);
21001namespace PHPUnit\PhpParser\Node\Expr;
21002
21003use PHPUnit\PhpParser\Node\Expr;
21004class AssignRef extends Expr
21005{
21006    /** @var Expr Variable reference is assigned to */
21007    public $var;
21008    /** @var Expr Variable which is referenced */
21009    public $expr;
21010    /**
21011     * Constructs an assignment node.
21012     *
21013     * @param Expr  $var        Variable
21014     * @param Expr  $expr       Expression
21015     * @param array $attributes Additional attributes
21016     */
21017    public function __construct(Expr $var, Expr $expr, array $attributes = [])
21018    {
21019        $this->attributes = $attributes;
21020        $this->var = $var;
21021        $this->expr = $expr;
21022    }
21023    public function getSubNodeNames() : array
21024    {
21025        return ['var', 'expr'];
21026    }
21027    public function getType() : string
21028    {
21029        return 'Expr_AssignRef';
21030    }
21031}
21032<?php
21033
21034declare (strict_types=1);
21035namespace PHPUnit\PhpParser\Node\Expr;
21036
21037use PHPUnit\PhpParser\Node\Arg;
21038use PHPUnit\PhpParser\Node\Expr;
21039use PHPUnit\PhpParser\Node\Identifier;
21040use PHPUnit\PhpParser\Node\VariadicPlaceholder;
21041class MethodCall extends CallLike
21042{
21043    /** @var Expr Variable holding object */
21044    public $var;
21045    /** @var Identifier|Expr Method name */
21046    public $name;
21047    /** @var array<Arg|VariadicPlaceholder> Arguments */
21048    public $args;
21049    /**
21050     * Constructs a function call node.
21051     *
21052     * @param Expr                           $var        Variable holding object
21053     * @param string|Identifier|Expr         $name       Method name
21054     * @param array<Arg|VariadicPlaceholder> $args       Arguments
21055     * @param array                          $attributes Additional attributes
21056     */
21057    public function __construct(Expr $var, $name, array $args = [], array $attributes = [])
21058    {
21059        $this->attributes = $attributes;
21060        $this->var = $var;
21061        $this->name = \is_string($name) ? new Identifier($name) : $name;
21062        $this->args = $args;
21063    }
21064    public function getSubNodeNames() : array
21065    {
21066        return ['var', 'name', 'args'];
21067    }
21068    public function getType() : string
21069    {
21070        return 'Expr_MethodCall';
21071    }
21072    public function getRawArgs() : array
21073    {
21074        return $this->args;
21075    }
21076}
21077<?php
21078
21079declare (strict_types=1);
21080namespace PHPUnit\PhpParser\Node\Expr;
21081
21082use PHPUnit\PhpParser\Node\Expr;
21083class BitwiseNot extends Expr
21084{
21085    /** @var Expr Expression */
21086    public $expr;
21087    /**
21088     * Constructs a bitwise not node.
21089     *
21090     * @param Expr  $expr       Expression
21091     * @param array $attributes Additional attributes
21092     */
21093    public function __construct(Expr $expr, array $attributes = [])
21094    {
21095        $this->attributes = $attributes;
21096        $this->expr = $expr;
21097    }
21098    public function getSubNodeNames() : array
21099    {
21100        return ['expr'];
21101    }
21102    public function getType() : string
21103    {
21104        return 'Expr_BitwiseNot';
21105    }
21106}
21107<?php
21108
21109declare (strict_types=1);
21110namespace PHPUnit\PhpParser\Node\Expr;
21111
21112use PHPUnit\PhpParser\Node\Expr;
21113class ClosureUse extends Expr
21114{
21115    /** @var Expr\Variable Variable to use */
21116    public $var;
21117    /** @var bool Whether to use by reference */
21118    public $byRef;
21119    /**
21120     * Constructs a closure use node.
21121     *
21122     * @param Expr\Variable $var        Variable to use
21123     * @param bool          $byRef      Whether to use by reference
21124     * @param array         $attributes Additional attributes
21125     */
21126    public function __construct(Expr\Variable $var, bool $byRef = \false, array $attributes = [])
21127    {
21128        $this->attributes = $attributes;
21129        $this->var = $var;
21130        $this->byRef = $byRef;
21131    }
21132    public function getSubNodeNames() : array
21133    {
21134        return ['var', 'byRef'];
21135    }
21136    public function getType() : string
21137    {
21138        return 'Expr_ClosureUse';
21139    }
21140}
21141<?php
21142
21143declare (strict_types=1);
21144namespace PHPUnit\PhpParser\Node\Expr;
21145
21146use PHPUnit\PhpParser\Node\Expr;
21147class ShellExec extends Expr
21148{
21149    /** @var array Encapsed string array */
21150    public $parts;
21151    /**
21152     * Constructs a shell exec (backtick) node.
21153     *
21154     * @param array $parts      Encapsed string array
21155     * @param array $attributes Additional attributes
21156     */
21157    public function __construct(array $parts, array $attributes = [])
21158    {
21159        $this->attributes = $attributes;
21160        $this->parts = $parts;
21161    }
21162    public function getSubNodeNames() : array
21163    {
21164        return ['parts'];
21165    }
21166    public function getType() : string
21167    {
21168        return 'Expr_ShellExec';
21169    }
21170}
21171<?php
21172
21173declare (strict_types=1);
21174namespace PHPUnit\PhpParser\Node\Expr;
21175
21176use PHPUnit\PhpParser\Node\Expr;
21177class Exit_ extends Expr
21178{
21179    /* For use in "kind" attribute */
21180    const KIND_EXIT = 1;
21181    const KIND_DIE = 2;
21182    /** @var null|Expr Expression */
21183    public $expr;
21184    /**
21185     * Constructs an exit() node.
21186     *
21187     * @param null|Expr $expr       Expression
21188     * @param array                    $attributes Additional attributes
21189     */
21190    public function __construct(Expr $expr = null, array $attributes = [])
21191    {
21192        $this->attributes = $attributes;
21193        $this->expr = $expr;
21194    }
21195    public function getSubNodeNames() : array
21196    {
21197        return ['expr'];
21198    }
21199    public function getType() : string
21200    {
21201        return 'Expr_Exit';
21202    }
21203}
21204<?php
21205
21206declare (strict_types=1);
21207namespace PHPUnit\PhpParser\Node\Expr;
21208
21209use PHPUnit\PhpParser\Node\Expr;
21210class Include_ extends Expr
21211{
21212    const TYPE_INCLUDE = 1;
21213    const TYPE_INCLUDE_ONCE = 2;
21214    const TYPE_REQUIRE = 3;
21215    const TYPE_REQUIRE_ONCE = 4;
21216    /** @var Expr Expression */
21217    public $expr;
21218    /** @var int Type of include */
21219    public $type;
21220    /**
21221     * Constructs an include node.
21222     *
21223     * @param Expr  $expr       Expression
21224     * @param int   $type       Type of include
21225     * @param array $attributes Additional attributes
21226     */
21227    public function __construct(Expr $expr, int $type, array $attributes = [])
21228    {
21229        $this->attributes = $attributes;
21230        $this->expr = $expr;
21231        $this->type = $type;
21232    }
21233    public function getSubNodeNames() : array
21234    {
21235        return ['expr', 'type'];
21236    }
21237    public function getType() : string
21238    {
21239        return 'Expr_Include';
21240    }
21241}
21242<?php
21243
21244declare (strict_types=1);
21245namespace PHPUnit\PhpParser\Node;
21246
21247class NullableType extends ComplexType
21248{
21249    /** @var Identifier|Name Type */
21250    public $type;
21251    /**
21252     * Constructs a nullable type (wrapping another type).
21253     *
21254     * @param string|Identifier|Name $type       Type
21255     * @param array                  $attributes Additional attributes
21256     */
21257    public function __construct($type, array $attributes = [])
21258    {
21259        $this->attributes = $attributes;
21260        $this->type = \is_string($type) ? new Identifier($type) : $type;
21261    }
21262    public function getSubNodeNames() : array
21263    {
21264        return ['type'];
21265    }
21266    public function getType() : string
21267    {
21268        return 'NullableType';
21269    }
21270}
21271<?php
21272
21273declare (strict_types=1);
21274namespace PHPUnit\PhpParser\Node\Scalar;
21275
21276use PHPUnit\PhpParser\Node\Scalar;
21277abstract class MagicConst extends Scalar
21278{
21279    /**
21280     * Constructs a magic constant node.
21281     *
21282     * @param array $attributes Additional attributes
21283     */
21284    public function __construct(array $attributes = [])
21285    {
21286        $this->attributes = $attributes;
21287    }
21288    public function getSubNodeNames() : array
21289    {
21290        return [];
21291    }
21292    /**
21293     * Get name of magic constant.
21294     *
21295     * @return string Name of magic constant
21296     */
21297    public abstract function getName() : string;
21298}
21299<?php
21300
21301declare (strict_types=1);
21302namespace PHPUnit\PhpParser\Node\Scalar;
21303
21304use PHPUnit\PhpParser\Node\Scalar;
21305class EncapsedStringPart extends Scalar
21306{
21307    /** @var string String value */
21308    public $value;
21309    /**
21310     * Constructs a node representing a string part of an encapsed string.
21311     *
21312     * @param string $value      String value
21313     * @param array  $attributes Additional attributes
21314     */
21315    public function __construct(string $value, array $attributes = [])
21316    {
21317        $this->attributes = $attributes;
21318        $this->value = $value;
21319    }
21320    public function getSubNodeNames() : array
21321    {
21322        return ['value'];
21323    }
21324    public function getType() : string
21325    {
21326        return 'Scalar_EncapsedStringPart';
21327    }
21328}
21329<?php
21330
21331declare (strict_types=1);
21332namespace PHPUnit\PhpParser\Node\Scalar;
21333
21334use PHPUnit\PhpParser\Error;
21335use PHPUnit\PhpParser\Node\Scalar;
21336class LNumber extends Scalar
21337{
21338    /* For use in "kind" attribute */
21339    const KIND_BIN = 2;
21340    const KIND_OCT = 8;
21341    const KIND_DEC = 10;
21342    const KIND_HEX = 16;
21343    /** @var int Number value */
21344    public $value;
21345    /**
21346     * Constructs an integer number scalar node.
21347     *
21348     * @param int   $value      Value of the number
21349     * @param array $attributes Additional attributes
21350     */
21351    public function __construct(int $value, array $attributes = [])
21352    {
21353        $this->attributes = $attributes;
21354        $this->value = $value;
21355    }
21356    public function getSubNodeNames() : array
21357    {
21358        return ['value'];
21359    }
21360    /**
21361     * Constructs an LNumber node from a string number literal.
21362     *
21363     * @param string $str               String number literal (decimal, octal, hex or binary)
21364     * @param array  $attributes        Additional attributes
21365     * @param bool   $allowInvalidOctal Whether to allow invalid octal numbers (PHP 5)
21366     *
21367     * @return LNumber The constructed LNumber, including kind attribute
21368     */
21369    public static function fromString(string $str, array $attributes = [], bool $allowInvalidOctal = \false) : LNumber
21370    {
21371        $str = \str_replace('_', '', $str);
21372        if ('0' !== $str[0] || '0' === $str) {
21373            $attributes['kind'] = LNumber::KIND_DEC;
21374            return new LNumber((int) $str, $attributes);
21375        }
21376        if ('x' === $str[1] || 'X' === $str[1]) {
21377            $attributes['kind'] = LNumber::KIND_HEX;
21378            return new LNumber(\hexdec($str), $attributes);
21379        }
21380        if ('b' === $str[1] || 'B' === $str[1]) {
21381            $attributes['kind'] = LNumber::KIND_BIN;
21382            return new LNumber(\bindec($str), $attributes);
21383        }
21384        if (!$allowInvalidOctal && \strpbrk($str, '89')) {
21385            throw new Error('Invalid numeric literal', $attributes);
21386        }
21387        // Strip optional explicit octal prefix.
21388        if ('o' === $str[1] || 'O' === $str[1]) {
21389            $str = \substr($str, 2);
21390        }
21391        // use intval instead of octdec to get proper cutting behavior with malformed numbers
21392        $attributes['kind'] = LNumber::KIND_OCT;
21393        return new LNumber(\intval($str, 8), $attributes);
21394    }
21395    public function getType() : string
21396    {
21397        return 'Scalar_LNumber';
21398    }
21399}
21400<?php
21401
21402declare (strict_types=1);
21403namespace PHPUnit\PhpParser\Node\Scalar;
21404
21405use PHPUnit\PhpParser\Error;
21406use PHPUnit\PhpParser\Node\Scalar;
21407class String_ extends Scalar
21408{
21409    /* For use in "kind" attribute */
21410    const KIND_SINGLE_QUOTED = 1;
21411    const KIND_DOUBLE_QUOTED = 2;
21412    const KIND_HEREDOC = 3;
21413    const KIND_NOWDOC = 4;
21414    /** @var string String value */
21415    public $value;
21416    protected static $replacements = ['\\' => '\\', '$' => '$', 'n' => "\n", 'r' => "\r", 't' => "\t", 'f' => "\f", 'v' => "\v", 'e' => "\33"];
21417    /**
21418     * Constructs a string scalar node.
21419     *
21420     * @param string $value      Value of the string
21421     * @param array  $attributes Additional attributes
21422     */
21423    public function __construct(string $value, array $attributes = [])
21424    {
21425        $this->attributes = $attributes;
21426        $this->value = $value;
21427    }
21428    public function getSubNodeNames() : array
21429    {
21430        return ['value'];
21431    }
21432    /**
21433     * @internal
21434     *
21435     * Parses a string token.
21436     *
21437     * @param string $str String token content
21438     * @param bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes
21439     *
21440     * @return string The parsed string
21441     */
21442    public static function parse(string $str, bool $parseUnicodeEscape = \true) : string
21443    {
21444        $bLength = 0;
21445        if ('b' === $str[0] || 'B' === $str[0]) {
21446            $bLength = 1;
21447        }
21448        if ('\'' === $str[$bLength]) {
21449            return \str_replace(['\\\\', '\\\''], ['\\', '\''], \substr($str, $bLength + 1, -1));
21450        } else {
21451            return self::parseEscapeSequences(\substr($str, $bLength + 1, -1), '"', $parseUnicodeEscape);
21452        }
21453    }
21454    /**
21455     * @internal
21456     *
21457     * Parses escape sequences in strings (all string types apart from single quoted).
21458     *
21459     * @param string      $str   String without quotes
21460     * @param null|string $quote Quote type
21461     * @param bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes
21462     *
21463     * @return string String with escape sequences parsed
21464     */
21465    public static function parseEscapeSequences(string $str, $quote, bool $parseUnicodeEscape = \true) : string
21466    {
21467        if (null !== $quote) {
21468            $str = \str_replace('\\' . $quote, $quote, $str);
21469        }
21470        $extra = '';
21471        if ($parseUnicodeEscape) {
21472            $extra = '|u\\{([0-9a-fA-F]+)\\}';
21473        }
21474        return \preg_replace_callback('~\\\\([\\\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}' . $extra . ')~', function ($matches) {
21475            $str = $matches[1];
21476            if (isset(self::$replacements[$str])) {
21477                return self::$replacements[$str];
21478            } elseif ('x' === $str[0] || 'X' === $str[0]) {
21479                return \chr(\hexdec(\substr($str, 1)));
21480            } elseif ('u' === $str[0]) {
21481                return self::codePointToUtf8(\hexdec($matches[2]));
21482            } else {
21483                return \chr(\octdec($str));
21484            }
21485        }, $str);
21486    }
21487    /**
21488     * Converts a Unicode code point to its UTF-8 encoded representation.
21489     *
21490     * @param int $num Code point
21491     *
21492     * @return string UTF-8 representation of code point
21493     */
21494    private static function codePointToUtf8(int $num) : string
21495    {
21496        if ($num <= 0x7f) {
21497            return \chr($num);
21498        }
21499        if ($num <= 0x7ff) {
21500            return \chr(($num >> 6) + 0xc0) . \chr(($num & 0x3f) + 0x80);
21501        }
21502        if ($num <= 0xffff) {
21503            return \chr(($num >> 12) + 0xe0) . \chr(($num >> 6 & 0x3f) + 0x80) . \chr(($num & 0x3f) + 0x80);
21504        }
21505        if ($num <= 0x1fffff) {
21506            return \chr(($num >> 18) + 0xf0) . \chr(($num >> 12 & 0x3f) + 0x80) . \chr(($num >> 6 & 0x3f) + 0x80) . \chr(($num & 0x3f) + 0x80);
21507        }
21508        throw new Error('Invalid UTF-8 codepoint escape sequence: Codepoint too large');
21509    }
21510    public function getType() : string
21511    {
21512        return 'Scalar_String';
21513    }
21514}
21515<?php
21516
21517declare (strict_types=1);
21518namespace PHPUnit\PhpParser\Node\Scalar\MagicConst;
21519
21520use PHPUnit\PhpParser\Node\Scalar\MagicConst;
21521class Function_ extends MagicConst
21522{
21523    public function getName() : string
21524    {
21525        return '__FUNCTION__';
21526    }
21527    public function getType() : string
21528    {
21529        return 'Scalar_MagicConst_Function';
21530    }
21531}
21532<?php
21533
21534declare (strict_types=1);
21535namespace PHPUnit\PhpParser\Node\Scalar\MagicConst;
21536
21537use PHPUnit\PhpParser\Node\Scalar\MagicConst;
21538class Method extends MagicConst
21539{
21540    public function getName() : string
21541    {
21542        return '__METHOD__';
21543    }
21544    public function getType() : string
21545    {
21546        return 'Scalar_MagicConst_Method';
21547    }
21548}
21549<?php
21550
21551declare (strict_types=1);
21552namespace PHPUnit\PhpParser\Node\Scalar\MagicConst;
21553
21554use PHPUnit\PhpParser\Node\Scalar\MagicConst;
21555class Class_ extends MagicConst
21556{
21557    public function getName() : string
21558    {
21559        return '__CLASS__';
21560    }
21561    public function getType() : string
21562    {
21563        return 'Scalar_MagicConst_Class';
21564    }
21565}
21566<?php
21567
21568declare (strict_types=1);
21569namespace PHPUnit\PhpParser\Node\Scalar\MagicConst;
21570
21571use PHPUnit\PhpParser\Node\Scalar\MagicConst;
21572class Dir extends MagicConst
21573{
21574    public function getName() : string
21575    {
21576        return '__DIR__';
21577    }
21578    public function getType() : string
21579    {
21580        return 'Scalar_MagicConst_Dir';
21581    }
21582}
21583<?php
21584
21585declare (strict_types=1);
21586namespace PHPUnit\PhpParser\Node\Scalar\MagicConst;
21587
21588use PHPUnit\PhpParser\Node\Scalar\MagicConst;
21589class Trait_ extends MagicConst
21590{
21591    public function getName() : string
21592    {
21593        return '__TRAIT__';
21594    }
21595    public function getType() : string
21596    {
21597        return 'Scalar_MagicConst_Trait';
21598    }
21599}
21600<?php
21601
21602declare (strict_types=1);
21603namespace PHPUnit\PhpParser\Node\Scalar\MagicConst;
21604
21605use PHPUnit\PhpParser\Node\Scalar\MagicConst;
21606class File extends MagicConst
21607{
21608    public function getName() : string
21609    {
21610        return '__FILE__';
21611    }
21612    public function getType() : string
21613    {
21614        return 'Scalar_MagicConst_File';
21615    }
21616}
21617<?php
21618
21619declare (strict_types=1);
21620namespace PHPUnit\PhpParser\Node\Scalar\MagicConst;
21621
21622use PHPUnit\PhpParser\Node\Scalar\MagicConst;
21623class Line extends MagicConst
21624{
21625    public function getName() : string
21626    {
21627        return '__LINE__';
21628    }
21629    public function getType() : string
21630    {
21631        return 'Scalar_MagicConst_Line';
21632    }
21633}
21634<?php
21635
21636declare (strict_types=1);
21637namespace PHPUnit\PhpParser\Node\Scalar\MagicConst;
21638
21639use PHPUnit\PhpParser\Node\Scalar\MagicConst;
21640class Namespace_ extends MagicConst
21641{
21642    public function getName() : string
21643    {
21644        return '__NAMESPACE__';
21645    }
21646    public function getType() : string
21647    {
21648        return 'Scalar_MagicConst_Namespace';
21649    }
21650}
21651<?php
21652
21653declare (strict_types=1);
21654namespace PHPUnit\PhpParser\Node\Scalar;
21655
21656use PHPUnit\PhpParser\Node\Expr;
21657use PHPUnit\PhpParser\Node\Scalar;
21658class Encapsed extends Scalar
21659{
21660    /** @var Expr[] list of string parts */
21661    public $parts;
21662    /**
21663     * Constructs an encapsed string node.
21664     *
21665     * @param Expr[] $parts      Encaps list
21666     * @param array  $attributes Additional attributes
21667     */
21668    public function __construct(array $parts, array $attributes = [])
21669    {
21670        $this->attributes = $attributes;
21671        $this->parts = $parts;
21672    }
21673    public function getSubNodeNames() : array
21674    {
21675        return ['parts'];
21676    }
21677    public function getType() : string
21678    {
21679        return 'Scalar_Encapsed';
21680    }
21681}
21682<?php
21683
21684declare (strict_types=1);
21685namespace PHPUnit\PhpParser\Node\Scalar;
21686
21687use PHPUnit\PhpParser\Node\Scalar;
21688class DNumber extends Scalar
21689{
21690    /** @var float Number value */
21691    public $value;
21692    /**
21693     * Constructs a float number scalar node.
21694     *
21695     * @param float $value      Value of the number
21696     * @param array $attributes Additional attributes
21697     */
21698    public function __construct(float $value, array $attributes = [])
21699    {
21700        $this->attributes = $attributes;
21701        $this->value = $value;
21702    }
21703    public function getSubNodeNames() : array
21704    {
21705        return ['value'];
21706    }
21707    /**
21708     * @internal
21709     *
21710     * Parses a DNUMBER token like PHP would.
21711     *
21712     * @param string $str A string number
21713     *
21714     * @return float The parsed number
21715     */
21716    public static function parse(string $str) : float
21717    {
21718        $str = \str_replace('_', '', $str);
21719        // if string contains any of .eE just cast it to float
21720        if (\false !== \strpbrk($str, '.eE')) {
21721            return (float) $str;
21722        }
21723        // otherwise it's an integer notation that overflowed into a float
21724        // if it starts with 0 it's one of the special integer notations
21725        if ('0' === $str[0]) {
21726            // hex
21727            if ('x' === $str[1] || 'X' === $str[1]) {
21728                return \hexdec($str);
21729            }
21730            // bin
21731            if ('b' === $str[1] || 'B' === $str[1]) {
21732                return \bindec($str);
21733            }
21734            // oct
21735            // substr($str, 0, strcspn($str, '89')) cuts the string at the first invalid digit (8 or 9)
21736            // so that only the digits before that are used
21737            return \octdec(\substr($str, 0, \strcspn($str, '89')));
21738        }
21739        // dec
21740        return (float) $str;
21741    }
21742    public function getType() : string
21743    {
21744        return 'Scalar_DNumber';
21745    }
21746}
21747<?php
21748
21749declare (strict_types=1);
21750namespace PHPUnit\PhpParser\Node;
21751
21752use PHPUnit\PhpParser\NodeAbstract;
21753/**
21754 * Represents the "..." in "foo(...)" of the first-class callable syntax.
21755 */
21756class VariadicPlaceholder extends NodeAbstract
21757{
21758    /**
21759     * Create a variadic argument placeholder (first-class callable syntax).
21760     *
21761     * @param array $attributes Additional attributes
21762     */
21763    public function __construct(array $attributes = [])
21764    {
21765        $this->attributes = $attributes;
21766    }
21767    public function getType() : string
21768    {
21769        return 'VariadicPlaceholder';
21770    }
21771    public function getSubNodeNames() : array
21772    {
21773        return [];
21774    }
21775}
21776<?php
21777
21778declare (strict_types=1);
21779namespace PHPUnit\PhpParser\Node;
21780
21781use PHPUnit\PhpParser\NodeAbstract;
21782class Name extends NodeAbstract
21783{
21784    /** @var string[] Parts of the name */
21785    public $parts;
21786    private static $specialClassNames = ['self' => \true, 'parent' => \true, 'static' => \true];
21787    /**
21788     * Constructs a name node.
21789     *
21790     * @param string|string[]|self $name       Name as string, part array or Name instance (copy ctor)
21791     * @param array                $attributes Additional attributes
21792     */
21793    public function __construct($name, array $attributes = [])
21794    {
21795        $this->attributes = $attributes;
21796        $this->parts = self::prepareName($name);
21797    }
21798    public function getSubNodeNames() : array
21799    {
21800        return ['parts'];
21801    }
21802    /**
21803     * Gets the first part of the name, i.e. everything before the first namespace separator.
21804     *
21805     * @return string First part of the name
21806     */
21807    public function getFirst() : string
21808    {
21809        return $this->parts[0];
21810    }
21811    /**
21812     * Gets the last part of the name, i.e. everything after the last namespace separator.
21813     *
21814     * @return string Last part of the name
21815     */
21816    public function getLast() : string
21817    {
21818        return $this->parts[\count($this->parts) - 1];
21819    }
21820    /**
21821     * Checks whether the name is unqualified. (E.g. Name)
21822     *
21823     * @return bool Whether the name is unqualified
21824     */
21825    public function isUnqualified() : bool
21826    {
21827        return 1 === \count($this->parts);
21828    }
21829    /**
21830     * Checks whether the name is qualified. (E.g. Name\Name)
21831     *
21832     * @return bool Whether the name is qualified
21833     */
21834    public function isQualified() : bool
21835    {
21836        return 1 < \count($this->parts);
21837    }
21838    /**
21839     * Checks whether the name is fully qualified. (E.g. \Name)
21840     *
21841     * @return bool Whether the name is fully qualified
21842     */
21843    public function isFullyQualified() : bool
21844    {
21845        return \false;
21846    }
21847    /**
21848     * Checks whether the name is explicitly relative to the current namespace. (E.g. namespace\Name)
21849     *
21850     * @return bool Whether the name is relative
21851     */
21852    public function isRelative() : bool
21853    {
21854        return \false;
21855    }
21856    /**
21857     * Returns a string representation of the name itself, without taking the name type into
21858     * account (e.g., not including a leading backslash for fully qualified names).
21859     *
21860     * @return string String representation
21861     */
21862    public function toString() : string
21863    {
21864        return \implode('\\', $this->parts);
21865    }
21866    /**
21867     * Returns a string representation of the name as it would occur in code (e.g., including
21868     * leading backslash for fully qualified names.
21869     *
21870     * @return string String representation
21871     */
21872    public function toCodeString() : string
21873    {
21874        return $this->toString();
21875    }
21876    /**
21877     * Returns lowercased string representation of the name, without taking the name type into
21878     * account (e.g., no leading backslash for fully qualified names).
21879     *
21880     * @return string Lowercased string representation
21881     */
21882    public function toLowerString() : string
21883    {
21884        return \strtolower(\implode('\\', $this->parts));
21885    }
21886    /**
21887     * Checks whether the identifier is a special class name (self, parent or static).
21888     *
21889     * @return bool Whether identifier is a special class name
21890     */
21891    public function isSpecialClassName() : bool
21892    {
21893        return \count($this->parts) === 1 && isset(self::$specialClassNames[\strtolower($this->parts[0])]);
21894    }
21895    /**
21896     * Returns a string representation of the name by imploding the namespace parts with the
21897     * namespace separator.
21898     *
21899     * @return string String representation
21900     */
21901    public function __toString() : string
21902    {
21903        return \implode('\\', $this->parts);
21904    }
21905    /**
21906     * Gets a slice of a name (similar to array_slice).
21907     *
21908     * This method returns a new instance of the same type as the original and with the same
21909     * attributes.
21910     *
21911     * If the slice is empty, null is returned. The null value will be correctly handled in
21912     * concatenations using concat().
21913     *
21914     * Offset and length have the same meaning as in array_slice().
21915     *
21916     * @param int      $offset Offset to start the slice at (may be negative)
21917     * @param int|null $length Length of the slice (may be negative)
21918     *
21919     * @return static|null Sliced name
21920     */
21921    public function slice(int $offset, int $length = null)
21922    {
21923        $numParts = \count($this->parts);
21924        $realOffset = $offset < 0 ? $offset + $numParts : $offset;
21925        if ($realOffset < 0 || $realOffset > $numParts) {
21926            throw new \OutOfBoundsException(\sprintf('Offset %d is out of bounds', $offset));
21927        }
21928        if (null === $length) {
21929            $realLength = $numParts - $realOffset;
21930        } else {
21931            $realLength = $length < 0 ? $length + $numParts - $realOffset : $length;
21932            if ($realLength < 0 || $realLength > $numParts) {
21933                throw new \OutOfBoundsException(\sprintf('Length %d is out of bounds', $length));
21934            }
21935        }
21936        if ($realLength === 0) {
21937            // Empty slice is represented as null
21938            return null;
21939        }
21940        return new static(\array_slice($this->parts, $realOffset, $realLength), $this->attributes);
21941    }
21942    /**
21943     * Concatenate two names, yielding a new Name instance.
21944     *
21945     * The type of the generated instance depends on which class this method is called on, for
21946     * example Name\FullyQualified::concat() will yield a Name\FullyQualified instance.
21947     *
21948     * If one of the arguments is null, a new instance of the other name will be returned. If both
21949     * arguments are null, null will be returned. As such, writing
21950     *     Name::concat($namespace, $shortName)
21951     * where $namespace is a Name node or null will work as expected.
21952     *
21953     * @param string|string[]|self|null $name1      The first name
21954     * @param string|string[]|self|null $name2      The second name
21955     * @param array                     $attributes Attributes to assign to concatenated name
21956     *
21957     * @return static|null Concatenated name
21958     */
21959    public static function concat($name1, $name2, array $attributes = [])
21960    {
21961        if (null === $name1 && null === $name2) {
21962            return null;
21963        } elseif (null === $name1) {
21964            return new static(self::prepareName($name2), $attributes);
21965        } elseif (null === $name2) {
21966            return new static(self::prepareName($name1), $attributes);
21967        } else {
21968            return new static(\array_merge(self::prepareName($name1), self::prepareName($name2)), $attributes);
21969        }
21970    }
21971    /**
21972     * Prepares a (string, array or Name node) name for use in name changing methods by converting
21973     * it to an array.
21974     *
21975     * @param string|string[]|self $name Name to prepare
21976     *
21977     * @return string[] Prepared name
21978     */
21979    private static function prepareName($name) : array
21980    {
21981        if (\is_string($name)) {
21982            if ('' === $name) {
21983                throw new \InvalidArgumentException('Name cannot be empty');
21984            }
21985            return \explode('\\', $name);
21986        } elseif (\is_array($name)) {
21987            if (empty($name)) {
21988                throw new \InvalidArgumentException('Name cannot be empty');
21989            }
21990            return $name;
21991        } elseif ($name instanceof self) {
21992            return $name->parts;
21993        }
21994        throw new \InvalidArgumentException('Expected string, array of parts or Name instance');
21995    }
21996    public function getType() : string
21997    {
21998        return 'Name';
21999    }
22000}
22001<?php
22002
22003declare (strict_types=1);
22004namespace PHPUnit\PhpParser\Node;
22005
22006use PHPUnit\PhpParser\Node;
22007use PHPUnit\PhpParser\NodeAbstract;
22008class AttributeGroup extends NodeAbstract
22009{
22010    /** @var Attribute[] Attributes */
22011    public $attrs;
22012    /**
22013     * @param Attribute[] $attrs PHP attributes
22014     * @param array $attributes Additional node attributes
22015     */
22016    public function __construct(array $attrs, array $attributes = [])
22017    {
22018        $this->attributes = $attributes;
22019        $this->attrs = $attrs;
22020    }
22021    public function getSubNodeNames() : array
22022    {
22023        return ['attrs'];
22024    }
22025    public function getType() : string
22026    {
22027        return 'AttributeGroup';
22028    }
22029}
22030<?php
22031
22032declare (strict_types=1);
22033namespace PHPUnit\PhpParser\Node;
22034
22035use PHPUnit\PhpParser\NodeAbstract;
22036/**
22037 * @property Name $namespacedName Namespaced name (for global constants, if using NameResolver)
22038 */
22039class Const_ extends NodeAbstract
22040{
22041    /** @var Identifier Name */
22042    public $name;
22043    /** @var Expr Value */
22044    public $value;
22045    /**
22046     * Constructs a const node for use in class const and const statements.
22047     *
22048     * @param string|Identifier $name       Name
22049     * @param Expr              $value      Value
22050     * @param array             $attributes Additional attributes
22051     */
22052    public function __construct($name, Expr $value, array $attributes = [])
22053    {
22054        $this->attributes = $attributes;
22055        $this->name = \is_string($name) ? new Identifier($name) : $name;
22056        $this->value = $value;
22057    }
22058    public function getSubNodeNames() : array
22059    {
22060        return ['name', 'value'];
22061    }
22062    public function getType() : string
22063    {
22064        return 'Const';
22065    }
22066}
22067<?php
22068
22069declare (strict_types=1);
22070namespace PHPUnit\PhpParser\Node\Name;
22071
22072class Relative extends \PHPUnit\PhpParser\Node\Name
22073{
22074    /**
22075     * Checks whether the name is unqualified. (E.g. Name)
22076     *
22077     * @return bool Whether the name is unqualified
22078     */
22079    public function isUnqualified() : bool
22080    {
22081        return \false;
22082    }
22083    /**
22084     * Checks whether the name is qualified. (E.g. Name\Name)
22085     *
22086     * @return bool Whether the name is qualified
22087     */
22088    public function isQualified() : bool
22089    {
22090        return \false;
22091    }
22092    /**
22093     * Checks whether the name is fully qualified. (E.g. \Name)
22094     *
22095     * @return bool Whether the name is fully qualified
22096     */
22097    public function isFullyQualified() : bool
22098    {
22099        return \false;
22100    }
22101    /**
22102     * Checks whether the name is explicitly relative to the current namespace. (E.g. namespace\Name)
22103     *
22104     * @return bool Whether the name is relative
22105     */
22106    public function isRelative() : bool
22107    {
22108        return \true;
22109    }
22110    public function toCodeString() : string
22111    {
22112        return 'namespace\\' . $this->toString();
22113    }
22114    public function getType() : string
22115    {
22116        return 'Name_Relative';
22117    }
22118}
22119<?php
22120
22121declare (strict_types=1);
22122namespace PHPUnit\PhpParser\Node\Name;
22123
22124class FullyQualified extends \PHPUnit\PhpParser\Node\Name
22125{
22126    /**
22127     * Checks whether the name is unqualified. (E.g. Name)
22128     *
22129     * @return bool Whether the name is unqualified
22130     */
22131    public function isUnqualified() : bool
22132    {
22133        return \false;
22134    }
22135    /**
22136     * Checks whether the name is qualified. (E.g. Name\Name)
22137     *
22138     * @return bool Whether the name is qualified
22139     */
22140    public function isQualified() : bool
22141    {
22142        return \false;
22143    }
22144    /**
22145     * Checks whether the name is fully qualified. (E.g. \Name)
22146     *
22147     * @return bool Whether the name is fully qualified
22148     */
22149    public function isFullyQualified() : bool
22150    {
22151        return \true;
22152    }
22153    /**
22154     * Checks whether the name is explicitly relative to the current namespace. (E.g. namespace\Name)
22155     *
22156     * @return bool Whether the name is relative
22157     */
22158    public function isRelative() : bool
22159    {
22160        return \false;
22161    }
22162    public function toCodeString() : string
22163    {
22164        return '\\' . $this->toString();
22165    }
22166    public function getType() : string
22167    {
22168        return 'Name_FullyQualified';
22169    }
22170}
22171<?php
22172
22173declare (strict_types=1);
22174namespace PHPUnit\PhpParser\Node;
22175
22176use PHPUnit\PhpParser\NodeAbstract;
22177/**
22178 * Represents a non-namespaced name. Namespaced names are represented using Name nodes.
22179 */
22180class Identifier extends NodeAbstract
22181{
22182    /** @var string Identifier as string */
22183    public $name;
22184    private static $specialClassNames = ['self' => \true, 'parent' => \true, 'static' => \true];
22185    /**
22186     * Constructs an identifier node.
22187     *
22188     * @param string $name       Identifier as string
22189     * @param array  $attributes Additional attributes
22190     */
22191    public function __construct(string $name, array $attributes = [])
22192    {
22193        $this->attributes = $attributes;
22194        $this->name = $name;
22195    }
22196    public function getSubNodeNames() : array
22197    {
22198        return ['name'];
22199    }
22200    /**
22201     * Get identifier as string.
22202     *
22203     * @return string Identifier as string.
22204     */
22205    public function toString() : string
22206    {
22207        return $this->name;
22208    }
22209    /**
22210     * Get lowercased identifier as string.
22211     *
22212     * @return string Lowercased identifier as string
22213     */
22214    public function toLowerString() : string
22215    {
22216        return \strtolower($this->name);
22217    }
22218    /**
22219     * Checks whether the identifier is a special class name (self, parent or static).
22220     *
22221     * @return bool Whether identifier is a special class name
22222     */
22223    public function isSpecialClassName() : bool
22224    {
22225        return isset(self::$specialClassNames[\strtolower($this->name)]);
22226    }
22227    /**
22228     * Get identifier as string.
22229     *
22230     * @return string Identifier as string
22231     */
22232    public function __toString() : string
22233    {
22234        return $this->name;
22235    }
22236    public function getType() : string
22237    {
22238        return 'Identifier';
22239    }
22240}
22241<?php
22242
22243declare (strict_types=1);
22244namespace PHPUnit\PhpParser\Node;
22245
22246abstract class Scalar extends Expr
22247{
22248}
22249<?php
22250
22251declare (strict_types=1);
22252namespace PHPUnit\PhpParser\Node;
22253
22254use PHPUnit\PhpParser\NodeAbstract;
22255abstract class Expr extends NodeAbstract
22256{
22257}
22258<?php
22259
22260declare (strict_types=1);
22261namespace PHPUnit\PhpParser\Node;
22262
22263use PHPUnit\PhpParser\NodeAbstract;
22264abstract class Stmt extends NodeAbstract
22265{
22266}
22267<?php
22268
22269declare (strict_types=1);
22270namespace PHPUnit\PhpParser\Node;
22271
22272use PHPUnit\PhpParser\NodeAbstract;
22273class Param extends NodeAbstract
22274{
22275    /** @var null|Identifier|Name|ComplexType Type declaration */
22276    public $type;
22277    /** @var bool Whether parameter is passed by reference */
22278    public $byRef;
22279    /** @var bool Whether this is a variadic argument */
22280    public $variadic;
22281    /** @var Expr\Variable|Expr\Error Parameter variable */
22282    public $var;
22283    /** @var null|Expr Default value */
22284    public $default;
22285    /** @var int */
22286    public $flags;
22287    /** @var AttributeGroup[] PHP attribute groups */
22288    public $attrGroups;
22289    /**
22290     * Constructs a parameter node.
22291     *
22292     * @param Expr\Variable|Expr\Error                $var        Parameter variable
22293     * @param null|Expr                               $default    Default value
22294     * @param null|string|Identifier|Name|ComplexType $type       Type declaration
22295     * @param bool                                    $byRef      Whether is passed by reference
22296     * @param bool                                    $variadic   Whether this is a variadic argument
22297     * @param array                                   $attributes Additional attributes
22298     * @param int                                     $flags      Optional visibility flags
22299     * @param AttributeGroup[]                        $attrGroups PHP attribute groups
22300     */
22301    public function __construct($var, Expr $default = null, $type = null, bool $byRef = \false, bool $variadic = \false, array $attributes = [], int $flags = 0, array $attrGroups = [])
22302    {
22303        $this->attributes = $attributes;
22304        $this->type = \is_string($type) ? new Identifier($type) : $type;
22305        $this->byRef = $byRef;
22306        $this->variadic = $variadic;
22307        $this->var = $var;
22308        $this->default = $default;
22309        $this->flags = $flags;
22310        $this->attrGroups = $attrGroups;
22311    }
22312    public function getSubNodeNames() : array
22313    {
22314        return ['attrGroups', 'flags', 'type', 'byRef', 'variadic', 'var', 'default'];
22315    }
22316    public function getType() : string
22317    {
22318        return 'Param';
22319    }
22320}
22321<?php
22322
22323declare (strict_types=1);
22324namespace PHPUnit\PhpParser\Node;
22325
22326use PHPUnit\PhpParser\Node;
22327use PHPUnit\PhpParser\NodeAbstract;
22328class MatchArm extends NodeAbstract
22329{
22330    /** @var null|Node\Expr[] */
22331    public $conds;
22332    /** @var Node\Expr */
22333    public $body;
22334    /**
22335     * @param null|Node\Expr[] $conds
22336     */
22337    public function __construct($conds, Node\Expr $body, array $attributes = [])
22338    {
22339        $this->conds = $conds;
22340        $this->body = $body;
22341        $this->attributes = $attributes;
22342    }
22343    public function getSubNodeNames() : array
22344    {
22345        return ['conds', 'body'];
22346    }
22347    public function getType() : string
22348    {
22349        return 'MatchArm';
22350    }
22351}
22352<?php
22353
22354declare (strict_types=1);
22355namespace PHPUnit\PhpParser\Node;
22356
22357use PHPUnit\PhpParser\NodeAbstract;
22358class IntersectionType extends ComplexType
22359{
22360    /** @var (Identifier|Name)[] Types */
22361    public $types;
22362    /**
22363     * Constructs an intersection type.
22364     *
22365     * @param (Identifier|Name)[] $types      Types
22366     * @param array               $attributes Additional attributes
22367     */
22368    public function __construct(array $types, array $attributes = [])
22369    {
22370        $this->attributes = $attributes;
22371        $this->types = $types;
22372    }
22373    public function getSubNodeNames() : array
22374    {
22375        return ['types'];
22376    }
22377    public function getType() : string
22378    {
22379        return 'IntersectionType';
22380    }
22381}
22382<?php
22383
22384declare (strict_types=1);
22385namespace PHPUnit\PhpParser;
22386
22387class NodeTraverser implements NodeTraverserInterface
22388{
22389    /**
22390     * If NodeVisitor::enterNode() returns DONT_TRAVERSE_CHILDREN, child nodes
22391     * of the current node will not be traversed for any visitors.
22392     *
22393     * For subsequent visitors enterNode() will still be called on the current
22394     * node and leaveNode() will also be invoked for the current node.
22395     */
22396    const DONT_TRAVERSE_CHILDREN = 1;
22397    /**
22398     * If NodeVisitor::enterNode() or NodeVisitor::leaveNode() returns
22399     * STOP_TRAVERSAL, traversal is aborted.
22400     *
22401     * The afterTraverse() method will still be invoked.
22402     */
22403    const STOP_TRAVERSAL = 2;
22404    /**
22405     * If NodeVisitor::leaveNode() returns REMOVE_NODE for a node that occurs
22406     * in an array, it will be removed from the array.
22407     *
22408     * For subsequent visitors leaveNode() will still be invoked for the
22409     * removed node.
22410     */
22411    const REMOVE_NODE = 3;
22412    /**
22413     * If NodeVisitor::enterNode() returns DONT_TRAVERSE_CURRENT_AND_CHILDREN, child nodes
22414     * of the current node will not be traversed for any visitors.
22415     *
22416     * For subsequent visitors enterNode() will not be called as well.
22417     * leaveNode() will be invoked for visitors that has enterNode() method invoked.
22418     */
22419    const DONT_TRAVERSE_CURRENT_AND_CHILDREN = 4;
22420    /** @var NodeVisitor[] Visitors */
22421    protected $visitors = [];
22422    /** @var bool Whether traversal should be stopped */
22423    protected $stopTraversal;
22424    public function __construct()
22425    {
22426        // for BC
22427    }
22428    /**
22429     * Adds a visitor.
22430     *
22431     * @param NodeVisitor $visitor Visitor to add
22432     */
22433    public function addVisitor(NodeVisitor $visitor)
22434    {
22435        $this->visitors[] = $visitor;
22436    }
22437    /**
22438     * Removes an added visitor.
22439     *
22440     * @param NodeVisitor $visitor
22441     */
22442    public function removeVisitor(NodeVisitor $visitor)
22443    {
22444        foreach ($this->visitors as $index => $storedVisitor) {
22445            if ($storedVisitor === $visitor) {
22446                unset($this->visitors[$index]);
22447                break;
22448            }
22449        }
22450    }
22451    /**
22452     * Traverses an array of nodes using the registered visitors.
22453     *
22454     * @param Node[] $nodes Array of nodes
22455     *
22456     * @return Node[] Traversed array of nodes
22457     */
22458    public function traverse(array $nodes) : array
22459    {
22460        $this->stopTraversal = \false;
22461        foreach ($this->visitors as $visitor) {
22462            if (null !== ($return = $visitor->beforeTraverse($nodes))) {
22463                $nodes = $return;
22464            }
22465        }
22466        $nodes = $this->traverseArray($nodes);
22467        foreach ($this->visitors as $visitor) {
22468            if (null !== ($return = $visitor->afterTraverse($nodes))) {
22469                $nodes = $return;
22470            }
22471        }
22472        return $nodes;
22473    }
22474    /**
22475     * Recursively traverse a node.
22476     *
22477     * @param Node $node Node to traverse.
22478     *
22479     * @return Node Result of traversal (may be original node or new one)
22480     */
22481    protected function traverseNode(Node $node) : Node
22482    {
22483        foreach ($node->getSubNodeNames() as $name) {
22484            $subNode =& $node->{$name};
22485            if (\is_array($subNode)) {
22486                $subNode = $this->traverseArray($subNode);
22487                if ($this->stopTraversal) {
22488                    break;
22489                }
22490            } elseif ($subNode instanceof Node) {
22491                $traverseChildren = \true;
22492                $breakVisitorIndex = null;
22493                foreach ($this->visitors as $visitorIndex => $visitor) {
22494                    $return = $visitor->enterNode($subNode);
22495                    if (null !== $return) {
22496                        if ($return instanceof Node) {
22497                            $this->ensureReplacementReasonable($subNode, $return);
22498                            $subNode = $return;
22499                        } elseif (self::DONT_TRAVERSE_CHILDREN === $return) {
22500                            $traverseChildren = \false;
22501                        } elseif (self::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) {
22502                            $traverseChildren = \false;
22503                            $breakVisitorIndex = $visitorIndex;
22504                            break;
22505                        } elseif (self::STOP_TRAVERSAL === $return) {
22506                            $this->stopTraversal = \true;
22507                            break 2;
22508                        } else {
22509                            throw new \LogicException('enterNode() returned invalid value of type ' . \gettype($return));
22510                        }
22511                    }
22512                }
22513                if ($traverseChildren) {
22514                    $subNode = $this->traverseNode($subNode);
22515                    if ($this->stopTraversal) {
22516                        break;
22517                    }
22518                }
22519                foreach ($this->visitors as $visitorIndex => $visitor) {
22520                    $return = $visitor->leaveNode($subNode);
22521                    if (null !== $return) {
22522                        if ($return instanceof Node) {
22523                            $this->ensureReplacementReasonable($subNode, $return);
22524                            $subNode = $return;
22525                        } elseif (self::STOP_TRAVERSAL === $return) {
22526                            $this->stopTraversal = \true;
22527                            break 2;
22528                        } elseif (\is_array($return)) {
22529                            throw new \LogicException('leaveNode() may only return an array ' . 'if the parent structure is an array');
22530                        } else {
22531                            throw new \LogicException('leaveNode() returned invalid value of type ' . \gettype($return));
22532                        }
22533                    }
22534                    if ($breakVisitorIndex === $visitorIndex) {
22535                        break;
22536                    }
22537                }
22538            }
22539        }
22540        return $node;
22541    }
22542    /**
22543     * Recursively traverse array (usually of nodes).
22544     *
22545     * @param array $nodes Array to traverse
22546     *
22547     * @return array Result of traversal (may be original array or changed one)
22548     */
22549    protected function traverseArray(array $nodes) : array
22550    {
22551        $doNodes = [];
22552        foreach ($nodes as $i => &$node) {
22553            if ($node instanceof Node) {
22554                $traverseChildren = \true;
22555                $breakVisitorIndex = null;
22556                foreach ($this->visitors as $visitorIndex => $visitor) {
22557                    $return = $visitor->enterNode($node);
22558                    if (null !== $return) {
22559                        if ($return instanceof Node) {
22560                            $this->ensureReplacementReasonable($node, $return);
22561                            $node = $return;
22562                        } elseif (self::DONT_TRAVERSE_CHILDREN === $return) {
22563                            $traverseChildren = \false;
22564                        } elseif (self::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) {
22565                            $traverseChildren = \false;
22566                            $breakVisitorIndex = $visitorIndex;
22567                            break;
22568                        } elseif (self::STOP_TRAVERSAL === $return) {
22569                            $this->stopTraversal = \true;
22570                            break 2;
22571                        } else {
22572                            throw new \LogicException('enterNode() returned invalid value of type ' . \gettype($return));
22573                        }
22574                    }
22575                }
22576                if ($traverseChildren) {
22577                    $node = $this->traverseNode($node);
22578                    if ($this->stopTraversal) {
22579                        break;
22580                    }
22581                }
22582                foreach ($this->visitors as $visitorIndex => $visitor) {
22583                    $return = $visitor->leaveNode($node);
22584                    if (null !== $return) {
22585                        if ($return instanceof Node) {
22586                            $this->ensureReplacementReasonable($node, $return);
22587                            $node = $return;
22588                        } elseif (\is_array($return)) {
22589                            $doNodes[] = [$i, $return];
22590                            break;
22591                        } elseif (self::REMOVE_NODE === $return) {
22592                            $doNodes[] = [$i, []];
22593                            break;
22594                        } elseif (self::STOP_TRAVERSAL === $return) {
22595                            $this->stopTraversal = \true;
22596                            break 2;
22597                        } elseif (\false === $return) {
22598                            throw new \LogicException('bool(false) return from leaveNode() no longer supported. ' . 'Return NodeTraverser::REMOVE_NODE instead');
22599                        } else {
22600                            throw new \LogicException('leaveNode() returned invalid value of type ' . \gettype($return));
22601                        }
22602                    }
22603                    if ($breakVisitorIndex === $visitorIndex) {
22604                        break;
22605                    }
22606                }
22607            } elseif (\is_array($node)) {
22608                throw new \LogicException('Invalid node structure: Contains nested arrays');
22609            }
22610        }
22611        if (!empty($doNodes)) {
22612            while (list($i, $replace) = \array_pop($doNodes)) {
22613                \array_splice($nodes, $i, 1, $replace);
22614            }
22615        }
22616        return $nodes;
22617    }
22618    private function ensureReplacementReasonable($old, $new)
22619    {
22620        if ($old instanceof Node\Stmt && $new instanceof Node\Expr) {
22621            throw new \LogicException("Trying to replace statement ({$old->getType()}) " . "with expression ({$new->getType()}). Are you missing a " . "Stmt_Expression wrapper?");
22622        }
22623        if ($old instanceof Node\Expr && $new instanceof Node\Stmt) {
22624            throw new \LogicException("Trying to replace expression ({$old->getType()}) " . "with statement ({$new->getType()})");
22625        }
22626    }
22627}
22628<?php
22629
22630declare (strict_types=1);
22631namespace PHPUnit\PhpParser;
22632
22633interface Parser
22634{
22635    /**
22636     * Parses PHP code into a node tree.
22637     *
22638     * @param string $code The source code to parse
22639     * @param ErrorHandler|null $errorHandler Error handler to use for lexer/parser errors, defaults
22640     *                                        to ErrorHandler\Throwing.
22641     *
22642     * @return Node\Stmt[]|null Array of statements (or null non-throwing error handler is used and
22643     *                          the parser was unable to recover from an error).
22644     */
22645    public function parse(string $code, ErrorHandler $errorHandler = null);
22646}
22647<?php
22648
22649declare (strict_types=1);
22650namespace PHPUnit\PhpParser;
22651
22652interface NodeVisitor
22653{
22654    /**
22655     * Called once before traversal.
22656     *
22657     * Return value semantics:
22658     *  * null:      $nodes stays as-is
22659     *  * otherwise: $nodes is set to the return value
22660     *
22661     * @param Node[] $nodes Array of nodes
22662     *
22663     * @return null|Node[] Array of nodes
22664     */
22665    public function beforeTraverse(array $nodes);
22666    /**
22667     * Called when entering a node.
22668     *
22669     * Return value semantics:
22670     *  * null
22671     *        => $node stays as-is
22672     *  * NodeTraverser::DONT_TRAVERSE_CHILDREN
22673     *        => Children of $node are not traversed. $node stays as-is
22674     *  * NodeTraverser::STOP_TRAVERSAL
22675     *        => Traversal is aborted. $node stays as-is
22676     *  * otherwise
22677     *        => $node is set to the return value
22678     *
22679     * @param Node $node Node
22680     *
22681     * @return null|int|Node Replacement node (or special return value)
22682     */
22683    public function enterNode(Node $node);
22684    /**
22685     * Called when leaving a node.
22686     *
22687     * Return value semantics:
22688     *  * null
22689     *        => $node stays as-is
22690     *  * NodeTraverser::REMOVE_NODE
22691     *        => $node is removed from the parent array
22692     *  * NodeTraverser::STOP_TRAVERSAL
22693     *        => Traversal is aborted. $node stays as-is
22694     *  * array (of Nodes)
22695     *        => The return value is merged into the parent array (at the position of the $node)
22696     *  * otherwise
22697     *        => $node is set to the return value
22698     *
22699     * @param Node $node Node
22700     *
22701     * @return null|int|Node|Node[] Replacement node (or special return value)
22702     */
22703    public function leaveNode(Node $node);
22704    /**
22705     * Called once after traversal.
22706     *
22707     * Return value semantics:
22708     *  * null:      $nodes stays as-is
22709     *  * otherwise: $nodes is set to the return value
22710     *
22711     * @param Node[] $nodes Array of nodes
22712     *
22713     * @return null|Node[] Array of nodes
22714     */
22715    public function afterTraverse(array $nodes);
22716}
22717<?php
22718
22719declare (strict_types=1);
22720namespace PHPUnit\PhpParser;
22721
22722class JsonDecoder
22723{
22724    /** @var \ReflectionClass[] Node type to reflection class map */
22725    private $reflectionClassCache;
22726    public function decode(string $json)
22727    {
22728        $value = \json_decode($json, \true);
22729        if (\json_last_error()) {
22730            throw new \RuntimeException('JSON decoding error: ' . \json_last_error_msg());
22731        }
22732        return $this->decodeRecursive($value);
22733    }
22734    private function decodeRecursive($value)
22735    {
22736        if (\is_array($value)) {
22737            if (isset($value['nodeType'])) {
22738                if ($value['nodeType'] === 'Comment' || $value['nodeType'] === 'Comment_Doc') {
22739                    return $this->decodeComment($value);
22740                }
22741                return $this->decodeNode($value);
22742            }
22743            return $this->decodeArray($value);
22744        }
22745        return $value;
22746    }
22747    private function decodeArray(array $array) : array
22748    {
22749        $decodedArray = [];
22750        foreach ($array as $key => $value) {
22751            $decodedArray[$key] = $this->decodeRecursive($value);
22752        }
22753        return $decodedArray;
22754    }
22755    private function decodeNode(array $value) : Node
22756    {
22757        $nodeType = $value['nodeType'];
22758        if (!\is_string($nodeType)) {
22759            throw new \RuntimeException('Node type must be a string');
22760        }
22761        $reflectionClass = $this->reflectionClassFromNodeType($nodeType);
22762        /** @var Node $node */
22763        $node = $reflectionClass->newInstanceWithoutConstructor();
22764        if (isset($value['attributes'])) {
22765            if (!\is_array($value['attributes'])) {
22766                throw new \RuntimeException('Attributes must be an array');
22767            }
22768            $node->setAttributes($this->decodeArray($value['attributes']));
22769        }
22770        foreach ($value as $name => $subNode) {
22771            if ($name === 'nodeType' || $name === 'attributes') {
22772                continue;
22773            }
22774            $node->{$name} = $this->decodeRecursive($subNode);
22775        }
22776        return $node;
22777    }
22778    private function decodeComment(array $value) : Comment
22779    {
22780        $className = $value['nodeType'] === 'Comment' ? Comment::class : Comment\Doc::class;
22781        if (!isset($value['text'])) {
22782            throw new \RuntimeException('Comment must have text');
22783        }
22784        return new $className($value['text'], $value['line'] ?? -1, $value['filePos'] ?? -1, $value['tokenPos'] ?? -1, $value['endLine'] ?? -1, $value['endFilePos'] ?? -1, $value['endTokenPos'] ?? -1);
22785    }
22786    private function reflectionClassFromNodeType(string $nodeType) : \ReflectionClass
22787    {
22788        if (!isset($this->reflectionClassCache[$nodeType])) {
22789            $className = $this->classNameFromNodeType($nodeType);
22790            $this->reflectionClassCache[$nodeType] = new \ReflectionClass($className);
22791        }
22792        return $this->reflectionClassCache[$nodeType];
22793    }
22794    private function classNameFromNodeType(string $nodeType) : string
22795    {
22796        $className = 'PhpParser\\Node\\' . \strtr($nodeType, '_', '\\');
22797        if (\class_exists($className)) {
22798            return $className;
22799        }
22800        $className .= '_';
22801        if (\class_exists($className)) {
22802            return $className;
22803        }
22804        throw new \RuntimeException("Unknown node type \"{$nodeType}\"");
22805    }
22806}
22807<?php
22808
22809declare (strict_types=1);
22810namespace PHPUnit\PhpParser;
22811
22812abstract class NodeAbstract implements Node, \JsonSerializable
22813{
22814    protected $attributes;
22815    /**
22816     * Creates a Node.
22817     *
22818     * @param array $attributes Array of attributes
22819     */
22820    public function __construct(array $attributes = [])
22821    {
22822        $this->attributes = $attributes;
22823    }
22824    /**
22825     * Gets line the node started in (alias of getStartLine).
22826     *
22827     * @return int Start line (or -1 if not available)
22828     */
22829    public function getLine() : int
22830    {
22831        return $this->attributes['startLine'] ?? -1;
22832    }
22833    /**
22834     * Gets line the node started in.
22835     *
22836     * Requires the 'startLine' attribute to be enabled in the lexer (enabled by default).
22837     *
22838     * @return int Start line (or -1 if not available)
22839     */
22840    public function getStartLine() : int
22841    {
22842        return $this->attributes['startLine'] ?? -1;
22843    }
22844    /**
22845     * Gets the line the node ended in.
22846     *
22847     * Requires the 'endLine' attribute to be enabled in the lexer (enabled by default).
22848     *
22849     * @return int End line (or -1 if not available)
22850     */
22851    public function getEndLine() : int
22852    {
22853        return $this->attributes['endLine'] ?? -1;
22854    }
22855    /**
22856     * Gets the token offset of the first token that is part of this node.
22857     *
22858     * The offset is an index into the array returned by Lexer::getTokens().
22859     *
22860     * Requires the 'startTokenPos' attribute to be enabled in the lexer (DISABLED by default).
22861     *
22862     * @return int Token start position (or -1 if not available)
22863     */
22864    public function getStartTokenPos() : int
22865    {
22866        return $this->attributes['startTokenPos'] ?? -1;
22867    }
22868    /**
22869     * Gets the token offset of the last token that is part of this node.
22870     *
22871     * The offset is an index into the array returned by Lexer::getTokens().
22872     *
22873     * Requires the 'endTokenPos' attribute to be enabled in the lexer (DISABLED by default).
22874     *
22875     * @return int Token end position (or -1 if not available)
22876     */
22877    public function getEndTokenPos() : int
22878    {
22879        return $this->attributes['endTokenPos'] ?? -1;
22880    }
22881    /**
22882     * Gets the file offset of the first character that is part of this node.
22883     *
22884     * Requires the 'startFilePos' attribute to be enabled in the lexer (DISABLED by default).
22885     *
22886     * @return int File start position (or -1 if not available)
22887     */
22888    public function getStartFilePos() : int
22889    {
22890        return $this->attributes['startFilePos'] ?? -1;
22891    }
22892    /**
22893     * Gets the file offset of the last character that is part of this node.
22894     *
22895     * Requires the 'endFilePos' attribute to be enabled in the lexer (DISABLED by default).
22896     *
22897     * @return int File end position (or -1 if not available)
22898     */
22899    public function getEndFilePos() : int
22900    {
22901        return $this->attributes['endFilePos'] ?? -1;
22902    }
22903    /**
22904     * Gets all comments directly preceding this node.
22905     *
22906     * The comments are also available through the "comments" attribute.
22907     *
22908     * @return Comment[]
22909     */
22910    public function getComments() : array
22911    {
22912        return $this->attributes['comments'] ?? [];
22913    }
22914    /**
22915     * Gets the doc comment of the node.
22916     *
22917     * @return null|Comment\Doc Doc comment object or null
22918     */
22919    public function getDocComment()
22920    {
22921        $comments = $this->getComments();
22922        for ($i = \count($comments) - 1; $i >= 0; $i--) {
22923            $comment = $comments[$i];
22924            if ($comment instanceof Comment\Doc) {
22925                return $comment;
22926            }
22927        }
22928        return null;
22929    }
22930    /**
22931     * Sets the doc comment of the node.
22932     *
22933     * This will either replace an existing doc comment or add it to the comments array.
22934     *
22935     * @param Comment\Doc $docComment Doc comment to set
22936     */
22937    public function setDocComment(Comment\Doc $docComment)
22938    {
22939        $comments = $this->getComments();
22940        for ($i = \count($comments) - 1; $i >= 0; $i--) {
22941            if ($comments[$i] instanceof Comment\Doc) {
22942                // Replace existing doc comment.
22943                $comments[$i] = $docComment;
22944                $this->setAttribute('comments', $comments);
22945                return;
22946            }
22947        }
22948        // Append new doc comment.
22949        $comments[] = $docComment;
22950        $this->setAttribute('comments', $comments);
22951    }
22952    public function setAttribute(string $key, $value)
22953    {
22954        $this->attributes[$key] = $value;
22955    }
22956    public function hasAttribute(string $key) : bool
22957    {
22958        return \array_key_exists($key, $this->attributes);
22959    }
22960    public function getAttribute(string $key, $default = null)
22961    {
22962        if (\array_key_exists($key, $this->attributes)) {
22963            return $this->attributes[$key];
22964        }
22965        return $default;
22966    }
22967    public function getAttributes() : array
22968    {
22969        return $this->attributes;
22970    }
22971    public function setAttributes(array $attributes)
22972    {
22973        $this->attributes = $attributes;
22974    }
22975    /**
22976     * @return array
22977     */
22978    public function jsonSerialize() : array
22979    {
22980        return ['nodeType' => $this->getType()] + \get_object_vars($this);
22981    }
22982}
22983<?php
22984
22985declare (strict_types=1);
22986namespace PHPUnit\PhpParser;
22987
22988use PHPUnit\PhpParser\Parser\Tokens;
22989class Lexer
22990{
22991    protected $code;
22992    protected $tokens;
22993    protected $pos;
22994    protected $line;
22995    protected $filePos;
22996    protected $prevCloseTagHasNewline;
22997    protected $tokenMap;
22998    protected $dropTokens;
22999    protected $identifierTokens;
23000    private $attributeStartLineUsed;
23001    private $attributeEndLineUsed;
23002    private $attributeStartTokenPosUsed;
23003    private $attributeEndTokenPosUsed;
23004    private $attributeStartFilePosUsed;
23005    private $attributeEndFilePosUsed;
23006    private $attributeCommentsUsed;
23007    /**
23008     * Creates a Lexer.
23009     *
23010     * @param array $options Options array. Currently only the 'usedAttributes' option is supported,
23011     *                       which is an array of attributes to add to the AST nodes. Possible
23012     *                       attributes are: 'comments', 'startLine', 'endLine', 'startTokenPos',
23013     *                       'endTokenPos', 'startFilePos', 'endFilePos'. The option defaults to the
23014     *                       first three. For more info see getNextToken() docs.
23015     */
23016    public function __construct(array $options = [])
23017    {
23018        // Create Map from internal tokens to PhpParser tokens.
23019        $this->defineCompatibilityTokens();
23020        $this->tokenMap = $this->createTokenMap();
23021        $this->identifierTokens = $this->createIdentifierTokenMap();
23022        // map of tokens to drop while lexing (the map is only used for isset lookup,
23023        // that's why the value is simply set to 1; the value is never actually used.)
23024        $this->dropTokens = \array_fill_keys([\T_WHITESPACE, \T_OPEN_TAG, \T_COMMENT, \T_DOC_COMMENT, \T_BAD_CHARACTER], 1);
23025        $defaultAttributes = ['comments', 'startLine', 'endLine'];
23026        $usedAttributes = \array_fill_keys($options['usedAttributes'] ?? $defaultAttributes, \true);
23027        // Create individual boolean properties to make these checks faster.
23028        $this->attributeStartLineUsed = isset($usedAttributes['startLine']);
23029        $this->attributeEndLineUsed = isset($usedAttributes['endLine']);
23030        $this->attributeStartTokenPosUsed = isset($usedAttributes['startTokenPos']);
23031        $this->attributeEndTokenPosUsed = isset($usedAttributes['endTokenPos']);
23032        $this->attributeStartFilePosUsed = isset($usedAttributes['startFilePos']);
23033        $this->attributeEndFilePosUsed = isset($usedAttributes['endFilePos']);
23034        $this->attributeCommentsUsed = isset($usedAttributes['comments']);
23035    }
23036    /**
23037     * Initializes the lexer for lexing the provided source code.
23038     *
23039     * This function does not throw if lexing errors occur. Instead, errors may be retrieved using
23040     * the getErrors() method.
23041     *
23042     * @param string $code The source code to lex
23043     * @param ErrorHandler|null $errorHandler Error handler to use for lexing errors. Defaults to
23044     *                                        ErrorHandler\Throwing
23045     */
23046    public function startLexing(string $code, ErrorHandler $errorHandler = null)
23047    {
23048        if (null === $errorHandler) {
23049            $errorHandler = new ErrorHandler\Throwing();
23050        }
23051        $this->code = $code;
23052        // keep the code around for __halt_compiler() handling
23053        $this->pos = -1;
23054        $this->line = 1;
23055        $this->filePos = 0;
23056        // If inline HTML occurs without preceding code, treat it as if it had a leading newline.
23057        // This ensures proper composability, because having a newline is the "safe" assumption.
23058        $this->prevCloseTagHasNewline = \true;
23059        $scream = \ini_set('xdebug.scream', '0');
23060        $this->tokens = @\token_get_all($code);
23061        $this->postprocessTokens($errorHandler);
23062        if (\false !== $scream) {
23063            \ini_set('xdebug.scream', $scream);
23064        }
23065    }
23066    private function handleInvalidCharacterRange($start, $end, $line, ErrorHandler $errorHandler)
23067    {
23068        $tokens = [];
23069        for ($i = $start; $i < $end; $i++) {
23070            $chr = $this->code[$i];
23071            if ($chr === "\0") {
23072                // PHP cuts error message after null byte, so need special case
23073                $errorMsg = 'Unexpected null byte';
23074            } else {
23075                $errorMsg = \sprintf('Unexpected character "%s" (ASCII %d)', $chr, \ord($chr));
23076            }
23077            $tokens[] = [\T_BAD_CHARACTER, $chr, $line];
23078            $errorHandler->handleError(new Error($errorMsg, ['startLine' => $line, 'endLine' => $line, 'startFilePos' => $i, 'endFilePos' => $i]));
23079        }
23080        return $tokens;
23081    }
23082    /**
23083     * Check whether comment token is unterminated.
23084     *
23085     * @return bool
23086     */
23087    private function isUnterminatedComment($token) : bool
23088    {
23089        return ($token[0] === \T_COMMENT || $token[0] === \T_DOC_COMMENT) && \substr($token[1], 0, 2) === '/*' && \substr($token[1], -2) !== '*/';
23090    }
23091    protected function postprocessTokens(ErrorHandler $errorHandler)
23092    {
23093        // PHP's error handling for token_get_all() is rather bad, so if we want detailed
23094        // error information we need to compute it ourselves. Invalid character errors are
23095        // detected by finding "gaps" in the token array. Unterminated comments are detected
23096        // by checking if a trailing comment has a "*/" at the end.
23097        //
23098        // Additionally, we perform a number of canonicalizations here:
23099        //  * Use the PHP 8.0 comment format, which does not include trailing whitespace anymore.
23100        //  * Use PHP 8.0 T_NAME_* tokens.
23101        //  * Use PHP 8.1 T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG and
23102        //    T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG tokens used to disambiguate intersection types.
23103        $filePos = 0;
23104        $line = 1;
23105        $numTokens = \count($this->tokens);
23106        for ($i = 0; $i < $numTokens; $i++) {
23107            $token = $this->tokens[$i];
23108            // Since PHP 7.4 invalid characters are represented by a T_BAD_CHARACTER token.
23109            // In this case we only need to emit an error.
23110            if ($token[0] === \T_BAD_CHARACTER) {
23111                $this->handleInvalidCharacterRange($filePos, $filePos + 1, $line, $errorHandler);
23112            }
23113            if ($token[0] === \T_COMMENT && \substr($token[1], 0, 2) !== '/*' && \preg_match('/(\\r\\n|\\n|\\r)$/D', $token[1], $matches)) {
23114                $trailingNewline = $matches[0];
23115                $token[1] = \substr($token[1], 0, -\strlen($trailingNewline));
23116                $this->tokens[$i] = $token;
23117                if (isset($this->tokens[$i + 1]) && $this->tokens[$i + 1][0] === \T_WHITESPACE) {
23118                    // Move trailing newline into following T_WHITESPACE token, if it already exists.
23119                    $this->tokens[$i + 1][1] = $trailingNewline . $this->tokens[$i + 1][1];
23120                    $this->tokens[$i + 1][2]--;
23121                } else {
23122                    // Otherwise, we need to create a new T_WHITESPACE token.
23123                    \array_splice($this->tokens, $i + 1, 0, [[\T_WHITESPACE, $trailingNewline, $line]]);
23124                    $numTokens++;
23125                }
23126            }
23127            // Emulate PHP 8 T_NAME_* tokens, by combining sequences of T_NS_SEPARATOR and T_STRING
23128            // into a single token.
23129            if (\is_array($token) && ($token[0] === \T_NS_SEPARATOR || isset($this->identifierTokens[$token[0]]))) {
23130                $lastWasSeparator = $token[0] === \T_NS_SEPARATOR;
23131                $text = $token[1];
23132                for ($j = $i + 1; isset($this->tokens[$j]); $j++) {
23133                    if ($lastWasSeparator) {
23134                        if (!isset($this->identifierTokens[$this->tokens[$j][0]])) {
23135                            break;
23136                        }
23137                        $lastWasSeparator = \false;
23138                    } else {
23139                        if ($this->tokens[$j][0] !== \T_NS_SEPARATOR) {
23140                            break;
23141                        }
23142                        $lastWasSeparator = \true;
23143                    }
23144                    $text .= $this->tokens[$j][1];
23145                }
23146                if ($lastWasSeparator) {
23147                    // Trailing separator is not part of the name.
23148                    $j--;
23149                    $text = \substr($text, 0, -1);
23150                }
23151                if ($j > $i + 1) {
23152                    if ($token[0] === \T_NS_SEPARATOR) {
23153                        $type = \T_NAME_FULLY_QUALIFIED;
23154                    } else {
23155                        if ($token[0] === \T_NAMESPACE) {
23156                            $type = \T_NAME_RELATIVE;
23157                        } else {
23158                            $type = \T_NAME_QUALIFIED;
23159                        }
23160                    }
23161                    $token = [$type, $text, $line];
23162                    \array_splice($this->tokens, $i, $j - $i, [$token]);
23163                    $numTokens -= $j - $i - 1;
23164                }
23165            }
23166            if ($token === '&') {
23167                $next = $i + 1;
23168                while (isset($this->tokens[$next]) && $this->tokens[$next][0] === \T_WHITESPACE) {
23169                    $next++;
23170                }
23171                $followedByVarOrVarArg = isset($this->tokens[$next]) && ($this->tokens[$next][0] === \T_VARIABLE || $this->tokens[$next][0] === \T_ELLIPSIS);
23172                $this->tokens[$i] = $token = [$followedByVarOrVarArg ? \T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG : \T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG, '&', $line];
23173            }
23174            $tokenValue = \is_string($token) ? $token : $token[1];
23175            $tokenLen = \strlen($tokenValue);
23176            if (\substr($this->code, $filePos, $tokenLen) !== $tokenValue) {
23177                // Something is missing, must be an invalid character
23178                $nextFilePos = \strpos($this->code, $tokenValue, $filePos);
23179                $badCharTokens = $this->handleInvalidCharacterRange($filePos, $nextFilePos, $line, $errorHandler);
23180                $filePos = (int) $nextFilePos;
23181                \array_splice($this->tokens, $i, 0, $badCharTokens);
23182                $numTokens += \count($badCharTokens);
23183                $i += \count($badCharTokens);
23184            }
23185            $filePos += $tokenLen;
23186            $line += \substr_count($tokenValue, "\n");
23187        }
23188        if ($filePos !== \strlen($this->code)) {
23189            if (\substr($this->code, $filePos, 2) === '/*') {
23190                // Unlike PHP, HHVM will drop unterminated comments entirely
23191                $comment = \substr($this->code, $filePos);
23192                $errorHandler->handleError(new Error('Unterminated comment', ['startLine' => $line, 'endLine' => $line + \substr_count($comment, "\n"), 'startFilePos' => $filePos, 'endFilePos' => $filePos + \strlen($comment)]));
23193                // Emulate the PHP behavior
23194                $isDocComment = isset($comment[3]) && $comment[3] === '*';
23195                $this->tokens[] = [$isDocComment ? \T_DOC_COMMENT : \T_COMMENT, $comment, $line];
23196            } else {
23197                // Invalid characters at the end of the input
23198                $badCharTokens = $this->handleInvalidCharacterRange($filePos, \strlen($this->code), $line, $errorHandler);
23199                $this->tokens = \array_merge($this->tokens, $badCharTokens);
23200            }
23201            return;
23202        }
23203        if (\count($this->tokens) > 0) {
23204            // Check for unterminated comment
23205            $lastToken = $this->tokens[\count($this->tokens) - 1];
23206            if ($this->isUnterminatedComment($lastToken)) {
23207                $errorHandler->handleError(new Error('Unterminated comment', ['startLine' => $line - \substr_count($lastToken[1], "\n"), 'endLine' => $line, 'startFilePos' => $filePos - \strlen($lastToken[1]), 'endFilePos' => $filePos]));
23208            }
23209        }
23210    }
23211    /**
23212     * Fetches the next token.
23213     *
23214     * The available attributes are determined by the 'usedAttributes' option, which can
23215     * be specified in the constructor. The following attributes are supported:
23216     *
23217     *  * 'comments'      => Array of PhpParser\Comment or PhpParser\Comment\Doc instances,
23218     *                       representing all comments that occurred between the previous
23219     *                       non-discarded token and the current one.
23220     *  * 'startLine'     => Line in which the node starts.
23221     *  * 'endLine'       => Line in which the node ends.
23222     *  * 'startTokenPos' => Offset into the token array of the first token in the node.
23223     *  * 'endTokenPos'   => Offset into the token array of the last token in the node.
23224     *  * 'startFilePos'  => Offset into the code string of the first character that is part of the node.
23225     *  * 'endFilePos'    => Offset into the code string of the last character that is part of the node.
23226     *
23227     * @param mixed $value           Variable to store token content in
23228     * @param mixed $startAttributes Variable to store start attributes in
23229     * @param mixed $endAttributes   Variable to store end attributes in
23230     *
23231     * @return int Token id
23232     */
23233    public function getNextToken(&$value = null, &$startAttributes = null, &$endAttributes = null) : int
23234    {
23235        $startAttributes = [];
23236        $endAttributes = [];
23237        while (1) {
23238            if (isset($this->tokens[++$this->pos])) {
23239                $token = $this->tokens[$this->pos];
23240            } else {
23241                // EOF token with ID 0
23242                $token = "\0";
23243            }
23244            if ($this->attributeStartLineUsed) {
23245                $startAttributes['startLine'] = $this->line;
23246            }
23247            if ($this->attributeStartTokenPosUsed) {
23248                $startAttributes['startTokenPos'] = $this->pos;
23249            }
23250            if ($this->attributeStartFilePosUsed) {
23251                $startAttributes['startFilePos'] = $this->filePos;
23252            }
23253            if (\is_string($token)) {
23254                $value = $token;
23255                if (isset($token[1])) {
23256                    // bug in token_get_all
23257                    $this->filePos += 2;
23258                    $id = \ord('"');
23259                } else {
23260                    $this->filePos += 1;
23261                    $id = \ord($token);
23262                }
23263            } elseif (!isset($this->dropTokens[$token[0]])) {
23264                $value = $token[1];
23265                $id = $this->tokenMap[$token[0]];
23266                if (\T_CLOSE_TAG === $token[0]) {
23267                    $this->prevCloseTagHasNewline = \false !== \strpos($token[1], "\n") || \false !== \strpos($token[1], "\r");
23268                } elseif (\T_INLINE_HTML === $token[0]) {
23269                    $startAttributes['hasLeadingNewline'] = $this->prevCloseTagHasNewline;
23270                }
23271                $this->line += \substr_count($value, "\n");
23272                $this->filePos += \strlen($value);
23273            } else {
23274                $origLine = $this->line;
23275                $origFilePos = $this->filePos;
23276                $this->line += \substr_count($token[1], "\n");
23277                $this->filePos += \strlen($token[1]);
23278                if (\T_COMMENT === $token[0] || \T_DOC_COMMENT === $token[0]) {
23279                    if ($this->attributeCommentsUsed) {
23280                        $comment = \T_DOC_COMMENT === $token[0] ? new Comment\Doc($token[1], $origLine, $origFilePos, $this->pos, $this->line, $this->filePos - 1, $this->pos) : new Comment($token[1], $origLine, $origFilePos, $this->pos, $this->line, $this->filePos - 1, $this->pos);
23281                        $startAttributes['comments'][] = $comment;
23282                    }
23283                }
23284                continue;
23285            }
23286            if ($this->attributeEndLineUsed) {
23287                $endAttributes['endLine'] = $this->line;
23288            }
23289            if ($this->attributeEndTokenPosUsed) {
23290                $endAttributes['endTokenPos'] = $this->pos;
23291            }
23292            if ($this->attributeEndFilePosUsed) {
23293                $endAttributes['endFilePos'] = $this->filePos - 1;
23294            }
23295            return $id;
23296        }
23297        throw new \RuntimeException('Reached end of lexer loop');
23298    }
23299    /**
23300     * Returns the token array for current code.
23301     *
23302     * The token array is in the same format as provided by the
23303     * token_get_all() function and does not discard tokens (i.e.
23304     * whitespace and comments are included). The token position
23305     * attributes are against this token array.
23306     *
23307     * @return array Array of tokens in token_get_all() format
23308     */
23309    public function getTokens() : array
23310    {
23311        return $this->tokens;
23312    }
23313    /**
23314     * Handles __halt_compiler() by returning the text after it.
23315     *
23316     * @return string Remaining text
23317     */
23318    public function handleHaltCompiler() : string
23319    {
23320        // text after T_HALT_COMPILER, still including ();
23321        $textAfter = \substr($this->code, $this->filePos);
23322        // ensure that it is followed by ();
23323        // this simplifies the situation, by not allowing any comments
23324        // in between of the tokens.
23325        if (!\preg_match('~^\\s*\\(\\s*\\)\\s*(?:;|\\?>\\r?\\n?)~', $textAfter, $matches)) {
23326            throw new Error('__HALT_COMPILER must be followed by "();"');
23327        }
23328        // prevent the lexer from returning any further tokens
23329        $this->pos = \count($this->tokens);
23330        // return with (); removed
23331        return \substr($textAfter, \strlen($matches[0]));
23332    }
23333    private function defineCompatibilityTokens()
23334    {
23335        static $compatTokensDefined = \false;
23336        if ($compatTokensDefined) {
23337            return;
23338        }
23339        $compatTokens = [
23340            // PHP 7.4
23341            'T_BAD_CHARACTER',
23342            'T_FN',
23343            'T_COALESCE_EQUAL',
23344            // PHP 8.0
23345            'T_NAME_QUALIFIED',
23346            'T_NAME_FULLY_QUALIFIED',
23347            'T_NAME_RELATIVE',
23348            'T_MATCH',
23349            'T_NULLSAFE_OBJECT_OPERATOR',
23350            'T_ATTRIBUTE',
23351            // PHP 8.1
23352            'T_ENUM',
23353            'T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG',
23354            'T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG',
23355            'T_READONLY',
23356        ];
23357        // PHP-Parser might be used together with another library that also emulates some or all
23358        // of these tokens. Perform a sanity-check that all already defined tokens have been
23359        // assigned a unique ID.
23360        $usedTokenIds = [];
23361        foreach ($compatTokens as $token) {
23362            if (\defined($token)) {
23363                $tokenId = \constant($token);
23364                $clashingToken = $usedTokenIds[$tokenId] ?? null;
23365                if ($clashingToken !== null) {
23366                    throw new \Error(\sprintf('Token %s has same ID as token %s, ' . 'you may be using a library with broken token emulation', $token, $clashingToken));
23367                }
23368                $usedTokenIds[$tokenId] = $token;
23369            }
23370        }
23371        // Now define any tokens that have not yet been emulated. Try to assign IDs from -1
23372        // downwards, but skip any IDs that may already be in use.
23373        $newTokenId = -1;
23374        foreach ($compatTokens as $token) {
23375            if (!\defined($token)) {
23376                while (isset($usedTokenIds[$newTokenId])) {
23377                    $newTokenId--;
23378                }
23379                \define($token, $newTokenId);
23380                $newTokenId--;
23381            }
23382        }
23383        $compatTokensDefined = \true;
23384    }
23385    /**
23386     * Creates the token map.
23387     *
23388     * The token map maps the PHP internal token identifiers
23389     * to the identifiers used by the Parser. Additionally it
23390     * maps T_OPEN_TAG_WITH_ECHO to T_ECHO and T_CLOSE_TAG to ';'.
23391     *
23392     * @return array The token map
23393     */
23394    protected function createTokenMap() : array
23395    {
23396        $tokenMap = [];
23397        // 256 is the minimum possible token number, as everything below
23398        // it is an ASCII value
23399        for ($i = 256; $i < 1000; ++$i) {
23400            if (\T_DOUBLE_COLON === $i) {
23401                // T_DOUBLE_COLON is equivalent to T_PAAMAYIM_NEKUDOTAYIM
23402                $tokenMap[$i] = Tokens::T_PAAMAYIM_NEKUDOTAYIM;
23403            } elseif (\T_OPEN_TAG_WITH_ECHO === $i) {
23404                // T_OPEN_TAG_WITH_ECHO with dropped T_OPEN_TAG results in T_ECHO
23405                $tokenMap[$i] = Tokens::T_ECHO;
23406            } elseif (\T_CLOSE_TAG === $i) {
23407                // T_CLOSE_TAG is equivalent to ';'
23408                $tokenMap[$i] = \ord(';');
23409            } elseif ('UNKNOWN' !== ($name = \token_name($i))) {
23410                if ('T_HASHBANG' === $name) {
23411                    // HHVM uses a special token for #! hashbang lines
23412                    $tokenMap[$i] = Tokens::T_INLINE_HTML;
23413                } elseif (\defined($name = Tokens::class . '::' . $name)) {
23414                    // Other tokens can be mapped directly
23415                    $tokenMap[$i] = \constant($name);
23416                }
23417            }
23418        }
23419        // HHVM uses a special token for numbers that overflow to double
23420        if (\defined('T_ONUMBER')) {
23421            $tokenMap[\T_ONUMBER] = Tokens::T_DNUMBER;
23422        }
23423        // HHVM also has a separate token for the __COMPILER_HALT_OFFSET__ constant
23424        if (\defined('T_COMPILER_HALT_OFFSET')) {
23425            $tokenMap[\T_COMPILER_HALT_OFFSET] = Tokens::T_STRING;
23426        }
23427        // Assign tokens for which we define compatibility constants, as token_name() does not know them.
23428        $tokenMap[\T_FN] = Tokens::T_FN;
23429        $tokenMap[\T_COALESCE_EQUAL] = Tokens::T_COALESCE_EQUAL;
23430        $tokenMap[\T_NAME_QUALIFIED] = Tokens::T_NAME_QUALIFIED;
23431        $tokenMap[\T_NAME_FULLY_QUALIFIED] = Tokens::T_NAME_FULLY_QUALIFIED;
23432        $tokenMap[\T_NAME_RELATIVE] = Tokens::T_NAME_RELATIVE;
23433        $tokenMap[\T_MATCH] = Tokens::T_MATCH;
23434        $tokenMap[\T_NULLSAFE_OBJECT_OPERATOR] = Tokens::T_NULLSAFE_OBJECT_OPERATOR;
23435        $tokenMap[\T_ATTRIBUTE] = Tokens::T_ATTRIBUTE;
23436        $tokenMap[\T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG] = Tokens::T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG;
23437        $tokenMap[\T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG] = Tokens::T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG;
23438        $tokenMap[\T_ENUM] = Tokens::T_ENUM;
23439        $tokenMap[\T_READONLY] = Tokens::T_READONLY;
23440        return $tokenMap;
23441    }
23442    private function createIdentifierTokenMap() : array
23443    {
23444        // Based on semi_reserved production.
23445        return \array_fill_keys([\T_STRING, \T_STATIC, \T_ABSTRACT, \T_FINAL, \T_PRIVATE, \T_PROTECTED, \T_PUBLIC, \T_READONLY, \T_INCLUDE, \T_INCLUDE_ONCE, \T_EVAL, \T_REQUIRE, \T_REQUIRE_ONCE, \T_LOGICAL_OR, \T_LOGICAL_XOR, \T_LOGICAL_AND, \T_INSTANCEOF, \T_NEW, \T_CLONE, \T_EXIT, \T_IF, \T_ELSEIF, \T_ELSE, \T_ENDIF, \T_ECHO, \T_DO, \T_WHILE, \T_ENDWHILE, \T_FOR, \T_ENDFOR, \T_FOREACH, \T_ENDFOREACH, \T_DECLARE, \T_ENDDECLARE, \T_AS, \T_TRY, \T_CATCH, \T_FINALLY, \T_THROW, \T_USE, \T_INSTEADOF, \T_GLOBAL, \T_VAR, \T_UNSET, \T_ISSET, \T_EMPTY, \T_CONTINUE, \T_GOTO, \T_FUNCTION, \T_CONST, \T_RETURN, \T_PRINT, \T_YIELD, \T_LIST, \T_SWITCH, \T_ENDSWITCH, \T_CASE, \T_DEFAULT, \T_BREAK, \T_ARRAY, \T_CALLABLE, \T_EXTENDS, \T_IMPLEMENTS, \T_NAMESPACE, \T_TRAIT, \T_INTERFACE, \T_CLASS, \T_CLASS_C, \T_TRAIT_C, \T_FUNC_C, \T_METHOD_C, \T_LINE, \T_FILE, \T_DIR, \T_NS_C, \T_HALT_COMPILER, \T_FN, \T_MATCH], \true);
23446    }
23447}
23448<?php
23449
23450namespace PHPUnit\PhpParser\Parser;
23451
23452use PHPUnit\PhpParser\Error;
23453use PHPUnit\PhpParser\Node;
23454use PHPUnit\PhpParser\Node\Expr;
23455use PHPUnit\PhpParser\Node\Name;
23456use PHPUnit\PhpParser\Node\Scalar;
23457use PHPUnit\PhpParser\Node\Stmt;
23458/* This is an automatically GENERATED file, which should not be manually edited.
23459 * Instead edit one of the following:
23460 *  * the grammar files grammar/php5.y or grammar/php7.y
23461 *  * the skeleton file grammar/parser.template
23462 *  * the preprocessing script grammar/rebuildParsers.php
23463 */
23464class Php7 extends \PHPUnit\PhpParser\ParserAbstract
23465{
23466    protected $tokenToSymbolMapSize = 396;
23467    protected $actionTableSize = 1196;
23468    protected $gotoTableSize = 585;
23469    protected $invalidSymbol = 168;
23470    protected $errorSymbol = 1;
23471    protected $defaultAction = -32766;
23472    protected $unexpectedTokenRule = 32767;
23473    protected $YY2TBLSTATE = 419;
23474    protected $numNonLeafStates = 710;
23475    protected $symbolToName = array("EOF", "error", "T_THROW", "T_INCLUDE", "T_INCLUDE_ONCE", "T_EVAL", "T_REQUIRE", "T_REQUIRE_ONCE", "','", "T_LOGICAL_OR", "T_LOGICAL_XOR", "T_LOGICAL_AND", "T_PRINT", "T_YIELD", "T_DOUBLE_ARROW", "T_YIELD_FROM", "'='", "T_PLUS_EQUAL", "T_MINUS_EQUAL", "T_MUL_EQUAL", "T_DIV_EQUAL", "T_CONCAT_EQUAL", "T_MOD_EQUAL", "T_AND_EQUAL", "T_OR_EQUAL", "T_XOR_EQUAL", "T_SL_EQUAL", "T_SR_EQUAL", "T_POW_EQUAL", "T_COALESCE_EQUAL", "'?'", "':'", "T_COALESCE", "T_BOOLEAN_OR", "T_BOOLEAN_AND", "'|'", "'^'", "T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG", "T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG", "T_IS_EQUAL", "T_IS_NOT_EQUAL", "T_IS_IDENTICAL", "T_IS_NOT_IDENTICAL", "T_SPACESHIP", "'<'", "T_IS_SMALLER_OR_EQUAL", "'>'", "T_IS_GREATER_OR_EQUAL", "T_SL", "T_SR", "'+'", "'-'", "'.'", "'*'", "'/'", "'%'", "'!'", "T_INSTANCEOF", "'~'", "T_INC", "T_DEC", "T_INT_CAST", "T_DOUBLE_CAST", "T_STRING_CAST", "T_ARRAY_CAST", "T_OBJECT_CAST", "T_BOOL_CAST", "T_UNSET_CAST", "'@'", "T_POW", "'['", "T_NEW", "T_CLONE", "T_EXIT", "T_IF", "T_ELSEIF", "T_ELSE", "T_ENDIF", "T_LNUMBER", "T_DNUMBER", "T_STRING", "T_STRING_VARNAME", "T_VARIABLE", "T_NUM_STRING", "T_INLINE_HTML", "T_ENCAPSED_AND_WHITESPACE", "T_CONSTANT_ENCAPSED_STRING", "T_ECHO", "T_DO", "T_WHILE", "T_ENDWHILE", "T_FOR", "T_ENDFOR", "T_FOREACH", "T_ENDFOREACH", "T_DECLARE", "T_ENDDECLARE", "T_AS", "T_SWITCH", "T_MATCH", "T_ENDSWITCH", "T_CASE", "T_DEFAULT", "T_BREAK", "T_CONTINUE", "T_GOTO", "T_FUNCTION", "T_FN", "T_CONST", "T_RETURN", "T_TRY", "T_CATCH", "T_FINALLY", "T_USE", "T_INSTEADOF", "T_GLOBAL", "T_STATIC", "T_ABSTRACT", "T_FINAL", "T_PRIVATE", "T_PROTECTED", "T_PUBLIC", "T_READONLY", "T_VAR", "T_UNSET", "T_ISSET", "T_EMPTY", "T_HALT_COMPILER", "T_CLASS", "T_TRAIT", "T_INTERFACE", "T_ENUM", "T_EXTENDS", "T_IMPLEMENTS", "T_OBJECT_OPERATOR", "T_NULLSAFE_OBJECT_OPERATOR", "T_LIST", "T_ARRAY", "T_CALLABLE", "T_CLASS_C", "T_TRAIT_C", "T_METHOD_C", "T_FUNC_C", "T_LINE", "T_FILE", "T_START_HEREDOC", "T_END_HEREDOC", "T_DOLLAR_OPEN_CURLY_BRACES", "T_CURLY_OPEN", "T_PAAMAYIM_NEKUDOTAYIM", "T_NAMESPACE", "T_NS_C", "T_DIR", "T_NS_SEPARATOR", "T_ELLIPSIS", "T_NAME_FULLY_QUALIFIED", "T_NAME_QUALIFIED", "T_NAME_RELATIVE", "T_ATTRIBUTE", "';'", "']'", "'{'", "'}'", "'('", "')'", "'`'", "'\"'", "'\$'");
23476    protected $tokenToSymbol = array(0, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 56, 166, 168, 167, 55, 168, 168, 163, 164, 53, 50, 8, 51, 52, 54, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 31, 159, 44, 16, 46, 30, 68, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 70, 168, 160, 36, 168, 165, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 161, 35, 162, 58, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32, 33, 34, 37, 38, 39, 40, 41, 42, 43, 45, 47, 48, 49, 57, 59, 60, 61, 62, 63, 64, 65, 66, 67, 69, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158);
23477    protected $action = array(131, 132, 133, 569, 134, 135, 0, 722, 723, 724, 136, 36, 834, 911, 835, 468, -32766, -32766, -32766, -32767, -32767, -32767, -32767, 100, 101, 102, 103, 104, 1068, 1069, 1070, 1067, 1066, 1065, 1071, 716, 715, -32766, -32766, -32766, -32766, -32766, -32766, -32766, -32766, -32766, -32767, -32767, -32767, -32767, -32767, 545, 546, -32766, -32766, 725, -32766, -32766, -32766, 998, 999, 806, 922, 446, 447, 448, 369, 370, 2, 266, 137, 395, 729, 730, 731, 732, 413, -32766, 419, -32766, -32766, -32766, -32766, -32766, 990, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 763, 570, 764, 765, 766, 767, 755, 756, 335, 336, 758, 759, 744, 745, 746, 748, 749, 750, 345, 790, 791, 792, 793, 794, 795, 751, 752, 571, 572, 784, 775, 773, 774, 787, 770, 771, 282, 419, 573, 574, 769, 575, 576, 577, 578, 579, 580, 598, -575, 469, 491, 798, 772, 581, 582, -575, 138, -32766, -32766, -32766, 131, 132, 133, 569, 134, 135, 1017, 722, 723, 724, 136, 36, 1060, -32766, -32766, -32766, 1303, 696, -32766, 1304, -32766, -32766, -32766, -32766, -32766, -32766, -32766, 1068, 1069, 1070, 1067, 1066, 1065, 1071, -32766, 716, 715, 371, 370, 1258, -32766, -32766, -32766, -572, 105, 106, 107, 413, 269, 891, -572, 239, 1193, 1192, 1194, 725, -32766, -32766, -32766, 1046, 108, -32766, -32766, -32766, -32766, 986, 985, 984, 987, 266, 137, 395, 729, 730, 731, 732, 12, -32766, 419, -32766, -32766, -32766, -32766, 998, 999, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 763, 570, 764, 765, 766, 767, 755, 756, 335, 336, 758, 759, 744, 745, 746, 748, 749, 750, 345, 790, 791, 792, 793, 794, 795, 751, 752, 571, 572, 784, 775, 773, 774, 787, 770, 771, 881, 320, 573, 574, 769, 575, 576, 577, 578, 579, 580, -32766, 81, 82, 83, -575, 772, 581, 582, -575, 147, 747, 717, 718, 719, 720, 721, 1278, 722, 723, 724, 760, 761, 35, 1277, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 996, 269, 149, -32766, -32766, -32766, 454, 455, 80, 33, -264, -572, 1016, 108, 319, -572, 893, 725, 682, 803, 127, 998, 999, 592, -32766, 1044, -32766, -32766, -32766, 809, 150, 726, 727, 728, 729, 730, 731, 732, -88, 1198, 796, 277, -526, 282, -32766, -32766, -32766, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 763, 786, 764, 765, 766, 767, 755, 756, 757, 785, 758, 759, 744, 745, 746, 748, 749, 750, 789, 790, 791, 792, 793, 794, 795, 751, 752, 753, 754, 784, 775, 773, 774, 787, 770, 771, 143, 804, 762, 768, 769, 776, 777, 779, 778, 780, 781, -314, -526, -526, -193, -192, 772, 783, 782, 48, 49, 50, 500, 51, 52, 238, 807, -526, -86, 53, 54, -111, 55, 996, 252, -32766, -111, 800, -111, -526, 541, -532, -352, 299, -352, 303, -111, -111, -111, -111, -111, -111, -111, -111, 998, 999, 998, 999, 152, -32766, -32766, -32766, 1191, 807, 125, 305, 1293, 56, 57, 102, 103, 104, -111, 58, 1218, 59, 245, 246, 60, 61, 62, 63, 64, 65, 66, 67, -525, 26, 267, 68, 435, 501, -328, 808, -86, 1224, 1225, 502, 1189, 807, 1198, 1230, 292, 1222, 40, 23, 503, 73, 504, 953, 505, 319, 506, 802, 153, 507, 508, 278, 684, 279, 42, 43, 436, 366, 365, 891, 44, 509, 34, 248, -16, -566, 357, 331, 317, -566, 1198, 1193, 1192, 1194, -527, 510, 511, 512, 332, -524, 1274, 47, 716, 715, -525, -525, 333, 513, 514, 807, 1212, 1213, 1214, 1215, 1209, 1210, 291, 359, 283, -525, 284, -314, 1216, 1211, -193, -192, 1193, 1192, 1194, 292, 891, -525, 363, -531, 69, 807, 315, 316, 319, 30, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, -153, -153, -153, 638, 24, -527, -527, 687, 378, 881, -524, -524, 295, 296, 891, -153, 431, -153, 807, -153, -527, -153, 716, 715, 432, -524, 798, 362, -111, 1105, 1107, 364, -527, 433, 891, 139, 434, -524, 954, 126, -524, 319, -111, -111, 688, 813, 380, -529, 11, 834, 154, 835, 867, -111, -111, -111, -111, 46, 292, -32766, 881, 654, 655, 73, 689, 1191, 1045, 319, 708, 148, 398, 156, -32766, -32766, -32766, 31, -32766, -79, -32766, 122, -32766, 716, 715, -32766, 893, 891, 682, -153, -32766, -32766, -32766, 716, 715, 891, -32766, -32766, 123, 881, 128, 73, -32766, 410, 129, 319, -524, -524, 142, 140, -75, -32766, 157, -529, -529, 319, 26, 691, 158, 881, 159, -524, 160, 293, 294, 698, 367, 368, 807, -73, -32766, -72, 1222, -524, 372, 373, 1191, 893, -71, 682, -529, 72, -70, -32766, -32766, -32766, -69, -32766, -68, -32766, 124, -32766, 630, 631, -32766, -67, -66, -47, -51, -32766, -32766, -32766, -18, 146, 270, -32766, -32766, 276, 697, 700, 881, -32766, 410, 890, 893, 145, 682, 281, 881, 907, -32766, 280, 513, 514, 285, 1212, 1213, 1214, 1215, 1209, 1210, 325, 130, 144, 939, 286, 682, 1216, 1211, 108, 269, -32766, 798, 807, -32766, 662, 639, 1191, 657, 71, 675, 1075, 316, 319, -32766, -32766, -32766, 1305, -32766, 300, -32766, 628, -32766, 430, 543, -32766, -32766, 923, 555, 924, -32766, -32766, -32766, 1229, 549, -32766, -32766, -32766, -4, 891, -490, 1191, -32766, 410, 644, 893, 298, 682, -32766, -32766, -32766, -32766, -32766, 893, -32766, 682, -32766, 13, 1231, -32766, 451, 479, 645, 909, -32766, -32766, -32766, -32766, 658, -480, -32766, -32766, 0, 1191, 0, 0, -32766, 410, 0, 297, -32766, -32766, -32766, 304, -32766, -32766, -32766, 0, -32766, 0, 806, -32766, 0, 0, 0, 474, -32766, -32766, -32766, -32766, 0, 7, -32766, -32766, 15, 1191, 561, 596, -32766, 410, 1219, 891, -32766, -32766, -32766, 361, -32766, -32766, -32766, 818, -32766, -267, 881, -32766, 38, 292, 0, 0, -32766, -32766, -32766, 39, 705, 706, -32766, -32766, 872, 963, 940, 947, -32766, 410, 937, 948, 364, 870, 426, 891, 935, -32766, 1049, 290, 1244, 1052, 1053, -111, -111, 1050, 1051, 1057, -560, 1262, 1296, 633, 0, 826, -111, -111, -111, -111, 32, 314, -32766, 360, 683, 686, 690, 692, 1191, 693, 694, 695, 699, 685, 319, -32766, -32766, -32766, 9, -32766, 702, -32766, 868, -32766, 881, 1300, -32766, 893, 1302, 682, -4, -32766, -32766, -32766, 829, 828, 837, -32766, -32766, 916, -242, -242, -242, -32766, 410, 955, 364, 26, 836, 1301, 915, 917, -32766, 914, 1177, 900, 910, -111, -111, 807, 881, 898, 945, 1222, 946, 1299, 1256, 867, -111, -111, -111, -111, 1245, 1263, 1269, 1272, -241, -241, -241, -558, -532, -531, 364, -530, 1, 27, 28, 37, 41, 45, 70, 0, 74, -111, -111, 75, 76, 77, 78, 893, 79, 682, -242, 867, -111, -111, -111, -111, 141, 151, 155, 244, 321, 346, 514, 347, 1212, 1213, 1214, 1215, 1209, 1210, 348, 349, 350, 351, 352, 353, 1216, 1211, 354, 355, 356, 358, 427, 893, -265, 682, -241, -264, 71, 0, 17, 316, 319, 18, 19, 20, 22, 397, 470, 471, 478, 481, 482, 483, 484, 488, 489, 490, 498, 669, 1202, 1145, 1220, 1019, 1018, 1181, -269, -103, 16, 21, 25, 289, 396, 589, 593, 620, 674, 1149, 1197, 1146, 1275, 0, -494, 1162, 0, 1223);
23478    protected $actionCheck = array(2, 3, 4, 5, 6, 7, 0, 9, 10, 11, 12, 13, 106, 1, 108, 31, 9, 10, 11, 44, 45, 46, 47, 48, 49, 50, 51, 52, 116, 117, 118, 119, 120, 121, 122, 37, 38, 30, 116, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 117, 118, 9, 10, 57, 9, 10, 11, 137, 138, 155, 128, 129, 130, 131, 106, 107, 8, 71, 72, 73, 74, 75, 76, 77, 116, 30, 80, 32, 33, 34, 35, 36, 1, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 30, 80, 136, 137, 138, 139, 140, 141, 142, 143, 144, 51, 1, 161, 101, 80, 150, 151, 152, 8, 154, 9, 10, 11, 2, 3, 4, 5, 6, 7, 164, 9, 10, 11, 12, 13, 123, 9, 10, 11, 80, 161, 30, 83, 32, 33, 34, 35, 36, 37, 38, 116, 117, 118, 119, 120, 121, 122, 30, 37, 38, 106, 107, 1, 9, 10, 11, 1, 53, 54, 55, 116, 57, 1, 8, 14, 155, 156, 157, 57, 9, 10, 11, 162, 69, 30, 116, 32, 33, 119, 120, 121, 122, 71, 72, 73, 74, 75, 76, 77, 8, 30, 80, 32, 33, 34, 35, 137, 138, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 84, 70, 136, 137, 138, 139, 140, 141, 142, 143, 144, 9, 9, 10, 11, 160, 150, 151, 152, 164, 154, 2, 3, 4, 5, 6, 7, 1, 9, 10, 11, 12, 13, 30, 8, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 116, 57, 14, 9, 10, 11, 134, 135, 161, 8, 164, 160, 1, 69, 167, 164, 159, 57, 161, 80, 8, 137, 138, 1, 30, 1, 32, 33, 34, 1, 14, 71, 72, 73, 74, 75, 76, 77, 31, 1, 80, 30, 70, 30, 9, 10, 11, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 8, 156, 136, 137, 138, 139, 140, 141, 142, 143, 144, 8, 134, 135, 8, 8, 150, 151, 152, 2, 3, 4, 5, 6, 7, 97, 82, 149, 31, 12, 13, 101, 15, 116, 8, 116, 106, 80, 108, 161, 85, 163, 106, 113, 108, 8, 116, 117, 118, 119, 120, 121, 122, 123, 137, 138, 137, 138, 14, 9, 10, 11, 80, 82, 14, 8, 85, 50, 51, 50, 51, 52, 128, 56, 1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 70, 70, 71, 72, 73, 74, 162, 159, 97, 78, 79, 80, 116, 82, 1, 146, 158, 86, 87, 88, 89, 163, 91, 31, 93, 167, 95, 156, 14, 98, 99, 35, 161, 37, 103, 104, 105, 106, 107, 1, 109, 110, 147, 148, 31, 160, 115, 116, 8, 164, 1, 155, 156, 157, 70, 124, 125, 126, 8, 70, 1, 70, 37, 38, 134, 135, 8, 136, 137, 82, 139, 140, 141, 142, 143, 144, 145, 8, 35, 149, 37, 164, 151, 152, 164, 164, 155, 156, 157, 158, 1, 161, 8, 163, 163, 82, 165, 166, 167, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 75, 76, 77, 75, 76, 134, 135, 31, 8, 84, 134, 135, 134, 135, 1, 90, 8, 92, 82, 94, 149, 96, 37, 38, 8, 149, 80, 149, 128, 59, 60, 106, 161, 8, 1, 161, 8, 161, 159, 161, 70, 167, 117, 118, 31, 8, 106, 70, 108, 106, 14, 108, 127, 128, 129, 130, 131, 70, 158, 74, 84, 75, 76, 163, 31, 80, 159, 167, 161, 101, 102, 14, 87, 88, 89, 14, 91, 31, 93, 16, 95, 37, 38, 98, 159, 1, 161, 162, 103, 104, 105, 37, 38, 1, 109, 110, 16, 84, 16, 163, 115, 116, 16, 167, 134, 135, 16, 161, 31, 124, 16, 134, 135, 167, 70, 31, 16, 84, 16, 149, 16, 134, 135, 31, 106, 107, 82, 31, 74, 31, 86, 161, 106, 107, 80, 159, 31, 161, 161, 154, 31, 87, 88, 89, 31, 91, 31, 93, 161, 95, 111, 112, 98, 31, 31, 31, 31, 103, 104, 105, 31, 31, 31, 109, 110, 31, 31, 31, 84, 115, 116, 31, 159, 31, 161, 37, 84, 38, 124, 35, 136, 137, 35, 139, 140, 141, 142, 143, 144, 35, 31, 70, 159, 37, 161, 151, 152, 69, 57, 74, 80, 82, 85, 77, 90, 80, 94, 163, 92, 82, 166, 167, 87, 88, 89, 83, 91, 114, 93, 113, 95, 128, 85, 98, 116, 128, 153, 128, 103, 104, 105, 146, 89, 74, 109, 110, 0, 1, 149, 80, 115, 116, 96, 159, 133, 161, 87, 88, 89, 124, 91, 159, 93, 161, 95, 97, 146, 98, 97, 97, 100, 154, 103, 104, 105, 74, 100, 149, 109, 110, -1, 80, -1, -1, 115, 116, -1, 132, 87, 88, 89, 132, 91, 124, 93, -1, 95, -1, 155, 98, -1, -1, -1, 102, 103, 104, 105, 74, -1, 149, 109, 110, 149, 80, 81, 153, 115, 116, 160, 1, 87, 88, 89, 149, 91, 124, 93, 160, 95, 164, 84, 98, 159, 158, -1, -1, 103, 104, 105, 159, 159, 159, 109, 110, 159, 159, 159, 159, 115, 116, 159, 159, 106, 159, 108, 1, 159, 124, 159, 113, 160, 159, 159, 117, 118, 159, 159, 159, 163, 160, 160, 160, -1, 127, 128, 129, 130, 131, 161, 161, 74, 161, 161, 161, 161, 161, 80, 161, 161, 161, 161, 161, 167, 87, 88, 89, 150, 91, 162, 93, 162, 95, 84, 162, 98, 159, 162, 161, 162, 103, 104, 105, 162, 162, 162, 109, 110, 162, 100, 101, 102, 115, 116, 162, 106, 70, 162, 162, 162, 162, 124, 162, 162, 162, 162, 117, 118, 82, 84, 162, 162, 86, 162, 162, 162, 127, 128, 129, 130, 131, 162, 162, 162, 162, 100, 101, 102, 163, 163, 163, 106, 163, 163, 163, 163, 163, 163, 163, 163, -1, 163, 117, 118, 163, 163, 163, 163, 159, 163, 161, 162, 127, 128, 129, 130, 131, 163, 163, 163, 163, 163, 163, 137, 163, 139, 140, 141, 142, 143, 144, 163, 163, 163, 163, 163, 163, 151, 152, 163, 163, 163, 163, 163, 159, 164, 161, 162, 164, 163, -1, 164, 166, 167, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, -1, 165, 165, -1, 166);
23479    protected $actionBase = array(0, -2, 154, 565, 876, 948, 984, 514, 53, 398, 837, 307, 307, 67, 307, 307, 653, 724, 724, 732, 724, 616, 673, 204, 204, 204, 625, 625, 625, 625, 694, 694, 831, 831, 863, 799, 765, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, 375, 519, 369, 701, 1017, 1023, 1019, 1024, 1015, 1014, 1018, 1020, 1025, 911, 912, 782, 918, 919, 920, 921, 1021, 841, 1016, 1022, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 290, 491, 44, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 160, 160, 160, 187, 684, 684, 341, 203, 610, 47, 985, 985, 985, 985, 985, 985, 985, 985, 985, 985, 144, 144, 7, 7, 7, 7, 7, 371, -25, -25, -25, -25, 540, 385, 102, 576, 358, 45, 377, 460, 460, 360, 231, 231, 231, 231, 231, 231, -78, -78, -78, -78, -78, -66, 319, 457, -94, 396, 423, 586, 586, 586, 586, 423, 423, 423, 423, 750, 1029, 423, 423, 423, 511, 516, 516, 518, 147, 147, 147, 516, 583, 777, 422, 583, 422, 194, 92, 748, -40, 87, 412, 748, 617, 627, 198, 143, 773, 658, 773, 1013, 757, 764, 717, 838, 860, 1026, 800, 908, 806, 910, 219, 686, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 855, 552, 1013, 286, 855, 855, 855, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 679, 286, 568, 626, 286, 794, 552, 375, 758, 375, 375, 375, 375, 958, 375, 375, 375, 375, 375, 375, 970, 769, -16, 375, 519, 12, 12, 547, 83, 12, 12, 12, 12, 375, 375, 375, 658, 781, 713, 666, 792, 448, 781, 781, 781, 438, 444, 193, 447, 570, 523, 580, 760, 760, 767, 929, 929, 760, 759, 760, 767, 934, 760, 929, 805, 359, 648, 577, 611, 656, 929, 478, 760, 760, 760, 760, 665, 760, 467, 433, 760, 760, 785, 774, 789, 60, 929, 929, 929, 789, 596, 751, 751, 751, 811, 812, 746, 771, 567, 498, 677, 348, 779, 771, 771, 760, 640, 746, 771, 746, 771, 747, 771, 771, 771, 746, 771, 760, 759, 585, 771, 734, 668, 224, 771, 6, 935, 937, 354, 940, 932, 941, 979, 942, 943, 851, 956, 933, 945, 931, 930, 780, 703, 720, 790, 729, 928, 768, 768, 768, 925, 768, 768, 768, 768, 768, 768, 768, 768, 703, 788, 804, 733, 783, 960, 722, 726, 725, 868, 1027, 1028, 737, 739, 958, 1006, 953, 803, 730, 992, 967, 866, 848, 968, 969, 993, 1007, 1008, 871, 761, 874, 880, 797, 971, 852, 768, 935, 943, 933, 945, 931, 930, 763, 762, 753, 755, 749, 745, 736, 738, 770, 1009, 924, 835, 830, 970, 926, 703, 839, 986, 847, 994, 995, 850, 801, 772, 840, 881, 972, 975, 976, 853, 1010, 810, 989, 795, 996, 802, 882, 997, 998, 999, 1000, 885, 854, 856, 857, 815, 754, 980, 786, 891, 335, 787, 796, 978, 363, 957, 858, 894, 895, 1001, 1002, 1003, 896, 954, 816, 990, 752, 991, 983, 817, 818, 485, 784, 778, 541, 676, 897, 899, 900, 955, 775, 766, 821, 822, 1011, 901, 697, 824, 740, 902, 1005, 742, 744, 756, 859, 793, 743, 798, 977, 776, 827, 907, 829, 832, 833, 1004, 836, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 458, 458, 458, 458, 458, 458, 307, 307, 307, 307, 0, 0, 307, 0, 0, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 423, 423, 291, 291, 0, 291, 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, 291, 291, 291, 291, 291, 291, 291, 805, 147, 147, 147, 147, 423, 423, 423, 423, 423, -88, -88, 147, 147, 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, 0, 0, 0, 286, 422, 0, 759, 759, 759, 759, 0, 0, 0, 0, 422, 422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 286, 422, 0, 286, 0, 759, 759, 423, 805, 805, 314, 423, 0, 0, 0, 0, 286, 759, 286, 552, 422, 552, 552, 12, 375, 314, 608, 608, 608, 608, 0, 658, 805, 805, 805, 805, 805, 805, 805, 805, 805, 805, 805, 759, 0, 805, 0, 759, 759, 759, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 759, 0, 0, 929, 0, 0, 0, 0, 760, 0, 0, 0, 0, 0, 0, 760, 934, 0, 0, 0, 0, 0, 0, 759, 0, 0, 0, 0, 0, 0, 0, 0, 768, 801, 0, 801, 0, 768, 768, 768);
23480    protected $actionDefault = array(3, 32767, 103, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 101, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 578, 578, 578, 578, 32767, 32767, 246, 103, 32767, 32767, 454, 372, 372, 372, 32767, 32767, 522, 522, 522, 522, 522, 522, 32767, 32767, 32767, 32767, 32767, 32767, 454, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 101, 32767, 32767, 32767, 37, 7, 8, 10, 11, 50, 17, 310, 32767, 32767, 32767, 32767, 103, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 571, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 458, 437, 438, 440, 441, 371, 523, 577, 313, 574, 370, 146, 325, 315, 234, 316, 250, 459, 251, 460, 463, 464, 211, 279, 367, 150, 401, 455, 403, 453, 457, 402, 377, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 375, 376, 456, 434, 433, 432, 399, 32767, 32767, 400, 404, 374, 407, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 103, 32767, 405, 406, 423, 424, 421, 422, 425, 32767, 426, 427, 428, 429, 32767, 32767, 302, 32767, 32767, 351, 349, 414, 415, 302, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 516, 431, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 103, 32767, 101, 518, 396, 398, 486, 409, 410, 408, 378, 32767, 493, 32767, 103, 495, 32767, 32767, 32767, 112, 32767, 32767, 32767, 517, 32767, 524, 524, 32767, 479, 101, 194, 32767, 194, 194, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 585, 479, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 32767, 194, 111, 32767, 32767, 32767, 101, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 189, 32767, 260, 262, 103, 539, 194, 32767, 498, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 491, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 479, 419, 139, 32767, 139, 524, 411, 412, 413, 481, 524, 524, 524, 298, 281, 32767, 32767, 32767, 32767, 496, 496, 101, 101, 101, 101, 491, 32767, 32767, 112, 100, 100, 100, 100, 100, 104, 102, 32767, 32767, 32767, 32767, 100, 32767, 102, 102, 32767, 32767, 217, 208, 215, 102, 32767, 543, 544, 215, 102, 219, 219, 219, 239, 239, 470, 304, 102, 100, 102, 102, 196, 304, 304, 32767, 102, 470, 304, 470, 304, 198, 304, 304, 304, 470, 304, 32767, 32767, 102, 304, 210, 100, 100, 304, 32767, 32767, 32767, 481, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 511, 32767, 528, 541, 417, 418, 420, 526, 442, 443, 444, 445, 446, 447, 448, 450, 573, 32767, 485, 32767, 32767, 32767, 32767, 324, 583, 32767, 583, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 584, 32767, 524, 32767, 32767, 32767, 32767, 416, 9, 76, 43, 44, 52, 58, 502, 503, 504, 505, 499, 500, 506, 501, 32767, 32767, 507, 549, 32767, 32767, 525, 576, 32767, 32767, 32767, 32767, 32767, 32767, 139, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 511, 32767, 137, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 524, 32767, 32767, 32767, 300, 301, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 524, 32767, 32767, 32767, 283, 284, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 278, 32767, 32767, 366, 32767, 32767, 32767, 32767, 345, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 152, 152, 3, 3, 327, 152, 152, 152, 327, 152, 327, 327, 327, 152, 152, 152, 152, 152, 152, 272, 184, 254, 257, 239, 239, 152, 337, 152);
23481    protected $goto = array(193, 193, 670, 421, 643, 1022, 1290, 1290, 824, 415, 307, 308, 328, 563, 313, 420, 329, 422, 622, 801, 678, 341, 586, 1290, 825, 164, 164, 164, 164, 217, 194, 190, 190, 174, 176, 212, 190, 190, 190, 190, 190, 191, 191, 191, 191, 191, 191, 185, 186, 187, 188, 189, 214, 212, 215, 521, 522, 411, 523, 525, 526, 527, 528, 529, 530, 531, 532, 1091, 165, 166, 167, 192, 168, 169, 170, 163, 171, 172, 173, 175, 211, 213, 216, 234, 237, 240, 241, 243, 254, 255, 256, 257, 258, 259, 260, 262, 263, 264, 265, 273, 274, 310, 311, 312, 416, 417, 418, 568, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 177, 233, 178, 195, 196, 197, 235, 185, 186, 187, 188, 189, 214, 1091, 198, 179, 180, 181, 199, 195, 182, 236, 200, 198, 162, 201, 202, 183, 203, 204, 205, 184, 206, 207, 208, 209, 210, 322, 322, 322, 322, 827, 608, 608, 858, 547, 538, 1186, 1221, 1221, 1221, 1221, 1221, 1221, 1221, 1221, 1221, 1221, 1239, 1239, 462, 1264, 1265, 799, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 387, 538, 547, 556, 557, 394, 566, 588, 602, 603, 832, 938, 880, 875, 876, 889, 14, 833, 877, 830, 878, 879, 831, 453, 453, 884, 883, 885, 1187, 250, 250, 560, 453, 1237, 1237, 815, 1043, 1039, 1040, 1237, 1237, 1237, 1237, 1237, 1237, 1237, 1237, 1237, 1237, 820, 820, 1188, 1247, 1248, 247, 247, 247, 247, 249, 251, 342, 343, 339, 1190, 1190, 997, 1190, 997, 1279, 930, 401, 677, 997, 997, 997, 997, 997, 997, 997, 997, 997, 997, 997, 997, 1261, 1261, 414, 1261, 597, 1190, 287, 287, 287, 287, 1190, 1190, 1190, 1190, 959, 344, 1190, 1190, 1190, 1271, 1271, 1271, 1271, 606, 640, 344, 344, 1273, 1273, 1273, 1273, 1063, 1064, 637, 896, 651, 652, 653, 897, 344, 344, 383, 344, 486, 1306, 487, 535, 535, 5, 535, 6, 494, 559, 1257, 1140, 540, 524, 524, 344, 318, 302, 642, 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, 444, 1266, 1267, 618, 619, 932, 932, 932, 932, 820, 428, 444, 926, 933, 330, 533, 533, 533, 533, 1030, 590, 817, 554, 1259, 1259, 1030, 704, 621, 623, 845, 641, 1250, 805, 393, 660, 664, 973, 668, 676, 969, 1183, 553, 842, 823, 1289, 1289, 564, 600, 601, 385, 389, 548, 587, 591, 663, 962, 936, 936, 934, 936, 703, 1289, 537, 971, 966, 438, 901, 1079, 981, 1028, 438, 438, 805, 605, 805, 707, 854, 1292, 978, 463, 539, 551, 1074, 467, 540, 539, 844, 551, 646, 957, 386, 1171, 912, 1032, 838, 1172, 1175, 913, 1176, 943, 567, 456, 457, 458, 0, 850, 0, 1182, 1297, 1298, 253, 253, 0, 399, 400, 0, 0, 0, 649, 0, 650, 423, 403, 404, 405, 840, 661, 0, 423, 0, 406, 0, 0, 848, 337, 1009, 1002, 1006, 1003, 1007, 852, 0, 0, 839, 1185, 495, 0, 0, 0, 0, 438, 438, 438, 438, 438, 438, 438, 438, 438, 438, 438, 0, 0, 438, 595, 609, 612, 613, 614, 615, 634, 635, 636, 680, 853, 841, 1027, 1031, 585, 1056, 0, 681, 667, 667, 941, 673, 1054, 0, 0, 0, 0, 0, 271, 0, 0, 0, 0, 536, 536, 919, 992, 1000, 1004, 1001, 1005, 0, 0, 931, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 976, 976, 0, 1072, 857);
23482    protected $gotoCheck = array(42, 42, 72, 65, 65, 119, 173, 173, 26, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 7, 9, 93, 122, 173, 27, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 23, 23, 23, 23, 15, 104, 104, 45, 75, 75, 20, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 160, 160, 166, 166, 166, 6, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 15, 49, 15, 15, 15, 15, 75, 15, 15, 15, 15, 15, 15, 141, 141, 64, 15, 64, 20, 5, 5, 162, 141, 161, 161, 20, 15, 15, 15, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 22, 22, 20, 20, 20, 5, 5, 5, 5, 5, 5, 93, 93, 169, 72, 72, 72, 72, 72, 171, 89, 89, 89, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 122, 122, 13, 122, 13, 72, 24, 24, 24, 24, 72, 72, 72, 72, 99, 14, 72, 72, 72, 9, 9, 9, 9, 55, 55, 14, 14, 122, 122, 122, 122, 136, 136, 84, 72, 84, 84, 84, 72, 14, 14, 61, 14, 147, 14, 147, 19, 19, 46, 19, 46, 147, 100, 122, 143, 14, 163, 163, 14, 159, 159, 63, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 19, 168, 168, 83, 83, 19, 19, 19, 19, 22, 109, 19, 19, 19, 29, 103, 103, 103, 103, 122, 103, 18, 48, 122, 122, 122, 48, 48, 48, 39, 48, 14, 12, 28, 48, 48, 48, 48, 48, 48, 152, 9, 37, 25, 172, 172, 2, 2, 9, 58, 58, 58, 58, 58, 14, 25, 25, 25, 25, 25, 25, 172, 25, 25, 25, 23, 17, 17, 106, 121, 23, 23, 12, 17, 12, 95, 41, 172, 17, 149, 9, 9, 139, 82, 14, 9, 17, 9, 17, 17, 9, 78, 78, 124, 17, 78, 78, 78, 78, 92, 9, 9, 9, 9, -1, 9, -1, 17, 9, 9, 5, 5, -1, 80, 80, -1, -1, -1, 80, -1, 80, 113, 80, 80, 80, 35, 80, -1, 113, -1, 80, -1, -1, 9, 80, 113, 113, 113, 113, 113, 35, -1, -1, 35, 14, 9, -1, -1, -1, -1, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, -1, -1, 23, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 16, 16, 16, 16, 8, 8, -1, 8, 8, 8, 16, 8, 8, -1, -1, -1, -1, -1, 24, -1, -1, -1, -1, 24, 24, 87, 87, 87, 87, 87, 87, -1, -1, 16, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, 103, -1, 16, 16);
23483    protected $gotoBase = array(0, 0, -285, 0, 0, 225, 173, 10, 524, 7, 0, 0, 95, -47, 5, -174, 87, -33, 71, 61, -212, 0, -76, 157, 284, 392, 4, 20, 56, 77, 0, 0, 0, 0, 0, 118, 0, 63, 0, 65, 0, -2, -1, 0, 0, 155, -378, 0, -308, 186, 0, 0, 0, 0, 0, 266, 0, 0, 359, 0, 0, 282, 0, 103, 204, -235, 0, 0, 0, 0, 0, 0, -6, 0, 0, -167, 0, 0, 45, 170, -11, 0, -27, -110, -376, 0, 0, 276, 0, -32, 0, 0, 19, -448, 0, 30, 0, 0, 0, 262, 292, 0, 0, 342, -73, 0, 62, 0, 0, 88, 0, 0, 0, 206, 0, 0, 0, 0, 0, 3, 0, 59, 15, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 1, 0, 188, 0, 66, 0, 0, 0, -157, 0, 2, 0, 0, 35, 0, 0, 0, 0, 0, 0, 25, -57, -8, 201, 99, 0, 0, -111, 0, -7, 231, 0, 236, 96, -295, 0, 0);
23484    protected $gotoDefault = array(-32768, 499, 711, 4, 712, 905, 788, 797, 583, 515, 679, 338, 610, 412, 1255, 882, 1078, 565, 816, 1199, 1207, 445, 819, 323, 701, 864, 865, 866, 390, 375, 381, 388, 632, 611, 480, 851, 441, 843, 472, 846, 440, 855, 161, 409, 497, 859, 3, 861, 542, 892, 376, 869, 377, 656, 871, 550, 873, 874, 384, 391, 392, 1083, 558, 607, 886, 242, 552, 887, 374, 888, 895, 379, 382, 665, 452, 492, 485, 402, 1058, 594, 629, 449, 466, 617, 616, 604, 465, 424, 407, 928, 473, 450, 942, 340, 950, 709, 1090, 624, 475, 958, 625, 965, 968, 516, 517, 464, 980, 268, 983, 476, 1015, 647, 648, 995, 626, 627, 1013, 459, 584, 1021, 442, 1029, 1243, 443, 1033, 261, 1036, 275, 408, 425, 1041, 1042, 8, 1048, 671, 672, 10, 272, 496, 1073, 666, 439, 1089, 429, 1159, 1161, 544, 477, 1179, 1178, 659, 493, 1184, 1246, 437, 518, 460, 309, 519, 301, 326, 306, 534, 288, 327, 520, 461, 1252, 1260, 324, 29, 1280, 1291, 334, 562, 599);
23485    protected $ruleToNonTerminal = array(0, 1, 3, 3, 2, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 9, 10, 11, 11, 11, 12, 12, 13, 13, 14, 15, 15, 16, 16, 17, 17, 18, 18, 21, 21, 22, 23, 23, 24, 24, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 29, 29, 30, 30, 32, 34, 34, 28, 36, 36, 33, 38, 38, 35, 35, 37, 37, 39, 39, 31, 40, 40, 41, 43, 44, 44, 45, 46, 46, 48, 47, 47, 47, 47, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 25, 25, 68, 68, 71, 71, 70, 69, 69, 62, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 26, 26, 27, 27, 27, 27, 86, 86, 88, 88, 81, 81, 81, 82, 82, 85, 85, 83, 83, 89, 90, 90, 56, 56, 64, 64, 67, 67, 67, 66, 91, 91, 92, 57, 57, 57, 57, 93, 93, 94, 94, 95, 95, 96, 97, 97, 98, 98, 99, 99, 54, 54, 50, 50, 101, 52, 52, 102, 51, 51, 53, 53, 63, 63, 63, 63, 79, 79, 105, 105, 107, 107, 108, 108, 108, 108, 106, 106, 106, 110, 110, 110, 110, 87, 87, 113, 113, 113, 111, 111, 114, 114, 112, 112, 115, 115, 116, 116, 116, 116, 109, 109, 80, 80, 80, 20, 20, 20, 118, 117, 117, 119, 119, 119, 119, 59, 120, 120, 121, 60, 123, 123, 124, 124, 125, 125, 84, 126, 126, 126, 126, 126, 126, 131, 131, 132, 132, 133, 133, 133, 133, 133, 134, 135, 135, 130, 130, 127, 127, 129, 129, 137, 137, 136, 136, 136, 136, 136, 136, 136, 128, 138, 138, 140, 139, 139, 61, 100, 141, 141, 55, 55, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 148, 142, 142, 147, 147, 150, 151, 151, 152, 153, 153, 153, 19, 19, 72, 72, 72, 72, 143, 143, 143, 143, 155, 155, 144, 144, 146, 146, 146, 149, 149, 160, 160, 160, 160, 160, 160, 160, 160, 160, 161, 161, 104, 163, 163, 163, 163, 145, 145, 145, 145, 145, 145, 145, 145, 58, 58, 158, 158, 158, 158, 164, 164, 154, 154, 154, 165, 165, 165, 165, 165, 165, 73, 73, 65, 65, 65, 65, 122, 122, 122, 122, 168, 167, 157, 157, 157, 157, 157, 157, 157, 156, 156, 156, 166, 166, 166, 166, 103, 162, 170, 170, 169, 169, 171, 171, 171, 171, 171, 171, 171, 171, 159, 159, 159, 159, 173, 174, 172, 172, 172, 172, 172, 172, 172, 172, 175, 175, 175, 175);
23486    protected $ruleToLength = array(1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 2, 1, 3, 4, 1, 2, 0, 1, 1, 1, 1, 1, 3, 5, 4, 3, 4, 2, 3, 1, 1, 7, 6, 2, 3, 1, 2, 3, 1, 2, 3, 1, 1, 3, 1, 3, 1, 2, 2, 3, 1, 3, 2, 3, 1, 3, 2, 0, 1, 1, 1, 1, 1, 3, 7, 10, 5, 7, 9, 5, 3, 3, 3, 3, 3, 3, 1, 2, 5, 7, 9, 6, 5, 6, 3, 2, 1, 1, 1, 0, 2, 1, 3, 8, 0, 4, 2, 1, 3, 0, 1, 0, 1, 0, 1, 3, 1, 8, 9, 8, 7, 6, 8, 0, 2, 0, 2, 1, 2, 2, 0, 2, 0, 2, 0, 2, 2, 1, 3, 1, 4, 1, 4, 1, 1, 4, 2, 1, 3, 3, 3, 4, 4, 5, 0, 2, 4, 3, 1, 1, 7, 0, 2, 1, 3, 3, 4, 1, 4, 0, 2, 5, 0, 2, 6, 0, 2, 0, 3, 1, 2, 1, 1, 2, 0, 1, 3, 0, 2, 1, 1, 1, 1, 6, 8, 6, 1, 2, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 1, 2, 1, 1, 0, 1, 0, 2, 2, 2, 4, 3, 1, 1, 3, 1, 2, 2, 3, 2, 3, 1, 1, 2, 3, 1, 1, 3, 2, 0, 1, 5, 5, 10, 3, 5, 1, 1, 3, 0, 2, 4, 5, 4, 4, 4, 3, 1, 1, 1, 1, 1, 1, 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 3, 1, 1, 3, 2, 2, 3, 1, 0, 1, 1, 3, 3, 3, 4, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 4, 3, 4, 4, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, 2, 1, 2, 4, 2, 2, 8, 9, 8, 9, 9, 10, 9, 10, 8, 3, 2, 0, 4, 2, 1, 3, 2, 2, 2, 4, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 0, 3, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 4, 1, 1, 3, 1, 1, 1, 1, 1, 3, 2, 3, 0, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 4, 4, 1, 4, 4, 0, 1, 1, 1, 3, 3, 1, 4, 2, 2, 1, 3, 1, 4, 4, 3, 3, 3, 3, 1, 3, 1, 1, 3, 1, 1, 4, 1, 1, 1, 3, 1, 1, 2, 1, 3, 4, 3, 2, 0, 2, 2, 1, 2, 1, 1, 1, 4, 3, 3, 3, 3, 6, 3, 1, 1, 2, 1);
23487    protected function initReduceCallbacks()
23488    {
23489        $this->reduceCallbacks = [0 => function ($stackPos) {
23490            $this->semValue = $this->semStack[$stackPos];
23491        }, 1 => function ($stackPos) {
23492            $this->semValue = $this->handleNamespaces($this->semStack[$stackPos - (1 - 1)]);
23493        }, 2 => function ($stackPos) {
23494            if (\is_array($this->semStack[$stackPos - (2 - 2)])) {
23495                $this->semValue = \array_merge($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)]);
23496            } else {
23497                $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
23498                $this->semValue = $this->semStack[$stackPos - (2 - 1)];
23499            }
23500        }, 3 => function ($stackPos) {
23501            $this->semValue = array();
23502        }, 4 => function ($stackPos) {
23503            $startAttributes = $this->lookaheadStartAttributes;
23504            if (isset($startAttributes['comments'])) {
23505                $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments']));
23506            } else {
23507                $nop = null;
23508            }
23509            if ($nop !== null) {
23510                $this->semStack[$stackPos - (1 - 1)][] = $nop;
23511            }
23512            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
23513        }, 5 => function ($stackPos) {
23514            $this->semValue = $this->semStack[$stackPos];
23515        }, 6 => function ($stackPos) {
23516            $this->semValue = $this->semStack[$stackPos];
23517        }, 7 => function ($stackPos) {
23518            $this->semValue = $this->semStack[$stackPos];
23519        }, 8 => function ($stackPos) {
23520            $this->semValue = $this->semStack[$stackPos];
23521        }, 9 => function ($stackPos) {
23522            $this->semValue = $this->semStack[$stackPos];
23523        }, 10 => function ($stackPos) {
23524            $this->semValue = $this->semStack[$stackPos];
23525        }, 11 => function ($stackPos) {
23526            $this->semValue = $this->semStack[$stackPos];
23527        }, 12 => function ($stackPos) {
23528            $this->semValue = $this->semStack[$stackPos];
23529        }, 13 => function ($stackPos) {
23530            $this->semValue = $this->semStack[$stackPos];
23531        }, 14 => function ($stackPos) {
23532            $this->semValue = $this->semStack[$stackPos];
23533        }, 15 => function ($stackPos) {
23534            $this->semValue = $this->semStack[$stackPos];
23535        }, 16 => function ($stackPos) {
23536            $this->semValue = $this->semStack[$stackPos];
23537        }, 17 => function ($stackPos) {
23538            $this->semValue = $this->semStack[$stackPos];
23539        }, 18 => function ($stackPos) {
23540            $this->semValue = $this->semStack[$stackPos];
23541        }, 19 => function ($stackPos) {
23542            $this->semValue = $this->semStack[$stackPos];
23543        }, 20 => function ($stackPos) {
23544            $this->semValue = $this->semStack[$stackPos];
23545        }, 21 => function ($stackPos) {
23546            $this->semValue = $this->semStack[$stackPos];
23547        }, 22 => function ($stackPos) {
23548            $this->semValue = $this->semStack[$stackPos];
23549        }, 23 => function ($stackPos) {
23550            $this->semValue = $this->semStack[$stackPos];
23551        }, 24 => function ($stackPos) {
23552            $this->semValue = $this->semStack[$stackPos];
23553        }, 25 => function ($stackPos) {
23554            $this->semValue = $this->semStack[$stackPos];
23555        }, 26 => function ($stackPos) {
23556            $this->semValue = $this->semStack[$stackPos];
23557        }, 27 => function ($stackPos) {
23558            $this->semValue = $this->semStack[$stackPos];
23559        }, 28 => function ($stackPos) {
23560            $this->semValue = $this->semStack[$stackPos];
23561        }, 29 => function ($stackPos) {
23562            $this->semValue = $this->semStack[$stackPos];
23563        }, 30 => function ($stackPos) {
23564            $this->semValue = $this->semStack[$stackPos];
23565        }, 31 => function ($stackPos) {
23566            $this->semValue = $this->semStack[$stackPos];
23567        }, 32 => function ($stackPos) {
23568            $this->semValue = $this->semStack[$stackPos];
23569        }, 33 => function ($stackPos) {
23570            $this->semValue = $this->semStack[$stackPos];
23571        }, 34 => function ($stackPos) {
23572            $this->semValue = $this->semStack[$stackPos];
23573        }, 35 => function ($stackPos) {
23574            $this->semValue = $this->semStack[$stackPos];
23575        }, 36 => function ($stackPos) {
23576            $this->semValue = $this->semStack[$stackPos];
23577        }, 37 => function ($stackPos) {
23578            $this->semValue = $this->semStack[$stackPos];
23579        }, 38 => function ($stackPos) {
23580            $this->semValue = $this->semStack[$stackPos];
23581        }, 39 => function ($stackPos) {
23582            $this->semValue = $this->semStack[$stackPos];
23583        }, 40 => function ($stackPos) {
23584            $this->semValue = $this->semStack[$stackPos];
23585        }, 41 => function ($stackPos) {
23586            $this->semValue = $this->semStack[$stackPos];
23587        }, 42 => function ($stackPos) {
23588            $this->semValue = $this->semStack[$stackPos];
23589        }, 43 => function ($stackPos) {
23590            $this->semValue = $this->semStack[$stackPos];
23591        }, 44 => function ($stackPos) {
23592            $this->semValue = $this->semStack[$stackPos];
23593        }, 45 => function ($stackPos) {
23594            $this->semValue = $this->semStack[$stackPos];
23595        }, 46 => function ($stackPos) {
23596            $this->semValue = $this->semStack[$stackPos];
23597        }, 47 => function ($stackPos) {
23598            $this->semValue = $this->semStack[$stackPos];
23599        }, 48 => function ($stackPos) {
23600            $this->semValue = $this->semStack[$stackPos];
23601        }, 49 => function ($stackPos) {
23602            $this->semValue = $this->semStack[$stackPos];
23603        }, 50 => function ($stackPos) {
23604            $this->semValue = $this->semStack[$stackPos];
23605        }, 51 => function ($stackPos) {
23606            $this->semValue = $this->semStack[$stackPos];
23607        }, 52 => function ($stackPos) {
23608            $this->semValue = $this->semStack[$stackPos];
23609        }, 53 => function ($stackPos) {
23610            $this->semValue = $this->semStack[$stackPos];
23611        }, 54 => function ($stackPos) {
23612            $this->semValue = $this->semStack[$stackPos];
23613        }, 55 => function ($stackPos) {
23614            $this->semValue = $this->semStack[$stackPos];
23615        }, 56 => function ($stackPos) {
23616            $this->semValue = $this->semStack[$stackPos];
23617        }, 57 => function ($stackPos) {
23618            $this->semValue = $this->semStack[$stackPos];
23619        }, 58 => function ($stackPos) {
23620            $this->semValue = $this->semStack[$stackPos];
23621        }, 59 => function ($stackPos) {
23622            $this->semValue = $this->semStack[$stackPos];
23623        }, 60 => function ($stackPos) {
23624            $this->semValue = $this->semStack[$stackPos];
23625        }, 61 => function ($stackPos) {
23626            $this->semValue = $this->semStack[$stackPos];
23627        }, 62 => function ($stackPos) {
23628            $this->semValue = $this->semStack[$stackPos];
23629        }, 63 => function ($stackPos) {
23630            $this->semValue = $this->semStack[$stackPos];
23631        }, 64 => function ($stackPos) {
23632            $this->semValue = $this->semStack[$stackPos];
23633        }, 65 => function ($stackPos) {
23634            $this->semValue = $this->semStack[$stackPos];
23635        }, 66 => function ($stackPos) {
23636            $this->semValue = $this->semStack[$stackPos];
23637        }, 67 => function ($stackPos) {
23638            $this->semValue = $this->semStack[$stackPos];
23639        }, 68 => function ($stackPos) {
23640            $this->semValue = $this->semStack[$stackPos];
23641        }, 69 => function ($stackPos) {
23642            $this->semValue = $this->semStack[$stackPos];
23643        }, 70 => function ($stackPos) {
23644            $this->semValue = $this->semStack[$stackPos];
23645        }, 71 => function ($stackPos) {
23646            $this->semValue = $this->semStack[$stackPos];
23647        }, 72 => function ($stackPos) {
23648            $this->semValue = $this->semStack[$stackPos];
23649        }, 73 => function ($stackPos) {
23650            $this->semValue = $this->semStack[$stackPos];
23651        }, 74 => function ($stackPos) {
23652            $this->semValue = $this->semStack[$stackPos];
23653        }, 75 => function ($stackPos) {
23654            $this->semValue = $this->semStack[$stackPos];
23655        }, 76 => function ($stackPos) {
23656            $this->semValue = $this->semStack[$stackPos];
23657        }, 77 => function ($stackPos) {
23658            $this->semValue = $this->semStack[$stackPos];
23659        }, 78 => function ($stackPos) {
23660            $this->semValue = $this->semStack[$stackPos];
23661        }, 79 => function ($stackPos) {
23662            $this->semValue = $this->semStack[$stackPos];
23663        }, 80 => function ($stackPos) {
23664            $this->semValue = $this->semStack[$stackPos];
23665        }, 81 => function ($stackPos) {
23666            $this->semValue = $this->semStack[$stackPos];
23667        }, 82 => function ($stackPos) {
23668            $this->semValue = $this->semStack[$stackPos];
23669        }, 83 => function ($stackPos) {
23670            $this->semValue = $this->semStack[$stackPos];
23671        }, 84 => function ($stackPos) {
23672            $this->semValue = $this->semStack[$stackPos];
23673        }, 85 => function ($stackPos) {
23674            $this->semValue = $this->semStack[$stackPos];
23675        }, 86 => function ($stackPos) {
23676            $this->semValue = new Node\Identifier($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
23677        }, 87 => function ($stackPos) {
23678            $this->semValue = new Node\Identifier($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
23679        }, 88 => function ($stackPos) {
23680            $this->semValue = new Node\Identifier($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
23681        }, 89 => function ($stackPos) {
23682            $this->semValue = new Node\Identifier($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
23683        }, 90 => function ($stackPos) {
23684            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
23685        }, 91 => function ($stackPos) {
23686            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
23687        }, 92 => function ($stackPos) {
23688            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
23689        }, 93 => function ($stackPos) {
23690            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
23691        }, 94 => function ($stackPos) {
23692            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
23693        }, 95 => function ($stackPos) {
23694            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
23695        }, 96 => function ($stackPos) {
23696            $this->semValue = new Name(\substr($this->semStack[$stackPos - (1 - 1)], 1), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
23697        }, 97 => function ($stackPos) {
23698            $this->semValue = new Expr\Variable(\substr($this->semStack[$stackPos - (1 - 1)], 1), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
23699        }, 98 => function ($stackPos) {
23700            /* nothing */
23701        }, 99 => function ($stackPos) {
23702            /* nothing */
23703        }, 100 => function ($stackPos) {
23704            /* nothing */
23705        }, 101 => function ($stackPos) {
23706            $this->emitError(new Error('A trailing comma is not allowed here', $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes));
23707        }, 102 => function ($stackPos) {
23708            $this->semValue = $this->semStack[$stackPos];
23709        }, 103 => function ($stackPos) {
23710            $this->semValue = $this->semStack[$stackPos];
23711        }, 104 => function ($stackPos) {
23712            $this->semValue = new Node\Attribute($this->semStack[$stackPos - (1 - 1)], [], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
23713        }, 105 => function ($stackPos) {
23714            $this->semValue = new Node\Attribute($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
23715        }, 106 => function ($stackPos) {
23716            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
23717        }, 107 => function ($stackPos) {
23718            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
23719            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
23720        }, 108 => function ($stackPos) {
23721            $this->semValue = new Node\AttributeGroup($this->semStack[$stackPos - (4 - 2)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
23722        }, 109 => function ($stackPos) {
23723            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
23724        }, 110 => function ($stackPos) {
23725            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
23726            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
23727        }, 111 => function ($stackPos) {
23728            $this->semValue = [];
23729        }, 112 => function ($stackPos) {
23730            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
23731        }, 113 => function ($stackPos) {
23732            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
23733        }, 114 => function ($stackPos) {
23734            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
23735        }, 115 => function ($stackPos) {
23736            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
23737        }, 116 => function ($stackPos) {
23738            $this->semValue = new Stmt\HaltCompiler($this->lexer->handleHaltCompiler(), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
23739        }, 117 => function ($stackPos) {
23740            $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos - (3 - 2)], null, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
23741            $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON);
23742            $this->checkNamespace($this->semValue);
23743        }, 118 => function ($stackPos) {
23744            $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos - (5 - 2)], $this->semStack[$stackPos - (5 - 4)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
23745            $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED);
23746            $this->checkNamespace($this->semValue);
23747        }, 119 => function ($stackPos) {
23748            $this->semValue = new Stmt\Namespace_(null, $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
23749            $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED);
23750            $this->checkNamespace($this->semValue);
23751        }, 120 => function ($stackPos) {
23752            $this->semValue = new Stmt\Use_($this->semStack[$stackPos - (3 - 2)], Stmt\Use_::TYPE_NORMAL, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
23753        }, 121 => function ($stackPos) {
23754            $this->semValue = new Stmt\Use_($this->semStack[$stackPos - (4 - 3)], $this->semStack[$stackPos - (4 - 2)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
23755        }, 122 => function ($stackPos) {
23756            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
23757        }, 123 => function ($stackPos) {
23758            $this->semValue = new Stmt\Const_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
23759        }, 124 => function ($stackPos) {
23760            $this->semValue = Stmt\Use_::TYPE_FUNCTION;
23761        }, 125 => function ($stackPos) {
23762            $this->semValue = Stmt\Use_::TYPE_CONSTANT;
23763        }, 126 => function ($stackPos) {
23764            $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos - (7 - 3)], $this->semStack[$stackPos - (7 - 6)], $this->semStack[$stackPos - (7 - 2)], $this->startAttributeStack[$stackPos - (7 - 1)] + $this->endAttributes);
23765        }, 127 => function ($stackPos) {
23766            $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos - (6 - 2)], $this->semStack[$stackPos - (6 - 5)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
23767        }, 128 => function ($stackPos) {
23768            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
23769        }, 129 => function ($stackPos) {
23770            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
23771            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
23772        }, 130 => function ($stackPos) {
23773            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
23774        }, 131 => function ($stackPos) {
23775            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
23776        }, 132 => function ($stackPos) {
23777            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
23778            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
23779        }, 133 => function ($stackPos) {
23780            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
23781        }, 134 => function ($stackPos) {
23782            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
23783        }, 135 => function ($stackPos) {
23784            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
23785            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
23786        }, 136 => function ($stackPos) {
23787            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
23788        }, 137 => function ($stackPos) {
23789            $this->semValue = new Stmt\UseUse($this->semStack[$stackPos - (1 - 1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
23790            $this->checkUseUse($this->semValue, $stackPos - (1 - 1));
23791        }, 138 => function ($stackPos) {
23792            $this->semValue = new Stmt\UseUse($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
23793            $this->checkUseUse($this->semValue, $stackPos - (3 - 3));
23794        }, 139 => function ($stackPos) {
23795            $this->semValue = new Stmt\UseUse($this->semStack[$stackPos - (1 - 1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
23796            $this->checkUseUse($this->semValue, $stackPos - (1 - 1));
23797        }, 140 => function ($stackPos) {
23798            $this->semValue = new Stmt\UseUse($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
23799            $this->checkUseUse($this->semValue, $stackPos - (3 - 3));
23800        }, 141 => function ($stackPos) {
23801            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
23802            $this->semValue->type = Stmt\Use_::TYPE_NORMAL;
23803        }, 142 => function ($stackPos) {
23804            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
23805            $this->semValue->type = $this->semStack[$stackPos - (2 - 1)];
23806        }, 143 => function ($stackPos) {
23807            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
23808        }, 144 => function ($stackPos) {
23809            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
23810            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
23811        }, 145 => function ($stackPos) {
23812            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
23813        }, 146 => function ($stackPos) {
23814            $this->semValue = new Node\Const_($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
23815        }, 147 => function ($stackPos) {
23816            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
23817        }, 148 => function ($stackPos) {
23818            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
23819            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
23820        }, 149 => function ($stackPos) {
23821            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
23822        }, 150 => function ($stackPos) {
23823            $this->semValue = new Node\Const_($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
23824        }, 151 => function ($stackPos) {
23825            if (\is_array($this->semStack[$stackPos - (2 - 2)])) {
23826                $this->semValue = \array_merge($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)]);
23827            } else {
23828                $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
23829                $this->semValue = $this->semStack[$stackPos - (2 - 1)];
23830            }
23831        }, 152 => function ($stackPos) {
23832            $this->semValue = array();
23833        }, 153 => function ($stackPos) {
23834            $startAttributes = $this->lookaheadStartAttributes;
23835            if (isset($startAttributes['comments'])) {
23836                $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments']));
23837            } else {
23838                $nop = null;
23839            }
23840            if ($nop !== null) {
23841                $this->semStack[$stackPos - (1 - 1)][] = $nop;
23842            }
23843            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
23844        }, 154 => function ($stackPos) {
23845            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
23846        }, 155 => function ($stackPos) {
23847            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
23848        }, 156 => function ($stackPos) {
23849            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
23850        }, 157 => function ($stackPos) {
23851            throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
23852        }, 158 => function ($stackPos) {
23853            if ($this->semStack[$stackPos - (3 - 2)]) {
23854                $this->semValue = $this->semStack[$stackPos - (3 - 2)];
23855                $attrs = $this->startAttributeStack[$stackPos - (3 - 1)];
23856                $stmts = $this->semValue;
23857                if (!empty($attrs['comments'])) {
23858                    $stmts[0]->setAttribute('comments', \array_merge($attrs['comments'], $stmts[0]->getAttribute('comments', [])));
23859                }
23860            } else {
23861                $startAttributes = $this->startAttributeStack[$stackPos - (3 - 1)];
23862                if (isset($startAttributes['comments'])) {
23863                    $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes);
23864                } else {
23865                    $this->semValue = null;
23866                }
23867                if (null === $this->semValue) {
23868                    $this->semValue = array();
23869                }
23870            }
23871        }, 159 => function ($stackPos) {
23872            $this->semValue = new Stmt\If_($this->semStack[$stackPos - (7 - 3)], ['stmts' => \is_array($this->semStack[$stackPos - (7 - 5)]) ? $this->semStack[$stackPos - (7 - 5)] : array($this->semStack[$stackPos - (7 - 5)]), 'elseifs' => $this->semStack[$stackPos - (7 - 6)], 'else' => $this->semStack[$stackPos - (7 - 7)]], $this->startAttributeStack[$stackPos - (7 - 1)] + $this->endAttributes);
23873        }, 160 => function ($stackPos) {
23874            $this->semValue = new Stmt\If_($this->semStack[$stackPos - (10 - 3)], ['stmts' => $this->semStack[$stackPos - (10 - 6)], 'elseifs' => $this->semStack[$stackPos - (10 - 7)], 'else' => $this->semStack[$stackPos - (10 - 8)]], $this->startAttributeStack[$stackPos - (10 - 1)] + $this->endAttributes);
23875        }, 161 => function ($stackPos) {
23876            $this->semValue = new Stmt\While_($this->semStack[$stackPos - (5 - 3)], $this->semStack[$stackPos - (5 - 5)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
23877        }, 162 => function ($stackPos) {
23878            $this->semValue = new Stmt\Do_($this->semStack[$stackPos - (7 - 5)], \is_array($this->semStack[$stackPos - (7 - 2)]) ? $this->semStack[$stackPos - (7 - 2)] : array($this->semStack[$stackPos - (7 - 2)]), $this->startAttributeStack[$stackPos - (7 - 1)] + $this->endAttributes);
23879        }, 163 => function ($stackPos) {
23880            $this->semValue = new Stmt\For_(['init' => $this->semStack[$stackPos - (9 - 3)], 'cond' => $this->semStack[$stackPos - (9 - 5)], 'loop' => $this->semStack[$stackPos - (9 - 7)], 'stmts' => $this->semStack[$stackPos - (9 - 9)]], $this->startAttributeStack[$stackPos - (9 - 1)] + $this->endAttributes);
23881        }, 164 => function ($stackPos) {
23882            $this->semValue = new Stmt\Switch_($this->semStack[$stackPos - (5 - 3)], $this->semStack[$stackPos - (5 - 5)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
23883        }, 165 => function ($stackPos) {
23884            $this->semValue = new Stmt\Break_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
23885        }, 166 => function ($stackPos) {
23886            $this->semValue = new Stmt\Continue_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
23887        }, 167 => function ($stackPos) {
23888            $this->semValue = new Stmt\Return_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
23889        }, 168 => function ($stackPos) {
23890            $this->semValue = new Stmt\Global_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
23891        }, 169 => function ($stackPos) {
23892            $this->semValue = new Stmt\Static_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
23893        }, 170 => function ($stackPos) {
23894            $this->semValue = new Stmt\Echo_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
23895        }, 171 => function ($stackPos) {
23896            $this->semValue = new Stmt\InlineHTML($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
23897        }, 172 => function ($stackPos) {
23898            $e = $this->semStack[$stackPos - (2 - 1)];
23899            if ($e instanceof Expr\Throw_) {
23900                // For backwards-compatibility reasons, convert throw in statement position into
23901                // Stmt\Throw_ rather than Stmt\Expression(Expr\Throw_).
23902                $this->semValue = new Stmt\Throw_($e->expr, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
23903            } else {
23904                $this->semValue = new Stmt\Expression($e, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
23905            }
23906        }, 173 => function ($stackPos) {
23907            $this->semValue = new Stmt\Unset_($this->semStack[$stackPos - (5 - 3)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
23908        }, 174 => function ($stackPos) {
23909            $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos - (7 - 3)], $this->semStack[$stackPos - (7 - 5)][0], ['keyVar' => null, 'byRef' => $this->semStack[$stackPos - (7 - 5)][1], 'stmts' => $this->semStack[$stackPos - (7 - 7)]], $this->startAttributeStack[$stackPos - (7 - 1)] + $this->endAttributes);
23910        }, 175 => function ($stackPos) {
23911            $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos - (9 - 3)], $this->semStack[$stackPos - (9 - 7)][0], ['keyVar' => $this->semStack[$stackPos - (9 - 5)], 'byRef' => $this->semStack[$stackPos - (9 - 7)][1], 'stmts' => $this->semStack[$stackPos - (9 - 9)]], $this->startAttributeStack[$stackPos - (9 - 1)] + $this->endAttributes);
23912        }, 176 => function ($stackPos) {
23913            $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos - (6 - 3)], new Expr\Error($this->startAttributeStack[$stackPos - (6 - 4)] + $this->endAttributeStack[$stackPos - (6 - 4)]), ['stmts' => $this->semStack[$stackPos - (6 - 6)]], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
23914        }, 177 => function ($stackPos) {
23915            $this->semValue = new Stmt\Declare_($this->semStack[$stackPos - (5 - 3)], $this->semStack[$stackPos - (5 - 5)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
23916        }, 178 => function ($stackPos) {
23917            $this->semValue = new Stmt\TryCatch($this->semStack[$stackPos - (6 - 3)], $this->semStack[$stackPos - (6 - 5)], $this->semStack[$stackPos - (6 - 6)], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
23918            $this->checkTryCatch($this->semValue);
23919        }, 179 => function ($stackPos) {
23920            $this->semValue = new Stmt\Goto_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
23921        }, 180 => function ($stackPos) {
23922            $this->semValue = new Stmt\Label($this->semStack[$stackPos - (2 - 1)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
23923        }, 181 => function ($stackPos) {
23924            $this->semValue = array();
23925            /* means: no statement */
23926        }, 182 => function ($stackPos) {
23927            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
23928        }, 183 => function ($stackPos) {
23929            $startAttributes = $this->startAttributeStack[$stackPos - (1 - 1)];
23930            if (isset($startAttributes['comments'])) {
23931                $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes);
23932            } else {
23933                $this->semValue = null;
23934            }
23935            if ($this->semValue === null) {
23936                $this->semValue = array();
23937            }
23938            /* means: no statement */
23939        }, 184 => function ($stackPos) {
23940            $this->semValue = array();
23941        }, 185 => function ($stackPos) {
23942            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
23943            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
23944        }, 186 => function ($stackPos) {
23945            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
23946        }, 187 => function ($stackPos) {
23947            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
23948            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
23949        }, 188 => function ($stackPos) {
23950            $this->semValue = new Stmt\Catch_($this->semStack[$stackPos - (8 - 3)], $this->semStack[$stackPos - (8 - 4)], $this->semStack[$stackPos - (8 - 7)], $this->startAttributeStack[$stackPos - (8 - 1)] + $this->endAttributes);
23951        }, 189 => function ($stackPos) {
23952            $this->semValue = null;
23953        }, 190 => function ($stackPos) {
23954            $this->semValue = new Stmt\Finally_($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
23955        }, 191 => function ($stackPos) {
23956            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
23957        }, 192 => function ($stackPos) {
23958            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
23959        }, 193 => function ($stackPos) {
23960            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
23961            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
23962        }, 194 => function ($stackPos) {
23963            $this->semValue = \false;
23964        }, 195 => function ($stackPos) {
23965            $this->semValue = \true;
23966        }, 196 => function ($stackPos) {
23967            $this->semValue = \false;
23968        }, 197 => function ($stackPos) {
23969            $this->semValue = \true;
23970        }, 198 => function ($stackPos) {
23971            $this->semValue = \false;
23972        }, 199 => function ($stackPos) {
23973            $this->semValue = \true;
23974        }, 200 => function ($stackPos) {
23975            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
23976        }, 201 => function ($stackPos) {
23977            $this->semValue = [];
23978        }, 202 => function ($stackPos) {
23979            $this->semValue = new Stmt\Function_($this->semStack[$stackPos - (8 - 3)], ['byRef' => $this->semStack[$stackPos - (8 - 2)], 'params' => $this->semStack[$stackPos - (8 - 5)], 'returnType' => $this->semStack[$stackPos - (8 - 7)], 'stmts' => $this->semStack[$stackPos - (8 - 8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos - (8 - 1)] + $this->endAttributes);
23980        }, 203 => function ($stackPos) {
23981            $this->semValue = new Stmt\Function_($this->semStack[$stackPos - (9 - 4)], ['byRef' => $this->semStack[$stackPos - (9 - 3)], 'params' => $this->semStack[$stackPos - (9 - 6)], 'returnType' => $this->semStack[$stackPos - (9 - 8)], 'stmts' => $this->semStack[$stackPos - (9 - 9)], 'attrGroups' => $this->semStack[$stackPos - (9 - 1)]], $this->startAttributeStack[$stackPos - (9 - 1)] + $this->endAttributes);
23982        }, 204 => function ($stackPos) {
23983            $this->semValue = new Stmt\Class_($this->semStack[$stackPos - (8 - 3)], ['type' => $this->semStack[$stackPos - (8 - 2)], 'extends' => $this->semStack[$stackPos - (8 - 4)], 'implements' => $this->semStack[$stackPos - (8 - 5)], 'stmts' => $this->semStack[$stackPos - (8 - 7)], 'attrGroups' => $this->semStack[$stackPos - (8 - 1)]], $this->startAttributeStack[$stackPos - (8 - 1)] + $this->endAttributes);
23984            $this->checkClass($this->semValue, $stackPos - (8 - 3));
23985        }, 205 => function ($stackPos) {
23986            $this->semValue = new Stmt\Interface_($this->semStack[$stackPos - (7 - 3)], ['extends' => $this->semStack[$stackPos - (7 - 4)], 'stmts' => $this->semStack[$stackPos - (7 - 6)], 'attrGroups' => $this->semStack[$stackPos - (7 - 1)]], $this->startAttributeStack[$stackPos - (7 - 1)] + $this->endAttributes);
23987            $this->checkInterface($this->semValue, $stackPos - (7 - 3));
23988        }, 206 => function ($stackPos) {
23989            $this->semValue = new Stmt\Trait_($this->semStack[$stackPos - (6 - 3)], ['stmts' => $this->semStack[$stackPos - (6 - 5)], 'attrGroups' => $this->semStack[$stackPos - (6 - 1)]], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
23990        }, 207 => function ($stackPos) {
23991            $this->semValue = new Stmt\Enum_($this->semStack[$stackPos - (8 - 3)], ['scalarType' => $this->semStack[$stackPos - (8 - 4)], 'implements' => $this->semStack[$stackPos - (8 - 5)], 'stmts' => $this->semStack[$stackPos - (8 - 7)], 'attrGroups' => $this->semStack[$stackPos - (8 - 1)]], $this->startAttributeStack[$stackPos - (8 - 1)] + $this->endAttributes);
23992            $this->checkEnum($this->semValue, $stackPos - (8 - 3));
23993        }, 208 => function ($stackPos) {
23994            $this->semValue = null;
23995        }, 209 => function ($stackPos) {
23996            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
23997        }, 210 => function ($stackPos) {
23998            $this->semValue = null;
23999        }, 211 => function ($stackPos) {
24000            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
24001        }, 212 => function ($stackPos) {
24002            $this->semValue = 0;
24003        }, 213 => function ($stackPos) {
24004            $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT;
24005        }, 214 => function ($stackPos) {
24006            $this->semValue = Stmt\Class_::MODIFIER_FINAL;
24007        }, 215 => function ($stackPos) {
24008            $this->semValue = null;
24009        }, 216 => function ($stackPos) {
24010            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
24011        }, 217 => function ($stackPos) {
24012            $this->semValue = array();
24013        }, 218 => function ($stackPos) {
24014            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
24015        }, 219 => function ($stackPos) {
24016            $this->semValue = array();
24017        }, 220 => function ($stackPos) {
24018            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
24019        }, 221 => function ($stackPos) {
24020            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
24021        }, 222 => function ($stackPos) {
24022            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
24023        }, 223 => function ($stackPos) {
24024            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
24025            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
24026        }, 224 => function ($stackPos) {
24027            $this->semValue = \is_array($this->semStack[$stackPos - (1 - 1)]) ? $this->semStack[$stackPos - (1 - 1)] : array($this->semStack[$stackPos - (1 - 1)]);
24028        }, 225 => function ($stackPos) {
24029            $this->semValue = $this->semStack[$stackPos - (4 - 2)];
24030        }, 226 => function ($stackPos) {
24031            $this->semValue = \is_array($this->semStack[$stackPos - (1 - 1)]) ? $this->semStack[$stackPos - (1 - 1)] : array($this->semStack[$stackPos - (1 - 1)]);
24032        }, 227 => function ($stackPos) {
24033            $this->semValue = $this->semStack[$stackPos - (4 - 2)];
24034        }, 228 => function ($stackPos) {
24035            $this->semValue = \is_array($this->semStack[$stackPos - (1 - 1)]) ? $this->semStack[$stackPos - (1 - 1)] : array($this->semStack[$stackPos - (1 - 1)]);
24036        }, 229 => function ($stackPos) {
24037            $this->semValue = null;
24038        }, 230 => function ($stackPos) {
24039            $this->semValue = $this->semStack[$stackPos - (4 - 2)];
24040        }, 231 => function ($stackPos) {
24041            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
24042        }, 232 => function ($stackPos) {
24043            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
24044        }, 233 => function ($stackPos) {
24045            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
24046            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
24047        }, 234 => function ($stackPos) {
24048            $this->semValue = new Stmt\DeclareDeclare($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24049        }, 235 => function ($stackPos) {
24050            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
24051        }, 236 => function ($stackPos) {
24052            $this->semValue = $this->semStack[$stackPos - (4 - 3)];
24053        }, 237 => function ($stackPos) {
24054            $this->semValue = $this->semStack[$stackPos - (4 - 2)];
24055        }, 238 => function ($stackPos) {
24056            $this->semValue = $this->semStack[$stackPos - (5 - 3)];
24057        }, 239 => function ($stackPos) {
24058            $this->semValue = array();
24059        }, 240 => function ($stackPos) {
24060            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
24061            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
24062        }, 241 => function ($stackPos) {
24063            $this->semValue = new Stmt\Case_($this->semStack[$stackPos - (4 - 2)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
24064        }, 242 => function ($stackPos) {
24065            $this->semValue = new Stmt\Case_(null, $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24066        }, 243 => function ($stackPos) {
24067            $this->semValue = $this->semStack[$stackPos];
24068        }, 244 => function ($stackPos) {
24069            $this->semValue = $this->semStack[$stackPos];
24070        }, 245 => function ($stackPos) {
24071            $this->semValue = new Expr\Match_($this->semStack[$stackPos - (7 - 3)], $this->semStack[$stackPos - (7 - 6)], $this->startAttributeStack[$stackPos - (7 - 1)] + $this->endAttributes);
24072        }, 246 => function ($stackPos) {
24073            $this->semValue = [];
24074        }, 247 => function ($stackPos) {
24075            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
24076        }, 248 => function ($stackPos) {
24077            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
24078        }, 249 => function ($stackPos) {
24079            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
24080            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
24081        }, 250 => function ($stackPos) {
24082            $this->semValue = new Node\MatchArm($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24083        }, 251 => function ($stackPos) {
24084            $this->semValue = new Node\MatchArm(null, $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
24085        }, 252 => function ($stackPos) {
24086            $this->semValue = \is_array($this->semStack[$stackPos - (1 - 1)]) ? $this->semStack[$stackPos - (1 - 1)] : array($this->semStack[$stackPos - (1 - 1)]);
24087        }, 253 => function ($stackPos) {
24088            $this->semValue = $this->semStack[$stackPos - (4 - 2)];
24089        }, 254 => function ($stackPos) {
24090            $this->semValue = array();
24091        }, 255 => function ($stackPos) {
24092            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
24093            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
24094        }, 256 => function ($stackPos) {
24095            $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos - (5 - 3)], \is_array($this->semStack[$stackPos - (5 - 5)]) ? $this->semStack[$stackPos - (5 - 5)] : array($this->semStack[$stackPos - (5 - 5)]), $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
24096        }, 257 => function ($stackPos) {
24097            $this->semValue = array();
24098        }, 258 => function ($stackPos) {
24099            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
24100            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
24101        }, 259 => function ($stackPos) {
24102            $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos - (6 - 3)], $this->semStack[$stackPos - (6 - 6)], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
24103        }, 260 => function ($stackPos) {
24104            $this->semValue = null;
24105        }, 261 => function ($stackPos) {
24106            $this->semValue = new Stmt\Else_(\is_array($this->semStack[$stackPos - (2 - 2)]) ? $this->semStack[$stackPos - (2 - 2)] : array($this->semStack[$stackPos - (2 - 2)]), $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24107        }, 262 => function ($stackPos) {
24108            $this->semValue = null;
24109        }, 263 => function ($stackPos) {
24110            $this->semValue = new Stmt\Else_($this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24111        }, 264 => function ($stackPos) {
24112            $this->semValue = array($this->semStack[$stackPos - (1 - 1)], \false);
24113        }, 265 => function ($stackPos) {
24114            $this->semValue = array($this->semStack[$stackPos - (2 - 2)], \true);
24115        }, 266 => function ($stackPos) {
24116            $this->semValue = array($this->semStack[$stackPos - (1 - 1)], \false);
24117        }, 267 => function ($stackPos) {
24118            $this->semValue = array($this->semStack[$stackPos - (1 - 1)], \false);
24119        }, 268 => function ($stackPos) {
24120            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
24121        }, 269 => function ($stackPos) {
24122            $this->semValue = array();
24123        }, 270 => function ($stackPos) {
24124            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
24125        }, 271 => function ($stackPos) {
24126            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
24127            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
24128        }, 272 => function ($stackPos) {
24129            $this->semValue = 0;
24130        }, 273 => function ($stackPos) {
24131            $this->checkModifier($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)], $stackPos - (2 - 2));
24132            $this->semValue = $this->semStack[$stackPos - (2 - 1)] | $this->semStack[$stackPos - (2 - 2)];
24133        }, 274 => function ($stackPos) {
24134            $this->semValue = Stmt\Class_::MODIFIER_PUBLIC;
24135        }, 275 => function ($stackPos) {
24136            $this->semValue = Stmt\Class_::MODIFIER_PROTECTED;
24137        }, 276 => function ($stackPos) {
24138            $this->semValue = Stmt\Class_::MODIFIER_PRIVATE;
24139        }, 277 => function ($stackPos) {
24140            $this->semValue = Stmt\Class_::MODIFIER_READONLY;
24141        }, 278 => function ($stackPos) {
24142            $this->semValue = new Node\Param($this->semStack[$stackPos - (6 - 6)], null, $this->semStack[$stackPos - (6 - 3)], $this->semStack[$stackPos - (6 - 4)], $this->semStack[$stackPos - (6 - 5)], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes, $this->semStack[$stackPos - (6 - 2)], $this->semStack[$stackPos - (6 - 1)]);
24143            $this->checkParam($this->semValue);
24144        }, 279 => function ($stackPos) {
24145            $this->semValue = new Node\Param($this->semStack[$stackPos - (8 - 6)], $this->semStack[$stackPos - (8 - 8)], $this->semStack[$stackPos - (8 - 3)], $this->semStack[$stackPos - (8 - 4)], $this->semStack[$stackPos - (8 - 5)], $this->startAttributeStack[$stackPos - (8 - 1)] + $this->endAttributes, $this->semStack[$stackPos - (8 - 2)], $this->semStack[$stackPos - (8 - 1)]);
24146            $this->checkParam($this->semValue);
24147        }, 280 => function ($stackPos) {
24148            $this->semValue = new Node\Param(new Expr\Error($this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes), null, $this->semStack[$stackPos - (6 - 3)], $this->semStack[$stackPos - (6 - 4)], $this->semStack[$stackPos - (6 - 5)], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes, $this->semStack[$stackPos - (6 - 2)], $this->semStack[$stackPos - (6 - 1)]);
24149        }, 281 => function ($stackPos) {
24150            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24151        }, 282 => function ($stackPos) {
24152            $this->semValue = new Node\NullableType($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24153        }, 283 => function ($stackPos) {
24154            $this->semValue = new Node\UnionType($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24155        }, 284 => function ($stackPos) {
24156            $this->semValue = new Node\IntersectionType($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24157        }, 285 => function ($stackPos) {
24158            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24159        }, 286 => function ($stackPos) {
24160            $this->semValue = new Node\Name('static', $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24161        }, 287 => function ($stackPos) {
24162            $this->semValue = $this->handleBuiltinTypes($this->semStack[$stackPos - (1 - 1)]);
24163        }, 288 => function ($stackPos) {
24164            $this->semValue = new Node\Identifier('array', $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24165        }, 289 => function ($stackPos) {
24166            $this->semValue = new Node\Identifier('callable', $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24167        }, 290 => function ($stackPos) {
24168            $this->semValue = array($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)]);
24169        }, 291 => function ($stackPos) {
24170            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
24171            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
24172        }, 292 => function ($stackPos) {
24173            $this->semValue = array($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)]);
24174        }, 293 => function ($stackPos) {
24175            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
24176            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
24177        }, 294 => function ($stackPos) {
24178            $this->semValue = array($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)]);
24179        }, 295 => function ($stackPos) {
24180            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
24181            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
24182        }, 296 => function ($stackPos) {
24183            $this->semValue = array($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)]);
24184        }, 297 => function ($stackPos) {
24185            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
24186            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
24187        }, 298 => function ($stackPos) {
24188            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24189        }, 299 => function ($stackPos) {
24190            $this->semValue = new Node\NullableType($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24191        }, 300 => function ($stackPos) {
24192            $this->semValue = new Node\UnionType($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24193        }, 301 => function ($stackPos) {
24194            $this->semValue = new Node\IntersectionType($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24195        }, 302 => function ($stackPos) {
24196            $this->semValue = null;
24197        }, 303 => function ($stackPos) {
24198            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24199        }, 304 => function ($stackPos) {
24200            $this->semValue = null;
24201        }, 305 => function ($stackPos) {
24202            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
24203        }, 306 => function ($stackPos) {
24204            $this->semValue = null;
24205        }, 307 => function ($stackPos) {
24206            $this->semValue = array();
24207        }, 308 => function ($stackPos) {
24208            $this->semValue = $this->semStack[$stackPos - (4 - 2)];
24209        }, 309 => function ($stackPos) {
24210            $this->semValue = array($this->semStack[$stackPos - (3 - 2)]);
24211        }, 310 => function ($stackPos) {
24212            $this->semValue = new Node\VariadicPlaceholder($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24213        }, 311 => function ($stackPos) {
24214            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
24215        }, 312 => function ($stackPos) {
24216            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
24217            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
24218        }, 313 => function ($stackPos) {
24219            $this->semValue = new Node\Arg($this->semStack[$stackPos - (1 - 1)], \false, \false, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24220        }, 314 => function ($stackPos) {
24221            $this->semValue = new Node\Arg($this->semStack[$stackPos - (2 - 2)], \true, \false, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24222        }, 315 => function ($stackPos) {
24223            $this->semValue = new Node\Arg($this->semStack[$stackPos - (2 - 2)], \false, \true, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24224        }, 316 => function ($stackPos) {
24225            $this->semValue = new Node\Arg($this->semStack[$stackPos - (3 - 3)], \false, \false, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes, $this->semStack[$stackPos - (3 - 1)]);
24226        }, 317 => function ($stackPos) {
24227            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
24228        }, 318 => function ($stackPos) {
24229            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
24230            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
24231        }, 319 => function ($stackPos) {
24232            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
24233        }, 320 => function ($stackPos) {
24234            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24235        }, 321 => function ($stackPos) {
24236            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
24237        }, 322 => function ($stackPos) {
24238            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
24239            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
24240        }, 323 => function ($stackPos) {
24241            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
24242        }, 324 => function ($stackPos) {
24243            $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos - (1 - 1)], null, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24244        }, 325 => function ($stackPos) {
24245            $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24246        }, 326 => function ($stackPos) {
24247            if ($this->semStack[$stackPos - (2 - 2)] !== null) {
24248                $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
24249                $this->semValue = $this->semStack[$stackPos - (2 - 1)];
24250            }
24251        }, 327 => function ($stackPos) {
24252            $this->semValue = array();
24253        }, 328 => function ($stackPos) {
24254            $startAttributes = $this->lookaheadStartAttributes;
24255            if (isset($startAttributes['comments'])) {
24256                $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments']));
24257            } else {
24258                $nop = null;
24259            }
24260            if ($nop !== null) {
24261                $this->semStack[$stackPos - (1 - 1)][] = $nop;
24262            }
24263            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24264        }, 329 => function ($stackPos) {
24265            $this->semValue = new Stmt\Property($this->semStack[$stackPos - (5 - 2)], $this->semStack[$stackPos - (5 - 4)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes, $this->semStack[$stackPos - (5 - 3)], $this->semStack[$stackPos - (5 - 1)]);
24266            $this->checkProperty($this->semValue, $stackPos - (5 - 2));
24267        }, 330 => function ($stackPos) {
24268            $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos - (5 - 4)], $this->semStack[$stackPos - (5 - 2)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes, $this->semStack[$stackPos - (5 - 1)]);
24269            $this->checkClassConst($this->semValue, $stackPos - (5 - 2));
24270        }, 331 => function ($stackPos) {
24271            $this->semValue = new Stmt\ClassMethod($this->semStack[$stackPos - (10 - 5)], ['type' => $this->semStack[$stackPos - (10 - 2)], 'byRef' => $this->semStack[$stackPos - (10 - 4)], 'params' => $this->semStack[$stackPos - (10 - 7)], 'returnType' => $this->semStack[$stackPos - (10 - 9)], 'stmts' => $this->semStack[$stackPos - (10 - 10)], 'attrGroups' => $this->semStack[$stackPos - (10 - 1)]], $this->startAttributeStack[$stackPos - (10 - 1)] + $this->endAttributes);
24272            $this->checkClassMethod($this->semValue, $stackPos - (10 - 2));
24273        }, 332 => function ($stackPos) {
24274            $this->semValue = new Stmt\TraitUse($this->semStack[$stackPos - (3 - 2)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24275        }, 333 => function ($stackPos) {
24276            $this->semValue = new Stmt\EnumCase($this->semStack[$stackPos - (5 - 3)], $this->semStack[$stackPos - (5 - 4)], $this->semStack[$stackPos - (5 - 1)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
24277        }, 334 => function ($stackPos) {
24278            $this->semValue = null;
24279            /* will be skipped */
24280        }, 335 => function ($stackPos) {
24281            $this->semValue = array();
24282        }, 336 => function ($stackPos) {
24283            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
24284        }, 337 => function ($stackPos) {
24285            $this->semValue = array();
24286        }, 338 => function ($stackPos) {
24287            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
24288            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
24289        }, 339 => function ($stackPos) {
24290            $this->semValue = new Stmt\TraitUseAdaptation\Precedence($this->semStack[$stackPos - (4 - 1)][0], $this->semStack[$stackPos - (4 - 1)][1], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
24291        }, 340 => function ($stackPos) {
24292            $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos - (5 - 1)][0], $this->semStack[$stackPos - (5 - 1)][1], $this->semStack[$stackPos - (5 - 3)], $this->semStack[$stackPos - (5 - 4)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
24293        }, 341 => function ($stackPos) {
24294            $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos - (4 - 1)][0], $this->semStack[$stackPos - (4 - 1)][1], $this->semStack[$stackPos - (4 - 3)], null, $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
24295        }, 342 => function ($stackPos) {
24296            $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos - (4 - 1)][0], $this->semStack[$stackPos - (4 - 1)][1], null, $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
24297        }, 343 => function ($stackPos) {
24298            $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos - (4 - 1)][0], $this->semStack[$stackPos - (4 - 1)][1], null, $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
24299        }, 344 => function ($stackPos) {
24300            $this->semValue = array($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)]);
24301        }, 345 => function ($stackPos) {
24302            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24303        }, 346 => function ($stackPos) {
24304            $this->semValue = array(null, $this->semStack[$stackPos - (1 - 1)]);
24305        }, 347 => function ($stackPos) {
24306            $this->semValue = null;
24307        }, 348 => function ($stackPos) {
24308            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24309        }, 349 => function ($stackPos) {
24310            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24311        }, 350 => function ($stackPos) {
24312            $this->semValue = 0;
24313        }, 351 => function ($stackPos) {
24314            $this->semValue = 0;
24315        }, 352 => function ($stackPos) {
24316            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24317        }, 353 => function ($stackPos) {
24318            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24319        }, 354 => function ($stackPos) {
24320            $this->checkModifier($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)], $stackPos - (2 - 2));
24321            $this->semValue = $this->semStack[$stackPos - (2 - 1)] | $this->semStack[$stackPos - (2 - 2)];
24322        }, 355 => function ($stackPos) {
24323            $this->semValue = Stmt\Class_::MODIFIER_PUBLIC;
24324        }, 356 => function ($stackPos) {
24325            $this->semValue = Stmt\Class_::MODIFIER_PROTECTED;
24326        }, 357 => function ($stackPos) {
24327            $this->semValue = Stmt\Class_::MODIFIER_PRIVATE;
24328        }, 358 => function ($stackPos) {
24329            $this->semValue = Stmt\Class_::MODIFIER_STATIC;
24330        }, 359 => function ($stackPos) {
24331            $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT;
24332        }, 360 => function ($stackPos) {
24333            $this->semValue = Stmt\Class_::MODIFIER_FINAL;
24334        }, 361 => function ($stackPos) {
24335            $this->semValue = Stmt\Class_::MODIFIER_READONLY;
24336        }, 362 => function ($stackPos) {
24337            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
24338        }, 363 => function ($stackPos) {
24339            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
24340        }, 364 => function ($stackPos) {
24341            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
24342            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
24343        }, 365 => function ($stackPos) {
24344            $this->semValue = new Node\VarLikeIdentifier(\substr($this->semStack[$stackPos - (1 - 1)], 1), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24345        }, 366 => function ($stackPos) {
24346            $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos - (1 - 1)], null, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24347        }, 367 => function ($stackPos) {
24348            $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24349        }, 368 => function ($stackPos) {
24350            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
24351        }, 369 => function ($stackPos) {
24352            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
24353        }, 370 => function ($stackPos) {
24354            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
24355            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
24356        }, 371 => function ($stackPos) {
24357            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
24358        }, 372 => function ($stackPos) {
24359            $this->semValue = array();
24360        }, 373 => function ($stackPos) {
24361            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24362        }, 374 => function ($stackPos) {
24363            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24364        }, 375 => function ($stackPos) {
24365            $this->semValue = new Expr\Assign($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24366        }, 376 => function ($stackPos) {
24367            $this->semValue = new Expr\Assign($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24368        }, 377 => function ($stackPos) {
24369            $this->semValue = new Expr\Assign($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24370        }, 378 => function ($stackPos) {
24371            $this->semValue = new Expr\AssignRef($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
24372        }, 379 => function ($stackPos) {
24373            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24374        }, 380 => function ($stackPos) {
24375            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24376        }, 381 => function ($stackPos) {
24377            $this->semValue = new Expr\Clone_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24378        }, 382 => function ($stackPos) {
24379            $this->semValue = new Expr\AssignOp\Plus($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24380        }, 383 => function ($stackPos) {
24381            $this->semValue = new Expr\AssignOp\Minus($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24382        }, 384 => function ($stackPos) {
24383            $this->semValue = new Expr\AssignOp\Mul($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24384        }, 385 => function ($stackPos) {
24385            $this->semValue = new Expr\AssignOp\Div($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24386        }, 386 => function ($stackPos) {
24387            $this->semValue = new Expr\AssignOp\Concat($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24388        }, 387 => function ($stackPos) {
24389            $this->semValue = new Expr\AssignOp\Mod($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24390        }, 388 => function ($stackPos) {
24391            $this->semValue = new Expr\AssignOp\BitwiseAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24392        }, 389 => function ($stackPos) {
24393            $this->semValue = new Expr\AssignOp\BitwiseOr($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24394        }, 390 => function ($stackPos) {
24395            $this->semValue = new Expr\AssignOp\BitwiseXor($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24396        }, 391 => function ($stackPos) {
24397            $this->semValue = new Expr\AssignOp\ShiftLeft($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24398        }, 392 => function ($stackPos) {
24399            $this->semValue = new Expr\AssignOp\ShiftRight($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24400        }, 393 => function ($stackPos) {
24401            $this->semValue = new Expr\AssignOp\Pow($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24402        }, 394 => function ($stackPos) {
24403            $this->semValue = new Expr\AssignOp\Coalesce($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24404        }, 395 => function ($stackPos) {
24405            $this->semValue = new Expr\PostInc($this->semStack[$stackPos - (2 - 1)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24406        }, 396 => function ($stackPos) {
24407            $this->semValue = new Expr\PreInc($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24408        }, 397 => function ($stackPos) {
24409            $this->semValue = new Expr\PostDec($this->semStack[$stackPos - (2 - 1)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24410        }, 398 => function ($stackPos) {
24411            $this->semValue = new Expr\PreDec($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24412        }, 399 => function ($stackPos) {
24413            $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24414        }, 400 => function ($stackPos) {
24415            $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24416        }, 401 => function ($stackPos) {
24417            $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24418        }, 402 => function ($stackPos) {
24419            $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24420        }, 403 => function ($stackPos) {
24421            $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24422        }, 404 => function ($stackPos) {
24423            $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24424        }, 405 => function ($stackPos) {
24425            $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24426        }, 406 => function ($stackPos) {
24427            $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24428        }, 407 => function ($stackPos) {
24429            $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24430        }, 408 => function ($stackPos) {
24431            $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24432        }, 409 => function ($stackPos) {
24433            $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24434        }, 410 => function ($stackPos) {
24435            $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24436        }, 411 => function ($stackPos) {
24437            $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24438        }, 412 => function ($stackPos) {
24439            $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24440        }, 413 => function ($stackPos) {
24441            $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24442        }, 414 => function ($stackPos) {
24443            $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24444        }, 415 => function ($stackPos) {
24445            $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24446        }, 416 => function ($stackPos) {
24447            $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24448        }, 417 => function ($stackPos) {
24449            $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24450        }, 418 => function ($stackPos) {
24451            $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24452        }, 419 => function ($stackPos) {
24453            $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24454        }, 420 => function ($stackPos) {
24455            $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24456        }, 421 => function ($stackPos) {
24457            $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24458        }, 422 => function ($stackPos) {
24459            $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24460        }, 423 => function ($stackPos) {
24461            $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24462        }, 424 => function ($stackPos) {
24463            $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24464        }, 425 => function ($stackPos) {
24465            $this->semValue = new Expr\BinaryOp\Spaceship($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24466        }, 426 => function ($stackPos) {
24467            $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24468        }, 427 => function ($stackPos) {
24469            $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24470        }, 428 => function ($stackPos) {
24471            $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24472        }, 429 => function ($stackPos) {
24473            $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24474        }, 430 => function ($stackPos) {
24475            $this->semValue = new Expr\Instanceof_($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24476        }, 431 => function ($stackPos) {
24477            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
24478        }, 432 => function ($stackPos) {
24479            $this->semValue = new Expr\Ternary($this->semStack[$stackPos - (5 - 1)], $this->semStack[$stackPos - (5 - 3)], $this->semStack[$stackPos - (5 - 5)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
24480        }, 433 => function ($stackPos) {
24481            $this->semValue = new Expr\Ternary($this->semStack[$stackPos - (4 - 1)], null, $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
24482        }, 434 => function ($stackPos) {
24483            $this->semValue = new Expr\BinaryOp\Coalesce($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24484        }, 435 => function ($stackPos) {
24485            $this->semValue = new Expr\Isset_($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
24486        }, 436 => function ($stackPos) {
24487            $this->semValue = new Expr\Empty_($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
24488        }, 437 => function ($stackPos) {
24489            $this->semValue = new Expr\Include_($this->semStack[$stackPos - (2 - 2)], Expr\Include_::TYPE_INCLUDE, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24490        }, 438 => function ($stackPos) {
24491            $this->semValue = new Expr\Include_($this->semStack[$stackPos - (2 - 2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24492        }, 439 => function ($stackPos) {
24493            $this->semValue = new Expr\Eval_($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
24494        }, 440 => function ($stackPos) {
24495            $this->semValue = new Expr\Include_($this->semStack[$stackPos - (2 - 2)], Expr\Include_::TYPE_REQUIRE, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24496        }, 441 => function ($stackPos) {
24497            $this->semValue = new Expr\Include_($this->semStack[$stackPos - (2 - 2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24498        }, 442 => function ($stackPos) {
24499            $this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24500        }, 443 => function ($stackPos) {
24501            $attrs = $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes;
24502            $attrs['kind'] = $this->getFloatCastKind($this->semStack[$stackPos - (2 - 1)]);
24503            $this->semValue = new Expr\Cast\Double($this->semStack[$stackPos - (2 - 2)], $attrs);
24504        }, 444 => function ($stackPos) {
24505            $this->semValue = new Expr\Cast\String_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24506        }, 445 => function ($stackPos) {
24507            $this->semValue = new Expr\Cast\Array_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24508        }, 446 => function ($stackPos) {
24509            $this->semValue = new Expr\Cast\Object_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24510        }, 447 => function ($stackPos) {
24511            $this->semValue = new Expr\Cast\Bool_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24512        }, 448 => function ($stackPos) {
24513            $this->semValue = new Expr\Cast\Unset_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24514        }, 449 => function ($stackPos) {
24515            $attrs = $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes;
24516            $attrs['kind'] = \strtolower($this->semStack[$stackPos - (2 - 1)]) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE;
24517            $this->semValue = new Expr\Exit_($this->semStack[$stackPos - (2 - 2)], $attrs);
24518        }, 450 => function ($stackPos) {
24519            $this->semValue = new Expr\ErrorSuppress($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24520        }, 451 => function ($stackPos) {
24521            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24522        }, 452 => function ($stackPos) {
24523            $this->semValue = new Expr\ShellExec($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24524        }, 453 => function ($stackPos) {
24525            $this->semValue = new Expr\Print_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24526        }, 454 => function ($stackPos) {
24527            $this->semValue = new Expr\Yield_(null, null, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24528        }, 455 => function ($stackPos) {
24529            $this->semValue = new Expr\Yield_($this->semStack[$stackPos - (2 - 2)], null, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24530        }, 456 => function ($stackPos) {
24531            $this->semValue = new Expr\Yield_($this->semStack[$stackPos - (4 - 4)], $this->semStack[$stackPos - (4 - 2)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
24532        }, 457 => function ($stackPos) {
24533            $this->semValue = new Expr\YieldFrom($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24534        }, 458 => function ($stackPos) {
24535            $this->semValue = new Expr\Throw_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24536        }, 459 => function ($stackPos) {
24537            $this->semValue = new Expr\ArrowFunction(['static' => \false, 'byRef' => $this->semStack[$stackPos - (8 - 2)], 'params' => $this->semStack[$stackPos - (8 - 4)], 'returnType' => $this->semStack[$stackPos - (8 - 6)], 'expr' => $this->semStack[$stackPos - (8 - 8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos - (8 - 1)] + $this->endAttributes);
24538        }, 460 => function ($stackPos) {
24539            $this->semValue = new Expr\ArrowFunction(['static' => \true, 'byRef' => $this->semStack[$stackPos - (9 - 3)], 'params' => $this->semStack[$stackPos - (9 - 5)], 'returnType' => $this->semStack[$stackPos - (9 - 7)], 'expr' => $this->semStack[$stackPos - (9 - 9)], 'attrGroups' => []], $this->startAttributeStack[$stackPos - (9 - 1)] + $this->endAttributes);
24540        }, 461 => function ($stackPos) {
24541            $this->semValue = new Expr\Closure(['static' => \false, 'byRef' => $this->semStack[$stackPos - (8 - 2)], 'params' => $this->semStack[$stackPos - (8 - 4)], 'uses' => $this->semStack[$stackPos - (8 - 6)], 'returnType' => $this->semStack[$stackPos - (8 - 7)], 'stmts' => $this->semStack[$stackPos - (8 - 8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos - (8 - 1)] + $this->endAttributes);
24542        }, 462 => function ($stackPos) {
24543            $this->semValue = new Expr\Closure(['static' => \true, 'byRef' => $this->semStack[$stackPos - (9 - 3)], 'params' => $this->semStack[$stackPos - (9 - 5)], 'uses' => $this->semStack[$stackPos - (9 - 7)], 'returnType' => $this->semStack[$stackPos - (9 - 8)], 'stmts' => $this->semStack[$stackPos - (9 - 9)], 'attrGroups' => []], $this->startAttributeStack[$stackPos - (9 - 1)] + $this->endAttributes);
24544        }, 463 => function ($stackPos) {
24545            $this->semValue = new Expr\ArrowFunction(['static' => \false, 'byRef' => $this->semStack[$stackPos - (9 - 3)], 'params' => $this->semStack[$stackPos - (9 - 5)], 'returnType' => $this->semStack[$stackPos - (9 - 7)], 'expr' => $this->semStack[$stackPos - (9 - 9)], 'attrGroups' => $this->semStack[$stackPos - (9 - 1)]], $this->startAttributeStack[$stackPos - (9 - 1)] + $this->endAttributes);
24546        }, 464 => function ($stackPos) {
24547            $this->semValue = new Expr\ArrowFunction(['static' => \true, 'byRef' => $this->semStack[$stackPos - (10 - 4)], 'params' => $this->semStack[$stackPos - (10 - 6)], 'returnType' => $this->semStack[$stackPos - (10 - 8)], 'expr' => $this->semStack[$stackPos - (10 - 10)], 'attrGroups' => $this->semStack[$stackPos - (10 - 1)]], $this->startAttributeStack[$stackPos - (10 - 1)] + $this->endAttributes);
24548        }, 465 => function ($stackPos) {
24549            $this->semValue = new Expr\Closure(['static' => \false, 'byRef' => $this->semStack[$stackPos - (9 - 3)], 'params' => $this->semStack[$stackPos - (9 - 5)], 'uses' => $this->semStack[$stackPos - (9 - 7)], 'returnType' => $this->semStack[$stackPos - (9 - 8)], 'stmts' => $this->semStack[$stackPos - (9 - 9)], 'attrGroups' => $this->semStack[$stackPos - (9 - 1)]], $this->startAttributeStack[$stackPos - (9 - 1)] + $this->endAttributes);
24550        }, 466 => function ($stackPos) {
24551            $this->semValue = new Expr\Closure(['static' => \true, 'byRef' => $this->semStack[$stackPos - (10 - 4)], 'params' => $this->semStack[$stackPos - (10 - 6)], 'uses' => $this->semStack[$stackPos - (10 - 8)], 'returnType' => $this->semStack[$stackPos - (10 - 9)], 'stmts' => $this->semStack[$stackPos - (10 - 10)], 'attrGroups' => $this->semStack[$stackPos - (10 - 1)]], $this->startAttributeStack[$stackPos - (10 - 1)] + $this->endAttributes);
24552        }, 467 => function ($stackPos) {
24553            $this->semValue = array(new Stmt\Class_(null, ['type' => 0, 'extends' => $this->semStack[$stackPos - (8 - 4)], 'implements' => $this->semStack[$stackPos - (8 - 5)], 'stmts' => $this->semStack[$stackPos - (8 - 7)], 'attrGroups' => $this->semStack[$stackPos - (8 - 1)]], $this->startAttributeStack[$stackPos - (8 - 1)] + $this->endAttributes), $this->semStack[$stackPos - (8 - 3)]);
24554            $this->checkClass($this->semValue[0], -1);
24555        }, 468 => function ($stackPos) {
24556            $this->semValue = new Expr\New_($this->semStack[$stackPos - (3 - 2)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24557        }, 469 => function ($stackPos) {
24558            list($class, $ctorArgs) = $this->semStack[$stackPos - (2 - 2)];
24559            $this->semValue = new Expr\New_($class, $ctorArgs, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24560        }, 470 => function ($stackPos) {
24561            $this->semValue = array();
24562        }, 471 => function ($stackPos) {
24563            $this->semValue = $this->semStack[$stackPos - (4 - 3)];
24564        }, 472 => function ($stackPos) {
24565            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
24566        }, 473 => function ($stackPos) {
24567            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
24568        }, 474 => function ($stackPos) {
24569            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
24570            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
24571        }, 475 => function ($stackPos) {
24572            $this->semValue = new Expr\ClosureUse($this->semStack[$stackPos - (2 - 2)], $this->semStack[$stackPos - (2 - 1)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24573        }, 476 => function ($stackPos) {
24574            $this->semValue = new Expr\FuncCall($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24575        }, 477 => function ($stackPos) {
24576            $this->semValue = new Expr\FuncCall($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24577        }, 478 => function ($stackPos) {
24578            $this->semValue = new Expr\StaticCall($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
24579        }, 479 => function ($stackPos) {
24580            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24581        }, 480 => function ($stackPos) {
24582            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24583        }, 481 => function ($stackPos) {
24584            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24585        }, 482 => function ($stackPos) {
24586            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24587        }, 483 => function ($stackPos) {
24588            $this->semValue = new Name\FullyQualified(\substr($this->semStack[$stackPos - (1 - 1)], 1), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24589        }, 484 => function ($stackPos) {
24590            $this->semValue = new Name\Relative(\substr($this->semStack[$stackPos - (1 - 1)], 10), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24591        }, 485 => function ($stackPos) {
24592            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24593        }, 486 => function ($stackPos) {
24594            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24595        }, 487 => function ($stackPos) {
24596            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
24597        }, 488 => function ($stackPos) {
24598            $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24599            $this->errorState = 2;
24600        }, 489 => function ($stackPos) {
24601            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24602        }, 490 => function ($stackPos) {
24603            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24604        }, 491 => function ($stackPos) {
24605            $this->semValue = null;
24606        }, 492 => function ($stackPos) {
24607            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
24608        }, 493 => function ($stackPos) {
24609            $this->semValue = array();
24610        }, 494 => function ($stackPos) {
24611            $this->semValue = array(new Scalar\EncapsedStringPart(Scalar\String_::parseEscapeSequences($this->semStack[$stackPos - (1 - 1)], '`'), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes));
24612        }, 495 => function ($stackPos) {
24613            foreach ($this->semStack[$stackPos - (1 - 1)] as $s) {
24614                if ($s instanceof Node\Scalar\EncapsedStringPart) {
24615                    $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', \true);
24616                }
24617            }
24618            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24619        }, 496 => function ($stackPos) {
24620            $this->semValue = array();
24621        }, 497 => function ($stackPos) {
24622            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24623        }, 498 => function ($stackPos) {
24624            $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24625        }, 499 => function ($stackPos) {
24626            $this->semValue = new Scalar\MagicConst\Line($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24627        }, 500 => function ($stackPos) {
24628            $this->semValue = new Scalar\MagicConst\File($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24629        }, 501 => function ($stackPos) {
24630            $this->semValue = new Scalar\MagicConst\Dir($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24631        }, 502 => function ($stackPos) {
24632            $this->semValue = new Scalar\MagicConst\Class_($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24633        }, 503 => function ($stackPos) {
24634            $this->semValue = new Scalar\MagicConst\Trait_($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24635        }, 504 => function ($stackPos) {
24636            $this->semValue = new Scalar\MagicConst\Method($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24637        }, 505 => function ($stackPos) {
24638            $this->semValue = new Scalar\MagicConst\Function_($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24639        }, 506 => function ($stackPos) {
24640            $this->semValue = new Scalar\MagicConst\Namespace_($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24641        }, 507 => function ($stackPos) {
24642            $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24643        }, 508 => function ($stackPos) {
24644            $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos - (3 - 1)], new Expr\Error($this->startAttributeStack[$stackPos - (3 - 3)] + $this->endAttributeStack[$stackPos - (3 - 3)]), $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24645            $this->errorState = 2;
24646        }, 509 => function ($stackPos) {
24647            $attrs = $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes;
24648            $attrs['kind'] = Expr\Array_::KIND_SHORT;
24649            $this->semValue = new Expr\Array_($this->semStack[$stackPos - (3 - 2)], $attrs);
24650        }, 510 => function ($stackPos) {
24651            $attrs = $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes;
24652            $attrs['kind'] = Expr\Array_::KIND_LONG;
24653            $this->semValue = new Expr\Array_($this->semStack[$stackPos - (4 - 3)], $attrs);
24654        }, 511 => function ($stackPos) {
24655            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24656        }, 512 => function ($stackPos) {
24657            $attrs = $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes;
24658            $attrs['kind'] = $this->semStack[$stackPos - (1 - 1)][0] === "'" || $this->semStack[$stackPos - (1 - 1)][1] === "'" && ($this->semStack[$stackPos - (1 - 1)][0] === 'b' || $this->semStack[$stackPos - (1 - 1)][0] === 'B') ? Scalar\String_::KIND_SINGLE_QUOTED : Scalar\String_::KIND_DOUBLE_QUOTED;
24659            $this->semValue = new Scalar\String_(Scalar\String_::parse($this->semStack[$stackPos - (1 - 1)]), $attrs);
24660        }, 513 => function ($stackPos) {
24661            $attrs = $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes;
24662            $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED;
24663            foreach ($this->semStack[$stackPos - (3 - 2)] as $s) {
24664                if ($s instanceof Node\Scalar\EncapsedStringPart) {
24665                    $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', \true);
24666                }
24667            }
24668            $this->semValue = new Scalar\Encapsed($this->semStack[$stackPos - (3 - 2)], $attrs);
24669        }, 514 => function ($stackPos) {
24670            $this->semValue = $this->parseLNumber($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24671        }, 515 => function ($stackPos) {
24672            $this->semValue = new Scalar\DNumber(Scalar\DNumber::parse($this->semStack[$stackPos - (1 - 1)]), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24673        }, 516 => function ($stackPos) {
24674            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24675        }, 517 => function ($stackPos) {
24676            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24677        }, 518 => function ($stackPos) {
24678            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24679        }, 519 => function ($stackPos) {
24680            $this->semValue = $this->parseDocString($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 2)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes, $this->startAttributeStack[$stackPos - (3 - 3)] + $this->endAttributeStack[$stackPos - (3 - 3)], \true);
24681        }, 520 => function ($stackPos) {
24682            $this->semValue = $this->parseDocString($this->semStack[$stackPos - (2 - 1)], '', $this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes, $this->startAttributeStack[$stackPos - (2 - 2)] + $this->endAttributeStack[$stackPos - (2 - 2)], \true);
24683        }, 521 => function ($stackPos) {
24684            $this->semValue = $this->parseDocString($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 2)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes, $this->startAttributeStack[$stackPos - (3 - 3)] + $this->endAttributeStack[$stackPos - (3 - 3)], \true);
24685        }, 522 => function ($stackPos) {
24686            $this->semValue = null;
24687        }, 523 => function ($stackPos) {
24688            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24689        }, 524 => function ($stackPos) {
24690            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24691        }, 525 => function ($stackPos) {
24692            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
24693        }, 526 => function ($stackPos) {
24694            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24695        }, 527 => function ($stackPos) {
24696            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24697        }, 528 => function ($stackPos) {
24698            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24699        }, 529 => function ($stackPos) {
24700            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24701        }, 530 => function ($stackPos) {
24702            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24703        }, 531 => function ($stackPos) {
24704            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
24705        }, 532 => function ($stackPos) {
24706            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24707        }, 533 => function ($stackPos) {
24708            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24709        }, 534 => function ($stackPos) {
24710            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
24711        }, 535 => function ($stackPos) {
24712            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
24713        }, 536 => function ($stackPos) {
24714            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24715        }, 537 => function ($stackPos) {
24716            $this->semValue = new Expr\MethodCall($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
24717        }, 538 => function ($stackPos) {
24718            $this->semValue = new Expr\NullsafeMethodCall($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
24719        }, 539 => function ($stackPos) {
24720            $this->semValue = null;
24721        }, 540 => function ($stackPos) {
24722            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24723        }, 541 => function ($stackPos) {
24724            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24725        }, 542 => function ($stackPos) {
24726            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24727        }, 543 => function ($stackPos) {
24728            $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24729        }, 544 => function ($stackPos) {
24730            $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24731        }, 545 => function ($stackPos) {
24732            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24733        }, 546 => function ($stackPos) {
24734            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
24735        }, 547 => function ($stackPos) {
24736            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24737        }, 548 => function ($stackPos) {
24738            $this->semValue = new Expr\Variable(new Expr\Error($this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes), $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24739            $this->errorState = 2;
24740        }, 549 => function ($stackPos) {
24741            $var = $this->semStack[$stackPos - (1 - 1)]->name;
24742            $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes) : $var;
24743        }, 550 => function ($stackPos) {
24744            $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24745        }, 551 => function ($stackPos) {
24746            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24747        }, 552 => function ($stackPos) {
24748            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
24749        }, 553 => function ($stackPos) {
24750            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
24751        }, 554 => function ($stackPos) {
24752            $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24753        }, 555 => function ($stackPos) {
24754            $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24755        }, 556 => function ($stackPos) {
24756            $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24757        }, 557 => function ($stackPos) {
24758            $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24759        }, 558 => function ($stackPos) {
24760            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24761        }, 559 => function ($stackPos) {
24762            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
24763        }, 560 => function ($stackPos) {
24764            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24765        }, 561 => function ($stackPos) {
24766            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24767        }, 562 => function ($stackPos) {
24768            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
24769        }, 563 => function ($stackPos) {
24770            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24771        }, 564 => function ($stackPos) {
24772            $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24773            $this->errorState = 2;
24774        }, 565 => function ($stackPos) {
24775            $this->semValue = new Expr\List_($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
24776        }, 566 => function ($stackPos) {
24777            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24778            $end = \count($this->semValue) - 1;
24779            if ($this->semValue[$end] === null) {
24780                \array_pop($this->semValue);
24781            }
24782        }, 567 => function ($stackPos) {
24783            $this->semValue = $this->semStack[$stackPos];
24784        }, 568 => function ($stackPos) {
24785            /* do nothing -- prevent default action of $$=$this->semStack[$1]. See $551. */
24786        }, 569 => function ($stackPos) {
24787            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
24788            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
24789        }, 570 => function ($stackPos) {
24790            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
24791        }, 571 => function ($stackPos) {
24792            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (1 - 1)], null, \false, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24793        }, 572 => function ($stackPos) {
24794            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (2 - 2)], null, \true, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24795        }, 573 => function ($stackPos) {
24796            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (1 - 1)], null, \false, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24797        }, 574 => function ($stackPos) {
24798            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (3 - 3)], $this->semStack[$stackPos - (3 - 1)], \false, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24799        }, 575 => function ($stackPos) {
24800            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (4 - 4)], $this->semStack[$stackPos - (4 - 1)], \true, $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
24801        }, 576 => function ($stackPos) {
24802            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (3 - 3)], $this->semStack[$stackPos - (3 - 1)], \false, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24803        }, 577 => function ($stackPos) {
24804            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (2 - 2)], null, \false, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes, \true, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24805        }, 578 => function ($stackPos) {
24806            $this->semValue = null;
24807        }, 579 => function ($stackPos) {
24808            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
24809            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
24810        }, 580 => function ($stackPos) {
24811            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
24812            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
24813        }, 581 => function ($stackPos) {
24814            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
24815        }, 582 => function ($stackPos) {
24816            $this->semValue = array($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)]);
24817        }, 583 => function ($stackPos) {
24818            $this->semValue = new Scalar\EncapsedStringPart($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24819        }, 584 => function ($stackPos) {
24820            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24821        }, 585 => function ($stackPos) {
24822            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24823        }, 586 => function ($stackPos) {
24824            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
24825        }, 587 => function ($stackPos) {
24826            $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24827        }, 588 => function ($stackPos) {
24828            $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24829        }, 589 => function ($stackPos) {
24830            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24831        }, 590 => function ($stackPos) {
24832            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
24833        }, 591 => function ($stackPos) {
24834            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (6 - 2)], $this->semStack[$stackPos - (6 - 4)], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
24835        }, 592 => function ($stackPos) {
24836            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
24837        }, 593 => function ($stackPos) {
24838            $this->semValue = new Scalar\String_($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24839        }, 594 => function ($stackPos) {
24840            $this->semValue = $this->parseNumString($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
24841        }, 595 => function ($stackPos) {
24842            $this->semValue = $this->parseNumString('-' . $this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
24843        }, 596 => function ($stackPos) {
24844            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
24845        }];
24846    }
24847}
24848<?php
24849
24850namespace PHPUnit\PhpParser\Parser;
24851
24852/* GENERATED file based on grammar/tokens.y */
24853final class Tokens
24854{
24855    const YYERRTOK = 256;
24856    const T_THROW = 257;
24857    const T_INCLUDE = 258;
24858    const T_INCLUDE_ONCE = 259;
24859    const T_EVAL = 260;
24860    const T_REQUIRE = 261;
24861    const T_REQUIRE_ONCE = 262;
24862    const T_LOGICAL_OR = 263;
24863    const T_LOGICAL_XOR = 264;
24864    const T_LOGICAL_AND = 265;
24865    const T_PRINT = 266;
24866    const T_YIELD = 267;
24867    const T_DOUBLE_ARROW = 268;
24868    const T_YIELD_FROM = 269;
24869    const T_PLUS_EQUAL = 270;
24870    const T_MINUS_EQUAL = 271;
24871    const T_MUL_EQUAL = 272;
24872    const T_DIV_EQUAL = 273;
24873    const T_CONCAT_EQUAL = 274;
24874    const T_MOD_EQUAL = 275;
24875    const T_AND_EQUAL = 276;
24876    const T_OR_EQUAL = 277;
24877    const T_XOR_EQUAL = 278;
24878    const T_SL_EQUAL = 279;
24879    const T_SR_EQUAL = 280;
24880    const T_POW_EQUAL = 281;
24881    const T_COALESCE_EQUAL = 282;
24882    const T_COALESCE = 283;
24883    const T_BOOLEAN_OR = 284;
24884    const T_BOOLEAN_AND = 285;
24885    const T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG = 286;
24886    const T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG = 287;
24887    const T_IS_EQUAL = 288;
24888    const T_IS_NOT_EQUAL = 289;
24889    const T_IS_IDENTICAL = 290;
24890    const T_IS_NOT_IDENTICAL = 291;
24891    const T_SPACESHIP = 292;
24892    const T_IS_SMALLER_OR_EQUAL = 293;
24893    const T_IS_GREATER_OR_EQUAL = 294;
24894    const T_SL = 295;
24895    const T_SR = 296;
24896    const T_INSTANCEOF = 297;
24897    const T_INC = 298;
24898    const T_DEC = 299;
24899    const T_INT_CAST = 300;
24900    const T_DOUBLE_CAST = 301;
24901    const T_STRING_CAST = 302;
24902    const T_ARRAY_CAST = 303;
24903    const T_OBJECT_CAST = 304;
24904    const T_BOOL_CAST = 305;
24905    const T_UNSET_CAST = 306;
24906    const T_POW = 307;
24907    const T_NEW = 308;
24908    const T_CLONE = 309;
24909    const T_EXIT = 310;
24910    const T_IF = 311;
24911    const T_ELSEIF = 312;
24912    const T_ELSE = 313;
24913    const T_ENDIF = 314;
24914    const T_LNUMBER = 315;
24915    const T_DNUMBER = 316;
24916    const T_STRING = 317;
24917    const T_STRING_VARNAME = 318;
24918    const T_VARIABLE = 319;
24919    const T_NUM_STRING = 320;
24920    const T_INLINE_HTML = 321;
24921    const T_ENCAPSED_AND_WHITESPACE = 322;
24922    const T_CONSTANT_ENCAPSED_STRING = 323;
24923    const T_ECHO = 324;
24924    const T_DO = 325;
24925    const T_WHILE = 326;
24926    const T_ENDWHILE = 327;
24927    const T_FOR = 328;
24928    const T_ENDFOR = 329;
24929    const T_FOREACH = 330;
24930    const T_ENDFOREACH = 331;
24931    const T_DECLARE = 332;
24932    const T_ENDDECLARE = 333;
24933    const T_AS = 334;
24934    const T_SWITCH = 335;
24935    const T_MATCH = 336;
24936    const T_ENDSWITCH = 337;
24937    const T_CASE = 338;
24938    const T_DEFAULT = 339;
24939    const T_BREAK = 340;
24940    const T_CONTINUE = 341;
24941    const T_GOTO = 342;
24942    const T_FUNCTION = 343;
24943    const T_FN = 344;
24944    const T_CONST = 345;
24945    const T_RETURN = 346;
24946    const T_TRY = 347;
24947    const T_CATCH = 348;
24948    const T_FINALLY = 349;
24949    const T_USE = 350;
24950    const T_INSTEADOF = 351;
24951    const T_GLOBAL = 352;
24952    const T_STATIC = 353;
24953    const T_ABSTRACT = 354;
24954    const T_FINAL = 355;
24955    const T_PRIVATE = 356;
24956    const T_PROTECTED = 357;
24957    const T_PUBLIC = 358;
24958    const T_READONLY = 359;
24959    const T_VAR = 360;
24960    const T_UNSET = 361;
24961    const T_ISSET = 362;
24962    const T_EMPTY = 363;
24963    const T_HALT_COMPILER = 364;
24964    const T_CLASS = 365;
24965    const T_TRAIT = 366;
24966    const T_INTERFACE = 367;
24967    const T_ENUM = 368;
24968    const T_EXTENDS = 369;
24969    const T_IMPLEMENTS = 370;
24970    const T_OBJECT_OPERATOR = 371;
24971    const T_NULLSAFE_OBJECT_OPERATOR = 372;
24972    const T_LIST = 373;
24973    const T_ARRAY = 374;
24974    const T_CALLABLE = 375;
24975    const T_CLASS_C = 376;
24976    const T_TRAIT_C = 377;
24977    const T_METHOD_C = 378;
24978    const T_FUNC_C = 379;
24979    const T_LINE = 380;
24980    const T_FILE = 381;
24981    const T_START_HEREDOC = 382;
24982    const T_END_HEREDOC = 383;
24983    const T_DOLLAR_OPEN_CURLY_BRACES = 384;
24984    const T_CURLY_OPEN = 385;
24985    const T_PAAMAYIM_NEKUDOTAYIM = 386;
24986    const T_NAMESPACE = 387;
24987    const T_NS_C = 388;
24988    const T_DIR = 389;
24989    const T_NS_SEPARATOR = 390;
24990    const T_ELLIPSIS = 391;
24991    const T_NAME_FULLY_QUALIFIED = 392;
24992    const T_NAME_QUALIFIED = 393;
24993    const T_NAME_RELATIVE = 394;
24994    const T_ATTRIBUTE = 395;
24995}
24996<?php
24997
24998declare (strict_types=1);
24999namespace PHPUnit\PhpParser\Parser;
25000
25001use PHPUnit\PhpParser\Error;
25002use PHPUnit\PhpParser\ErrorHandler;
25003use PHPUnit\PhpParser\Parser;
25004class Multiple implements Parser
25005{
25006    /** @var Parser[] List of parsers to try, in order of preference */
25007    private $parsers;
25008    /**
25009     * Create a parser which will try multiple parsers in an order of preference.
25010     *
25011     * Parsers will be invoked in the order they're provided to the constructor. If one of the
25012     * parsers runs without throwing, it's output is returned. Otherwise the exception that the
25013     * first parser generated is thrown.
25014     *
25015     * @param Parser[] $parsers
25016     */
25017    public function __construct(array $parsers)
25018    {
25019        $this->parsers = $parsers;
25020    }
25021    public function parse(string $code, ErrorHandler $errorHandler = null)
25022    {
25023        if (null === $errorHandler) {
25024            $errorHandler = new ErrorHandler\Throwing();
25025        }
25026        list($firstStmts, $firstError) = $this->tryParse($this->parsers[0], $errorHandler, $code);
25027        if ($firstError === null) {
25028            return $firstStmts;
25029        }
25030        for ($i = 1, $c = \count($this->parsers); $i < $c; ++$i) {
25031            list($stmts, $error) = $this->tryParse($this->parsers[$i], $errorHandler, $code);
25032            if ($error === null) {
25033                return $stmts;
25034            }
25035        }
25036        throw $firstError;
25037    }
25038    private function tryParse(Parser $parser, ErrorHandler $errorHandler, $code)
25039    {
25040        $stmts = null;
25041        $error = null;
25042        try {
25043            $stmts = $parser->parse($code, $errorHandler);
25044        } catch (Error $error) {
25045        }
25046        return [$stmts, $error];
25047    }
25048}
25049<?php
25050
25051namespace PHPUnit\PhpParser\Parser;
25052
25053use PHPUnit\PhpParser\Error;
25054use PHPUnit\PhpParser\Node;
25055use PHPUnit\PhpParser\Node\Expr;
25056use PHPUnit\PhpParser\Node\Name;
25057use PHPUnit\PhpParser\Node\Scalar;
25058use PHPUnit\PhpParser\Node\Stmt;
25059/* This is an automatically GENERATED file, which should not be manually edited.
25060 * Instead edit one of the following:
25061 *  * the grammar files grammar/php5.y or grammar/php7.y
25062 *  * the skeleton file grammar/parser.template
25063 *  * the preprocessing script grammar/rebuildParsers.php
25064 */
25065class Php5 extends \PHPUnit\PhpParser\ParserAbstract
25066{
25067    protected $tokenToSymbolMapSize = 396;
25068    protected $actionTableSize = 1093;
25069    protected $gotoTableSize = 643;
25070    protected $invalidSymbol = 168;
25071    protected $errorSymbol = 1;
25072    protected $defaultAction = -32766;
25073    protected $unexpectedTokenRule = 32767;
25074    protected $YY2TBLSTATE = 415;
25075    protected $numNonLeafStates = 662;
25076    protected $symbolToName = array("EOF", "error", "T_THROW", "T_INCLUDE", "T_INCLUDE_ONCE", "T_EVAL", "T_REQUIRE", "T_REQUIRE_ONCE", "','", "T_LOGICAL_OR", "T_LOGICAL_XOR", "T_LOGICAL_AND", "T_PRINT", "T_YIELD", "T_DOUBLE_ARROW", "T_YIELD_FROM", "'='", "T_PLUS_EQUAL", "T_MINUS_EQUAL", "T_MUL_EQUAL", "T_DIV_EQUAL", "T_CONCAT_EQUAL", "T_MOD_EQUAL", "T_AND_EQUAL", "T_OR_EQUAL", "T_XOR_EQUAL", "T_SL_EQUAL", "T_SR_EQUAL", "T_POW_EQUAL", "T_COALESCE_EQUAL", "'?'", "':'", "T_COALESCE", "T_BOOLEAN_OR", "T_BOOLEAN_AND", "'|'", "'^'", "T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG", "T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG", "T_IS_EQUAL", "T_IS_NOT_EQUAL", "T_IS_IDENTICAL", "T_IS_NOT_IDENTICAL", "T_SPACESHIP", "'<'", "T_IS_SMALLER_OR_EQUAL", "'>'", "T_IS_GREATER_OR_EQUAL", "T_SL", "T_SR", "'+'", "'-'", "'.'", "'*'", "'/'", "'%'", "'!'", "T_INSTANCEOF", "'~'", "T_INC", "T_DEC", "T_INT_CAST", "T_DOUBLE_CAST", "T_STRING_CAST", "T_ARRAY_CAST", "T_OBJECT_CAST", "T_BOOL_CAST", "T_UNSET_CAST", "'@'", "T_POW", "'['", "T_NEW", "T_CLONE", "T_EXIT", "T_IF", "T_ELSEIF", "T_ELSE", "T_ENDIF", "T_LNUMBER", "T_DNUMBER", "T_STRING", "T_STRING_VARNAME", "T_VARIABLE", "T_NUM_STRING", "T_INLINE_HTML", "T_ENCAPSED_AND_WHITESPACE", "T_CONSTANT_ENCAPSED_STRING", "T_ECHO", "T_DO", "T_WHILE", "T_ENDWHILE", "T_FOR", "T_ENDFOR", "T_FOREACH", "T_ENDFOREACH", "T_DECLARE", "T_ENDDECLARE", "T_AS", "T_SWITCH", "T_MATCH", "T_ENDSWITCH", "T_CASE", "T_DEFAULT", "T_BREAK", "T_CONTINUE", "T_GOTO", "T_FUNCTION", "T_FN", "T_CONST", "T_RETURN", "T_TRY", "T_CATCH", "T_FINALLY", "T_USE", "T_INSTEADOF", "T_GLOBAL", "T_STATIC", "T_ABSTRACT", "T_FINAL", "T_PRIVATE", "T_PROTECTED", "T_PUBLIC", "T_VAR", "T_UNSET", "T_ISSET", "T_EMPTY", "T_HALT_COMPILER", "T_CLASS", "T_TRAIT", "T_INTERFACE", "T_EXTENDS", "T_IMPLEMENTS", "T_OBJECT_OPERATOR", "T_LIST", "T_ARRAY", "T_CALLABLE", "T_CLASS_C", "T_TRAIT_C", "T_METHOD_C", "T_FUNC_C", "T_LINE", "T_FILE", "T_START_HEREDOC", "T_END_HEREDOC", "T_DOLLAR_OPEN_CURLY_BRACES", "T_CURLY_OPEN", "T_PAAMAYIM_NEKUDOTAYIM", "T_NAMESPACE", "T_NS_C", "T_DIR", "T_NS_SEPARATOR", "T_ELLIPSIS", "T_NAME_FULLY_QUALIFIED", "T_NAME_QUALIFIED", "T_NAME_RELATIVE", "';'", "'{'", "'}'", "'('", "')'", "'\$'", "'`'", "']'", "'\"'", "T_READONLY", "T_ENUM", "T_NULLSAFE_OBJECT_OPERATOR", "T_ATTRIBUTE");
25077    protected $tokenToSymbol = array(0, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 56, 163, 168, 160, 55, 168, 168, 158, 159, 53, 50, 8, 51, 52, 54, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 31, 155, 44, 16, 46, 30, 68, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 70, 168, 162, 36, 168, 161, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 156, 35, 157, 58, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32, 33, 34, 37, 38, 39, 40, 41, 42, 43, 45, 47, 48, 49, 57, 59, 60, 61, 62, 63, 64, 65, 66, 67, 69, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 164, 122, 123, 124, 125, 126, 127, 128, 129, 165, 130, 131, 132, 166, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 167);
25078    protected $action = array(699, 669, 670, 671, 672, 673, 286, 674, 675, 676, 712, 713, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 0, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, -32766, -32766, -32766, -32766, -32766, -32766, -32766, -32766, -32766, -32767, -32767, -32767, -32767, 245, 246, 242, 243, 244, -32766, -32766, 677, -32766, 750, -32766, -32766, -32766, -32766, -32766, -32766, -32766, 1224, 245, 246, 1225, 678, 679, 680, 681, 682, 683, 684, -32766, 48, 746, -32766, -32766, -32766, -32766, -32766, -32766, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 715, 738, 716, 717, 718, 719, 707, 708, 709, 737, 710, 711, 696, 697, 698, 700, 701, 702, 740, 741, 742, 743, 744, 745, 703, 704, 705, 706, 736, 727, 725, 726, 722, 723, 751, 714, 720, 721, 728, 729, 731, 730, 732, 733, 55, 56, 425, 57, 58, 724, 735, 734, 1073, 59, 60, -224, 61, -32766, -32766, -32766, -32766, -32766, -32766, -32766, -32766, -32766, -32766, 121, -32767, -32767, -32767, -32767, 29, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 1043, 766, 1071, 767, 580, 62, 63, -32766, -32766, -32766, -32766, 64, 516, 65, 294, 295, 66, 67, 68, 69, 70, 71, 72, 73, 822, 25, 302, 74, 418, 981, 983, 1043, 1181, 1095, 1096, 1073, 748, 754, 1075, 1074, 1076, 469, -32766, -32766, -32766, 337, 823, 54, -32767, -32767, -32767, -32767, 98, 99, 100, 101, 102, 220, 221, 222, 78, 361, 1107, -32766, 341, -32766, -32766, -32766, -32766, -32766, 1107, 492, 949, 950, 951, 948, 947, 946, 207, 477, 478, 949, 950, 951, 948, 947, 946, 1043, 479, 480, 52, 1101, 1102, 1103, 1104, 1098, 1099, 319, 872, 668, 667, 27, -511, 1105, 1100, -32766, 130, 1075, 1074, 1076, 345, 668, 667, 41, 126, 341, 334, 369, 336, 426, -128, -128, -128, 896, 897, 468, 220, 221, 222, 811, 1195, 619, 40, 21, 427, -128, 470, -128, 471, -128, 472, -128, 802, 428, -4, 823, 54, 207, 33, 34, 429, 360, 317, 28, 35, 473, -32766, -32766, -32766, 211, 356, 357, 474, 475, -32766, -32766, -32766, 754, 476, 49, 313, 794, 843, 430, 431, 289, 125, -32766, 813, -32766, -32766, -32766, -32766, -32766, -32766, -32766, -32767, -32767, -32767, -32767, -32767, -32766, -32766, -32766, 769, 103, 104, 105, 327, 307, 825, 633, -128, 1075, 1074, 1076, 221, 222, 927, 748, 1146, 106, -32766, 129, -32766, -32766, -32766, -32766, 426, 823, 54, 902, 873, 302, 468, 75, 207, 359, 811, 668, 667, 40, 21, 427, 754, 470, 754, 471, 423, 472, 1043, 127, 428, 435, 1043, 341, 1043, 33, 34, 429, 360, 1181, 415, 35, 473, 122, 10, 315, 128, 356, 357, 474, 475, -32766, -32766, -32766, 768, 476, 668, 667, 758, 843, 430, 431, 754, 1043, 1147, -32766, -32766, -32766, 754, 419, 342, 1215, -32766, 131, -32766, -32766, -32766, 341, 363, 346, 426, 823, 54, 100, 101, 102, 468, 825, 633, -4, 811, 442, 903, 40, 21, 427, 754, 470, 435, 471, 341, 472, 341, 766, 428, 767, -209, -209, -209, 33, 34, 429, 360, 479, 1196, 35, 473, 345, -32766, -32766, -32766, 356, 357, 474, 475, 220, 221, 222, 421, 476, 32, 297, 794, 843, 430, 431, 754, 754, 435, -32766, 341, -32766, -32766, 9, 300, 51, 207, 249, 324, 753, 120, 220, 221, 222, 426, 30, 247, 941, 422, 424, 468, 825, 633, -209, 811, 1043, 1061, 40, 21, 427, 129, 470, 207, 471, 341, 472, 804, 20, 428, 124, -208, -208, -208, 33, 34, 429, 360, 479, 212, 35, 473, 923, -259, 823, 54, 356, 357, 474, 475, -32766, -32766, -32766, 1043, 476, 213, 806, 794, 843, 430, 431, -32766, -32766, 435, 435, 341, 341, 443, 79, 80, 81, -32766, 668, 667, 636, 344, 808, 668, 667, 239, 240, 241, 123, 214, 538, 250, 825, 633, -208, 36, 251, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 252, 307, 426, 220, 221, 222, 823, 54, 468, -32766, 222, 765, 811, 106, 134, 40, 21, 427, 571, 470, 207, 471, 445, 472, 207, -32766, 428, 896, 897, 207, 307, 33, 34, 429, 245, 246, 637, 35, 473, 452, 22, 809, 922, 356, 357, 457, 588, 135, 374, 595, 596, 476, -228, 759, 639, 938, 653, 926, 661, -86, 823, 54, 314, 644, 647, 821, 133, 836, 43, 106, 603, 44, 45, 46, 47, 748, 50, 53, 132, 426, 302, -32766, 520, 825, 633, 468, -84, 607, 577, 811, 641, 362, 40, 21, 427, -278, 470, 754, 471, 954, 472, 441, 627, 428, 823, 54, 574, 844, 33, 34, 429, 11, 615, 845, 35, 473, 444, 461, 285, -511, 356, 357, 592, -419, 593, 1106, 1153, -410, 476, 368, 838, 38, 658, 426, 645, 795, 1052, 0, 325, 468, 0, -32766, 0, 811, 0, 0, 40, 21, 427, 0, 470, 0, 471, 0, 472, 0, 322, 428, 823, 54, 825, 633, 33, 34, 429, 0, 326, 0, 35, 473, 323, 0, 316, 318, 356, 357, -512, 426, 0, 753, 531, 0, 476, 468, 6, 0, 0, 811, 650, 7, 40, 21, 427, 12, 470, 14, 471, 373, 472, -420, 562, 428, 823, 54, 78, -225, 33, 34, 429, 39, 656, 657, 35, 473, 859, 633, 764, 812, 356, 357, 820, 799, 814, 875, 866, 867, 476, 797, 860, 857, 855, 426, 933, 934, 931, 819, 803, 468, 805, 807, 810, 811, 930, 762, 40, 21, 427, 763, 470, 932, 471, 335, 472, 358, 634, 428, 638, 640, 825, 633, 33, 34, 429, 642, 643, 646, 35, 473, 648, 649, 651, 652, 356, 357, 635, 426, 1221, 1223, 761, 842, 476, 468, 248, 760, 841, 811, 1222, 840, 40, 21, 427, 1057, 470, 830, 471, 1045, 472, 839, 1046, 428, 828, 215, 216, 939, 33, 34, 429, 217, 864, 218, 35, 473, 825, 633, 24, 865, 356, 357, 456, 1220, 1189, 209, 1187, 1172, 476, 1185, 215, 216, 1086, 1095, 1096, 914, 217, 1193, 218, 1183, -224, 1097, 26, 31, 37, 42, 76, 77, 210, 288, 209, 292, 293, 308, 309, 310, 311, 339, 1095, 1096, 825, 633, 355, 291, 416, 1152, 1097, 16, 17, 18, 393, 453, 460, 462, 466, 552, 624, 1048, 1051, 904, 1111, 1047, 1023, 563, 1022, 1088, 0, 0, -429, 558, 1041, 1101, 1102, 1103, 1104, 1098, 1099, 398, 1054, 1053, 1056, 1055, 1070, 1105, 1100, 1186, 1171, 1167, 1184, 1085, 1218, 1112, 1166, 219, 558, 599, 1101, 1102, 1103, 1104, 1098, 1099, 398, 0, 0, 0, 0, 0, 1105, 1100, 0, 0, 0, 0, 0, 0, 0, 0, 219);
25079    protected $actionCheck = array(2, 3, 4, 5, 6, 7, 14, 9, 10, 11, 12, 13, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 0, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 9, 10, 11, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 69, 70, 53, 54, 55, 9, 10, 57, 30, 80, 32, 33, 34, 35, 36, 37, 38, 80, 69, 70, 83, 71, 72, 73, 74, 75, 76, 77, 9, 70, 80, 33, 34, 35, 36, 37, 38, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 153, 133, 134, 135, 136, 137, 138, 139, 140, 141, 3, 4, 5, 6, 7, 147, 148, 149, 80, 12, 13, 159, 15, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 156, 44, 45, 46, 47, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 13, 106, 116, 108, 85, 50, 51, 33, 34, 35, 36, 56, 85, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 1, 70, 71, 72, 73, 59, 60, 13, 82, 78, 79, 80, 80, 82, 152, 153, 154, 86, 9, 10, 11, 8, 1, 2, 44, 45, 46, 47, 48, 49, 50, 51, 52, 9, 10, 11, 156, 106, 143, 30, 160, 32, 33, 34, 35, 36, 143, 116, 116, 117, 118, 119, 120, 121, 30, 124, 125, 116, 117, 118, 119, 120, 121, 13, 133, 134, 70, 136, 137, 138, 139, 140, 141, 142, 31, 37, 38, 8, 132, 148, 149, 116, 156, 152, 153, 154, 160, 37, 38, 158, 8, 160, 161, 8, 163, 74, 75, 76, 77, 134, 135, 80, 9, 10, 11, 84, 1, 80, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 155, 98, 0, 1, 2, 30, 103, 104, 105, 106, 132, 8, 109, 110, 9, 10, 11, 8, 115, 116, 117, 118, 9, 10, 11, 82, 123, 70, 8, 126, 127, 128, 129, 8, 156, 30, 155, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 9, 10, 11, 157, 53, 54, 55, 8, 57, 155, 156, 157, 152, 153, 154, 10, 11, 157, 80, 162, 69, 30, 151, 32, 33, 34, 35, 74, 1, 2, 159, 155, 71, 80, 151, 30, 8, 84, 37, 38, 87, 88, 89, 82, 91, 82, 93, 8, 95, 13, 156, 98, 158, 13, 160, 13, 103, 104, 105, 106, 82, 108, 109, 110, 156, 8, 113, 31, 115, 116, 117, 118, 9, 10, 11, 157, 123, 37, 38, 126, 127, 128, 129, 82, 13, 159, 33, 34, 35, 82, 127, 8, 85, 30, 156, 32, 33, 34, 160, 8, 147, 74, 1, 2, 50, 51, 52, 80, 155, 156, 157, 84, 31, 159, 87, 88, 89, 82, 91, 158, 93, 160, 95, 160, 106, 98, 108, 100, 101, 102, 103, 104, 105, 106, 133, 159, 109, 110, 160, 9, 10, 11, 115, 116, 117, 118, 9, 10, 11, 8, 123, 144, 145, 126, 127, 128, 129, 82, 82, 158, 30, 160, 32, 33, 108, 8, 70, 30, 31, 113, 152, 16, 9, 10, 11, 74, 14, 14, 122, 8, 8, 80, 155, 156, 157, 84, 13, 159, 87, 88, 89, 151, 91, 30, 93, 160, 95, 155, 159, 98, 14, 100, 101, 102, 103, 104, 105, 106, 133, 16, 109, 110, 155, 157, 1, 2, 115, 116, 117, 118, 9, 10, 11, 13, 123, 16, 155, 126, 127, 128, 129, 33, 34, 158, 158, 160, 160, 156, 9, 10, 11, 30, 37, 38, 31, 70, 155, 37, 38, 50, 51, 52, 156, 16, 81, 16, 155, 156, 157, 30, 16, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 16, 57, 74, 9, 10, 11, 1, 2, 80, 116, 11, 155, 84, 69, 156, 87, 88, 89, 160, 91, 30, 93, 132, 95, 30, 33, 98, 134, 135, 30, 57, 103, 104, 105, 69, 70, 31, 109, 110, 75, 76, 155, 155, 115, 116, 75, 76, 101, 102, 111, 112, 123, 159, 155, 156, 155, 156, 155, 156, 31, 1, 2, 31, 31, 31, 31, 31, 38, 70, 69, 77, 70, 70, 70, 70, 80, 70, 70, 70, 74, 71, 85, 85, 155, 156, 80, 97, 96, 100, 84, 31, 106, 87, 88, 89, 82, 91, 82, 93, 82, 95, 89, 92, 98, 1, 2, 90, 127, 103, 104, 105, 97, 94, 127, 109, 110, 97, 97, 97, 132, 115, 116, 100, 146, 113, 143, 143, 146, 123, 106, 151, 155, 157, 74, 31, 157, 162, -1, 114, 80, -1, 116, -1, 84, -1, -1, 87, 88, 89, -1, 91, -1, 93, -1, 95, -1, 130, 98, 1, 2, 155, 156, 103, 104, 105, -1, 130, -1, 109, 110, 131, -1, 132, 132, 115, 116, 132, 74, -1, 152, 150, -1, 123, 80, 146, -1, -1, 84, 31, 146, 87, 88, 89, 146, 91, 146, 93, 146, 95, 146, 150, 98, 1, 2, 156, 159, 103, 104, 105, 155, 155, 155, 109, 110, 155, 156, 155, 155, 115, 116, 155, 155, 155, 155, 155, 155, 123, 155, 155, 155, 155, 74, 155, 155, 155, 155, 155, 80, 155, 155, 155, 84, 155, 155, 87, 88, 89, 155, 91, 155, 93, 156, 95, 156, 156, 98, 156, 156, 155, 156, 103, 104, 105, 156, 156, 156, 109, 110, 156, 156, 156, 156, 115, 116, 156, 74, 157, 157, 157, 157, 123, 80, 31, 157, 157, 84, 157, 157, 87, 88, 89, 157, 91, 157, 93, 157, 95, 157, 157, 98, 157, 50, 51, 157, 103, 104, 105, 56, 157, 58, 109, 110, 155, 156, 158, 157, 115, 116, 157, 157, 157, 70, 157, 157, 123, 157, 50, 51, 157, 78, 79, 157, 56, 157, 58, 157, 159, 86, 158, 158, 158, 158, 158, 158, 158, 158, 70, 158, 158, 158, 158, 158, 158, 158, 78, 79, 155, 156, 158, 160, 158, 163, 86, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, -1, -1, 161, 134, 161, 136, 137, 138, 139, 140, 141, 142, 162, 162, 162, 162, 162, 148, 149, 162, 162, 162, 162, 162, 162, 162, 162, 158, 134, 162, 136, 137, 138, 139, 140, 141, 142, -1, -1, -1, -1, -1, 148, 149, -1, -1, -1, -1, -1, -1, -1, -1, 158);
25080    protected $actionBase = array(0, 227, 326, 400, 474, 233, 132, 132, 752, -2, -2, 138, -2, -2, -2, 663, 761, 815, 761, 586, 717, 859, 859, 859, 244, 256, 256, 256, 413, 583, 583, 880, 546, 169, 415, 444, 409, 200, 200, 200, 200, 137, 137, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 249, 205, 738, 559, 535, 739, 741, 742, 876, 679, 877, 820, 821, 693, 823, 824, 826, 829, 832, 819, 834, 907, 836, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 67, 536, 299, 510, 230, 44, 652, 652, 652, 652, 652, 652, 652, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 378, 584, 584, 584, 657, 909, 648, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, 503, -21, -21, 436, 650, 364, 571, 215, 426, 156, 26, 26, 329, 329, 329, 329, 329, 46, 46, 5, 5, 5, 5, 152, 186, 186, 186, 186, 120, 120, 120, 120, 374, 374, 429, 448, 448, 334, 267, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 336, 427, 427, 572, 572, 408, 551, 551, 551, 551, 671, 171, 171, 391, 311, 311, 311, 109, 641, 856, 68, 68, 68, 68, 68, 68, 324, 324, 324, -3, -3, -3, 655, 77, 380, 77, 380, 683, 685, 86, 685, 654, -15, 516, 776, 281, 646, 809, 680, 816, 560, 711, 202, 578, 857, 643, -23, 578, 578, 578, 578, 857, 622, 628, 596, -23, 578, -23, 639, 454, 849, 351, 249, 558, 469, 631, 743, 514, 688, 746, 464, 544, 548, 556, 7, 412, 708, 750, 878, 879, 349, 702, 631, 631, 631, 327, 101, 7, -8, 623, 623, 623, 623, 219, 623, 623, 623, 623, 291, 430, 545, 401, 745, 653, 653, 675, 839, 814, 814, 653, 673, 653, 675, 841, 841, 841, 841, 653, 653, 653, 653, 814, 814, 667, 814, 275, 684, 694, 694, 841, 713, 714, 653, 653, 697, 814, 814, 814, 697, 687, 841, 669, 637, 333, 814, 841, 689, 673, 689, 653, 669, 689, 673, 673, 689, 22, 686, 656, 840, 842, 860, 756, 638, 644, 847, 848, 843, 845, 838, 692, 719, 720, 528, 659, 660, 661, 662, 696, 664, 698, 643, 658, 658, 658, 645, 701, 645, 658, 658, 658, 658, 658, 658, 658, 658, 632, 635, 709, 699, 670, 723, 566, 582, 758, 640, 636, 872, 865, 881, 883, 849, 870, 645, 890, 634, 288, 610, 850, 633, 753, 645, 851, 645, 759, 645, 873, 777, 666, 778, 779, 658, 874, 891, 892, 893, 894, 897, 898, 899, 900, 665, 901, 724, 674, 866, 344, 844, 639, 705, 677, 755, 725, 780, 372, 902, 784, 645, 645, 765, 706, 645, 766, 726, 712, 862, 727, 867, 903, 640, 678, 868, 645, 681, 785, 904, 372, 690, 651, 704, 649, 728, 858, 875, 853, 767, 612, 617, 787, 788, 792, 691, 730, 863, 864, 835, 731, 770, 642, 771, 676, 794, 772, 852, 732, 796, 798, 871, 647, 707, 682, 672, 668, 773, 799, 869, 733, 735, 736, 801, 737, 804, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 137, 137, 137, 137, -2, -2, -2, -2, 0, 0, -2, 0, 0, 0, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 0, 0, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 602, -21, -21, -21, -21, 602, -21, -21, -21, -21, -21, -21, -21, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, -21, 602, 602, 602, -21, 68, -21, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 602, 0, 0, 602, -21, 602, -21, 602, -21, -21, 602, 602, 602, 602, 602, 602, 602, -21, -21, -21, -21, -21, -21, 0, 324, 324, 324, 324, -21, -21, -21, -21, 68, 68, 147, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 324, 324, -3, -3, 68, 68, 68, 68, 68, 147, 68, 68, -23, 673, 673, 673, 380, 380, 380, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 380, -23, 0, -23, 0, 68, -23, 673, -23, 380, 673, 673, -23, 814, 604, 604, 604, 604, 372, 7, 0, 0, 673, 673, 0, 0, 0, 0, 0, 673, 0, 0, 0, 0, 0, 0, 814, 0, 653, 0, 0, 0, 0, 658, 288, 0, 677, 456, 0, 0, 0, 0, 0, 0, 677, 456, 530, 530, 0, 665, 658, 658, 658, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 372);
25081    protected $actionDefault = array(3, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 540, 540, 495, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 297, 297, 297, 32767, 32767, 32767, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 32767, 32767, 32767, 32767, 32767, 32767, 381, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 387, 545, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 362, 363, 365, 366, 296, 548, 529, 245, 388, 544, 295, 247, 325, 499, 32767, 32767, 32767, 327, 122, 256, 201, 498, 125, 294, 232, 380, 382, 326, 301, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 300, 454, 359, 358, 357, 456, 32767, 455, 492, 492, 495, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 323, 483, 482, 324, 452, 328, 453, 331, 457, 460, 329, 330, 347, 348, 345, 346, 349, 458, 459, 476, 477, 474, 475, 299, 350, 351, 352, 353, 478, 479, 480, 481, 32767, 32767, 280, 539, 539, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 338, 339, 467, 468, 32767, 236, 236, 236, 236, 281, 236, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 333, 334, 332, 462, 463, 461, 428, 32767, 32767, 32767, 430, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 500, 32767, 32767, 32767, 32767, 32767, 513, 417, 171, 32767, 409, 32767, 171, 171, 171, 171, 32767, 220, 222, 167, 32767, 171, 32767, 486, 32767, 32767, 32767, 32767, 32767, 518, 343, 32767, 32767, 116, 32767, 32767, 32767, 555, 32767, 513, 32767, 116, 32767, 32767, 32767, 32767, 356, 335, 336, 337, 32767, 32767, 517, 511, 470, 471, 472, 473, 32767, 464, 465, 466, 469, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 425, 431, 431, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 516, 515, 32767, 410, 494, 186, 184, 184, 32767, 206, 206, 32767, 32767, 188, 487, 506, 32767, 188, 173, 32767, 398, 175, 494, 32767, 32767, 238, 32767, 238, 32767, 398, 238, 32767, 32767, 238, 32767, 411, 435, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 377, 378, 489, 502, 32767, 503, 32767, 409, 341, 342, 344, 320, 32767, 322, 367, 368, 369, 370, 371, 372, 373, 375, 32767, 415, 32767, 418, 32767, 32767, 32767, 255, 32767, 553, 32767, 32767, 304, 553, 32767, 32767, 32767, 547, 32767, 32767, 298, 32767, 32767, 32767, 32767, 251, 32767, 169, 32767, 537, 32767, 554, 32767, 511, 32767, 340, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 512, 32767, 32767, 32767, 32767, 227, 32767, 448, 32767, 116, 32767, 32767, 32767, 187, 32767, 32767, 302, 246, 32767, 32767, 546, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 114, 32767, 170, 32767, 32767, 32767, 189, 32767, 32767, 511, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 293, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 511, 32767, 32767, 231, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 411, 32767, 274, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 127, 127, 3, 127, 127, 258, 3, 258, 127, 258, 258, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 214, 217, 206, 206, 164, 127, 127, 266);
25082    protected $goto = array(166, 140, 140, 140, 166, 187, 168, 144, 147, 141, 142, 143, 149, 163, 163, 163, 163, 144, 144, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 138, 159, 160, 161, 162, 184, 139, 185, 493, 494, 377, 495, 499, 500, 501, 502, 503, 504, 505, 506, 967, 164, 145, 146, 148, 171, 176, 186, 203, 253, 256, 258, 260, 263, 264, 265, 266, 267, 268, 269, 277, 278, 279, 280, 303, 304, 328, 329, 330, 394, 395, 396, 542, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 150, 151, 152, 167, 153, 169, 154, 204, 170, 155, 156, 157, 205, 158, 136, 620, 560, 756, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 1108, 628, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 757, 888, 888, 508, 1200, 1200, 400, 606, 508, 536, 536, 568, 532, 534, 534, 496, 498, 524, 540, 569, 572, 583, 590, 852, 852, 852, 852, 847, 853, 174, 585, 519, 600, 601, 177, 178, 179, 401, 402, 403, 404, 173, 202, 206, 208, 257, 259, 261, 262, 270, 271, 272, 273, 274, 275, 281, 282, 283, 284, 305, 306, 331, 332, 333, 406, 407, 408, 409, 175, 180, 254, 255, 181, 182, 183, 497, 497, 785, 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, 509, 578, 582, 626, 749, 509, 544, 545, 546, 547, 548, 549, 550, 551, 553, 586, 338, 559, 321, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, 530, 349, 655, 555, 587, 352, 414, 591, 575, 604, 885, 611, 612, 881, 616, 617, 623, 625, 630, 632, 298, 296, 296, 296, 298, 290, 299, 944, 610, 816, 1170, 613, 436, 436, 375, 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, 1072, 1084, 1083, 945, 1065, 1072, 895, 895, 895, 895, 1178, 895, 895, 1212, 1212, 1178, 388, 858, 561, 755, 1072, 1072, 1072, 1072, 1072, 1072, 3, 4, 384, 384, 384, 1212, 874, 856, 854, 856, 654, 465, 511, 883, 878, 1089, 541, 384, 537, 384, 567, 384, 1026, 19, 15, 371, 384, 1226, 510, 1204, 1192, 1192, 1192, 510, 906, 372, 522, 533, 554, 912, 514, 1068, 1069, 13, 1065, 378, 912, 1158, 594, 23, 965, 386, 386, 386, 602, 1066, 1169, 1066, 937, 447, 449, 631, 752, 1177, 1067, 1109, 614, 935, 1177, 605, 1197, 391, 1211, 1211, 543, 892, 386, 1194, 1194, 1194, 399, 518, 1016, 901, 389, 771, 529, 752, 340, 752, 1211, 518, 518, 385, 781, 1214, 770, 772, 1063, 910, 774, 1058, 1176, 659, 953, 514, 782, 862, 915, 450, 573, 1155, 0, 463, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 513, 528, 0, 0, 0, 0, 513, 0, 528, 0, 350, 351, 0, 609, 512, 515, 438, 439, 1064, 618, 0, 0, 0, 0, 0, 0, 0, 0, 0, 779, 1219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 777, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 523, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 301, 301);
25083    protected $gotoCheck = array(43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 57, 68, 15, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 126, 9, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 16, 76, 76, 68, 76, 76, 51, 51, 68, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 68, 68, 68, 68, 68, 68, 27, 66, 101, 66, 66, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 117, 117, 29, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 61, 61, 61, 6, 117, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 125, 57, 125, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 32, 71, 32, 32, 69, 69, 69, 32, 40, 40, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 5, 5, 5, 5, 5, 5, 5, 97, 62, 50, 81, 62, 57, 57, 62, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 124, 124, 97, 81, 57, 57, 57, 57, 57, 118, 57, 57, 142, 142, 118, 12, 33, 12, 14, 57, 57, 57, 57, 57, 57, 30, 30, 13, 13, 13, 142, 14, 14, 14, 14, 14, 57, 14, 14, 14, 34, 2, 13, 109, 13, 2, 13, 34, 34, 34, 34, 13, 13, 122, 140, 9, 9, 9, 122, 83, 58, 58, 58, 34, 13, 13, 81, 81, 58, 81, 46, 13, 131, 127, 34, 101, 123, 123, 123, 34, 81, 81, 81, 8, 8, 8, 8, 11, 119, 81, 8, 8, 8, 119, 49, 138, 48, 141, 141, 47, 78, 123, 119, 119, 119, 123, 47, 102, 80, 17, 23, 9, 11, 18, 11, 141, 47, 47, 11, 23, 141, 23, 24, 115, 84, 25, 113, 119, 73, 99, 13, 26, 70, 85, 64, 65, 130, -1, 108, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 9, 9, -1, -1, -1, -1, 9, -1, 9, -1, 71, 71, -1, 13, 9, 9, 9, 9, 13, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, 9, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 101, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, 5);
25084    protected $gotoBase = array(0, 0, -184, 0, 0, 356, 290, 0, 488, 149, 0, 182, 85, 118, 426, 112, 203, 179, 208, 0, 0, 0, 0, 162, 190, 198, 120, 27, 0, 272, -224, 0, -274, 406, 32, 0, 0, 0, 0, 0, 330, 0, 0, -24, 0, 0, 440, 485, 213, 218, 371, -74, 0, 0, 0, 0, 0, 107, 110, 0, 0, -11, -72, 0, 104, 95, -405, 0, -94, 41, 119, -82, 0, 164, 0, 0, -79, 0, 197, 0, 204, 43, 0, 441, 171, 121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 115, 0, 195, 210, 0, 0, 0, 0, 0, 86, 427, 259, 0, 0, 116, 0, 174, 0, -5, 117, 196, 0, 0, 161, 170, 93, -21, -48, 273, 0, 0, 91, 271, 0, 0, 0, 0, 0, 0, 216, 0, 437, 187, 102, 0, 0);
25085    protected $gotoDefault = array(-32768, 467, 663, 2, 664, 834, 739, 747, 597, 481, 629, 581, 380, 1188, 791, 792, 793, 381, 367, 482, 379, 410, 405, 780, 773, 775, 783, 172, 411, 786, 1, 788, 517, 824, 1017, 364, 796, 365, 589, 798, 526, 800, 801, 137, 382, 383, 527, 483, 390, 576, 815, 276, 387, 817, 366, 818, 827, 370, 464, 454, 459, 556, 608, 432, 446, 570, 564, 535, 1081, 565, 861, 348, 869, 660, 877, 880, 484, 557, 891, 451, 899, 1094, 397, 905, 911, 916, 287, 919, 417, 412, 584, 924, 925, 5, 929, 621, 622, 8, 312, 952, 598, 966, 420, 1036, 1038, 485, 486, 521, 458, 507, 525, 487, 1059, 440, 413, 1062, 488, 489, 433, 434, 1078, 354, 1163, 353, 448, 320, 1150, 579, 1113, 455, 1203, 1159, 347, 490, 491, 376, 1182, 392, 1198, 437, 1205, 1213, 343, 539, 566);
25086    protected $ruleToNonTerminal = array(0, 1, 3, 3, 2, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 9, 10, 11, 11, 12, 12, 13, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 18, 18, 19, 19, 21, 21, 17, 17, 22, 22, 23, 23, 24, 24, 25, 25, 20, 20, 26, 28, 28, 29, 30, 30, 32, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 14, 14, 54, 54, 56, 55, 55, 48, 48, 58, 58, 59, 59, 60, 60, 15, 16, 16, 16, 63, 63, 63, 64, 64, 67, 67, 65, 65, 69, 69, 41, 41, 50, 50, 53, 53, 53, 52, 52, 70, 42, 42, 42, 42, 71, 71, 72, 72, 73, 73, 39, 39, 35, 35, 74, 37, 37, 75, 36, 36, 38, 38, 49, 49, 49, 61, 61, 77, 77, 78, 78, 80, 80, 80, 79, 79, 62, 62, 81, 81, 81, 82, 82, 83, 83, 83, 44, 44, 84, 84, 84, 45, 45, 85, 85, 86, 86, 66, 87, 87, 87, 87, 92, 92, 93, 93, 94, 94, 94, 94, 94, 95, 96, 96, 91, 91, 88, 88, 90, 90, 98, 98, 97, 97, 97, 97, 97, 97, 89, 89, 100, 99, 99, 46, 46, 40, 40, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 34, 34, 47, 47, 105, 105, 106, 106, 106, 106, 112, 101, 101, 108, 108, 114, 114, 115, 116, 116, 116, 116, 116, 116, 68, 68, 57, 57, 57, 57, 102, 102, 120, 120, 117, 117, 121, 121, 121, 121, 103, 103, 103, 107, 107, 107, 113, 113, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 27, 27, 27, 27, 27, 27, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 111, 111, 104, 104, 104, 104, 127, 127, 130, 130, 129, 129, 131, 131, 51, 51, 51, 51, 133, 133, 132, 132, 132, 132, 132, 134, 134, 119, 119, 122, 122, 118, 118, 136, 135, 135, 135, 135, 123, 123, 123, 123, 110, 110, 124, 124, 124, 124, 76, 137, 137, 138, 138, 138, 109, 109, 139, 139, 140, 140, 140, 140, 140, 125, 125, 125, 125, 142, 143, 141, 141, 141, 141, 141, 141, 141, 144, 144, 144);
25087    protected $ruleToLength = array(1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 5, 4, 3, 4, 2, 3, 1, 1, 7, 6, 3, 1, 3, 1, 3, 1, 1, 3, 1, 3, 1, 2, 3, 1, 3, 3, 1, 3, 2, 0, 1, 1, 1, 1, 1, 3, 5, 8, 3, 5, 9, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 1, 2, 2, 5, 7, 9, 5, 6, 3, 3, 2, 2, 1, 1, 1, 0, 2, 8, 0, 4, 1, 3, 0, 1, 0, 1, 0, 1, 10, 7, 6, 5, 1, 2, 2, 0, 2, 0, 2, 0, 2, 1, 3, 1, 4, 1, 4, 1, 1, 4, 1, 3, 3, 3, 4, 4, 5, 0, 2, 4, 3, 1, 1, 1, 4, 0, 2, 3, 0, 2, 4, 0, 2, 0, 3, 1, 2, 1, 1, 0, 1, 3, 4, 6, 1, 1, 1, 0, 1, 0, 2, 2, 3, 3, 1, 3, 1, 2, 2, 3, 1, 1, 2, 4, 3, 1, 1, 3, 2, 0, 1, 3, 3, 9, 3, 1, 3, 0, 2, 4, 5, 4, 4, 4, 3, 1, 1, 1, 3, 1, 1, 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 3, 3, 1, 0, 1, 1, 3, 3, 4, 4, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, 5, 4, 3, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 3, 2, 1, 2, 10, 11, 3, 3, 2, 4, 4, 3, 4, 4, 4, 4, 7, 3, 2, 0, 4, 1, 3, 2, 2, 4, 6, 2, 2, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 4, 4, 0, 2, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 1, 3, 1, 4, 3, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 5, 4, 4, 3, 1, 3, 1, 1, 3, 3, 0, 2, 0, 1, 3, 1, 3, 1, 1, 1, 1, 1, 6, 4, 3, 4, 2, 4, 4, 1, 3, 1, 2, 1, 1, 4, 1, 1, 3, 6, 4, 4, 4, 4, 1, 4, 0, 1, 1, 3, 1, 1, 4, 3, 1, 1, 1, 0, 0, 2, 3, 1, 3, 1, 4, 2, 2, 2, 2, 1, 2, 1, 1, 1, 4, 3, 3, 3, 6, 3, 1, 1, 1);
25088    protected function initReduceCallbacks()
25089    {
25090        $this->reduceCallbacks = [0 => function ($stackPos) {
25091            $this->semValue = $this->semStack[$stackPos];
25092        }, 1 => function ($stackPos) {
25093            $this->semValue = $this->handleNamespaces($this->semStack[$stackPos - (1 - 1)]);
25094        }, 2 => function ($stackPos) {
25095            if (\is_array($this->semStack[$stackPos - (2 - 2)])) {
25096                $this->semValue = \array_merge($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)]);
25097            } else {
25098                $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
25099                $this->semValue = $this->semStack[$stackPos - (2 - 1)];
25100            }
25101        }, 3 => function ($stackPos) {
25102            $this->semValue = array();
25103        }, 4 => function ($stackPos) {
25104            $startAttributes = $this->lookaheadStartAttributes;
25105            if (isset($startAttributes['comments'])) {
25106                $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments']));
25107            } else {
25108                $nop = null;
25109            }
25110            if ($nop !== null) {
25111                $this->semStack[$stackPos - (1 - 1)][] = $nop;
25112            }
25113            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25114        }, 5 => function ($stackPos) {
25115            $this->semValue = $this->semStack[$stackPos];
25116        }, 6 => function ($stackPos) {
25117            $this->semValue = $this->semStack[$stackPos];
25118        }, 7 => function ($stackPos) {
25119            $this->semValue = $this->semStack[$stackPos];
25120        }, 8 => function ($stackPos) {
25121            $this->semValue = $this->semStack[$stackPos];
25122        }, 9 => function ($stackPos) {
25123            $this->semValue = $this->semStack[$stackPos];
25124        }, 10 => function ($stackPos) {
25125            $this->semValue = $this->semStack[$stackPos];
25126        }, 11 => function ($stackPos) {
25127            $this->semValue = $this->semStack[$stackPos];
25128        }, 12 => function ($stackPos) {
25129            $this->semValue = $this->semStack[$stackPos];
25130        }, 13 => function ($stackPos) {
25131            $this->semValue = $this->semStack[$stackPos];
25132        }, 14 => function ($stackPos) {
25133            $this->semValue = $this->semStack[$stackPos];
25134        }, 15 => function ($stackPos) {
25135            $this->semValue = $this->semStack[$stackPos];
25136        }, 16 => function ($stackPos) {
25137            $this->semValue = $this->semStack[$stackPos];
25138        }, 17 => function ($stackPos) {
25139            $this->semValue = $this->semStack[$stackPos];
25140        }, 18 => function ($stackPos) {
25141            $this->semValue = $this->semStack[$stackPos];
25142        }, 19 => function ($stackPos) {
25143            $this->semValue = $this->semStack[$stackPos];
25144        }, 20 => function ($stackPos) {
25145            $this->semValue = $this->semStack[$stackPos];
25146        }, 21 => function ($stackPos) {
25147            $this->semValue = $this->semStack[$stackPos];
25148        }, 22 => function ($stackPos) {
25149            $this->semValue = $this->semStack[$stackPos];
25150        }, 23 => function ($stackPos) {
25151            $this->semValue = $this->semStack[$stackPos];
25152        }, 24 => function ($stackPos) {
25153            $this->semValue = $this->semStack[$stackPos];
25154        }, 25 => function ($stackPos) {
25155            $this->semValue = $this->semStack[$stackPos];
25156        }, 26 => function ($stackPos) {
25157            $this->semValue = $this->semStack[$stackPos];
25158        }, 27 => function ($stackPos) {
25159            $this->semValue = $this->semStack[$stackPos];
25160        }, 28 => function ($stackPos) {
25161            $this->semValue = $this->semStack[$stackPos];
25162        }, 29 => function ($stackPos) {
25163            $this->semValue = $this->semStack[$stackPos];
25164        }, 30 => function ($stackPos) {
25165            $this->semValue = $this->semStack[$stackPos];
25166        }, 31 => function ($stackPos) {
25167            $this->semValue = $this->semStack[$stackPos];
25168        }, 32 => function ($stackPos) {
25169            $this->semValue = $this->semStack[$stackPos];
25170        }, 33 => function ($stackPos) {
25171            $this->semValue = $this->semStack[$stackPos];
25172        }, 34 => function ($stackPos) {
25173            $this->semValue = $this->semStack[$stackPos];
25174        }, 35 => function ($stackPos) {
25175            $this->semValue = $this->semStack[$stackPos];
25176        }, 36 => function ($stackPos) {
25177            $this->semValue = $this->semStack[$stackPos];
25178        }, 37 => function ($stackPos) {
25179            $this->semValue = $this->semStack[$stackPos];
25180        }, 38 => function ($stackPos) {
25181            $this->semValue = $this->semStack[$stackPos];
25182        }, 39 => function ($stackPos) {
25183            $this->semValue = $this->semStack[$stackPos];
25184        }, 40 => function ($stackPos) {
25185            $this->semValue = $this->semStack[$stackPos];
25186        }, 41 => function ($stackPos) {
25187            $this->semValue = $this->semStack[$stackPos];
25188        }, 42 => function ($stackPos) {
25189            $this->semValue = $this->semStack[$stackPos];
25190        }, 43 => function ($stackPos) {
25191            $this->semValue = $this->semStack[$stackPos];
25192        }, 44 => function ($stackPos) {
25193            $this->semValue = $this->semStack[$stackPos];
25194        }, 45 => function ($stackPos) {
25195            $this->semValue = $this->semStack[$stackPos];
25196        }, 46 => function ($stackPos) {
25197            $this->semValue = $this->semStack[$stackPos];
25198        }, 47 => function ($stackPos) {
25199            $this->semValue = $this->semStack[$stackPos];
25200        }, 48 => function ($stackPos) {
25201            $this->semValue = $this->semStack[$stackPos];
25202        }, 49 => function ($stackPos) {
25203            $this->semValue = $this->semStack[$stackPos];
25204        }, 50 => function ($stackPos) {
25205            $this->semValue = $this->semStack[$stackPos];
25206        }, 51 => function ($stackPos) {
25207            $this->semValue = $this->semStack[$stackPos];
25208        }, 52 => function ($stackPos) {
25209            $this->semValue = $this->semStack[$stackPos];
25210        }, 53 => function ($stackPos) {
25211            $this->semValue = $this->semStack[$stackPos];
25212        }, 54 => function ($stackPos) {
25213            $this->semValue = $this->semStack[$stackPos];
25214        }, 55 => function ($stackPos) {
25215            $this->semValue = $this->semStack[$stackPos];
25216        }, 56 => function ($stackPos) {
25217            $this->semValue = $this->semStack[$stackPos];
25218        }, 57 => function ($stackPos) {
25219            $this->semValue = $this->semStack[$stackPos];
25220        }, 58 => function ($stackPos) {
25221            $this->semValue = $this->semStack[$stackPos];
25222        }, 59 => function ($stackPos) {
25223            $this->semValue = $this->semStack[$stackPos];
25224        }, 60 => function ($stackPos) {
25225            $this->semValue = $this->semStack[$stackPos];
25226        }, 61 => function ($stackPos) {
25227            $this->semValue = $this->semStack[$stackPos];
25228        }, 62 => function ($stackPos) {
25229            $this->semValue = $this->semStack[$stackPos];
25230        }, 63 => function ($stackPos) {
25231            $this->semValue = $this->semStack[$stackPos];
25232        }, 64 => function ($stackPos) {
25233            $this->semValue = $this->semStack[$stackPos];
25234        }, 65 => function ($stackPos) {
25235            $this->semValue = $this->semStack[$stackPos];
25236        }, 66 => function ($stackPos) {
25237            $this->semValue = $this->semStack[$stackPos];
25238        }, 67 => function ($stackPos) {
25239            $this->semValue = $this->semStack[$stackPos];
25240        }, 68 => function ($stackPos) {
25241            $this->semValue = $this->semStack[$stackPos];
25242        }, 69 => function ($stackPos) {
25243            $this->semValue = $this->semStack[$stackPos];
25244        }, 70 => function ($stackPos) {
25245            $this->semValue = $this->semStack[$stackPos];
25246        }, 71 => function ($stackPos) {
25247            $this->semValue = $this->semStack[$stackPos];
25248        }, 72 => function ($stackPos) {
25249            $this->semValue = $this->semStack[$stackPos];
25250        }, 73 => function ($stackPos) {
25251            $this->semValue = $this->semStack[$stackPos];
25252        }, 74 => function ($stackPos) {
25253            $this->semValue = $this->semStack[$stackPos];
25254        }, 75 => function ($stackPos) {
25255            $this->semValue = $this->semStack[$stackPos];
25256        }, 76 => function ($stackPos) {
25257            $this->semValue = $this->semStack[$stackPos];
25258        }, 77 => function ($stackPos) {
25259            $this->semValue = $this->semStack[$stackPos];
25260        }, 78 => function ($stackPos) {
25261            $this->semValue = $this->semStack[$stackPos];
25262        }, 79 => function ($stackPos) {
25263            $this->semValue = $this->semStack[$stackPos];
25264        }, 80 => function ($stackPos) {
25265            $this->semValue = $this->semStack[$stackPos];
25266        }, 81 => function ($stackPos) {
25267            $this->semValue = $this->semStack[$stackPos];
25268        }, 82 => function ($stackPos) {
25269            $this->semValue = $this->semStack[$stackPos];
25270        }, 83 => function ($stackPos) {
25271            $this->semValue = $this->semStack[$stackPos];
25272        }, 84 => function ($stackPos) {
25273            $this->semValue = new Node\Identifier($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
25274        }, 85 => function ($stackPos) {
25275            $this->semValue = new Node\Identifier($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
25276        }, 86 => function ($stackPos) {
25277            $this->semValue = new Node\Identifier($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
25278        }, 87 => function ($stackPos) {
25279            $this->semValue = new Node\Identifier($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
25280        }, 88 => function ($stackPos) {
25281            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
25282        }, 89 => function ($stackPos) {
25283            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
25284        }, 90 => function ($stackPos) {
25285            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25286        }, 91 => function ($stackPos) {
25287            $this->semValue = new Name(\substr($this->semStack[$stackPos - (1 - 1)], 1), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
25288        }, 92 => function ($stackPos) {
25289            $this->semValue = new Expr\Variable(\substr($this->semStack[$stackPos - (1 - 1)], 1), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
25290        }, 93 => function ($stackPos) {
25291            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25292        }, 94 => function ($stackPos) {
25293            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25294        }, 95 => function ($stackPos) {
25295            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25296        }, 96 => function ($stackPos) {
25297            $this->semValue = new Stmt\HaltCompiler($this->lexer->handleHaltCompiler(), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
25298        }, 97 => function ($stackPos) {
25299            $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos - (3 - 2)], null, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25300            $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON);
25301            $this->checkNamespace($this->semValue);
25302        }, 98 => function ($stackPos) {
25303            $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos - (5 - 2)], $this->semStack[$stackPos - (5 - 4)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
25304            $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED);
25305            $this->checkNamespace($this->semValue);
25306        }, 99 => function ($stackPos) {
25307            $this->semValue = new Stmt\Namespace_(null, $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
25308            $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED);
25309            $this->checkNamespace($this->semValue);
25310        }, 100 => function ($stackPos) {
25311            $this->semValue = new Stmt\Use_($this->semStack[$stackPos - (3 - 2)], Stmt\Use_::TYPE_NORMAL, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25312        }, 101 => function ($stackPos) {
25313            $this->semValue = new Stmt\Use_($this->semStack[$stackPos - (4 - 3)], $this->semStack[$stackPos - (4 - 2)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
25314        }, 102 => function ($stackPos) {
25315            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
25316        }, 103 => function ($stackPos) {
25317            $this->semValue = new Stmt\Const_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25318        }, 104 => function ($stackPos) {
25319            $this->semValue = Stmt\Use_::TYPE_FUNCTION;
25320        }, 105 => function ($stackPos) {
25321            $this->semValue = Stmt\Use_::TYPE_CONSTANT;
25322        }, 106 => function ($stackPos) {
25323            $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos - (7 - 3)], $this->semStack[$stackPos - (7 - 6)], $this->semStack[$stackPos - (7 - 2)], $this->startAttributeStack[$stackPos - (7 - 1)] + $this->endAttributes);
25324        }, 107 => function ($stackPos) {
25325            $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos - (6 - 2)], $this->semStack[$stackPos - (6 - 5)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
25326        }, 108 => function ($stackPos) {
25327            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
25328            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
25329        }, 109 => function ($stackPos) {
25330            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
25331        }, 110 => function ($stackPos) {
25332            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
25333            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
25334        }, 111 => function ($stackPos) {
25335            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
25336        }, 112 => function ($stackPos) {
25337            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
25338            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
25339        }, 113 => function ($stackPos) {
25340            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
25341        }, 114 => function ($stackPos) {
25342            $this->semValue = new Stmt\UseUse($this->semStack[$stackPos - (1 - 1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
25343            $this->checkUseUse($this->semValue, $stackPos - (1 - 1));
25344        }, 115 => function ($stackPos) {
25345            $this->semValue = new Stmt\UseUse($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25346            $this->checkUseUse($this->semValue, $stackPos - (3 - 3));
25347        }, 116 => function ($stackPos) {
25348            $this->semValue = new Stmt\UseUse($this->semStack[$stackPos - (1 - 1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
25349            $this->checkUseUse($this->semValue, $stackPos - (1 - 1));
25350        }, 117 => function ($stackPos) {
25351            $this->semValue = new Stmt\UseUse($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25352            $this->checkUseUse($this->semValue, $stackPos - (3 - 3));
25353        }, 118 => function ($stackPos) {
25354            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25355            $this->semValue->type = Stmt\Use_::TYPE_NORMAL;
25356        }, 119 => function ($stackPos) {
25357            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
25358            $this->semValue->type = $this->semStack[$stackPos - (2 - 1)];
25359        }, 120 => function ($stackPos) {
25360            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
25361            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
25362        }, 121 => function ($stackPos) {
25363            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
25364        }, 122 => function ($stackPos) {
25365            $this->semValue = new Node\Const_($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25366        }, 123 => function ($stackPos) {
25367            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
25368            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
25369        }, 124 => function ($stackPos) {
25370            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
25371        }, 125 => function ($stackPos) {
25372            $this->semValue = new Node\Const_($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25373        }, 126 => function ($stackPos) {
25374            if (\is_array($this->semStack[$stackPos - (2 - 2)])) {
25375                $this->semValue = \array_merge($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)]);
25376            } else {
25377                $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
25378                $this->semValue = $this->semStack[$stackPos - (2 - 1)];
25379            }
25380        }, 127 => function ($stackPos) {
25381            $this->semValue = array();
25382        }, 128 => function ($stackPos) {
25383            $startAttributes = $this->lookaheadStartAttributes;
25384            if (isset($startAttributes['comments'])) {
25385                $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments']));
25386            } else {
25387                $nop = null;
25388            }
25389            if ($nop !== null) {
25390                $this->semStack[$stackPos - (1 - 1)][] = $nop;
25391            }
25392            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25393        }, 129 => function ($stackPos) {
25394            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25395        }, 130 => function ($stackPos) {
25396            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25397        }, 131 => function ($stackPos) {
25398            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25399        }, 132 => function ($stackPos) {
25400            throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
25401        }, 133 => function ($stackPos) {
25402            if ($this->semStack[$stackPos - (3 - 2)]) {
25403                $this->semValue = $this->semStack[$stackPos - (3 - 2)];
25404                $attrs = $this->startAttributeStack[$stackPos - (3 - 1)];
25405                $stmts = $this->semValue;
25406                if (!empty($attrs['comments'])) {
25407                    $stmts[0]->setAttribute('comments', \array_merge($attrs['comments'], $stmts[0]->getAttribute('comments', [])));
25408                }
25409            } else {
25410                $startAttributes = $this->startAttributeStack[$stackPos - (3 - 1)];
25411                if (isset($startAttributes['comments'])) {
25412                    $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes);
25413                } else {
25414                    $this->semValue = null;
25415                }
25416                if (null === $this->semValue) {
25417                    $this->semValue = array();
25418                }
25419            }
25420        }, 134 => function ($stackPos) {
25421            $this->semValue = new Stmt\If_($this->semStack[$stackPos - (5 - 2)], ['stmts' => \is_array($this->semStack[$stackPos - (5 - 3)]) ? $this->semStack[$stackPos - (5 - 3)] : array($this->semStack[$stackPos - (5 - 3)]), 'elseifs' => $this->semStack[$stackPos - (5 - 4)], 'else' => $this->semStack[$stackPos - (5 - 5)]], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
25422        }, 135 => function ($stackPos) {
25423            $this->semValue = new Stmt\If_($this->semStack[$stackPos - (8 - 2)], ['stmts' => $this->semStack[$stackPos - (8 - 4)], 'elseifs' => $this->semStack[$stackPos - (8 - 5)], 'else' => $this->semStack[$stackPos - (8 - 6)]], $this->startAttributeStack[$stackPos - (8 - 1)] + $this->endAttributes);
25424        }, 136 => function ($stackPos) {
25425            $this->semValue = new Stmt\While_($this->semStack[$stackPos - (3 - 2)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25426        }, 137 => function ($stackPos) {
25427            $this->semValue = new Stmt\Do_($this->semStack[$stackPos - (5 - 4)], \is_array($this->semStack[$stackPos - (5 - 2)]) ? $this->semStack[$stackPos - (5 - 2)] : array($this->semStack[$stackPos - (5 - 2)]), $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
25428        }, 138 => function ($stackPos) {
25429            $this->semValue = new Stmt\For_(['init' => $this->semStack[$stackPos - (9 - 3)], 'cond' => $this->semStack[$stackPos - (9 - 5)], 'loop' => $this->semStack[$stackPos - (9 - 7)], 'stmts' => $this->semStack[$stackPos - (9 - 9)]], $this->startAttributeStack[$stackPos - (9 - 1)] + $this->endAttributes);
25430        }, 139 => function ($stackPos) {
25431            $this->semValue = new Stmt\Switch_($this->semStack[$stackPos - (3 - 2)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25432        }, 140 => function ($stackPos) {
25433            $this->semValue = new Stmt\Break_(null, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25434        }, 141 => function ($stackPos) {
25435            $this->semValue = new Stmt\Break_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25436        }, 142 => function ($stackPos) {
25437            $this->semValue = new Stmt\Continue_(null, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25438        }, 143 => function ($stackPos) {
25439            $this->semValue = new Stmt\Continue_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25440        }, 144 => function ($stackPos) {
25441            $this->semValue = new Stmt\Return_(null, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25442        }, 145 => function ($stackPos) {
25443            $this->semValue = new Stmt\Return_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25444        }, 146 => function ($stackPos) {
25445            $this->semValue = new Stmt\Global_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25446        }, 147 => function ($stackPos) {
25447            $this->semValue = new Stmt\Static_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25448        }, 148 => function ($stackPos) {
25449            $this->semValue = new Stmt\Echo_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25450        }, 149 => function ($stackPos) {
25451            $this->semValue = new Stmt\InlineHTML($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
25452        }, 150 => function ($stackPos) {
25453            $this->semValue = new Stmt\Expression($this->semStack[$stackPos - (2 - 1)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25454        }, 151 => function ($stackPos) {
25455            $this->semValue = new Stmt\Expression($this->semStack[$stackPos - (2 - 1)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25456        }, 152 => function ($stackPos) {
25457            $this->semValue = new Stmt\Unset_($this->semStack[$stackPos - (5 - 3)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
25458        }, 153 => function ($stackPos) {
25459            $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos - (7 - 3)], $this->semStack[$stackPos - (7 - 5)][0], ['keyVar' => null, 'byRef' => $this->semStack[$stackPos - (7 - 5)][1], 'stmts' => $this->semStack[$stackPos - (7 - 7)]], $this->startAttributeStack[$stackPos - (7 - 1)] + $this->endAttributes);
25460        }, 154 => function ($stackPos) {
25461            $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos - (9 - 3)], $this->semStack[$stackPos - (9 - 7)][0], ['keyVar' => $this->semStack[$stackPos - (9 - 5)], 'byRef' => $this->semStack[$stackPos - (9 - 7)][1], 'stmts' => $this->semStack[$stackPos - (9 - 9)]], $this->startAttributeStack[$stackPos - (9 - 1)] + $this->endAttributes);
25462        }, 155 => function ($stackPos) {
25463            $this->semValue = new Stmt\Declare_($this->semStack[$stackPos - (5 - 3)], $this->semStack[$stackPos - (5 - 5)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
25464        }, 156 => function ($stackPos) {
25465            $this->semValue = new Stmt\TryCatch($this->semStack[$stackPos - (6 - 3)], $this->semStack[$stackPos - (6 - 5)], $this->semStack[$stackPos - (6 - 6)], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
25466            $this->checkTryCatch($this->semValue);
25467        }, 157 => function ($stackPos) {
25468            $this->semValue = new Stmt\Throw_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25469        }, 158 => function ($stackPos) {
25470            $this->semValue = new Stmt\Goto_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25471        }, 159 => function ($stackPos) {
25472            $this->semValue = new Stmt\Label($this->semStack[$stackPos - (2 - 1)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25473        }, 160 => function ($stackPos) {
25474            $this->semValue = new Stmt\Expression($this->semStack[$stackPos - (2 - 1)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25475        }, 161 => function ($stackPos) {
25476            $this->semValue = array();
25477            /* means: no statement */
25478        }, 162 => function ($stackPos) {
25479            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25480        }, 163 => function ($stackPos) {
25481            $startAttributes = $this->startAttributeStack[$stackPos - (1 - 1)];
25482            if (isset($startAttributes['comments'])) {
25483                $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes);
25484            } else {
25485                $this->semValue = null;
25486            }
25487            if ($this->semValue === null) {
25488                $this->semValue = array();
25489            }
25490            /* means: no statement */
25491        }, 164 => function ($stackPos) {
25492            $this->semValue = array();
25493        }, 165 => function ($stackPos) {
25494            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
25495            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
25496        }, 166 => function ($stackPos) {
25497            $this->semValue = new Stmt\Catch_(array($this->semStack[$stackPos - (8 - 3)]), $this->semStack[$stackPos - (8 - 4)], $this->semStack[$stackPos - (8 - 7)], $this->startAttributeStack[$stackPos - (8 - 1)] + $this->endAttributes);
25498        }, 167 => function ($stackPos) {
25499            $this->semValue = null;
25500        }, 168 => function ($stackPos) {
25501            $this->semValue = new Stmt\Finally_($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
25502        }, 169 => function ($stackPos) {
25503            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
25504        }, 170 => function ($stackPos) {
25505            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
25506            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
25507        }, 171 => function ($stackPos) {
25508            $this->semValue = \false;
25509        }, 172 => function ($stackPos) {
25510            $this->semValue = \true;
25511        }, 173 => function ($stackPos) {
25512            $this->semValue = \false;
25513        }, 174 => function ($stackPos) {
25514            $this->semValue = \true;
25515        }, 175 => function ($stackPos) {
25516            $this->semValue = \false;
25517        }, 176 => function ($stackPos) {
25518            $this->semValue = \true;
25519        }, 177 => function ($stackPos) {
25520            $this->semValue = new Stmt\Function_($this->semStack[$stackPos - (10 - 3)], ['byRef' => $this->semStack[$stackPos - (10 - 2)], 'params' => $this->semStack[$stackPos - (10 - 5)], 'returnType' => $this->semStack[$stackPos - (10 - 7)], 'stmts' => $this->semStack[$stackPos - (10 - 9)]], $this->startAttributeStack[$stackPos - (10 - 1)] + $this->endAttributes);
25521        }, 178 => function ($stackPos) {
25522            $this->semValue = new Stmt\Class_($this->semStack[$stackPos - (7 - 2)], ['type' => $this->semStack[$stackPos - (7 - 1)], 'extends' => $this->semStack[$stackPos - (7 - 3)], 'implements' => $this->semStack[$stackPos - (7 - 4)], 'stmts' => $this->semStack[$stackPos - (7 - 6)]], $this->startAttributeStack[$stackPos - (7 - 1)] + $this->endAttributes);
25523            $this->checkClass($this->semValue, $stackPos - (7 - 2));
25524        }, 179 => function ($stackPos) {
25525            $this->semValue = new Stmt\Interface_($this->semStack[$stackPos - (6 - 2)], ['extends' => $this->semStack[$stackPos - (6 - 3)], 'stmts' => $this->semStack[$stackPos - (6 - 5)]], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
25526            $this->checkInterface($this->semValue, $stackPos - (6 - 2));
25527        }, 180 => function ($stackPos) {
25528            $this->semValue = new Stmt\Trait_($this->semStack[$stackPos - (5 - 2)], ['stmts' => $this->semStack[$stackPos - (5 - 4)]], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
25529        }, 181 => function ($stackPos) {
25530            $this->semValue = 0;
25531        }, 182 => function ($stackPos) {
25532            $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT;
25533        }, 183 => function ($stackPos) {
25534            $this->semValue = Stmt\Class_::MODIFIER_FINAL;
25535        }, 184 => function ($stackPos) {
25536            $this->semValue = null;
25537        }, 185 => function ($stackPos) {
25538            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
25539        }, 186 => function ($stackPos) {
25540            $this->semValue = array();
25541        }, 187 => function ($stackPos) {
25542            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
25543        }, 188 => function ($stackPos) {
25544            $this->semValue = array();
25545        }, 189 => function ($stackPos) {
25546            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
25547        }, 190 => function ($stackPos) {
25548            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
25549        }, 191 => function ($stackPos) {
25550            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
25551            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
25552        }, 192 => function ($stackPos) {
25553            $this->semValue = \is_array($this->semStack[$stackPos - (1 - 1)]) ? $this->semStack[$stackPos - (1 - 1)] : array($this->semStack[$stackPos - (1 - 1)]);
25554        }, 193 => function ($stackPos) {
25555            $this->semValue = $this->semStack[$stackPos - (4 - 2)];
25556        }, 194 => function ($stackPos) {
25557            $this->semValue = \is_array($this->semStack[$stackPos - (1 - 1)]) ? $this->semStack[$stackPos - (1 - 1)] : array($this->semStack[$stackPos - (1 - 1)]);
25558        }, 195 => function ($stackPos) {
25559            $this->semValue = $this->semStack[$stackPos - (4 - 2)];
25560        }, 196 => function ($stackPos) {
25561            $this->semValue = \is_array($this->semStack[$stackPos - (1 - 1)]) ? $this->semStack[$stackPos - (1 - 1)] : array($this->semStack[$stackPos - (1 - 1)]);
25562        }, 197 => function ($stackPos) {
25563            $this->semValue = null;
25564        }, 198 => function ($stackPos) {
25565            $this->semValue = $this->semStack[$stackPos - (4 - 2)];
25566        }, 199 => function ($stackPos) {
25567            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
25568        }, 200 => function ($stackPos) {
25569            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
25570            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
25571        }, 201 => function ($stackPos) {
25572            $this->semValue = new Stmt\DeclareDeclare($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25573        }, 202 => function ($stackPos) {
25574            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
25575        }, 203 => function ($stackPos) {
25576            $this->semValue = $this->semStack[$stackPos - (4 - 3)];
25577        }, 204 => function ($stackPos) {
25578            $this->semValue = $this->semStack[$stackPos - (4 - 2)];
25579        }, 205 => function ($stackPos) {
25580            $this->semValue = $this->semStack[$stackPos - (5 - 3)];
25581        }, 206 => function ($stackPos) {
25582            $this->semValue = array();
25583        }, 207 => function ($stackPos) {
25584            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
25585            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
25586        }, 208 => function ($stackPos) {
25587            $this->semValue = new Stmt\Case_($this->semStack[$stackPos - (4 - 2)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
25588        }, 209 => function ($stackPos) {
25589            $this->semValue = new Stmt\Case_(null, $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25590        }, 210 => function ($stackPos) {
25591            $this->semValue = $this->semStack[$stackPos];
25592        }, 211 => function ($stackPos) {
25593            $this->semValue = $this->semStack[$stackPos];
25594        }, 212 => function ($stackPos) {
25595            $this->semValue = \is_array($this->semStack[$stackPos - (1 - 1)]) ? $this->semStack[$stackPos - (1 - 1)] : array($this->semStack[$stackPos - (1 - 1)]);
25596        }, 213 => function ($stackPos) {
25597            $this->semValue = $this->semStack[$stackPos - (4 - 2)];
25598        }, 214 => function ($stackPos) {
25599            $this->semValue = array();
25600        }, 215 => function ($stackPos) {
25601            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
25602            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
25603        }, 216 => function ($stackPos) {
25604            $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos - (3 - 2)], \is_array($this->semStack[$stackPos - (3 - 3)]) ? $this->semStack[$stackPos - (3 - 3)] : array($this->semStack[$stackPos - (3 - 3)]), $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25605        }, 217 => function ($stackPos) {
25606            $this->semValue = array();
25607        }, 218 => function ($stackPos) {
25608            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
25609            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
25610        }, 219 => function ($stackPos) {
25611            $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos - (4 - 2)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
25612        }, 220 => function ($stackPos) {
25613            $this->semValue = null;
25614        }, 221 => function ($stackPos) {
25615            $this->semValue = new Stmt\Else_(\is_array($this->semStack[$stackPos - (2 - 2)]) ? $this->semStack[$stackPos - (2 - 2)] : array($this->semStack[$stackPos - (2 - 2)]), $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25616        }, 222 => function ($stackPos) {
25617            $this->semValue = null;
25618        }, 223 => function ($stackPos) {
25619            $this->semValue = new Stmt\Else_($this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25620        }, 224 => function ($stackPos) {
25621            $this->semValue = array($this->semStack[$stackPos - (1 - 1)], \false);
25622        }, 225 => function ($stackPos) {
25623            $this->semValue = array($this->semStack[$stackPos - (2 - 2)], \true);
25624        }, 226 => function ($stackPos) {
25625            $this->semValue = array($this->semStack[$stackPos - (1 - 1)], \false);
25626        }, 227 => function ($stackPos) {
25627            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25628        }, 228 => function ($stackPos) {
25629            $this->semValue = array();
25630        }, 229 => function ($stackPos) {
25631            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
25632        }, 230 => function ($stackPos) {
25633            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
25634            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
25635        }, 231 => function ($stackPos) {
25636            $this->semValue = new Node\Param($this->semStack[$stackPos - (4 - 4)], null, $this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 2)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
25637            $this->checkParam($this->semValue);
25638        }, 232 => function ($stackPos) {
25639            $this->semValue = new Node\Param($this->semStack[$stackPos - (6 - 4)], $this->semStack[$stackPos - (6 - 6)], $this->semStack[$stackPos - (6 - 1)], $this->semStack[$stackPos - (6 - 2)], $this->semStack[$stackPos - (6 - 3)], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
25640            $this->checkParam($this->semValue);
25641        }, 233 => function ($stackPos) {
25642            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25643        }, 234 => function ($stackPos) {
25644            $this->semValue = new Node\Identifier('array', $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
25645        }, 235 => function ($stackPos) {
25646            $this->semValue = new Node\Identifier('callable', $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
25647        }, 236 => function ($stackPos) {
25648            $this->semValue = null;
25649        }, 237 => function ($stackPos) {
25650            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25651        }, 238 => function ($stackPos) {
25652            $this->semValue = null;
25653        }, 239 => function ($stackPos) {
25654            $this->semValue = $this->semStack[$stackPos - (2 - 2)];
25655        }, 240 => function ($stackPos) {
25656            $this->semValue = array();
25657        }, 241 => function ($stackPos) {
25658            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
25659        }, 242 => function ($stackPos) {
25660            $this->semValue = array(new Node\Arg($this->semStack[$stackPos - (3 - 2)], \false, \false, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes));
25661        }, 243 => function ($stackPos) {
25662            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
25663        }, 244 => function ($stackPos) {
25664            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
25665            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
25666        }, 245 => function ($stackPos) {
25667            $this->semValue = new Node\Arg($this->semStack[$stackPos - (1 - 1)], \false, \false, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
25668        }, 246 => function ($stackPos) {
25669            $this->semValue = new Node\Arg($this->semStack[$stackPos - (2 - 2)], \true, \false, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25670        }, 247 => function ($stackPos) {
25671            $this->semValue = new Node\Arg($this->semStack[$stackPos - (2 - 2)], \false, \true, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25672        }, 248 => function ($stackPos) {
25673            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
25674            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
25675        }, 249 => function ($stackPos) {
25676            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
25677        }, 250 => function ($stackPos) {
25678            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25679        }, 251 => function ($stackPos) {
25680            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25681        }, 252 => function ($stackPos) {
25682            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
25683        }, 253 => function ($stackPos) {
25684            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
25685            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
25686        }, 254 => function ($stackPos) {
25687            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
25688        }, 255 => function ($stackPos) {
25689            $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos - (1 - 1)], null, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
25690        }, 256 => function ($stackPos) {
25691            $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25692        }, 257 => function ($stackPos) {
25693            if ($this->semStack[$stackPos - (2 - 2)] !== null) {
25694                $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
25695                $this->semValue = $this->semStack[$stackPos - (2 - 1)];
25696            }
25697        }, 258 => function ($stackPos) {
25698            $this->semValue = array();
25699        }, 259 => function ($stackPos) {
25700            $startAttributes = $this->lookaheadStartAttributes;
25701            if (isset($startAttributes['comments'])) {
25702                $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments']));
25703            } else {
25704                $nop = null;
25705            }
25706            if ($nop !== null) {
25707                $this->semStack[$stackPos - (1 - 1)][] = $nop;
25708            }
25709            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25710        }, 260 => function ($stackPos) {
25711            $this->semValue = new Stmt\Property($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25712            $this->checkProperty($this->semValue, $stackPos - (3 - 1));
25713        }, 261 => function ($stackPos) {
25714            $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos - (3 - 2)], 0, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25715        }, 262 => function ($stackPos) {
25716            $this->semValue = new Stmt\ClassMethod($this->semStack[$stackPos - (9 - 4)], ['type' => $this->semStack[$stackPos - (9 - 1)], 'byRef' => $this->semStack[$stackPos - (9 - 3)], 'params' => $this->semStack[$stackPos - (9 - 6)], 'returnType' => $this->semStack[$stackPos - (9 - 8)], 'stmts' => $this->semStack[$stackPos - (9 - 9)]], $this->startAttributeStack[$stackPos - (9 - 1)] + $this->endAttributes);
25717            $this->checkClassMethod($this->semValue, $stackPos - (9 - 1));
25718        }, 263 => function ($stackPos) {
25719            $this->semValue = new Stmt\TraitUse($this->semStack[$stackPos - (3 - 2)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25720        }, 264 => function ($stackPos) {
25721            $this->semValue = array();
25722        }, 265 => function ($stackPos) {
25723            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
25724        }, 266 => function ($stackPos) {
25725            $this->semValue = array();
25726        }, 267 => function ($stackPos) {
25727            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
25728            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
25729        }, 268 => function ($stackPos) {
25730            $this->semValue = new Stmt\TraitUseAdaptation\Precedence($this->semStack[$stackPos - (4 - 1)][0], $this->semStack[$stackPos - (4 - 1)][1], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
25731        }, 269 => function ($stackPos) {
25732            $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos - (5 - 1)][0], $this->semStack[$stackPos - (5 - 1)][1], $this->semStack[$stackPos - (5 - 3)], $this->semStack[$stackPos - (5 - 4)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
25733        }, 270 => function ($stackPos) {
25734            $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos - (4 - 1)][0], $this->semStack[$stackPos - (4 - 1)][1], $this->semStack[$stackPos - (4 - 3)], null, $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
25735        }, 271 => function ($stackPos) {
25736            $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos - (4 - 1)][0], $this->semStack[$stackPos - (4 - 1)][1], null, $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
25737        }, 272 => function ($stackPos) {
25738            $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos - (4 - 1)][0], $this->semStack[$stackPos - (4 - 1)][1], null, $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
25739        }, 273 => function ($stackPos) {
25740            $this->semValue = array($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)]);
25741        }, 274 => function ($stackPos) {
25742            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25743        }, 275 => function ($stackPos) {
25744            $this->semValue = array(null, $this->semStack[$stackPos - (1 - 1)]);
25745        }, 276 => function ($stackPos) {
25746            $this->semValue = null;
25747        }, 277 => function ($stackPos) {
25748            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
25749        }, 278 => function ($stackPos) {
25750            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25751        }, 279 => function ($stackPos) {
25752            $this->semValue = 0;
25753        }, 280 => function ($stackPos) {
25754            $this->semValue = 0;
25755        }, 281 => function ($stackPos) {
25756            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25757        }, 282 => function ($stackPos) {
25758            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25759        }, 283 => function ($stackPos) {
25760            $this->checkModifier($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)], $stackPos - (2 - 2));
25761            $this->semValue = $this->semStack[$stackPos - (2 - 1)] | $this->semStack[$stackPos - (2 - 2)];
25762        }, 284 => function ($stackPos) {
25763            $this->semValue = Stmt\Class_::MODIFIER_PUBLIC;
25764        }, 285 => function ($stackPos) {
25765            $this->semValue = Stmt\Class_::MODIFIER_PROTECTED;
25766        }, 286 => function ($stackPos) {
25767            $this->semValue = Stmt\Class_::MODIFIER_PRIVATE;
25768        }, 287 => function ($stackPos) {
25769            $this->semValue = Stmt\Class_::MODIFIER_STATIC;
25770        }, 288 => function ($stackPos) {
25771            $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT;
25772        }, 289 => function ($stackPos) {
25773            $this->semValue = Stmt\Class_::MODIFIER_FINAL;
25774        }, 290 => function ($stackPos) {
25775            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
25776        }, 291 => function ($stackPos) {
25777            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
25778            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
25779        }, 292 => function ($stackPos) {
25780            $this->semValue = new Node\VarLikeIdentifier(\substr($this->semStack[$stackPos - (1 - 1)], 1), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
25781        }, 293 => function ($stackPos) {
25782            $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos - (1 - 1)], null, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
25783        }, 294 => function ($stackPos) {
25784            $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25785        }, 295 => function ($stackPos) {
25786            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
25787            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
25788        }, 296 => function ($stackPos) {
25789            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
25790        }, 297 => function ($stackPos) {
25791            $this->semValue = array();
25792        }, 298 => function ($stackPos) {
25793            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25794        }, 299 => function ($stackPos) {
25795            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25796        }, 300 => function ($stackPos) {
25797            $this->semValue = new Expr\Assign($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25798        }, 301 => function ($stackPos) {
25799            $this->semValue = new Expr\Assign($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25800        }, 302 => function ($stackPos) {
25801            $this->semValue = new Expr\AssignRef($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
25802        }, 303 => function ($stackPos) {
25803            $this->semValue = new Expr\AssignRef($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
25804        }, 304 => function ($stackPos) {
25805            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25806        }, 305 => function ($stackPos) {
25807            $this->semValue = new Expr\Clone_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25808        }, 306 => function ($stackPos) {
25809            $this->semValue = new Expr\AssignOp\Plus($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25810        }, 307 => function ($stackPos) {
25811            $this->semValue = new Expr\AssignOp\Minus($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25812        }, 308 => function ($stackPos) {
25813            $this->semValue = new Expr\AssignOp\Mul($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25814        }, 309 => function ($stackPos) {
25815            $this->semValue = new Expr\AssignOp\Div($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25816        }, 310 => function ($stackPos) {
25817            $this->semValue = new Expr\AssignOp\Concat($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25818        }, 311 => function ($stackPos) {
25819            $this->semValue = new Expr\AssignOp\Mod($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25820        }, 312 => function ($stackPos) {
25821            $this->semValue = new Expr\AssignOp\BitwiseAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25822        }, 313 => function ($stackPos) {
25823            $this->semValue = new Expr\AssignOp\BitwiseOr($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25824        }, 314 => function ($stackPos) {
25825            $this->semValue = new Expr\AssignOp\BitwiseXor($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25826        }, 315 => function ($stackPos) {
25827            $this->semValue = new Expr\AssignOp\ShiftLeft($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25828        }, 316 => function ($stackPos) {
25829            $this->semValue = new Expr\AssignOp\ShiftRight($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25830        }, 317 => function ($stackPos) {
25831            $this->semValue = new Expr\AssignOp\Pow($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25832        }, 318 => function ($stackPos) {
25833            $this->semValue = new Expr\AssignOp\Coalesce($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25834        }, 319 => function ($stackPos) {
25835            $this->semValue = new Expr\PostInc($this->semStack[$stackPos - (2 - 1)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25836        }, 320 => function ($stackPos) {
25837            $this->semValue = new Expr\PreInc($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25838        }, 321 => function ($stackPos) {
25839            $this->semValue = new Expr\PostDec($this->semStack[$stackPos - (2 - 1)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25840        }, 322 => function ($stackPos) {
25841            $this->semValue = new Expr\PreDec($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25842        }, 323 => function ($stackPos) {
25843            $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25844        }, 324 => function ($stackPos) {
25845            $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25846        }, 325 => function ($stackPos) {
25847            $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25848        }, 326 => function ($stackPos) {
25849            $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25850        }, 327 => function ($stackPos) {
25851            $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25852        }, 328 => function ($stackPos) {
25853            $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25854        }, 329 => function ($stackPos) {
25855            $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25856        }, 330 => function ($stackPos) {
25857            $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25858        }, 331 => function ($stackPos) {
25859            $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25860        }, 332 => function ($stackPos) {
25861            $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25862        }, 333 => function ($stackPos) {
25863            $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25864        }, 334 => function ($stackPos) {
25865            $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25866        }, 335 => function ($stackPos) {
25867            $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25868        }, 336 => function ($stackPos) {
25869            $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25870        }, 337 => function ($stackPos) {
25871            $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25872        }, 338 => function ($stackPos) {
25873            $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25874        }, 339 => function ($stackPos) {
25875            $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25876        }, 340 => function ($stackPos) {
25877            $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25878        }, 341 => function ($stackPos) {
25879            $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25880        }, 342 => function ($stackPos) {
25881            $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25882        }, 343 => function ($stackPos) {
25883            $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25884        }, 344 => function ($stackPos) {
25885            $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25886        }, 345 => function ($stackPos) {
25887            $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25888        }, 346 => function ($stackPos) {
25889            $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25890        }, 347 => function ($stackPos) {
25891            $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25892        }, 348 => function ($stackPos) {
25893            $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25894        }, 349 => function ($stackPos) {
25895            $this->semValue = new Expr\BinaryOp\Spaceship($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25896        }, 350 => function ($stackPos) {
25897            $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25898        }, 351 => function ($stackPos) {
25899            $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25900        }, 352 => function ($stackPos) {
25901            $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25902        }, 353 => function ($stackPos) {
25903            $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25904        }, 354 => function ($stackPos) {
25905            $this->semValue = new Expr\Instanceof_($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25906        }, 355 => function ($stackPos) {
25907            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25908        }, 356 => function ($stackPos) {
25909            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
25910        }, 357 => function ($stackPos) {
25911            $this->semValue = new Expr\Ternary($this->semStack[$stackPos - (5 - 1)], $this->semStack[$stackPos - (5 - 3)], $this->semStack[$stackPos - (5 - 5)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
25912        }, 358 => function ($stackPos) {
25913            $this->semValue = new Expr\Ternary($this->semStack[$stackPos - (4 - 1)], null, $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
25914        }, 359 => function ($stackPos) {
25915            $this->semValue = new Expr\BinaryOp\Coalesce($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25916        }, 360 => function ($stackPos) {
25917            $this->semValue = new Expr\Isset_($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
25918        }, 361 => function ($stackPos) {
25919            $this->semValue = new Expr\Empty_($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
25920        }, 362 => function ($stackPos) {
25921            $this->semValue = new Expr\Include_($this->semStack[$stackPos - (2 - 2)], Expr\Include_::TYPE_INCLUDE, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25922        }, 363 => function ($stackPos) {
25923            $this->semValue = new Expr\Include_($this->semStack[$stackPos - (2 - 2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25924        }, 364 => function ($stackPos) {
25925            $this->semValue = new Expr\Eval_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25926        }, 365 => function ($stackPos) {
25927            $this->semValue = new Expr\Include_($this->semStack[$stackPos - (2 - 2)], Expr\Include_::TYPE_REQUIRE, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25928        }, 366 => function ($stackPos) {
25929            $this->semValue = new Expr\Include_($this->semStack[$stackPos - (2 - 2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25930        }, 367 => function ($stackPos) {
25931            $this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25932        }, 368 => function ($stackPos) {
25933            $attrs = $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes;
25934            $attrs['kind'] = $this->getFloatCastKind($this->semStack[$stackPos - (2 - 1)]);
25935            $this->semValue = new Expr\Cast\Double($this->semStack[$stackPos - (2 - 2)], $attrs);
25936        }, 369 => function ($stackPos) {
25937            $this->semValue = new Expr\Cast\String_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25938        }, 370 => function ($stackPos) {
25939            $this->semValue = new Expr\Cast\Array_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25940        }, 371 => function ($stackPos) {
25941            $this->semValue = new Expr\Cast\Object_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25942        }, 372 => function ($stackPos) {
25943            $this->semValue = new Expr\Cast\Bool_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25944        }, 373 => function ($stackPos) {
25945            $this->semValue = new Expr\Cast\Unset_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25946        }, 374 => function ($stackPos) {
25947            $attrs = $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes;
25948            $attrs['kind'] = \strtolower($this->semStack[$stackPos - (2 - 1)]) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE;
25949            $this->semValue = new Expr\Exit_($this->semStack[$stackPos - (2 - 2)], $attrs);
25950        }, 375 => function ($stackPos) {
25951            $this->semValue = new Expr\ErrorSuppress($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25952        }, 376 => function ($stackPos) {
25953            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25954        }, 377 => function ($stackPos) {
25955            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25956        }, 378 => function ($stackPos) {
25957            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
25958        }, 379 => function ($stackPos) {
25959            $this->semValue = new Expr\ShellExec($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
25960        }, 380 => function ($stackPos) {
25961            $this->semValue = new Expr\Print_($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25962        }, 381 => function ($stackPos) {
25963            $this->semValue = new Expr\Yield_(null, null, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
25964        }, 382 => function ($stackPos) {
25965            $this->semValue = new Expr\YieldFrom($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25966        }, 383 => function ($stackPos) {
25967            $this->semValue = new Expr\Closure(['static' => \false, 'byRef' => $this->semStack[$stackPos - (10 - 2)], 'params' => $this->semStack[$stackPos - (10 - 4)], 'uses' => $this->semStack[$stackPos - (10 - 6)], 'returnType' => $this->semStack[$stackPos - (10 - 7)], 'stmts' => $this->semStack[$stackPos - (10 - 9)]], $this->startAttributeStack[$stackPos - (10 - 1)] + $this->endAttributes);
25968        }, 384 => function ($stackPos) {
25969            $this->semValue = new Expr\Closure(['static' => \true, 'byRef' => $this->semStack[$stackPos - (11 - 3)], 'params' => $this->semStack[$stackPos - (11 - 5)], 'uses' => $this->semStack[$stackPos - (11 - 7)], 'returnType' => $this->semStack[$stackPos - (11 - 8)], 'stmts' => $this->semStack[$stackPos - (11 - 10)]], $this->startAttributeStack[$stackPos - (11 - 1)] + $this->endAttributes);
25970        }, 385 => function ($stackPos) {
25971            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
25972        }, 386 => function ($stackPos) {
25973            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
25974        }, 387 => function ($stackPos) {
25975            $this->semValue = new Expr\Yield_($this->semStack[$stackPos - (2 - 2)], null, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
25976        }, 388 => function ($stackPos) {
25977            $this->semValue = new Expr\Yield_($this->semStack[$stackPos - (4 - 4)], $this->semStack[$stackPos - (4 - 2)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
25978        }, 389 => function ($stackPos) {
25979            $attrs = $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes;
25980            $attrs['kind'] = Expr\Array_::KIND_LONG;
25981            $this->semValue = new Expr\Array_($this->semStack[$stackPos - (4 - 3)], $attrs);
25982        }, 390 => function ($stackPos) {
25983            $attrs = $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes;
25984            $attrs['kind'] = Expr\Array_::KIND_SHORT;
25985            $this->semValue = new Expr\Array_($this->semStack[$stackPos - (3 - 2)], $attrs);
25986        }, 391 => function ($stackPos) {
25987            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
25988        }, 392 => function ($stackPos) {
25989            $attrs = $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes;
25990            $attrs['kind'] = $this->semStack[$stackPos - (4 - 1)][0] === "'" || $this->semStack[$stackPos - (4 - 1)][1] === "'" && ($this->semStack[$stackPos - (4 - 1)][0] === 'b' || $this->semStack[$stackPos - (4 - 1)][0] === 'B') ? Scalar\String_::KIND_SINGLE_QUOTED : Scalar\String_::KIND_DOUBLE_QUOTED;
25991            $this->semValue = new Expr\ArrayDimFetch(new Scalar\String_(Scalar\String_::parse($this->semStack[$stackPos - (4 - 1)]), $attrs), $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
25992        }, 393 => function ($stackPos) {
25993            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
25994        }, 394 => function ($stackPos) {
25995            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
25996        }, 395 => function ($stackPos) {
25997            $this->semValue = array(new Stmt\Class_(null, ['type' => 0, 'extends' => $this->semStack[$stackPos - (7 - 3)], 'implements' => $this->semStack[$stackPos - (7 - 4)], 'stmts' => $this->semStack[$stackPos - (7 - 6)]], $this->startAttributeStack[$stackPos - (7 - 1)] + $this->endAttributes), $this->semStack[$stackPos - (7 - 2)]);
25998            $this->checkClass($this->semValue[0], -1);
25999        }, 396 => function ($stackPos) {
26000            $this->semValue = new Expr\New_($this->semStack[$stackPos - (3 - 2)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26001        }, 397 => function ($stackPos) {
26002            list($class, $ctorArgs) = $this->semStack[$stackPos - (2 - 2)];
26003            $this->semValue = new Expr\New_($class, $ctorArgs, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
26004        }, 398 => function ($stackPos) {
26005            $this->semValue = array();
26006        }, 399 => function ($stackPos) {
26007            $this->semValue = $this->semStack[$stackPos - (4 - 3)];
26008        }, 400 => function ($stackPos) {
26009            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
26010        }, 401 => function ($stackPos) {
26011            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
26012            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
26013        }, 402 => function ($stackPos) {
26014            $this->semValue = new Expr\ClosureUse($this->semStack[$stackPos - (2 - 2)], $this->semStack[$stackPos - (2 - 1)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
26015        }, 403 => function ($stackPos) {
26016            $this->semValue = new Expr\FuncCall($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
26017        }, 404 => function ($stackPos) {
26018            $this->semValue = new Expr\StaticCall($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
26019        }, 405 => function ($stackPos) {
26020            $this->semValue = new Expr\StaticCall($this->semStack[$stackPos - (6 - 1)], $this->semStack[$stackPos - (6 - 4)], $this->semStack[$stackPos - (6 - 6)], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
26021        }, 406 => function ($stackPos) {
26022            $this->semValue = $this->fixupPhp5StaticPropCall($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
26023        }, 407 => function ($stackPos) {
26024            $this->semValue = new Expr\FuncCall($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
26025        }, 408 => function ($stackPos) {
26026            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
26027        }, 409 => function ($stackPos) {
26028            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26029        }, 410 => function ($stackPos) {
26030            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26031        }, 411 => function ($stackPos) {
26032            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26033        }, 412 => function ($stackPos) {
26034            $this->semValue = new Name($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26035        }, 413 => function ($stackPos) {
26036            $this->semValue = new Name\FullyQualified(\substr($this->semStack[$stackPos - (1 - 1)], 1), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26037        }, 414 => function ($stackPos) {
26038            $this->semValue = new Name\Relative(\substr($this->semStack[$stackPos - (1 - 1)], 10), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26039        }, 415 => function ($stackPos) {
26040            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26041        }, 416 => function ($stackPos) {
26042            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26043        }, 417 => function ($stackPos) {
26044            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26045        }, 418 => function ($stackPos) {
26046            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26047        }, 419 => function ($stackPos) {
26048            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26049        }, 420 => function ($stackPos) {
26050            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26051        }, 421 => function ($stackPos) {
26052            $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26053        }, 422 => function ($stackPos) {
26054            $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26055        }, 423 => function ($stackPos) {
26056            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
26057        }, 424 => function ($stackPos) {
26058            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
26059        }, 425 => function ($stackPos) {
26060            $this->semValue = null;
26061        }, 426 => function ($stackPos) {
26062            $this->semValue = null;
26063        }, 427 => function ($stackPos) {
26064            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26065        }, 428 => function ($stackPos) {
26066            $this->semValue = array();
26067        }, 429 => function ($stackPos) {
26068            $this->semValue = array(new Scalar\EncapsedStringPart(Scalar\String_::parseEscapeSequences($this->semStack[$stackPos - (1 - 1)], '`', \false), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes));
26069        }, 430 => function ($stackPos) {
26070            foreach ($this->semStack[$stackPos - (1 - 1)] as $s) {
26071                if ($s instanceof Node\Scalar\EncapsedStringPart) {
26072                    $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', \false);
26073                }
26074            }
26075            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26076        }, 431 => function ($stackPos) {
26077            $this->semValue = array();
26078        }, 432 => function ($stackPos) {
26079            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26080        }, 433 => function ($stackPos) {
26081            $this->semValue = $this->parseLNumber($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes, \true);
26082        }, 434 => function ($stackPos) {
26083            $this->semValue = new Scalar\DNumber(Scalar\DNumber::parse($this->semStack[$stackPos - (1 - 1)]), $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26084        }, 435 => function ($stackPos) {
26085            $attrs = $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes;
26086            $attrs['kind'] = $this->semStack[$stackPos - (1 - 1)][0] === "'" || $this->semStack[$stackPos - (1 - 1)][1] === "'" && ($this->semStack[$stackPos - (1 - 1)][0] === 'b' || $this->semStack[$stackPos - (1 - 1)][0] === 'B') ? Scalar\String_::KIND_SINGLE_QUOTED : Scalar\String_::KIND_DOUBLE_QUOTED;
26087            $this->semValue = new Scalar\String_(Scalar\String_::parse($this->semStack[$stackPos - (1 - 1)], \false), $attrs);
26088        }, 436 => function ($stackPos) {
26089            $this->semValue = new Scalar\MagicConst\Line($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26090        }, 437 => function ($stackPos) {
26091            $this->semValue = new Scalar\MagicConst\File($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26092        }, 438 => function ($stackPos) {
26093            $this->semValue = new Scalar\MagicConst\Dir($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26094        }, 439 => function ($stackPos) {
26095            $this->semValue = new Scalar\MagicConst\Class_($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26096        }, 440 => function ($stackPos) {
26097            $this->semValue = new Scalar\MagicConst\Trait_($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26098        }, 441 => function ($stackPos) {
26099            $this->semValue = new Scalar\MagicConst\Method($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26100        }, 442 => function ($stackPos) {
26101            $this->semValue = new Scalar\MagicConst\Function_($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26102        }, 443 => function ($stackPos) {
26103            $this->semValue = new Scalar\MagicConst\Namespace_($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26104        }, 444 => function ($stackPos) {
26105            $this->semValue = $this->parseDocString($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 2)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes, $this->startAttributeStack[$stackPos - (3 - 3)] + $this->endAttributeStack[$stackPos - (3 - 3)], \false);
26106        }, 445 => function ($stackPos) {
26107            $this->semValue = $this->parseDocString($this->semStack[$stackPos - (2 - 1)], '', $this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes, $this->startAttributeStack[$stackPos - (2 - 2)] + $this->endAttributeStack[$stackPos - (2 - 2)], \false);
26108        }, 446 => function ($stackPos) {
26109            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26110        }, 447 => function ($stackPos) {
26111            $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26112        }, 448 => function ($stackPos) {
26113            $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26114        }, 449 => function ($stackPos) {
26115            $this->semValue = new Expr\Array_($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
26116        }, 450 => function ($stackPos) {
26117            $this->semValue = new Expr\Array_($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26118        }, 451 => function ($stackPos) {
26119            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26120        }, 452 => function ($stackPos) {
26121            $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26122        }, 453 => function ($stackPos) {
26123            $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26124        }, 454 => function ($stackPos) {
26125            $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26126        }, 455 => function ($stackPos) {
26127            $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26128        }, 456 => function ($stackPos) {
26129            $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26130        }, 457 => function ($stackPos) {
26131            $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26132        }, 458 => function ($stackPos) {
26133            $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26134        }, 459 => function ($stackPos) {
26135            $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26136        }, 460 => function ($stackPos) {
26137            $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26138        }, 461 => function ($stackPos) {
26139            $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26140        }, 462 => function ($stackPos) {
26141            $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26142        }, 463 => function ($stackPos) {
26143            $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26144        }, 464 => function ($stackPos) {
26145            $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26146        }, 465 => function ($stackPos) {
26147            $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26148        }, 466 => function ($stackPos) {
26149            $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26150        }, 467 => function ($stackPos) {
26151            $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26152        }, 468 => function ($stackPos) {
26153            $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26154        }, 469 => function ($stackPos) {
26155            $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26156        }, 470 => function ($stackPos) {
26157            $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
26158        }, 471 => function ($stackPos) {
26159            $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
26160        }, 472 => function ($stackPos) {
26161            $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
26162        }, 473 => function ($stackPos) {
26163            $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
26164        }, 474 => function ($stackPos) {
26165            $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26166        }, 475 => function ($stackPos) {
26167            $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26168        }, 476 => function ($stackPos) {
26169            $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26170        }, 477 => function ($stackPos) {
26171            $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26172        }, 478 => function ($stackPos) {
26173            $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26174        }, 479 => function ($stackPos) {
26175            $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26176        }, 480 => function ($stackPos) {
26177            $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26178        }, 481 => function ($stackPos) {
26179            $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26180        }, 482 => function ($stackPos) {
26181            $this->semValue = new Expr\Ternary($this->semStack[$stackPos - (5 - 1)], $this->semStack[$stackPos - (5 - 3)], $this->semStack[$stackPos - (5 - 5)], $this->startAttributeStack[$stackPos - (5 - 1)] + $this->endAttributes);
26182        }, 483 => function ($stackPos) {
26183            $this->semValue = new Expr\Ternary($this->semStack[$stackPos - (4 - 1)], null, $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
26184        }, 484 => function ($stackPos) {
26185            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
26186        }, 485 => function ($stackPos) {
26187            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
26188        }, 486 => function ($stackPos) {
26189            $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26190        }, 487 => function ($stackPos) {
26191            $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26192        }, 488 => function ($stackPos) {
26193            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26194        }, 489 => function ($stackPos) {
26195            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26196        }, 490 => function ($stackPos) {
26197            $attrs = $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes;
26198            $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED;
26199            foreach ($this->semStack[$stackPos - (3 - 2)] as $s) {
26200                if ($s instanceof Node\Scalar\EncapsedStringPart) {
26201                    $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', \true);
26202                }
26203            }
26204            $this->semValue = new Scalar\Encapsed($this->semStack[$stackPos - (3 - 2)], $attrs);
26205        }, 491 => function ($stackPos) {
26206            $this->semValue = $this->parseDocString($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 2)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes, $this->startAttributeStack[$stackPos - (3 - 3)] + $this->endAttributeStack[$stackPos - (3 - 3)], \true);
26207        }, 492 => function ($stackPos) {
26208            $this->semValue = array();
26209        }, 493 => function ($stackPos) {
26210            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
26211        }, 494 => function ($stackPos) {
26212            $this->semValue = $this->semStack[$stackPos];
26213        }, 495 => function ($stackPos) {
26214            $this->semValue = $this->semStack[$stackPos];
26215        }, 496 => function ($stackPos) {
26216            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
26217            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
26218        }, 497 => function ($stackPos) {
26219            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
26220        }, 498 => function ($stackPos) {
26221            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (3 - 3)], $this->semStack[$stackPos - (3 - 1)], \false, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26222        }, 499 => function ($stackPos) {
26223            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (1 - 1)], null, \false, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26224        }, 500 => function ($stackPos) {
26225            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26226        }, 501 => function ($stackPos) {
26227            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26228        }, 502 => function ($stackPos) {
26229            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26230        }, 503 => function ($stackPos) {
26231            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26232        }, 504 => function ($stackPos) {
26233            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (6 - 2)], $this->semStack[$stackPos - (6 - 5)], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
26234        }, 505 => function ($stackPos) {
26235            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
26236        }, 506 => function ($stackPos) {
26237            $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26238        }, 507 => function ($stackPos) {
26239            $this->semValue = new Expr\MethodCall($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
26240        }, 508 => function ($stackPos) {
26241            $this->semValue = new Expr\FuncCall($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
26242        }, 509 => function ($stackPos) {
26243            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
26244        }, 510 => function ($stackPos) {
26245            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
26246        }, 511 => function ($stackPos) {
26247            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26248        }, 512 => function ($stackPos) {
26249            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
26250        }, 513 => function ($stackPos) {
26251            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26252        }, 514 => function ($stackPos) {
26253            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (2 - 2)], $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
26254        }, 515 => function ($stackPos) {
26255            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26256        }, 516 => function ($stackPos) {
26257            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26258        }, 517 => function ($stackPos) {
26259            $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 4)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
26260        }, 518 => function ($stackPos) {
26261            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26262        }, 519 => function ($stackPos) {
26263            $var = \substr($this->semStack[$stackPos - (1 - 1)], 1);
26264            $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes) : $var;
26265        }, 520 => function ($stackPos) {
26266            $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26267        }, 521 => function ($stackPos) {
26268            $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos - (6 - 1)], $this->semStack[$stackPos - (6 - 5)], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
26269        }, 522 => function ($stackPos) {
26270            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
26271        }, 523 => function ($stackPos) {
26272            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
26273        }, 524 => function ($stackPos) {
26274            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
26275        }, 525 => function ($stackPos) {
26276            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
26277        }, 526 => function ($stackPos) {
26278            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26279        }, 527 => function ($stackPos) {
26280            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
26281        }, 528 => function ($stackPos) {
26282            $this->semValue = null;
26283        }, 529 => function ($stackPos) {
26284            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26285        }, 530 => function ($stackPos) {
26286            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26287        }, 531 => function ($stackPos) {
26288            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
26289        }, 532 => function ($stackPos) {
26290            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26291        }, 533 => function ($stackPos) {
26292            $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26293            $this->errorState = 2;
26294        }, 534 => function ($stackPos) {
26295            $this->semValue = new Expr\List_($this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
26296        }, 535 => function ($stackPos) {
26297            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
26298            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
26299        }, 536 => function ($stackPos) {
26300            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
26301        }, 537 => function ($stackPos) {
26302            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (1 - 1)], null, \false, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26303        }, 538 => function ($stackPos) {
26304            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (1 - 1)], null, \false, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26305        }, 539 => function ($stackPos) {
26306            $this->semValue = null;
26307        }, 540 => function ($stackPos) {
26308            $this->semValue = array();
26309        }, 541 => function ($stackPos) {
26310            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
26311        }, 542 => function ($stackPos) {
26312            $this->semStack[$stackPos - (3 - 1)][] = $this->semStack[$stackPos - (3 - 3)];
26313            $this->semValue = $this->semStack[$stackPos - (3 - 1)];
26314        }, 543 => function ($stackPos) {
26315            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
26316        }, 544 => function ($stackPos) {
26317            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (3 - 3)], $this->semStack[$stackPos - (3 - 1)], \false, $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26318        }, 545 => function ($stackPos) {
26319            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (1 - 1)], null, \false, $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26320        }, 546 => function ($stackPos) {
26321            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (4 - 4)], $this->semStack[$stackPos - (4 - 1)], \true, $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
26322        }, 547 => function ($stackPos) {
26323            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (2 - 2)], null, \true, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
26324        }, 548 => function ($stackPos) {
26325            $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos - (2 - 2)], null, \false, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes, \true, $this->startAttributeStack[$stackPos - (2 - 1)] + $this->endAttributes);
26326        }, 549 => function ($stackPos) {
26327            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
26328            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
26329        }, 550 => function ($stackPos) {
26330            $this->semStack[$stackPos - (2 - 1)][] = $this->semStack[$stackPos - (2 - 2)];
26331            $this->semValue = $this->semStack[$stackPos - (2 - 1)];
26332        }, 551 => function ($stackPos) {
26333            $this->semValue = array($this->semStack[$stackPos - (1 - 1)]);
26334        }, 552 => function ($stackPos) {
26335            $this->semValue = array($this->semStack[$stackPos - (2 - 1)], $this->semStack[$stackPos - (2 - 2)]);
26336        }, 553 => function ($stackPos) {
26337            $this->semValue = new Scalar\EncapsedStringPart($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26338        }, 554 => function ($stackPos) {
26339            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26340        }, 555 => function ($stackPos) {
26341            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26342        }, 556 => function ($stackPos) {
26343            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (4 - 1)], $this->semStack[$stackPos - (4 - 3)], $this->startAttributeStack[$stackPos - (4 - 1)] + $this->endAttributes);
26344        }, 557 => function ($stackPos) {
26345            $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos - (3 - 1)], $this->semStack[$stackPos - (3 - 3)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26346        }, 558 => function ($stackPos) {
26347            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26348        }, 559 => function ($stackPos) {
26349            $this->semValue = new Expr\Variable($this->semStack[$stackPos - (3 - 2)], $this->startAttributeStack[$stackPos - (3 - 1)] + $this->endAttributes);
26350        }, 560 => function ($stackPos) {
26351            $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos - (6 - 2)], $this->semStack[$stackPos - (6 - 4)], $this->startAttributeStack[$stackPos - (6 - 1)] + $this->endAttributes);
26352        }, 561 => function ($stackPos) {
26353            $this->semValue = $this->semStack[$stackPos - (3 - 2)];
26354        }, 562 => function ($stackPos) {
26355            $this->semValue = new Scalar\String_($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26356        }, 563 => function ($stackPos) {
26357            $this->semValue = $this->parseNumString($this->semStack[$stackPos - (1 - 1)], $this->startAttributeStack[$stackPos - (1 - 1)] + $this->endAttributes);
26358        }, 564 => function ($stackPos) {
26359            $this->semValue = $this->semStack[$stackPos - (1 - 1)];
26360        }];
26361    }
26362}
26363<?php
26364
26365declare (strict_types=1);
26366/*
26367 * This file is part of phpunit/php-timer.
26368 *
26369 * (c) Sebastian Bergmann <sebastian@phpunit.de>
26370 *
26371 * For the full copyright and license information, please view the LICENSE
26372 * file that was distributed with this source code.
26373 */
26374namespace PHPUnit\SebastianBergmann\Timer;
26375
26376use function array_pop;
26377use function hrtime;
26378final class Timer
26379{
26380    /**
26381     * @psalm-var list<float>
26382     */
26383    private $startTimes = [];
26384    public function start() : void
26385    {
26386        $this->startTimes[] = (float) hrtime(\true);
26387    }
26388    /**
26389     * @throws NoActiveTimerException
26390     */
26391    public function stop() : Duration
26392    {
26393        if (empty($this->startTimes)) {
26394            throw new NoActiveTimerException('Timer::start() has to be called before Timer::stop()');
26395        }
26396        return Duration::fromNanoseconds((float) hrtime(\true) - array_pop($this->startTimes));
26397    }
26398}
26399<?php
26400
26401declare (strict_types=1);
26402/*
26403 * This file is part of phpunit/php-timer.
26404 *
26405 * (c) Sebastian Bergmann <sebastian@phpunit.de>
26406 *
26407 * For the full copyright and license information, please view the LICENSE
26408 * file that was distributed with this source code.
26409 */
26410namespace PHPUnit\SebastianBergmann\Timer;
26411
26412use function is_float;
26413use function memory_get_peak_usage;
26414use function microtime;
26415use function sprintf;
26416final class ResourceUsageFormatter
26417{
26418    /**
26419     * @psalm-var array<string,int>
26420     */
26421    private const SIZES = ['GB' => 1073741824, 'MB' => 1048576, 'KB' => 1024];
26422    public function resourceUsage(Duration $duration) : string
26423    {
26424        return sprintf('Time: %s, Memory: %s', $duration->asString(), $this->bytesToString(memory_get_peak_usage(\true)));
26425    }
26426    /**
26427     * @throws TimeSinceStartOfRequestNotAvailableException
26428     */
26429    public function resourceUsageSinceStartOfRequest() : string
26430    {
26431        if (!isset($_SERVER['REQUEST_TIME_FLOAT'])) {
26432            throw new TimeSinceStartOfRequestNotAvailableException('Cannot determine time at which the request started because $_SERVER[\'REQUEST_TIME_FLOAT\'] is not available');
26433        }
26434        if (!is_float($_SERVER['REQUEST_TIME_FLOAT'])) {
26435            throw new TimeSinceStartOfRequestNotAvailableException('Cannot determine time at which the request started because $_SERVER[\'REQUEST_TIME_FLOAT\'] is not of type float');
26436        }
26437        return $this->resourceUsage(Duration::fromMicroseconds(1000000 * (microtime(\true) - $_SERVER['REQUEST_TIME_FLOAT'])));
26438    }
26439    private function bytesToString(int $bytes) : string
26440    {
26441        foreach (self::SIZES as $unit => $value) {
26442            if ($bytes >= $value) {
26443                return sprintf('%.2f %s', $bytes >= 1024 ? $bytes / $value : $bytes, $unit);
26444            }
26445        }
26446        // @codeCoverageIgnoreStart
26447        return $bytes . ' byte' . ($bytes !== 1 ? 's' : '');
26448        // @codeCoverageIgnoreEnd
26449    }
26450}
26451<?php
26452
26453declare (strict_types=1);
26454/*
26455 * This file is part of phpunit/php-timer.
26456 *
26457 * (c) Sebastian Bergmann <sebastian@phpunit.de>
26458 *
26459 * For the full copyright and license information, please view the LICENSE
26460 * file that was distributed with this source code.
26461 */
26462namespace PHPUnit\SebastianBergmann\Timer;
26463
26464use function floor;
26465use function sprintf;
26466/**
26467 * @psalm-immutable
26468 */
26469final class Duration
26470{
26471    /**
26472     * @var float
26473     */
26474    private $nanoseconds;
26475    /**
26476     * @var int
26477     */
26478    private $hours;
26479    /**
26480     * @var int
26481     */
26482    private $minutes;
26483    /**
26484     * @var int
26485     */
26486    private $seconds;
26487    /**
26488     * @var int
26489     */
26490    private $milliseconds;
26491    public static function fromMicroseconds(float $microseconds) : self
26492    {
26493        return new self($microseconds * 1000);
26494    }
26495    public static function fromNanoseconds(float $nanoseconds) : self
26496    {
26497        return new self($nanoseconds);
26498    }
26499    private function __construct(float $nanoseconds)
26500    {
26501        $this->nanoseconds = $nanoseconds;
26502        $timeInMilliseconds = $nanoseconds / 1000000;
26503        $hours = floor($timeInMilliseconds / 60 / 60 / 1000);
26504        $hoursInMilliseconds = $hours * 60 * 60 * 1000;
26505        $minutes = floor($timeInMilliseconds / 60 / 1000) % 60;
26506        $minutesInMilliseconds = $minutes * 60 * 1000;
26507        $seconds = floor(($timeInMilliseconds - $hoursInMilliseconds - $minutesInMilliseconds) / 1000);
26508        $secondsInMilliseconds = $seconds * 1000;
26509        $milliseconds = $timeInMilliseconds - $hoursInMilliseconds - $minutesInMilliseconds - $secondsInMilliseconds;
26510        $this->hours = (int) $hours;
26511        $this->minutes = $minutes;
26512        $this->seconds = (int) $seconds;
26513        $this->milliseconds = (int) $milliseconds;
26514    }
26515    public function asNanoseconds() : float
26516    {
26517        return $this->nanoseconds;
26518    }
26519    public function asMicroseconds() : float
26520    {
26521        return $this->nanoseconds / 1000;
26522    }
26523    public function asMilliseconds() : float
26524    {
26525        return $this->nanoseconds / 1000000;
26526    }
26527    public function asSeconds() : float
26528    {
26529        return $this->nanoseconds / 1000000000;
26530    }
26531    public function asString() : string
26532    {
26533        $result = '';
26534        if ($this->hours > 0) {
26535            $result = sprintf('%02d', $this->hours) . ':';
26536        }
26537        $result .= sprintf('%02d', $this->minutes) . ':';
26538        $result .= sprintf('%02d', $this->seconds);
26539        if ($this->milliseconds > 0) {
26540            $result .= '.' . sprintf('%03d', $this->milliseconds);
26541        }
26542        return $result;
26543    }
26544}
26545<?php
26546
26547declare (strict_types=1);
26548/*
26549 * This file is part of phpunit/php-timer.
26550 *
26551 * (c) Sebastian Bergmann <sebastian@phpunit.de>
26552 *
26553 * For the full copyright and license information, please view the LICENSE
26554 * file that was distributed with this source code.
26555 */
26556namespace PHPUnit\SebastianBergmann\Timer;
26557
26558use LogicException;
26559final class NoActiveTimerException extends LogicException implements Exception
26560{
26561}
26562<?php
26563
26564declare (strict_types=1);
26565/*
26566 * This file is part of phpunit/php-timer.
26567 *
26568 * (c) Sebastian Bergmann <sebastian@phpunit.de>
26569 *
26570 * For the full copyright and license information, please view the LICENSE
26571 * file that was distributed with this source code.
26572 */
26573namespace PHPUnit\SebastianBergmann\Timer;
26574
26575use RuntimeException;
26576final class TimeSinceStartOfRequestNotAvailableException extends RuntimeException implements Exception
26577{
26578}
26579<?php
26580
26581declare (strict_types=1);
26582/*
26583 * This file is part of phpunit/php-timer.
26584 *
26585 * (c) Sebastian Bergmann <sebastian@phpunit.de>
26586 *
26587 * For the full copyright and license information, please view the LICENSE
26588 * file that was distributed with this source code.
26589 */
26590namespace PHPUnit\SebastianBergmann\Timer;
26591
26592use Throwable;
26593interface Exception extends Throwable
26594{
26595}
26596phpunit/php-timer
26597
26598Copyright (c) 2010-2020, Sebastian Bergmann <sebastian@phpunit.de>.
26599All rights reserved.
26600
26601Redistribution and use in source and binary forms, with or without
26602modification, are permitted provided that the following conditions
26603are met:
26604
26605 * Redistributions of source code must retain the above copyright
26606   notice, this list of conditions and the following disclaimer.
26607
26608 * Redistributions in binary form must reproduce the above copyright
26609   notice, this list of conditions and the following disclaimer in
26610   the documentation and/or other materials provided with the
26611   distribution.
26612
26613 * Neither the name of Sebastian Bergmann nor the names of his
26614   contributors may be used to endorse or promote products derived
26615   from this software without specific prior written permission.
26616
26617THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26618"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26619LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26620FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26621COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26622INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26623BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26624LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26625CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26626LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26627ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26628POSSIBILITY OF SUCH DAMAGE.
26629<?php
26630
26631declare (strict_types=1);
26632/*
26633 * This file is part of sebastian/global-state.
26634 *
26635 * (c) Sebastian Bergmann <sebastian@phpunit.de>
26636 *
26637 * For the full copyright and license information, please view the LICENSE
26638 * file that was distributed with this source code.
26639 */
26640namespace PHPUnit\SebastianBergmann\GlobalState;
26641
26642use function array_keys;
26643use function array_merge;
26644use function array_reverse;
26645use function func_get_args;
26646use function get_declared_classes;
26647use function get_declared_interfaces;
26648use function get_declared_traits;
26649use function get_defined_constants;
26650use function get_defined_functions;
26651use function get_included_files;
26652use function in_array;
26653use function ini_get_all;
26654use function is_array;
26655use function is_object;
26656use function is_resource;
26657use function is_scalar;
26658use function serialize;
26659use function unserialize;
26660use ReflectionClass;
26661use PHPUnit\SebastianBergmann\ObjectReflector\ObjectReflector;
26662use PHPUnit\SebastianBergmann\RecursionContext\Context;
26663use Throwable;
26664/**
26665 * A snapshot of global state.
26666 */
26667class Snapshot
26668{
26669    /**
26670     * @var ExcludeList
26671     */
26672    private $excludeList;
26673    /**
26674     * @var array
26675     */
26676    private $globalVariables = [];
26677    /**
26678     * @var array
26679     */
26680    private $superGlobalArrays = [];
26681    /**
26682     * @var array
26683     */
26684    private $superGlobalVariables = [];
26685    /**
26686     * @var array
26687     */
26688    private $staticAttributes = [];
26689    /**
26690     * @var array
26691     */
26692    private $iniSettings = [];
26693    /**
26694     * @var array
26695     */
26696    private $includedFiles = [];
26697    /**
26698     * @var array
26699     */
26700    private $constants = [];
26701    /**
26702     * @var array
26703     */
26704    private $functions = [];
26705    /**
26706     * @var array
26707     */
26708    private $interfaces = [];
26709    /**
26710     * @var array
26711     */
26712    private $classes = [];
26713    /**
26714     * @var array
26715     */
26716    private $traits = [];
26717    /**
26718     * Creates a snapshot of the current global state.
26719     */
26720    public function __construct(ExcludeList $excludeList = null, bool $includeGlobalVariables = \true, bool $includeStaticAttributes = \true, bool $includeConstants = \true, bool $includeFunctions = \true, bool $includeClasses = \true, bool $includeInterfaces = \true, bool $includeTraits = \true, bool $includeIniSettings = \true, bool $includeIncludedFiles = \true)
26721    {
26722        $this->excludeList = $excludeList ?: new ExcludeList();
26723        if ($includeConstants) {
26724            $this->snapshotConstants();
26725        }
26726        if ($includeFunctions) {
26727            $this->snapshotFunctions();
26728        }
26729        if ($includeClasses || $includeStaticAttributes) {
26730            $this->snapshotClasses();
26731        }
26732        if ($includeInterfaces) {
26733            $this->snapshotInterfaces();
26734        }
26735        if ($includeGlobalVariables) {
26736            $this->setupSuperGlobalArrays();
26737            $this->snapshotGlobals();
26738        }
26739        if ($includeStaticAttributes) {
26740            $this->snapshotStaticAttributes();
26741        }
26742        if ($includeIniSettings) {
26743            $this->iniSettings = ini_get_all(null, \false);
26744        }
26745        if ($includeIncludedFiles) {
26746            $this->includedFiles = get_included_files();
26747        }
26748        $this->traits = get_declared_traits();
26749    }
26750    public function excludeList() : ExcludeList
26751    {
26752        return $this->excludeList;
26753    }
26754    public function globalVariables() : array
26755    {
26756        return $this->globalVariables;
26757    }
26758    public function superGlobalVariables() : array
26759    {
26760        return $this->superGlobalVariables;
26761    }
26762    public function superGlobalArrays() : array
26763    {
26764        return $this->superGlobalArrays;
26765    }
26766    public function staticAttributes() : array
26767    {
26768        return $this->staticAttributes;
26769    }
26770    public function iniSettings() : array
26771    {
26772        return $this->iniSettings;
26773    }
26774    public function includedFiles() : array
26775    {
26776        return $this->includedFiles;
26777    }
26778    public function constants() : array
26779    {
26780        return $this->constants;
26781    }
26782    public function functions() : array
26783    {
26784        return $this->functions;
26785    }
26786    public function interfaces() : array
26787    {
26788        return $this->interfaces;
26789    }
26790    public function classes() : array
26791    {
26792        return $this->classes;
26793    }
26794    public function traits() : array
26795    {
26796        return $this->traits;
26797    }
26798    /**
26799     * Creates a snapshot user-defined constants.
26800     */
26801    private function snapshotConstants() : void
26802    {
26803        $constants = get_defined_constants(\true);
26804        if (isset($constants['user'])) {
26805            $this->constants = $constants['user'];
26806        }
26807    }
26808    /**
26809     * Creates a snapshot user-defined functions.
26810     */
26811    private function snapshotFunctions() : void
26812    {
26813        $functions = get_defined_functions();
26814        $this->functions = $functions['user'];
26815    }
26816    /**
26817     * Creates a snapshot user-defined classes.
26818     */
26819    private function snapshotClasses() : void
26820    {
26821        foreach (array_reverse(get_declared_classes()) as $className) {
26822            $class = new ReflectionClass($className);
26823            if (!$class->isUserDefined()) {
26824                break;
26825            }
26826            $this->classes[] = $className;
26827        }
26828        $this->classes = array_reverse($this->classes);
26829    }
26830    /**
26831     * Creates a snapshot user-defined interfaces.
26832     */
26833    private function snapshotInterfaces() : void
26834    {
26835        foreach (array_reverse(get_declared_interfaces()) as $interfaceName) {
26836            $class = new ReflectionClass($interfaceName);
26837            if (!$class->isUserDefined()) {
26838                break;
26839            }
26840            $this->interfaces[] = $interfaceName;
26841        }
26842        $this->interfaces = array_reverse($this->interfaces);
26843    }
26844    /**
26845     * Creates a snapshot of all global and super-global variables.
26846     */
26847    private function snapshotGlobals() : void
26848    {
26849        $superGlobalArrays = $this->superGlobalArrays();
26850        foreach ($superGlobalArrays as $superGlobalArray) {
26851            $this->snapshotSuperGlobalArray($superGlobalArray);
26852        }
26853        foreach (array_keys($GLOBALS) as $key) {
26854            if ($key !== 'GLOBALS' && !in_array($key, $superGlobalArrays, \true) && $this->canBeSerialized($GLOBALS[$key]) && !$this->excludeList->isGlobalVariableExcluded($key)) {
26855                /* @noinspection UnserializeExploitsInspection */
26856                $this->globalVariables[$key] = unserialize(serialize($GLOBALS[$key]));
26857            }
26858        }
26859    }
26860    /**
26861     * Creates a snapshot a super-global variable array.
26862     */
26863    private function snapshotSuperGlobalArray(string $superGlobalArray) : void
26864    {
26865        $this->superGlobalVariables[$superGlobalArray] = [];
26866        if (isset($GLOBALS[$superGlobalArray]) && is_array($GLOBALS[$superGlobalArray])) {
26867            foreach ($GLOBALS[$superGlobalArray] as $key => $value) {
26868                /* @noinspection UnserializeExploitsInspection */
26869                $this->superGlobalVariables[$superGlobalArray][$key] = unserialize(serialize($value));
26870            }
26871        }
26872    }
26873    /**
26874     * Creates a snapshot of all static attributes in user-defined classes.
26875     */
26876    private function snapshotStaticAttributes() : void
26877    {
26878        foreach ($this->classes as $className) {
26879            $class = new ReflectionClass($className);
26880            $snapshot = [];
26881            foreach ($class->getProperties() as $attribute) {
26882                if ($attribute->isStatic()) {
26883                    $name = $attribute->getName();
26884                    if ($this->excludeList->isStaticAttributeExcluded($className, $name)) {
26885                        continue;
26886                    }
26887                    $attribute->setAccessible(\true);
26888                    $value = $attribute->getValue();
26889                    if ($this->canBeSerialized($value)) {
26890                        /* @noinspection UnserializeExploitsInspection */
26891                        $snapshot[$name] = unserialize(serialize($value));
26892                    }
26893                }
26894            }
26895            if (!empty($snapshot)) {
26896                $this->staticAttributes[$className] = $snapshot;
26897            }
26898        }
26899    }
26900    /**
26901     * Returns a list of all super-global variable arrays.
26902     */
26903    private function setupSuperGlobalArrays() : void
26904    {
26905        $this->superGlobalArrays = ['_ENV', '_POST', '_GET', '_COOKIE', '_SERVER', '_FILES', '_REQUEST'];
26906    }
26907    private function canBeSerialized($variable) : bool
26908    {
26909        if (is_scalar($variable) || $variable === null) {
26910            return \true;
26911        }
26912        if (is_resource($variable)) {
26913            return \false;
26914        }
26915        foreach ($this->enumerateObjectsAndResources($variable) as $value) {
26916            if (is_resource($value)) {
26917                return \false;
26918            }
26919            if (is_object($value)) {
26920                $class = new ReflectionClass($value);
26921                if ($class->isAnonymous()) {
26922                    return \false;
26923                }
26924                try {
26925                    @serialize($value);
26926                } catch (Throwable $t) {
26927                    return \false;
26928                }
26929            }
26930        }
26931        return \true;
26932    }
26933    private function enumerateObjectsAndResources($variable) : array
26934    {
26935        if (isset(func_get_args()[1])) {
26936            $processed = func_get_args()[1];
26937        } else {
26938            $processed = new Context();
26939        }
26940        $result = [];
26941        if ($processed->contains($variable)) {
26942            return $result;
26943        }
26944        $array = $variable;
26945        $processed->add($variable);
26946        if (is_array($variable)) {
26947            foreach ($array as $element) {
26948                if (!is_array($element) && !is_object($element) && !is_resource($element)) {
26949                    continue;
26950                }
26951                if (!is_resource($element)) {
26952                    /** @noinspection SlowArrayOperationsInLoopInspection */
26953                    $result = array_merge($result, $this->enumerateObjectsAndResources($element, $processed));
26954                } else {
26955                    $result[] = $element;
26956                }
26957            }
26958        } else {
26959            $result[] = $variable;
26960            foreach ((new ObjectReflector())->getAttributes($variable) as $value) {
26961                if (!is_array($value) && !is_object($value) && !is_resource($value)) {
26962                    continue;
26963                }
26964                if (!is_resource($value)) {
26965                    /** @noinspection SlowArrayOperationsInLoopInspection */
26966                    $result = array_merge($result, $this->enumerateObjectsAndResources($value, $processed));
26967                } else {
26968                    $result[] = $value;
26969                }
26970            }
26971        }
26972        return $result;
26973    }
26974}
26975<?php
26976
26977declare (strict_types=1);
26978/*
26979 * This file is part of sebastian/global-state.
26980 *
26981 * (c) Sebastian Bergmann <sebastian@phpunit.de>
26982 *
26983 * For the full copyright and license information, please view the LICENSE
26984 * file that was distributed with this source code.
26985 */
26986namespace PHPUnit\SebastianBergmann\GlobalState;
26987
26988use const PHP_EOL;
26989use function is_array;
26990use function is_scalar;
26991use function serialize;
26992use function sprintf;
26993use function var_export;
26994/**
26995 * Exports parts of a Snapshot as PHP code.
26996 */
26997final class CodeExporter
26998{
26999    public function constants(Snapshot $snapshot) : string
27000    {
27001        $result = '';
27002        foreach ($snapshot->constants() as $name => $value) {
27003            $result .= sprintf('if (!defined(\'%s\')) define(\'%s\', %s);' . "\n", $name, $name, $this->exportVariable($value));
27004        }
27005        return $result;
27006    }
27007    public function globalVariables(Snapshot $snapshot) : string
27008    {
27009        $result = <<<'EOT'
27010call_user_func(
27011    function ()
27012    {
27013        foreach (array_keys($GLOBALS) as $key) {
27014            unset($GLOBALS[$key]);
27015        }
27016    }
27017);
27018
27019
27020EOT;
27021        foreach ($snapshot->globalVariables() as $name => $value) {
27022            $result .= sprintf('$GLOBALS[%s] = %s;' . \PHP_EOL, $this->exportVariable($name), $this->exportVariable($value));
27023        }
27024        return $result;
27025    }
27026    public function iniSettings(Snapshot $snapshot) : string
27027    {
27028        $result = '';
27029        foreach ($snapshot->iniSettings() as $key => $value) {
27030            $result .= sprintf('@ini_set(%s, %s);' . "\n", $this->exportVariable($key), $this->exportVariable($value));
27031        }
27032        return $result;
27033    }
27034    private function exportVariable($variable) : string
27035    {
27036        if (is_scalar($variable) || null === $variable || is_array($variable) && $this->arrayOnlyContainsScalars($variable)) {
27037            return var_export($variable, \true);
27038        }
27039        return 'unserialize(' . var_export(serialize($variable), \true) . ')';
27040    }
27041    private function arrayOnlyContainsScalars(array $array) : bool
27042    {
27043        $result = \true;
27044        foreach ($array as $element) {
27045            if (is_array($element)) {
27046                $result = $this->arrayOnlyContainsScalars($element);
27047            } elseif (!is_scalar($element) && null !== $element) {
27048                $result = \false;
27049            }
27050            if ($result === \false) {
27051                break;
27052            }
27053        }
27054        return $result;
27055    }
27056}
27057<?php
27058
27059declare (strict_types=1);
27060/*
27061 * This file is part of sebastian/global-state.
27062 *
27063 * (c) Sebastian Bergmann <sebastian@phpunit.de>
27064 *
27065 * For the full copyright and license information, please view the LICENSE
27066 * file that was distributed with this source code.
27067 */
27068namespace PHPUnit\SebastianBergmann\GlobalState;
27069
27070use function array_diff;
27071use function array_key_exists;
27072use function array_keys;
27073use function array_merge;
27074use function function_exists;
27075use function get_defined_functions;
27076use function in_array;
27077use function is_array;
27078use ReflectionClass;
27079use ReflectionProperty;
27080/**
27081 * Restorer of snapshots of global state.
27082 */
27083class Restorer
27084{
27085    /**
27086     * Deletes function definitions that are not defined in a snapshot.
27087     *
27088     * @throws RuntimeException when the uopz_delete() function is not available
27089     *
27090     * @see https://github.com/krakjoe/uopz
27091     */
27092    public function restoreFunctions(Snapshot $snapshot) : void
27093    {
27094        if (!function_exists('PHPUnit\\uopz_delete')) {
27095            throw new RuntimeException('The uopz_delete() function is required for this operation');
27096        }
27097        $functions = get_defined_functions();
27098        foreach (array_diff($functions['user'], $snapshot->functions()) as $function) {
27099            uopz_delete($function);
27100        }
27101    }
27102    /**
27103     * Restores all global and super-global variables from a snapshot.
27104     */
27105    public function restoreGlobalVariables(Snapshot $snapshot) : void
27106    {
27107        $superGlobalArrays = $snapshot->superGlobalArrays();
27108        foreach ($superGlobalArrays as $superGlobalArray) {
27109            $this->restoreSuperGlobalArray($snapshot, $superGlobalArray);
27110        }
27111        $globalVariables = $snapshot->globalVariables();
27112        foreach (array_keys($GLOBALS) as $key) {
27113            if ($key !== 'GLOBALS' && !in_array($key, $superGlobalArrays, \true) && !$snapshot->excludeList()->isGlobalVariableExcluded($key)) {
27114                if (array_key_exists($key, $globalVariables)) {
27115                    $GLOBALS[$key] = $globalVariables[$key];
27116                } else {
27117                    unset($GLOBALS[$key]);
27118                }
27119            }
27120        }
27121    }
27122    /**
27123     * Restores all static attributes in user-defined classes from this snapshot.
27124     */
27125    public function restoreStaticAttributes(Snapshot $snapshot) : void
27126    {
27127        $current = new Snapshot($snapshot->excludeList(), \false, \false, \false, \false, \true, \false, \false, \false, \false);
27128        $newClasses = array_diff($current->classes(), $snapshot->classes());
27129        unset($current);
27130        foreach ($snapshot->staticAttributes() as $className => $staticAttributes) {
27131            foreach ($staticAttributes as $name => $value) {
27132                $reflector = new ReflectionProperty($className, $name);
27133                $reflector->setAccessible(\true);
27134                $reflector->setValue($value);
27135            }
27136        }
27137        foreach ($newClasses as $className) {
27138            $class = new ReflectionClass($className);
27139            $defaults = $class->getDefaultProperties();
27140            foreach ($class->getProperties() as $attribute) {
27141                if (!$attribute->isStatic()) {
27142                    continue;
27143                }
27144                $name = $attribute->getName();
27145                if ($snapshot->excludeList()->isStaticAttributeExcluded($className, $name)) {
27146                    continue;
27147                }
27148                if (!isset($defaults[$name])) {
27149                    continue;
27150                }
27151                $attribute->setAccessible(\true);
27152                $attribute->setValue($defaults[$name]);
27153            }
27154        }
27155    }
27156    /**
27157     * Restores a super-global variable array from this snapshot.
27158     */
27159    private function restoreSuperGlobalArray(Snapshot $snapshot, string $superGlobalArray) : void
27160    {
27161        $superGlobalVariables = $snapshot->superGlobalVariables();
27162        if (isset($GLOBALS[$superGlobalArray]) && is_array($GLOBALS[$superGlobalArray]) && isset($superGlobalVariables[$superGlobalArray])) {
27163            $keys = array_keys(array_merge($GLOBALS[$superGlobalArray], $superGlobalVariables[$superGlobalArray]));
27164            foreach ($keys as $key) {
27165                if (isset($superGlobalVariables[$superGlobalArray][$key])) {
27166                    $GLOBALS[$superGlobalArray][$key] = $superGlobalVariables[$superGlobalArray][$key];
27167                } else {
27168                    unset($GLOBALS[$superGlobalArray][$key]);
27169                }
27170            }
27171        }
27172    }
27173}
27174<?php
27175
27176declare (strict_types=1);
27177/*
27178 * This file is part of sebastian/global-state.
27179 *
27180 * (c) Sebastian Bergmann <sebastian@phpunit.de>
27181 *
27182 * For the full copyright and license information, please view the LICENSE
27183 * file that was distributed with this source code.
27184 */
27185namespace PHPUnit\SebastianBergmann\GlobalState;
27186
27187final class RuntimeException extends \RuntimeException implements Exception
27188{
27189}
27190<?php
27191
27192declare (strict_types=1);
27193/*
27194 * This file is part of sebastian/global-state.
27195 *
27196 * (c) Sebastian Bergmann <sebastian@phpunit.de>
27197 *
27198 * For the full copyright and license information, please view the LICENSE
27199 * file that was distributed with this source code.
27200 */
27201namespace PHPUnit\SebastianBergmann\GlobalState;
27202
27203use Throwable;
27204interface Exception extends Throwable
27205{
27206}
27207sebastian/global-state
27208
27209Copyright (c) 2001-2021, Sebastian Bergmann <sebastian@phpunit.de>.
27210All rights reserved.
27211
27212Redistribution and use in source and binary forms, with or without
27213modification, are permitted provided that the following conditions
27214are met:
27215
27216 * Redistributions of source code must retain the above copyright
27217   notice, this list of conditions and the following disclaimer.
27218
27219 * Redistributions in binary form must reproduce the above copyright
27220   notice, this list of conditions and the following disclaimer in
27221   the documentation and/or other materials provided with the
27222   distribution.
27223
27224 * Neither the name of Sebastian Bergmann nor the names of his
27225   contributors may be used to endorse or promote products derived
27226   from this software without specific prior written permission.
27227
27228THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27229"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27230LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27231FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27232COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27233INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27234BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27235LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27236CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27237LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
27238ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27239POSSIBILITY OF SUCH DAMAGE.
27240<?php
27241
27242declare (strict_types=1);
27243/*
27244 * This file is part of sebastian/global-state.
27245 *
27246 * (c) Sebastian Bergmann <sebastian@phpunit.de>
27247 *
27248 * For the full copyright and license information, please view the LICENSE
27249 * file that was distributed with this source code.
27250 */
27251namespace PHPUnit\SebastianBergmann\GlobalState;
27252
27253use function in_array;
27254use function strpos;
27255use ReflectionClass;
27256final class ExcludeList
27257{
27258    /**
27259     * @var array
27260     */
27261    private $globalVariables = [];
27262    /**
27263     * @var string[]
27264     */
27265    private $classes = [];
27266    /**
27267     * @var string[]
27268     */
27269    private $classNamePrefixes = [];
27270    /**
27271     * @var string[]
27272     */
27273    private $parentClasses = [];
27274    /**
27275     * @var string[]
27276     */
27277    private $interfaces = [];
27278    /**
27279     * @var array
27280     */
27281    private $staticAttributes = [];
27282    public function addGlobalVariable(string $variableName) : void
27283    {
27284        $this->globalVariables[$variableName] = \true;
27285    }
27286    public function addClass(string $className) : void
27287    {
27288        $this->classes[] = $className;
27289    }
27290    public function addSubclassesOf(string $className) : void
27291    {
27292        $this->parentClasses[] = $className;
27293    }
27294    public function addImplementorsOf(string $interfaceName) : void
27295    {
27296        $this->interfaces[] = $interfaceName;
27297    }
27298    public function addClassNamePrefix(string $classNamePrefix) : void
27299    {
27300        $this->classNamePrefixes[] = $classNamePrefix;
27301    }
27302    public function addStaticAttribute(string $className, string $attributeName) : void
27303    {
27304        if (!isset($this->staticAttributes[$className])) {
27305            $this->staticAttributes[$className] = [];
27306        }
27307        $this->staticAttributes[$className][$attributeName] = \true;
27308    }
27309    public function isGlobalVariableExcluded(string $variableName) : bool
27310    {
27311        return isset($this->globalVariables[$variableName]);
27312    }
27313    public function isStaticAttributeExcluded(string $className, string $attributeName) : bool
27314    {
27315        if (in_array($className, $this->classes, \true)) {
27316            return \true;
27317        }
27318        foreach ($this->classNamePrefixes as $prefix) {
27319            if (strpos($className, $prefix) === 0) {
27320                return \true;
27321            }
27322        }
27323        $class = new ReflectionClass($className);
27324        foreach ($this->parentClasses as $type) {
27325            if ($class->isSubclassOf($type)) {
27326                return \true;
27327            }
27328        }
27329        foreach ($this->interfaces as $type) {
27330            if ($class->implementsInterface($type)) {
27331                return \true;
27332            }
27333        }
27334        if (isset($this->staticAttributes[$className][$attributeName])) {
27335            return \true;
27336        }
27337        return \false;
27338    }
27339}
27340<?php
27341
27342namespace PHPUnit\DeepCopy\Matcher;
27343
27344/**
27345 * @final
27346 */
27347class PropertyNameMatcher implements Matcher
27348{
27349    /**
27350     * @var string
27351     */
27352    private $property;
27353    /**
27354     * @param string $property Property name
27355     */
27356    public function __construct($property)
27357    {
27358        $this->property = $property;
27359    }
27360    /**
27361     * Matches a property by its name.
27362     *
27363     * {@inheritdoc}
27364     */
27365    public function matches($object, $property)
27366    {
27367        return $property == $this->property;
27368    }
27369}
27370<?php
27371
27372namespace PHPUnit\DeepCopy\Matcher;
27373
27374/**
27375 * @final
27376 */
27377class PropertyMatcher implements Matcher
27378{
27379    /**
27380     * @var string
27381     */
27382    private $class;
27383    /**
27384     * @var string
27385     */
27386    private $property;
27387    /**
27388     * @param string $class    Class name
27389     * @param string $property Property name
27390     */
27391    public function __construct($class, $property)
27392    {
27393        $this->class = $class;
27394        $this->property = $property;
27395    }
27396    /**
27397     * Matches a specific property of a specific class.
27398     *
27399     * {@inheritdoc}
27400     */
27401    public function matches($object, $property)
27402    {
27403        return $object instanceof $this->class && $property == $this->property;
27404    }
27405}
27406<?php
27407
27408namespace PHPUnit\DeepCopy\Matcher;
27409
27410interface Matcher
27411{
27412    /**
27413     * @param object $object
27414     * @param string $property
27415     *
27416     * @return boolean
27417     */
27418    public function matches($object, $property);
27419}
27420<?php
27421
27422namespace PHPUnit\DeepCopy\Matcher\Doctrine;
27423
27424use PHPUnit\DeepCopy\Matcher\Matcher;
27425use PHPUnit\Doctrine\Common\Persistence\Proxy;
27426/**
27427 * @final
27428 */
27429class DoctrineProxyMatcher implements Matcher
27430{
27431    /**
27432     * Matches a Doctrine Proxy class.
27433     *
27434     * {@inheritdoc}
27435     */
27436    public function matches($object, $property)
27437    {
27438        return $object instanceof Proxy;
27439    }
27440}
27441<?php
27442
27443namespace PHPUnit\DeepCopy\Matcher;
27444
27445use PHPUnit\DeepCopy\Reflection\ReflectionHelper;
27446use ReflectionException;
27447/**
27448 * Matches a property by its type.
27449 *
27450 * It is recommended to use {@see DeepCopy\TypeFilter\TypeFilter} instead, as it applies on all occurrences
27451 * of given type in copied context (eg. array elements), not just on object properties.
27452 *
27453 * @final
27454 */
27455class PropertyTypeMatcher implements Matcher
27456{
27457    /**
27458     * @var string
27459     */
27460    private $propertyType;
27461    /**
27462     * @param string $propertyType Property type
27463     */
27464    public function __construct($propertyType)
27465    {
27466        $this->propertyType = $propertyType;
27467    }
27468    /**
27469     * {@inheritdoc}
27470     */
27471    public function matches($object, $property)
27472    {
27473        try {
27474            $reflectionProperty = ReflectionHelper::getProperty($object, $property);
27475        } catch (ReflectionException $exception) {
27476            return \false;
27477        }
27478        $reflectionProperty->setAccessible(\true);
27479        // Uninitialized properties (for PHP >7.4)
27480        if (\method_exists($reflectionProperty, 'isInitialized') && !$reflectionProperty->isInitialized($object)) {
27481            // null instanceof $this->propertyType
27482            return \false;
27483        }
27484        return $reflectionProperty->getValue($object) instanceof $this->propertyType;
27485    }
27486}
27487<?php
27488
27489namespace PHPUnit\DeepCopy\Exception;
27490
27491use ReflectionException;
27492class PropertyException extends ReflectionException
27493{
27494}
27495<?php
27496
27497namespace PHPUnit\DeepCopy\Exception;
27498
27499use UnexpectedValueException;
27500class CloneException extends UnexpectedValueException
27501{
27502}
27503<?php
27504
27505namespace PHPUnit\DeepCopy;
27506
27507use function function_exists;
27508if (\false === function_exists('PHPUnit\\DeepCopy\\deep_copy')) {
27509    /**
27510     * Deep copies the given value.
27511     *
27512     * @param mixed $value
27513     * @param bool  $useCloneMethod
27514     *
27515     * @return mixed
27516     */
27517    function deep_copy($value, $useCloneMethod = \false)
27518    {
27519        return (new DeepCopy($useCloneMethod))->copy($value);
27520    }
27521}
27522<?php
27523
27524namespace PHPUnit\DeepCopy\Filter;
27525
27526use PHPUnit\DeepCopy\Reflection\ReflectionHelper;
27527/**
27528 * @final
27529 */
27530class ReplaceFilter implements Filter
27531{
27532    /**
27533     * @var callable
27534     */
27535    protected $callback;
27536    /**
27537     * @param callable $callable Will be called to get the new value for each property to replace
27538     */
27539    public function __construct(callable $callable)
27540    {
27541        $this->callback = $callable;
27542    }
27543    /**
27544     * Replaces the object property by the result of the callback called with the object property.
27545     *
27546     * {@inheritdoc}
27547     */
27548    public function apply($object, $property, $objectCopier)
27549    {
27550        $reflectionProperty = ReflectionHelper::getProperty($object, $property);
27551        $reflectionProperty->setAccessible(\true);
27552        $value = \call_user_func($this->callback, $reflectionProperty->getValue($object));
27553        $reflectionProperty->setValue($object, $value);
27554    }
27555}
27556<?php
27557
27558namespace PHPUnit\DeepCopy\Filter;
27559
27560use PHPUnit\DeepCopy\Reflection\ReflectionHelper;
27561/**
27562 * @final
27563 */
27564class SetNullFilter implements Filter
27565{
27566    /**
27567     * Sets the object property to null.
27568     *
27569     * {@inheritdoc}
27570     */
27571    public function apply($object, $property, $objectCopier)
27572    {
27573        $reflectionProperty = ReflectionHelper::getProperty($object, $property);
27574        $reflectionProperty->setAccessible(\true);
27575        $reflectionProperty->setValue($object, null);
27576    }
27577}
27578<?php
27579
27580namespace PHPUnit\DeepCopy\Filter;
27581
27582class KeepFilter implements Filter
27583{
27584    /**
27585     * Keeps the value of the object property.
27586     *
27587     * {@inheritdoc}
27588     */
27589    public function apply($object, $property, $objectCopier)
27590    {
27591        // Nothing to do
27592    }
27593}
27594<?php
27595
27596namespace PHPUnit\DeepCopy\Filter;
27597
27598/**
27599 * Filter to apply to a property while copying an object
27600 */
27601interface Filter
27602{
27603    /**
27604     * Applies the filter to the object.
27605     *
27606     * @param object   $object
27607     * @param string   $property
27608     * @param callable $objectCopier
27609     */
27610    public function apply($object, $property, $objectCopier);
27611}
27612<?php
27613
27614namespace PHPUnit\DeepCopy\Filter\Doctrine;
27615
27616use PHPUnit\DeepCopy\Filter\Filter;
27617use PHPUnit\DeepCopy\Reflection\ReflectionHelper;
27618/**
27619 * @final
27620 */
27621class DoctrineCollectionFilter implements Filter
27622{
27623    /**
27624     * Copies the object property doctrine collection.
27625     *
27626     * {@inheritdoc}
27627     */
27628    public function apply($object, $property, $objectCopier)
27629    {
27630        $reflectionProperty = ReflectionHelper::getProperty($object, $property);
27631        $reflectionProperty->setAccessible(\true);
27632        $oldCollection = $reflectionProperty->getValue($object);
27633        $newCollection = $oldCollection->map(function ($item) use($objectCopier) {
27634            return $objectCopier($item);
27635        });
27636        $reflectionProperty->setValue($object, $newCollection);
27637    }
27638}
27639<?php
27640
27641namespace PHPUnit\DeepCopy\Filter\Doctrine;
27642
27643use PHPUnit\DeepCopy\Filter\Filter;
27644use PHPUnit\DeepCopy\Reflection\ReflectionHelper;
27645use PHPUnit\Doctrine\Common\Collections\ArrayCollection;
27646/**
27647 * @final
27648 */
27649class DoctrineEmptyCollectionFilter implements Filter
27650{
27651    /**
27652     * Sets the object property to an empty doctrine collection.
27653     *
27654     * @param object   $object
27655     * @param string   $property
27656     * @param callable $objectCopier
27657     */
27658    public function apply($object, $property, $objectCopier)
27659    {
27660        $reflectionProperty = ReflectionHelper::getProperty($object, $property);
27661        $reflectionProperty->setAccessible(\true);
27662        $reflectionProperty->setValue($object, new ArrayCollection());
27663    }
27664}
27665<?php
27666
27667namespace PHPUnit\DeepCopy\Filter\Doctrine;
27668
27669use PHPUnit\DeepCopy\Filter\Filter;
27670/**
27671 * @final
27672 */
27673class DoctrineProxyFilter implements Filter
27674{
27675    /**
27676     * Triggers the magic method __load() on a Doctrine Proxy class to load the
27677     * actual entity from the database.
27678     *
27679     * {@inheritdoc}
27680     */
27681    public function apply($object, $property, $objectCopier)
27682    {
27683        $object->__load();
27684    }
27685}
27686<?php
27687
27688namespace PHPUnit\DeepCopy\TypeMatcher;
27689
27690class TypeMatcher
27691{
27692    /**
27693     * @var string
27694     */
27695    private $type;
27696    /**
27697     * @param string $type
27698     */
27699    public function __construct($type)
27700    {
27701        $this->type = $type;
27702    }
27703    /**
27704     * @param mixed $element
27705     *
27706     * @return boolean
27707     */
27708    public function matches($element)
27709    {
27710        return \is_object($element) ? \is_a($element, $this->type) : \gettype($element) === $this->type;
27711    }
27712}
27713<?php
27714
27715namespace PHPUnit\DeepCopy\TypeFilter;
27716
27717/**
27718 * @final
27719 */
27720class ReplaceFilter implements TypeFilter
27721{
27722    /**
27723     * @var callable
27724     */
27725    protected $callback;
27726    /**
27727     * @param callable $callable Will be called to get the new value for each element to replace
27728     */
27729    public function __construct(callable $callable)
27730    {
27731        $this->callback = $callable;
27732    }
27733    /**
27734     * {@inheritdoc}
27735     */
27736    public function apply($element)
27737    {
27738        return \call_user_func($this->callback, $element);
27739    }
27740}
27741<?php
27742
27743namespace PHPUnit\DeepCopy\TypeFilter;
27744
27745interface TypeFilter
27746{
27747    /**
27748     * Applies the filter to the object.
27749     *
27750     * @param mixed $element
27751     */
27752    public function apply($element);
27753}
27754<?php
27755
27756namespace PHPUnit\DeepCopy\TypeFilter\Spl;
27757
27758use PHPUnit\DeepCopy\DeepCopy;
27759use PHPUnit\DeepCopy\TypeFilter\TypeFilter;
27760/**
27761 * In PHP 7.4 the storage of an ArrayObject isn't returned as
27762 * ReflectionProperty. So we deep copy its array copy.
27763 */
27764final class ArrayObjectFilter implements TypeFilter
27765{
27766    /**
27767     * @var DeepCopy
27768     */
27769    private $copier;
27770    public function __construct(DeepCopy $copier)
27771    {
27772        $this->copier = $copier;
27773    }
27774    /**
27775     * {@inheritdoc}
27776     */
27777    public function apply($arrayObject)
27778    {
27779        $clone = clone $arrayObject;
27780        foreach ($arrayObject->getArrayCopy() as $k => $v) {
27781            $clone->offsetSet($k, $this->copier->copy($v));
27782        }
27783        return $clone;
27784    }
27785}
27786<?php
27787
27788namespace PHPUnit\DeepCopy\TypeFilter\Spl;
27789
27790/**
27791 * @deprecated Use {@see SplDoublyLinkedListFilter} instead.
27792 */
27793class SplDoublyLinkedList extends SplDoublyLinkedListFilter
27794{
27795}
27796<?php
27797
27798namespace PHPUnit\DeepCopy\TypeFilter\Spl;
27799
27800use Closure;
27801use PHPUnit\DeepCopy\DeepCopy;
27802use PHPUnit\DeepCopy\TypeFilter\TypeFilter;
27803use SplDoublyLinkedList;
27804/**
27805 * @final
27806 */
27807class SplDoublyLinkedListFilter implements TypeFilter
27808{
27809    private $copier;
27810    public function __construct(DeepCopy $copier)
27811    {
27812        $this->copier = $copier;
27813    }
27814    /**
27815     * {@inheritdoc}
27816     */
27817    public function apply($element)
27818    {
27819        $newElement = clone $element;
27820        $copy = $this->createCopyClosure();
27821        return $copy($newElement);
27822    }
27823    private function createCopyClosure()
27824    {
27825        $copier = $this->copier;
27826        $copy = function (SplDoublyLinkedList $list) use($copier) {
27827            // Replace each element in the list with a deep copy of itself
27828            for ($i = 1; $i <= $list->count(); $i++) {
27829                $copy = $copier->recursiveCopy($list->shift());
27830                $list->push($copy);
27831            }
27832            return $list;
27833        };
27834        return Closure::bind($copy, null, DeepCopy::class);
27835    }
27836}
27837<?php
27838
27839namespace PHPUnit\DeepCopy\TypeFilter;
27840
27841/**
27842 * @final
27843 */
27844class ShallowCopyFilter implements TypeFilter
27845{
27846    /**
27847     * {@inheritdoc}
27848     */
27849    public function apply($element)
27850    {
27851        return clone $element;
27852    }
27853}
27854<?php
27855
27856namespace PHPUnit\DeepCopy\TypeFilter\Date;
27857
27858use DateInterval;
27859use PHPUnit\DeepCopy\TypeFilter\TypeFilter;
27860/**
27861 * @final
27862 *
27863 * @deprecated Will be removed in 2.0. This filter will no longer be necessary in PHP 7.1+.
27864 */
27865class DateIntervalFilter implements TypeFilter
27866{
27867    /**
27868     * {@inheritdoc}
27869     *
27870     * @param DateInterval $element
27871     *
27872     * @see http://news.php.net/php.bugs/205076
27873     */
27874    public function apply($element)
27875    {
27876        $copy = new DateInterval('P0D');
27877        foreach ($element as $propertyName => $propertyValue) {
27878            $copy->{$propertyName} = $propertyValue;
27879        }
27880        return $copy;
27881    }
27882}
27883<?php
27884
27885namespace PHPUnit\DeepCopy\Reflection;
27886
27887use PHPUnit\DeepCopy\Exception\PropertyException;
27888use ReflectionClass;
27889use ReflectionException;
27890use ReflectionObject;
27891use ReflectionProperty;
27892class ReflectionHelper
27893{
27894    /**
27895     * Retrieves all properties (including private ones), from object and all its ancestors.
27896     *
27897     * Standard \ReflectionClass->getProperties() does not return private properties from ancestor classes.
27898     *
27899     * @author muratyaman@gmail.com
27900     * @see http://php.net/manual/en/reflectionclass.getproperties.php
27901     *
27902     * @param ReflectionClass $ref
27903     *
27904     * @return ReflectionProperty[]
27905     */
27906    public static function getProperties(ReflectionClass $ref)
27907    {
27908        $props = $ref->getProperties();
27909        $propsArr = array();
27910        foreach ($props as $prop) {
27911            $propertyName = $prop->getName();
27912            $propsArr[$propertyName] = $prop;
27913        }
27914        if ($parentClass = $ref->getParentClass()) {
27915            $parentPropsArr = self::getProperties($parentClass);
27916            foreach ($propsArr as $key => $property) {
27917                $parentPropsArr[$key] = $property;
27918            }
27919            return $parentPropsArr;
27920        }
27921        return $propsArr;
27922    }
27923    /**
27924     * Retrieves property by name from object and all its ancestors.
27925     *
27926     * @param object|string $object
27927     * @param string $name
27928     *
27929     * @throws PropertyException
27930     * @throws ReflectionException
27931     *
27932     * @return ReflectionProperty
27933     */
27934    public static function getProperty($object, $name)
27935    {
27936        $reflection = \is_object($object) ? new ReflectionObject($object) : new ReflectionClass($object);
27937        if ($reflection->hasProperty($name)) {
27938            return $reflection->getProperty($name);
27939        }
27940        if ($parentClass = $reflection->getParentClass()) {
27941            return self::getProperty($parentClass->getName(), $name);
27942        }
27943        throw new PropertyException(\sprintf('The class "%s" doesn\'t have a property with the given name: "%s".', \is_object($object) ? \get_class($object) : $object, $name));
27944    }
27945}
27946<?php
27947
27948namespace PHPUnit\DeepCopy;
27949
27950use ArrayObject;
27951use DateInterval;
27952use DateTimeInterface;
27953use DateTimeZone;
27954use PHPUnit\DeepCopy\Exception\CloneException;
27955use PHPUnit\DeepCopy\Filter\Filter;
27956use PHPUnit\DeepCopy\Matcher\Matcher;
27957use PHPUnit\DeepCopy\Reflection\ReflectionHelper;
27958use PHPUnit\DeepCopy\TypeFilter\Date\DateIntervalFilter;
27959use PHPUnit\DeepCopy\TypeFilter\Spl\ArrayObjectFilter;
27960use PHPUnit\DeepCopy\TypeFilter\Spl\SplDoublyLinkedListFilter;
27961use PHPUnit\DeepCopy\TypeFilter\TypeFilter;
27962use PHPUnit\DeepCopy\TypeMatcher\TypeMatcher;
27963use ReflectionObject;
27964use ReflectionProperty;
27965use SplDoublyLinkedList;
27966/**
27967 * @final
27968 */
27969class DeepCopy
27970{
27971    /**
27972     * @var object[] List of objects copied.
27973     */
27974    private $hashMap = [];
27975    /**
27976     * Filters to apply.
27977     *
27978     * @var array Array of ['filter' => Filter, 'matcher' => Matcher] pairs.
27979     */
27980    private $filters = [];
27981    /**
27982     * Type Filters to apply.
27983     *
27984     * @var array Array of ['filter' => Filter, 'matcher' => Matcher] pairs.
27985     */
27986    private $typeFilters = [];
27987    /**
27988     * @var bool
27989     */
27990    private $skipUncloneable = \false;
27991    /**
27992     * @var bool
27993     */
27994    private $useCloneMethod;
27995    /**
27996     * @param bool $useCloneMethod   If set to true, when an object implements the __clone() function, it will be used
27997     *                               instead of the regular deep cloning.
27998     */
27999    public function __construct($useCloneMethod = \false)
28000    {
28001        $this->useCloneMethod = $useCloneMethod;
28002        $this->addTypeFilter(new ArrayObjectFilter($this), new TypeMatcher(ArrayObject::class));
28003        $this->addTypeFilter(new DateIntervalFilter(), new TypeMatcher(DateInterval::class));
28004        $this->addTypeFilter(new SplDoublyLinkedListFilter($this), new TypeMatcher(SplDoublyLinkedList::class));
28005    }
28006    /**
28007     * If enabled, will not throw an exception when coming across an uncloneable property.
28008     *
28009     * @param $skipUncloneable
28010     *
28011     * @return $this
28012     */
28013    public function skipUncloneable($skipUncloneable = \true)
28014    {
28015        $this->skipUncloneable = $skipUncloneable;
28016        return $this;
28017    }
28018    /**
28019     * Deep copies the given object.
28020     *
28021     * @param mixed $object
28022     *
28023     * @return mixed
28024     */
28025    public function copy($object)
28026    {
28027        $this->hashMap = [];
28028        return $this->recursiveCopy($object);
28029    }
28030    public function addFilter(Filter $filter, Matcher $matcher)
28031    {
28032        $this->filters[] = ['matcher' => $matcher, 'filter' => $filter];
28033    }
28034    public function prependFilter(Filter $filter, Matcher $matcher)
28035    {
28036        \array_unshift($this->filters, ['matcher' => $matcher, 'filter' => $filter]);
28037    }
28038    public function addTypeFilter(TypeFilter $filter, TypeMatcher $matcher)
28039    {
28040        $this->typeFilters[] = ['matcher' => $matcher, 'filter' => $filter];
28041    }
28042    private function recursiveCopy($var)
28043    {
28044        // Matches Type Filter
28045        if ($filter = $this->getFirstMatchedTypeFilter($this->typeFilters, $var)) {
28046            return $filter->apply($var);
28047        }
28048        // Resource
28049        if (\is_resource($var)) {
28050            return $var;
28051        }
28052        // Array
28053        if (\is_array($var)) {
28054            return $this->copyArray($var);
28055        }
28056        // Scalar
28057        if (!\is_object($var)) {
28058            return $var;
28059        }
28060        // Object
28061        return $this->copyObject($var);
28062    }
28063    /**
28064     * Copy an array
28065     * @param array $array
28066     * @return array
28067     */
28068    private function copyArray(array $array)
28069    {
28070        foreach ($array as $key => $value) {
28071            $array[$key] = $this->recursiveCopy($value);
28072        }
28073        return $array;
28074    }
28075    /**
28076     * Copies an object.
28077     *
28078     * @param object $object
28079     *
28080     * @throws CloneException
28081     *
28082     * @return object
28083     */
28084    private function copyObject($object)
28085    {
28086        $objectHash = \spl_object_hash($object);
28087        if (isset($this->hashMap[$objectHash])) {
28088            return $this->hashMap[$objectHash];
28089        }
28090        $reflectedObject = new ReflectionObject($object);
28091        $isCloneable = $reflectedObject->isCloneable();
28092        if (\false === $isCloneable) {
28093            if ($this->skipUncloneable) {
28094                $this->hashMap[$objectHash] = $object;
28095                return $object;
28096            }
28097            throw new CloneException(\sprintf('The class "%s" is not cloneable.', $reflectedObject->getName()));
28098        }
28099        $newObject = clone $object;
28100        $this->hashMap[$objectHash] = $newObject;
28101        if ($this->useCloneMethod && $reflectedObject->hasMethod('__clone')) {
28102            return $newObject;
28103        }
28104        if ($newObject instanceof DateTimeInterface || $newObject instanceof DateTimeZone) {
28105            return $newObject;
28106        }
28107        foreach (ReflectionHelper::getProperties($reflectedObject) as $property) {
28108            $this->copyObjectProperty($newObject, $property);
28109        }
28110        return $newObject;
28111    }
28112    private function copyObjectProperty($object, ReflectionProperty $property)
28113    {
28114        // Ignore static properties
28115        if ($property->isStatic()) {
28116            return;
28117        }
28118        // Apply the filters
28119        foreach ($this->filters as $item) {
28120            /** @var Matcher $matcher */
28121            $matcher = $item['matcher'];
28122            /** @var Filter $filter */
28123            $filter = $item['filter'];
28124            if ($matcher->matches($object, $property->getName())) {
28125                $filter->apply($object, $property->getName(), function ($object) {
28126                    return $this->recursiveCopy($object);
28127                });
28128                // If a filter matches, we stop processing this property
28129                return;
28130            }
28131        }
28132        $property->setAccessible(\true);
28133        // Ignore uninitialized properties (for PHP >7.4)
28134        if (\method_exists($property, 'isInitialized') && !$property->isInitialized($object)) {
28135            return;
28136        }
28137        $propertyValue = $property->getValue($object);
28138        // Copy the property
28139        $property->setValue($object, $this->recursiveCopy($propertyValue));
28140    }
28141    /**
28142     * Returns first filter that matches variable, `null` if no such filter found.
28143     *
28144     * @param array $filterRecords Associative array with 2 members: 'filter' with value of type {@see TypeFilter} and
28145     *                             'matcher' with value of type {@see TypeMatcher}
28146     * @param mixed $var
28147     *
28148     * @return TypeFilter|null
28149     */
28150    private function getFirstMatchedTypeFilter(array $filterRecords, $var)
28151    {
28152        $matched = $this->first($filterRecords, function (array $record) use($var) {
28153            /* @var TypeMatcher $matcher */
28154            $matcher = $record['matcher'];
28155            return $matcher->matches($var);
28156        });
28157        return isset($matched) ? $matched['filter'] : null;
28158    }
28159    /**
28160     * Returns first element that matches predicate, `null` if no such element found.
28161     *
28162     * @param array    $elements Array of ['filter' => Filter, 'matcher' => Matcher] pairs.
28163     * @param callable $predicate Predicate arguments are: element.
28164     *
28165     * @return array|null Associative array with 2 members: 'filter' with value of type {@see TypeFilter} and 'matcher'
28166     *                    with value of type {@see TypeMatcher} or `null`.
28167     */
28168    private function first(array $elements, callable $predicate)
28169    {
28170        foreach ($elements as $element) {
28171            if (\call_user_func($predicate, $element)) {
28172                return $element;
28173            }
28174        }
28175        return null;
28176    }
28177}
28178The MIT License (MIT)
28179
28180Copyright (c) 2013 My C-Sense
28181
28182Permission is hereby granted, free of charge, to any person obtaining a copy of
28183this software and associated documentation files (the "Software"), to deal in
28184the Software without restriction, including without limitation the rights to
28185use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
28186the Software, and to permit persons to whom the Software is furnished to do so,
28187subject to the following conditions:
28188
28189The above copyright notice and this permission notice shall be included in all
28190copies or substantial portions of the Software.
28191
28192THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28193IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
28194FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
28195COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
28196IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
28197CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28198<?php
28199
28200declare (strict_types=1);
28201/*
28202 * This file is part of sebastian/type.
28203 *
28204 * (c) Sebastian Bergmann <sebastian@phpunit.de>
28205 *
28206 * For the full copyright and license information, please view the LICENSE
28207 * file that was distributed with this source code.
28208 */
28209namespace PHPUnit\SebastianBergmann\Type;
28210
28211final class UnknownType extends Type
28212{
28213    public function isAssignable(Type $other) : bool
28214    {
28215        return \true;
28216    }
28217    public function name() : string
28218    {
28219        return 'unknown type';
28220    }
28221    public function asString() : string
28222    {
28223        return '';
28224    }
28225    /**
28226     * @deprecated
28227     *
28228     * @codeCoverageIgnore
28229     */
28230    public function getReturnTypeDeclaration() : string
28231    {
28232        return '';
28233    }
28234    public function allowsNull() : bool
28235    {
28236        return \true;
28237    }
28238}
28239<?php
28240
28241declare (strict_types=1);
28242/*
28243 * This file is part of sebastian/type.
28244 *
28245 * (c) Sebastian Bergmann <sebastian@phpunit.de>
28246 *
28247 * For the full copyright and license information, please view the LICENSE
28248 * file that was distributed with this source code.
28249 */
28250namespace PHPUnit\SebastianBergmann\Type;
28251
28252final class GenericObjectType extends Type
28253{
28254    /**
28255     * @var bool
28256     */
28257    private $allowsNull;
28258    public function __construct(bool $nullable)
28259    {
28260        $this->allowsNull = $nullable;
28261    }
28262    public function isAssignable(Type $other) : bool
28263    {
28264        if ($this->allowsNull && $other instanceof NullType) {
28265            return \true;
28266        }
28267        if (!$other instanceof ObjectType) {
28268            return \false;
28269        }
28270        return \true;
28271    }
28272    public function name() : string
28273    {
28274        return 'object';
28275    }
28276    public function allowsNull() : bool
28277    {
28278        return $this->allowsNull;
28279    }
28280}
28281<?php
28282
28283declare (strict_types=1);
28284/*
28285 * This file is part of sebastian/type.
28286 *
28287 * (c) Sebastian Bergmann <sebastian@phpunit.de>
28288 *
28289 * For the full copyright and license information, please view the LICENSE
28290 * file that was distributed with this source code.
28291 */
28292namespace PHPUnit\SebastianBergmann\Type;
28293
28294use function count;
28295use function implode;
28296use function sort;
28297final class UnionType extends Type
28298{
28299    /**
28300     * @psalm-var list<Type>
28301     */
28302    private $types;
28303    /**
28304     * @throws RuntimeException
28305     */
28306    public function __construct(Type ...$types)
28307    {
28308        $this->ensureMinimumOfTwoTypes(...$types);
28309        $this->ensureOnlyValidTypes(...$types);
28310        $this->types = $types;
28311    }
28312    public function isAssignable(Type $other) : bool
28313    {
28314        foreach ($this->types as $type) {
28315            if ($type->isAssignable($other)) {
28316                return \true;
28317            }
28318        }
28319        return \false;
28320    }
28321    public function asString() : string
28322    {
28323        return $this->name();
28324    }
28325    /**
28326     * @deprecated
28327     *
28328     * @codeCoverageIgnore
28329     */
28330    public function getReturnTypeDeclaration() : string
28331    {
28332        return ': ' . $this->name();
28333    }
28334    public function name() : string
28335    {
28336        $types = [];
28337        foreach ($this->types as $type) {
28338            $types[] = $type->name();
28339        }
28340        sort($types);
28341        return implode('|', $types);
28342    }
28343    public function allowsNull() : bool
28344    {
28345        foreach ($this->types as $type) {
28346            if ($type instanceof NullType) {
28347                return \true;
28348            }
28349        }
28350        return \false;
28351    }
28352    /**
28353     * @throws RuntimeException
28354     */
28355    private function ensureMinimumOfTwoTypes(Type ...$types) : void
28356    {
28357        if (count($types) < 2) {
28358            throw new RuntimeException('A union type must be composed of at least two types');
28359        }
28360    }
28361    /**
28362     * @throws RuntimeException
28363     */
28364    private function ensureOnlyValidTypes(Type ...$types) : void
28365    {
28366        foreach ($types as $type) {
28367            if ($type instanceof UnknownType) {
28368                throw new RuntimeException('A union type must not be composed of an unknown type');
28369            }
28370            if ($type instanceof VoidType) {
28371                throw new RuntimeException('A union type must not be composed of a void type');
28372            }
28373        }
28374    }
28375}
28376<?php
28377
28378declare (strict_types=1);
28379/*
28380 * This file is part of sebastian/type.
28381 *
28382 * (c) Sebastian Bergmann <sebastian@phpunit.de>
28383 *
28384 * For the full copyright and license information, please view the LICENSE
28385 * file that was distributed with this source code.
28386 */
28387namespace PHPUnit\SebastianBergmann\Type;
28388
28389final class MixedType extends Type
28390{
28391    public function isAssignable(Type $other) : bool
28392    {
28393        return !$other instanceof VoidType;
28394    }
28395    public function asString() : string
28396    {
28397        return 'mixed';
28398    }
28399    public function name() : string
28400    {
28401        return 'mixed';
28402    }
28403    public function allowsNull() : bool
28404    {
28405        return \true;
28406    }
28407}
28408<?php
28409
28410declare (strict_types=1);
28411/*
28412 * This file is part of sebastian/type.
28413 *
28414 * (c) Sebastian Bergmann <sebastian@phpunit.de>
28415 *
28416 * For the full copyright and license information, please view the LICENSE
28417 * file that was distributed with this source code.
28418 */
28419namespace PHPUnit\SebastianBergmann\Type;
28420
28421use function assert;
28422use function class_exists;
28423use function count;
28424use function explode;
28425use function function_exists;
28426use function is_array;
28427use function is_object;
28428use function is_string;
28429use function strpos;
28430use Closure;
28431use ReflectionClass;
28432use ReflectionException;
28433use ReflectionObject;
28434final class CallableType extends Type
28435{
28436    /**
28437     * @var bool
28438     */
28439    private $allowsNull;
28440    public function __construct(bool $nullable)
28441    {
28442        $this->allowsNull = $nullable;
28443    }
28444    /**
28445     * @throws RuntimeException
28446     */
28447    public function isAssignable(Type $other) : bool
28448    {
28449        if ($this->allowsNull && $other instanceof NullType) {
28450            return \true;
28451        }
28452        if ($other instanceof self) {
28453            return \true;
28454        }
28455        if ($other instanceof ObjectType) {
28456            if ($this->isClosure($other)) {
28457                return \true;
28458            }
28459            if ($this->hasInvokeMethod($other)) {
28460                return \true;
28461            }
28462        }
28463        if ($other instanceof SimpleType) {
28464            if ($this->isFunction($other)) {
28465                return \true;
28466            }
28467            if ($this->isClassCallback($other)) {
28468                return \true;
28469            }
28470            if ($this->isObjectCallback($other)) {
28471                return \true;
28472            }
28473        }
28474        return \false;
28475    }
28476    public function name() : string
28477    {
28478        return 'callable';
28479    }
28480    public function allowsNull() : bool
28481    {
28482        return $this->allowsNull;
28483    }
28484    private function isClosure(ObjectType $type) : bool
28485    {
28486        return !$type->className()->isNamespaced() && $type->className()->simpleName() === Closure::class;
28487    }
28488    /**
28489     * @throws RuntimeException
28490     */
28491    private function hasInvokeMethod(ObjectType $type) : bool
28492    {
28493        $className = $type->className()->qualifiedName();
28494        assert(class_exists($className));
28495        try {
28496            $class = new ReflectionClass($className);
28497            // @codeCoverageIgnoreStart
28498        } catch (ReflectionException $e) {
28499            throw new RuntimeException($e->getMessage(), (int) $e->getCode(), $e);
28500            // @codeCoverageIgnoreEnd
28501        }
28502        if ($class->hasMethod('__invoke')) {
28503            return \true;
28504        }
28505        return \false;
28506    }
28507    private function isFunction(SimpleType $type) : bool
28508    {
28509        if (!is_string($type->value())) {
28510            return \false;
28511        }
28512        return function_exists($type->value());
28513    }
28514    private function isObjectCallback(SimpleType $type) : bool
28515    {
28516        if (!is_array($type->value())) {
28517            return \false;
28518        }
28519        if (count($type->value()) !== 2) {
28520            return \false;
28521        }
28522        if (!is_object($type->value()[0]) || !is_string($type->value()[1])) {
28523            return \false;
28524        }
28525        [$object, $methodName] = $type->value();
28526        return (new ReflectionObject($object))->hasMethod($methodName);
28527    }
28528    private function isClassCallback(SimpleType $type) : bool
28529    {
28530        if (!is_string($type->value()) && !is_array($type->value())) {
28531            return \false;
28532        }
28533        if (is_string($type->value())) {
28534            if (strpos($type->value(), '::') === \false) {
28535                return \false;
28536            }
28537            [$className, $methodName] = explode('::', $type->value());
28538        }
28539        if (is_array($type->value())) {
28540            if (count($type->value()) !== 2) {
28541                return \false;
28542            }
28543            if (!is_string($type->value()[0]) || !is_string($type->value()[1])) {
28544                return \false;
28545            }
28546            [$className, $methodName] = $type->value();
28547        }
28548        assert(isset($className) && is_string($className) && class_exists($className));
28549        assert(isset($methodName) && is_string($methodName));
28550        try {
28551            $class = new ReflectionClass($className);
28552            if ($class->hasMethod($methodName)) {
28553                $method = $class->getMethod($methodName);
28554                return $method->isPublic() && $method->isStatic();
28555            }
28556            // @codeCoverageIgnoreStart
28557        } catch (ReflectionException $e) {
28558            throw new RuntimeException($e->getMessage(), (int) $e->getCode(), $e);
28559            // @codeCoverageIgnoreEnd
28560        }
28561        return \false;
28562    }
28563}
28564<?php
28565
28566declare (strict_types=1);
28567/*
28568 * This file is part of sebastian/type.
28569 *
28570 * (c) Sebastian Bergmann <sebastian@phpunit.de>
28571 *
28572 * For the full copyright and license information, please view the LICENSE
28573 * file that was distributed with this source code.
28574 */
28575namespace PHPUnit\SebastianBergmann\Type;
28576
28577final class VoidType extends Type
28578{
28579    public function isAssignable(Type $other) : bool
28580    {
28581        return $other instanceof self;
28582    }
28583    public function name() : string
28584    {
28585        return 'void';
28586    }
28587    public function allowsNull() : bool
28588    {
28589        return \false;
28590    }
28591}
28592<?php
28593
28594declare (strict_types=1);
28595/*
28596 * This file is part of sebastian/type.
28597 *
28598 * (c) Sebastian Bergmann <sebastian@phpunit.de>
28599 *
28600 * For the full copyright and license information, please view the LICENSE
28601 * file that was distributed with this source code.
28602 */
28603namespace PHPUnit\SebastianBergmann\Type;
28604
28605final class NullType extends Type
28606{
28607    public function isAssignable(Type $other) : bool
28608    {
28609        return !$other instanceof VoidType;
28610    }
28611    public function name() : string
28612    {
28613        return 'null';
28614    }
28615    public function asString() : string
28616    {
28617        return 'null';
28618    }
28619    /**
28620     * @deprecated
28621     *
28622     * @codeCoverageIgnore
28623     */
28624    public function getReturnTypeDeclaration() : string
28625    {
28626        return '';
28627    }
28628    public function allowsNull() : bool
28629    {
28630        return \true;
28631    }
28632}
28633<?php
28634
28635declare (strict_types=1);
28636/*
28637 * This file is part of sebastian/type.
28638 *
28639 * (c) Sebastian Bergmann <sebastian@phpunit.de>
28640 *
28641 * For the full copyright and license information, please view the LICENSE
28642 * file that was distributed with this source code.
28643 */
28644namespace PHPUnit\SebastianBergmann\Type;
28645
28646use function is_subclass_of;
28647use function strcasecmp;
28648final class ObjectType extends Type
28649{
28650    /**
28651     * @var TypeName
28652     */
28653    private $className;
28654    /**
28655     * @var bool
28656     */
28657    private $allowsNull;
28658    public function __construct(TypeName $className, bool $allowsNull)
28659    {
28660        $this->className = $className;
28661        $this->allowsNull = $allowsNull;
28662    }
28663    public function isAssignable(Type $other) : bool
28664    {
28665        if ($this->allowsNull && $other instanceof NullType) {
28666            return \true;
28667        }
28668        if ($other instanceof self) {
28669            if (0 === strcasecmp($this->className->qualifiedName(), $other->className->qualifiedName())) {
28670                return \true;
28671            }
28672            if (is_subclass_of($other->className->qualifiedName(), $this->className->qualifiedName(), \true)) {
28673                return \true;
28674            }
28675        }
28676        return \false;
28677    }
28678    public function name() : string
28679    {
28680        return $this->className->qualifiedName();
28681    }
28682    public function allowsNull() : bool
28683    {
28684        return $this->allowsNull;
28685    }
28686    public function className() : TypeName
28687    {
28688        return $this->className;
28689    }
28690}
28691<?php
28692
28693declare (strict_types=1);
28694/*
28695 * This file is part of sebastian/type.
28696 *
28697 * (c) Sebastian Bergmann <sebastian@phpunit.de>
28698 *
28699 * For the full copyright and license information, please view the LICENSE
28700 * file that was distributed with this source code.
28701 */
28702namespace PHPUnit\SebastianBergmann\Type;
28703
28704use function strtolower;
28705final class SimpleType extends Type
28706{
28707    /**
28708     * @var string
28709     */
28710    private $name;
28711    /**
28712     * @var bool
28713     */
28714    private $allowsNull;
28715    /**
28716     * @var mixed
28717     */
28718    private $value;
28719    public function __construct(string $name, bool $nullable, $value = null)
28720    {
28721        $this->name = $this->normalize($name);
28722        $this->allowsNull = $nullable;
28723        $this->value = $value;
28724    }
28725    public function isAssignable(Type $other) : bool
28726    {
28727        if ($this->allowsNull && $other instanceof NullType) {
28728            return \true;
28729        }
28730        if ($this->name === 'bool' && $other->name() === 'false') {
28731            return \true;
28732        }
28733        if ($other instanceof self) {
28734            return $this->name === $other->name;
28735        }
28736        return \false;
28737    }
28738    public function name() : string
28739    {
28740        return $this->name;
28741    }
28742    public function allowsNull() : bool
28743    {
28744        return $this->allowsNull;
28745    }
28746    public function value()
28747    {
28748        return $this->value;
28749    }
28750    private function normalize(string $name) : string
28751    {
28752        $name = strtolower($name);
28753        switch ($name) {
28754            case 'boolean':
28755                return 'bool';
28756            case 'real':
28757            case 'double':
28758                return 'float';
28759            case 'integer':
28760                return 'int';
28761            case '[]':
28762                return 'array';
28763            default:
28764                return $name;
28765        }
28766    }
28767}
28768<?php
28769
28770declare (strict_types=1);
28771/*
28772 * This file is part of sebastian/type.
28773 *
28774 * (c) Sebastian Bergmann <sebastian@phpunit.de>
28775 *
28776 * For the full copyright and license information, please view the LICENSE
28777 * file that was distributed with this source code.
28778 */
28779namespace PHPUnit\SebastianBergmann\Type;
28780
28781use function array_pop;
28782use function explode;
28783use function implode;
28784use function substr;
28785use ReflectionClass;
28786final class TypeName
28787{
28788    /**
28789     * @var ?string
28790     */
28791    private $namespaceName;
28792    /**
28793     * @var string
28794     */
28795    private $simpleName;
28796    public static function fromQualifiedName(string $fullClassName) : self
28797    {
28798        if ($fullClassName[0] === '\\') {
28799            $fullClassName = substr($fullClassName, 1);
28800        }
28801        $classNameParts = explode('\\', $fullClassName);
28802        $simpleName = array_pop($classNameParts);
28803        $namespaceName = implode('\\', $classNameParts);
28804        return new self($namespaceName, $simpleName);
28805    }
28806    public static function fromReflection(ReflectionClass $type) : self
28807    {
28808        return new self($type->getNamespaceName(), $type->getShortName());
28809    }
28810    public function __construct(?string $namespaceName, string $simpleName)
28811    {
28812        if ($namespaceName === '') {
28813            $namespaceName = null;
28814        }
28815        $this->namespaceName = $namespaceName;
28816        $this->simpleName = $simpleName;
28817    }
28818    public function namespaceName() : ?string
28819    {
28820        return $this->namespaceName;
28821    }
28822    public function simpleName() : string
28823    {
28824        return $this->simpleName;
28825    }
28826    public function qualifiedName() : string
28827    {
28828        return $this->namespaceName === null ? $this->simpleName : $this->namespaceName . '\\' . $this->simpleName;
28829    }
28830    /**
28831     * @deprecated Use namespaceName() instead
28832     *
28833     * @codeCoverageIgnore
28834     */
28835    public function getNamespaceName() : ?string
28836    {
28837        return $this->namespaceName();
28838    }
28839    /**
28840     * @deprecated Use simpleName() instead
28841     *
28842     * @codeCoverageIgnore
28843     */
28844    public function getSimpleName() : string
28845    {
28846        return $this->simpleName();
28847    }
28848    /**
28849     * @deprecated Use qualifiedName() instead
28850     *
28851     * @codeCoverageIgnore
28852     */
28853    public function getQualifiedName() : string
28854    {
28855        return $this->qualifiedName();
28856    }
28857    public function isNamespaced() : bool
28858    {
28859        return $this->namespaceName !== null;
28860    }
28861}
28862<?php
28863
28864declare (strict_types=1);
28865/*
28866 * This file is part of sebastian/type.
28867 *
28868 * (c) Sebastian Bergmann <sebastian@phpunit.de>
28869 *
28870 * For the full copyright and license information, please view the LICENSE
28871 * file that was distributed with this source code.
28872 */
28873namespace PHPUnit\SebastianBergmann\Type;
28874
28875final class StaticType extends Type
28876{
28877    /**
28878     * @var TypeName
28879     */
28880    private $className;
28881    /**
28882     * @var bool
28883     */
28884    private $allowsNull;
28885    public function __construct(TypeName $className, bool $allowsNull)
28886    {
28887        $this->className = $className;
28888        $this->allowsNull = $allowsNull;
28889    }
28890    public function isAssignable(Type $other) : bool
28891    {
28892        if ($this->allowsNull && $other instanceof NullType) {
28893            return \true;
28894        }
28895        if (!$other instanceof ObjectType) {
28896            return \false;
28897        }
28898        if (0 === \strcasecmp($this->className->qualifiedName(), $other->className()->qualifiedName())) {
28899            return \true;
28900        }
28901        if (\is_subclass_of($other->className()->qualifiedName(), $this->className->qualifiedName(), \true)) {
28902            return \true;
28903        }
28904        return \false;
28905    }
28906    public function name() : string
28907    {
28908        return 'static';
28909    }
28910    public function allowsNull() : bool
28911    {
28912        return $this->allowsNull;
28913    }
28914}
28915<?php
28916
28917declare (strict_types=1);
28918/*
28919 * This file is part of sebastian/type.
28920 *
28921 * (c) Sebastian Bergmann <sebastian@phpunit.de>
28922 *
28923 * For the full copyright and license information, please view the LICENSE
28924 * file that was distributed with this source code.
28925 */
28926namespace PHPUnit\SebastianBergmann\Type;
28927
28928final class FalseType extends Type
28929{
28930    public function isAssignable(Type $other) : bool
28931    {
28932        if ($other instanceof self) {
28933            return \true;
28934        }
28935        return $other instanceof SimpleType && $other->name() === 'bool' && $other->value() === \false;
28936    }
28937    public function name() : string
28938    {
28939        return 'false';
28940    }
28941    public function allowsNull() : bool
28942    {
28943        return \false;
28944    }
28945    /**
28946     * @deprecated
28947     *
28948     * @codeCoverageIgnore
28949     *
28950     * @throws LogicException
28951     */
28952    public function getReturnTypeDeclaration() : string
28953    {
28954        throw new LogicException();
28955    }
28956}
28957<?php
28958
28959declare (strict_types=1);
28960/*
28961 * This file is part of sebastian/type.
28962 *
28963 * (c) Sebastian Bergmann <sebastian@phpunit.de>
28964 *
28965 * For the full copyright and license information, please view the LICENSE
28966 * file that was distributed with this source code.
28967 */
28968namespace PHPUnit\SebastianBergmann\Type;
28969
28970use function assert;
28971use function sprintf;
28972use ReflectionMethod;
28973use ReflectionNamedType;
28974use ReflectionType;
28975use ReflectionUnionType;
28976final class ReflectionMapper
28977{
28978    public function fromMethodReturnType(ReflectionMethod $method) : Type
28979    {
28980        if (!$this->reflectionMethodHasReturnType($method)) {
28981            return new UnknownType();
28982        }
28983        $returnType = $this->reflectionMethodGetReturnType($method);
28984        assert($returnType instanceof ReflectionNamedType || $returnType instanceof ReflectionUnionType);
28985        if ($returnType instanceof ReflectionNamedType) {
28986            if ($returnType->getName() === 'self') {
28987                return ObjectType::fromName($method->getDeclaringClass()->getName(), $returnType->allowsNull());
28988            }
28989            if ($returnType->getName() === 'static') {
28990                return new StaticType(TypeName::fromReflection($method->getDeclaringClass()), $returnType->allowsNull());
28991            }
28992            if ($returnType->getName() === 'mixed') {
28993                return new MixedType();
28994            }
28995            if ($returnType->getName() === 'parent') {
28996                $parentClass = $method->getDeclaringClass()->getParentClass();
28997                // @codeCoverageIgnoreStart
28998                if ($parentClass === \false) {
28999                    throw new RuntimeException(sprintf('%s::%s() has a "parent" return type declaration but %s does not have a parent class', $method->getDeclaringClass()->getName(), $method->getName(), $method->getDeclaringClass()->getName()));
29000                }
29001                // @codeCoverageIgnoreEnd
29002                return ObjectType::fromName($parentClass->getName(), $returnType->allowsNull());
29003            }
29004            return Type::fromName($returnType->getName(), $returnType->allowsNull());
29005        }
29006        assert($returnType instanceof ReflectionUnionType);
29007        $types = [];
29008        foreach ($returnType->getTypes() as $type) {
29009            assert($type instanceof ReflectionNamedType);
29010            if ($type->getName() === 'self') {
29011                $types[] = ObjectType::fromName($method->getDeclaringClass()->getName(), \false);
29012            } else {
29013                $types[] = Type::fromName($type->getName(), \false);
29014            }
29015        }
29016        return new UnionType(...$types);
29017    }
29018    private function reflectionMethodHasReturnType(ReflectionMethod $method) : bool
29019    {
29020        if ($method->hasReturnType()) {
29021            return \true;
29022        }
29023        if (!\method_exists($method, 'hasTentativeReturnType')) {
29024            return \false;
29025        }
29026        return $method->hasTentativeReturnType();
29027    }
29028    private function reflectionMethodGetReturnType(ReflectionMethod $method) : ?ReflectionType
29029    {
29030        if ($method->hasReturnType()) {
29031            return $method->getReturnType();
29032        }
29033        if (!\method_exists($method, 'getTentativeReturnType')) {
29034            return null;
29035        }
29036        return $method->getTentativeReturnType();
29037    }
29038}
29039<?php
29040
29041declare (strict_types=1);
29042/*
29043 * This file is part of sebastian/type.
29044 *
29045 * (c) Sebastian Bergmann <sebastian@phpunit.de>
29046 *
29047 * For the full copyright and license information, please view the LICENSE
29048 * file that was distributed with this source code.
29049 */
29050namespace PHPUnit\SebastianBergmann\Type;
29051
29052use function assert;
29053use function class_exists;
29054use function is_iterable;
29055use ReflectionClass;
29056use ReflectionException;
29057final class IterableType extends Type
29058{
29059    /**
29060     * @var bool
29061     */
29062    private $allowsNull;
29063    public function __construct(bool $nullable)
29064    {
29065        $this->allowsNull = $nullable;
29066    }
29067    /**
29068     * @throws RuntimeException
29069     */
29070    public function isAssignable(Type $other) : bool
29071    {
29072        if ($this->allowsNull && $other instanceof NullType) {
29073            return \true;
29074        }
29075        if ($other instanceof self) {
29076            return \true;
29077        }
29078        if ($other instanceof SimpleType) {
29079            return is_iterable($other->value());
29080        }
29081        if ($other instanceof ObjectType) {
29082            $className = $other->className()->qualifiedName();
29083            assert(class_exists($className));
29084            try {
29085                return (new ReflectionClass($className))->isIterable();
29086                // @codeCoverageIgnoreStart
29087            } catch (ReflectionException $e) {
29088                throw new RuntimeException($e->getMessage(), (int) $e->getCode(), $e);
29089                // @codeCoverageIgnoreEnd
29090            }
29091        }
29092        return \false;
29093    }
29094    public function name() : string
29095    {
29096        return 'iterable';
29097    }
29098    public function allowsNull() : bool
29099    {
29100        return $this->allowsNull;
29101    }
29102}
29103<?php
29104
29105declare (strict_types=1);
29106/*
29107 * This file is part of sebastian/type.
29108 *
29109 * (c) Sebastian Bergmann <sebastian@phpunit.de>
29110 *
29111 * For the full copyright and license information, please view the LICENSE
29112 * file that was distributed with this source code.
29113 */
29114namespace PHPUnit\SebastianBergmann\Type;
29115
29116use function get_class;
29117use function gettype;
29118use function strtolower;
29119abstract class Type
29120{
29121    public static function fromValue($value, bool $allowsNull) : self
29122    {
29123        if ($value === \false) {
29124            return new FalseType();
29125        }
29126        $typeName = gettype($value);
29127        if ($typeName === 'object') {
29128            return new ObjectType(TypeName::fromQualifiedName(get_class($value)), $allowsNull);
29129        }
29130        $type = self::fromName($typeName, $allowsNull);
29131        if ($type instanceof SimpleType) {
29132            $type = new SimpleType($typeName, $allowsNull, $value);
29133        }
29134        return $type;
29135    }
29136    public static function fromName(string $typeName, bool $allowsNull) : self
29137    {
29138        switch (strtolower($typeName)) {
29139            case 'callable':
29140                return new CallableType($allowsNull);
29141            case 'false':
29142                return new FalseType();
29143            case 'iterable':
29144                return new IterableType($allowsNull);
29145            case 'null':
29146                return new NullType();
29147            case 'object':
29148                return new GenericObjectType($allowsNull);
29149            case 'unknown type':
29150                return new UnknownType();
29151            case 'void':
29152                return new VoidType();
29153            case 'array':
29154            case 'bool':
29155            case 'boolean':
29156            case 'double':
29157            case 'float':
29158            case 'int':
29159            case 'integer':
29160            case 'real':
29161            case 'resource':
29162            case 'resource (closed)':
29163            case 'string':
29164                return new SimpleType($typeName, $allowsNull);
29165            default:
29166                return new ObjectType(TypeName::fromQualifiedName($typeName), $allowsNull);
29167        }
29168    }
29169    public function asString() : string
29170    {
29171        return ($this->allowsNull() ? '?' : '') . $this->name();
29172    }
29173    /**
29174     * @deprecated
29175     *
29176     * @codeCoverageIgnore
29177     */
29178    public function getReturnTypeDeclaration() : string
29179    {
29180        return ': ' . $this->asString();
29181    }
29182    public abstract function isAssignable(Type $other) : bool;
29183    public abstract function name() : string;
29184    public abstract function allowsNull() : bool;
29185}
29186sebastian/type
29187
29188Copyright (c) 2019-2020, Sebastian Bergmann <sebastian@phpunit.de>.
29189All rights reserved.
29190
29191Redistribution and use in source and binary forms, with or without
29192modification, are permitted provided that the following conditions
29193are met:
29194
29195 * Redistributions of source code must retain the above copyright
29196   notice, this list of conditions and the following disclaimer.
29197
29198 * Redistributions in binary form must reproduce the above copyright
29199   notice, this list of conditions and the following disclaimer in
29200   the documentation and/or other materials provided with the
29201   distribution.
29202
29203 * Neither the name of Sebastian Bergmann nor the names of his
29204   contributors may be used to endorse or promote products derived
29205   from this software without specific prior written permission.
29206
29207THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29208"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29209LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
29210FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29211COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29212INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29213BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29214LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29215CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29216LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29217ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29218POSSIBILITY OF SUCH DAMAGE.
29219<?php
29220
29221declare (strict_types=1);
29222/*
29223 * This file is part of sebastian/type.
29224 *
29225 * (c) Sebastian Bergmann <sebastian@phpunit.de>
29226 *
29227 * For the full copyright and license information, please view the LICENSE
29228 * file that was distributed with this source code.
29229 */
29230namespace PHPUnit\SebastianBergmann\Type;
29231
29232final class RuntimeException extends \RuntimeException implements Exception
29233{
29234}
29235<?php
29236
29237declare (strict_types=1);
29238/*
29239 * This file is part of sebastian/type.
29240 *
29241 * (c) Sebastian Bergmann <sebastian@phpunit.de>
29242 *
29243 * For the full copyright and license information, please view the LICENSE
29244 * file that was distributed with this source code.
29245 */
29246namespace PHPUnit\SebastianBergmann\Type;
29247
29248final class LogicException extends \LogicException implements Exception
29249{
29250}
29251<?php
29252
29253declare (strict_types=1);
29254/*
29255 * This file is part of sebastian/type.
29256 *
29257 * (c) Sebastian Bergmann <sebastian@phpunit.de>
29258 *
29259 * For the full copyright and license information, please view the LICENSE
29260 * file that was distributed with this source code.
29261 */
29262namespace PHPUnit\SebastianBergmann\Type;
29263
29264use Throwable;
29265interface Exception extends Throwable
29266{
29267}
29268<?php
29269
29270/*
29271 * This file is part of sebastian/version.
29272 *
29273 * (c) Sebastian Bergmann <sebastian@phpunit.de>
29274 *
29275 * For the full copyright and license information, please view the LICENSE
29276 * file that was distributed with this source code.
29277 */
29278namespace PHPUnit\SebastianBergmann;
29279
29280final class Version
29281{
29282    /**
29283     * @var string
29284     */
29285    private $path;
29286    /**
29287     * @var string
29288     */
29289    private $release;
29290    /**
29291     * @var string
29292     */
29293    private $version;
29294    public function __construct(string $release, string $path)
29295    {
29296        $this->release = $release;
29297        $this->path = $path;
29298    }
29299    public function getVersion() : string
29300    {
29301        if ($this->version === null) {
29302            if (\substr_count($this->release, '.') + 1 === 3) {
29303                $this->version = $this->release;
29304            } else {
29305                $this->version = $this->release . '-dev';
29306            }
29307            $git = $this->getGitInformation($this->path);
29308            if ($git) {
29309                if (\substr_count($this->release, '.') + 1 === 3) {
29310                    $this->version = $git;
29311                } else {
29312                    $git = \explode('-', $git);
29313                    $this->version = $this->release . '-' . \end($git);
29314                }
29315            }
29316        }
29317        return $this->version;
29318    }
29319    /**
29320     * @return bool|string
29321     */
29322    private function getGitInformation(string $path)
29323    {
29324        if (!\is_dir($path . \DIRECTORY_SEPARATOR . '.git')) {
29325            return \false;
29326        }
29327        $process = \proc_open('git describe --tags', [1 => ['pipe', 'w'], 2 => ['pipe', 'w']], $pipes, $path);
29328        if (!\is_resource($process)) {
29329            return \false;
29330        }
29331        $result = \trim(\stream_get_contents($pipes[1]));
29332        \fclose($pipes[1]);
29333        \fclose($pipes[2]);
29334        $returnCode = \proc_close($process);
29335        if ($returnCode !== 0) {
29336            return \false;
29337        }
29338        return $result;
29339    }
29340}
29341Version
29342
29343Copyright (c) 2013-2020, Sebastian Bergmann <sebastian@phpunit.de>.
29344All rights reserved.
29345
29346Redistribution and use in source and binary forms, with or without
29347modification, are permitted provided that the following conditions
29348are met:
29349
29350 * Redistributions of source code must retain the above copyright
29351   notice, this list of conditions and the following disclaimer.
29352
29353 * Redistributions in binary form must reproduce the above copyright
29354   notice, this list of conditions and the following disclaimer in
29355   the documentation and/or other materials provided with the
29356   distribution.
29357
29358 * Neither the name of Sebastian Bergmann nor the names of his
29359   contributors may be used to endorse or promote products derived
29360   from this software without specific prior written permission.
29361
29362THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29363"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29364LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
29365FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29366COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29367INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29368BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29369LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29370CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29371LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29372ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29373POSSIBILITY OF SUCH DAMAGE.
29374<?xml version="1.0" encoding="UTF-8"?>
29375<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
29376    <xs:annotation>
29377        <xs:documentation source="https://phpunit.de/documentation.html">
29378            This Schema file defines the rules by which the XML configuration file of PHPUnit 8.5 may be structured.
29379        </xs:documentation>
29380        <xs:appinfo source="https://phpunit.de/documentation.html"/>
29381    </xs:annotation>
29382    <xs:element name="phpunit" type="phpUnitType">
29383        <xs:annotation>
29384            <xs:documentation>Root Element</xs:documentation>
29385        </xs:annotation>
29386    </xs:element>
29387    <xs:complexType name="filtersType">
29388        <xs:sequence>
29389            <xs:element name="whitelist" type="whiteListType" minOccurs="0"/>
29390        </xs:sequence>
29391    </xs:complexType>
29392    <xs:complexType name="filterType">
29393        <xs:sequence>
29394            <xs:choice maxOccurs="unbounded" minOccurs="0">
29395                <xs:group ref="pathGroup"/>
29396                <xs:element name="exclude">
29397                    <xs:complexType>
29398                        <xs:group ref="pathGroup"/>
29399                    </xs:complexType>
29400                </xs:element>
29401            </xs:choice>
29402        </xs:sequence>
29403    </xs:complexType>
29404    <xs:complexType name="whiteListType">
29405        <xs:complexContent>
29406            <xs:extension base="filterType">
29407                <xs:attribute name="addUncoveredFilesFromWhitelist" default="true" type="xs:boolean"/>
29408                <xs:attribute name="processUncoveredFilesFromWhitelist" default="false" type="xs:boolean"/>
29409            </xs:extension>
29410        </xs:complexContent>
29411    </xs:complexType>
29412    <xs:complexType name="groupsType">
29413        <xs:choice>
29414            <xs:sequence>
29415                <xs:element name="include" type="groupType"/>
29416                <xs:element name="exclude" type="groupType" minOccurs="0"/>
29417            </xs:sequence>
29418            <xs:sequence>
29419                <xs:element name="exclude" type="groupType"/>
29420            </xs:sequence>
29421        </xs:choice>
29422    </xs:complexType>
29423    <xs:complexType name="groupType">
29424        <xs:sequence>
29425            <xs:element name="group" type="xs:string" maxOccurs="unbounded"/>
29426        </xs:sequence>
29427    </xs:complexType>
29428    <xs:complexType name="extensionsType">
29429        <xs:sequence>
29430            <xs:element name="extension" type="objectType" maxOccurs="unbounded"/>
29431        </xs:sequence>
29432    </xs:complexType>
29433    <xs:complexType name="listenersType">
29434        <xs:sequence>
29435            <xs:element name="listener" type="objectType" maxOccurs="unbounded"/>
29436        </xs:sequence>
29437    </xs:complexType>
29438    <xs:complexType name="objectType">
29439        <xs:sequence>
29440            <xs:element name="arguments" minOccurs="0">
29441                <xs:complexType>
29442                    <xs:group ref="argumentsGroup"/>
29443                </xs:complexType>
29444            </xs:element>
29445        </xs:sequence>
29446        <xs:attribute name="class" type="xs:string" use="required"/>
29447        <xs:attribute name="file" type="xs:anyURI"/>
29448    </xs:complexType>
29449    <xs:complexType name="arrayType">
29450        <xs:sequence>
29451            <xs:element name="element" type="argumentType" minOccurs="0" maxOccurs="unbounded"/>
29452        </xs:sequence>
29453    </xs:complexType>
29454    <xs:complexType name="argumentType">
29455        <xs:group ref="argumentChoice"/>
29456        <xs:attribute name="key" use="required"/>
29457    </xs:complexType>
29458    <xs:group name="argumentsGroup">
29459        <xs:sequence>
29460            <xs:choice minOccurs="0" maxOccurs="unbounded">
29461                <xs:element name="array" type="arrayType" />
29462                <xs:element name="integer" type="xs:integer" />
29463                <xs:element name="string" type="xs:string" />
29464                <xs:element name="double" type="xs:double" />
29465                <xs:element name="null" />
29466                <xs:element name="object" type="objectType" />
29467                <xs:element name="file" type="xs:anyURI" />
29468                <xs:element name="directory" type="xs:anyURI" />
29469                <xs:element name="boolean" type="xs:boolean" />
29470            </xs:choice>
29471        </xs:sequence>
29472    </xs:group>
29473    <xs:group name="argumentChoice">
29474        <xs:choice>
29475            <xs:element name="array" type="arrayType" minOccurs="0" maxOccurs="unbounded"/>
29476            <xs:element name="integer" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
29477            <xs:element name="string" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
29478            <xs:element name="double" type="xs:double" minOccurs="0" maxOccurs="unbounded"/>
29479            <xs:element name="null" minOccurs="0" maxOccurs="unbounded"/>
29480            <xs:element name="object" type="objectType" minOccurs="0" maxOccurs="unbounded"/>
29481            <xs:element name="file" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
29482            <xs:element name="directory" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
29483            <xs:element name="boolean" type="xs:boolean" minOccurs="0" maxOccurs="unbounded"/>
29484        </xs:choice>
29485    </xs:group>
29486    <xs:simpleType name="columnsType">
29487        <xs:union>
29488            <xs:simpleType>
29489                <xs:restriction base="xs:integer"/>
29490            </xs:simpleType>
29491            <xs:simpleType>
29492                <xs:restriction base="xs:string">
29493                    <xs:enumeration value="max"/>
29494                </xs:restriction>
29495            </xs:simpleType>
29496        </xs:union>
29497    </xs:simpleType>
29498    <xs:complexType name="loggersType">
29499        <xs:sequence>
29500            <xs:element name="log" type="loggerType" maxOccurs="unbounded"/>
29501        </xs:sequence>
29502    </xs:complexType>
29503    <xs:complexType name="loggerType">
29504        <xs:attribute name="type">
29505            <xs:simpleType>
29506                <xs:restriction base="xs:string">
29507                    <xs:enumeration value="coverage-html"/>
29508                    <xs:enumeration value="coverage-text"/>
29509                    <xs:enumeration value="coverage-clover"/>
29510                    <xs:enumeration value="coverage-crap4j"/>
29511                    <xs:enumeration value="coverage-xml"/>
29512                    <xs:enumeration value="coverage-php"/>
29513                    <xs:enumeration value="json"/>
29514                    <xs:enumeration value="plain"/>
29515                    <xs:enumeration value="tap"/>
29516                    <xs:enumeration value="teamcity"/>
29517                    <xs:enumeration value="junit"/>
29518                    <xs:enumeration value="testdox-html"/>
29519                    <xs:enumeration value="testdox-text"/>
29520                    <xs:enumeration value="testdox-xml"/>
29521                </xs:restriction>
29522            </xs:simpleType>
29523        </xs:attribute>
29524        <xs:attribute name="target" type="xs:anyURI"/>
29525        <xs:attribute name="lowUpperBound" type="xs:nonNegativeInteger" default="50"/>
29526        <xs:attribute name="highLowerBound" type="xs:nonNegativeInteger" default="90"/>
29527        <xs:attribute name="showUncoveredFiles" type="xs:boolean" default="false"/>
29528        <xs:attribute name="showOnlySummary" type="xs:boolean" default="false"/>
29529        <xs:attribute name="threshold" type="xs:nonNegativeInteger" default="30"/>
29530    </xs:complexType>
29531    <xs:group name="pathGroup">
29532        <xs:sequence>
29533            <xs:choice minOccurs="0" maxOccurs="unbounded">
29534                <xs:element name="directory" type="directoryFilterType"/>
29535                <xs:element name="file" type="fileFilterType"/>
29536            </xs:choice>
29537        </xs:sequence>
29538    </xs:group>
29539    <xs:complexType name="directoryFilterType">
29540        <xs:simpleContent>
29541            <xs:extension base="xs:string">
29542                <xs:attribute type="xs:string" name="prefix" default=""/>
29543                <xs:attribute type="xs:string" name="suffix" default="Test.php"/>
29544                <xs:attributeGroup ref="phpVersionGroup"/>
29545            </xs:extension>
29546        </xs:simpleContent>
29547    </xs:complexType>
29548    <xs:simpleType name="executionOrderType">
29549        <xs:restriction base="xs:string">
29550            <xs:enumeration value="default"/>
29551            <xs:enumeration value="defects"/>
29552            <xs:enumeration value="depends"/>
29553            <xs:enumeration value="depends,defects"/>
29554            <xs:enumeration value="depends,duration"/>
29555            <xs:enumeration value="depends,random"/>
29556            <xs:enumeration value="depends,reverse"/>
29557            <xs:enumeration value="depends,size"/>
29558            <xs:enumeration value="duration"/>
29559            <xs:enumeration value="no-depends"/>
29560            <xs:enumeration value="no-depends,defects"/>
29561            <xs:enumeration value="no-depends,duration"/>
29562            <xs:enumeration value="no-depends,random"/>
29563            <xs:enumeration value="no-depends,reverse"/>
29564            <xs:enumeration value="no-depends,size"/>
29565            <xs:enumeration value="random"/>
29566            <xs:enumeration value="reverse"/>
29567            <xs:enumeration value="size"/>
29568        </xs:restriction>
29569    </xs:simpleType>
29570    <xs:complexType name="fileFilterType">
29571        <xs:simpleContent>
29572            <xs:extension base="xs:anyURI">
29573                <xs:attributeGroup ref="phpVersionGroup"/>
29574            </xs:extension>
29575        </xs:simpleContent>
29576    </xs:complexType>
29577    <xs:attributeGroup name="phpVersionGroup">
29578        <xs:attribute name="phpVersion" type="xs:string" default="5.3.0"/>
29579        <xs:attribute name="phpVersionOperator" type="xs:string" default="&gt;="/>
29580    </xs:attributeGroup>
29581    <xs:complexType name="phpType">
29582        <xs:sequence>
29583            <xs:choice maxOccurs="unbounded">
29584                <xs:element name="includePath" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
29585                <xs:element name="ini" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
29586                <xs:element name="const" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
29587                <xs:element name="var" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
29588                <xs:element name="env" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
29589                <xs:element name="post" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
29590                <xs:element name="get" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
29591                <xs:element name="cookie" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
29592                <xs:element name="server" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
29593                <xs:element name="files" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
29594                <xs:element name="request" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
29595            </xs:choice>
29596        </xs:sequence>
29597    </xs:complexType>
29598    <xs:complexType name="namedValueType">
29599        <xs:attribute name="name" use="required" type="xs:string"/>
29600        <xs:attribute name="value" use="required" type="xs:anySimpleType"/>
29601        <xs:attribute name="verbatim" use="optional" type="xs:boolean"/>
29602        <xs:attribute name="force" use="optional" type="xs:boolean"/>
29603    </xs:complexType>
29604    <xs:complexType name="phpUnitType">
29605        <xs:annotation>
29606            <xs:documentation>The main type specifying the document structure</xs:documentation>
29607        </xs:annotation>
29608        <xs:group ref="configGroup"/>
29609        <xs:attributeGroup ref="configAttributeGroup"/>
29610    </xs:complexType>
29611    <xs:attributeGroup name="configAttributeGroup">
29612        <xs:attribute name="backupGlobals" type="xs:boolean" default="false"/>
29613        <xs:attribute name="backupStaticAttributes" type="xs:boolean" default="false"/>
29614        <xs:attribute name="bootstrap" type="xs:anyURI"/>
29615        <xs:attribute name="cacheResult" type="xs:boolean" default="true"/>
29616        <xs:attribute name="cacheResultFile" type="xs:anyURI"/>
29617        <xs:attribute name="cacheTokens" type="xs:boolean" default="false"/>
29618        <xs:attribute name="colors" type="xs:boolean" default="false"/>
29619        <xs:attribute name="columns" type="columnsType" default="80"/>
29620        <xs:attribute name="convertDeprecationsToExceptions" type="xs:boolean" default="true"/>
29621        <xs:attribute name="convertErrorsToExceptions" type="xs:boolean" default="true"/>
29622        <xs:attribute name="convertNoticesToExceptions" type="xs:boolean" default="true"/>
29623        <xs:attribute name="convertWarningsToExceptions" type="xs:boolean" default="true"/>
29624        <xs:attribute name="disableCodeCoverageIgnore" type="xs:boolean" default="false"/>
29625        <xs:attribute name="forceCoversAnnotation" type="xs:boolean" default="false"/>
29626        <xs:attribute name="printerClass" type="xs:string" default="PHPUnit\TextUI\ResultPrinter"/>
29627        <xs:attribute name="printerFile" type="xs:anyURI"/>
29628        <xs:attribute name="processIsolation" type="xs:boolean" default="false"/>
29629        <xs:attribute name="stopOnDefect" type="xs:boolean" default="false"/>
29630        <xs:attribute name="stopOnError" type="xs:boolean" default="false"/>
29631        <xs:attribute name="stopOnFailure" type="xs:boolean" default="false"/>
29632        <xs:attribute name="stopOnWarning" type="xs:boolean" default="false"/>
29633        <xs:attribute name="stopOnIncomplete" type="xs:boolean" default="false"/>
29634        <xs:attribute name="stopOnRisky" type="xs:boolean" default="false"/>
29635        <xs:attribute name="stopOnSkipped" type="xs:boolean" default="false"/>
29636        <xs:attribute name="failOnRisky" type="xs:boolean" default="false"/>
29637        <xs:attribute name="failOnWarning" type="xs:boolean" default="false"/>
29638        <xs:attribute name="beStrictAboutChangesToGlobalState" type="xs:boolean" default="false"/>
29639        <xs:attribute name="beStrictAboutOutputDuringTests" type="xs:boolean" default="false"/>
29640        <xs:attribute name="beStrictAboutResourceUsageDuringSmallTests" type="xs:boolean" default="false"/>
29641        <xs:attribute name="beStrictAboutTestsThatDoNotTestAnything" type="xs:boolean" default="true"/>
29642        <xs:attribute name="beStrictAboutTodoAnnotatedTests" type="xs:boolean" default="false"/>
29643        <xs:attribute name="beStrictAboutCoversAnnotation" type="xs:boolean" default="false"/>
29644        <xs:attribute name="defaultTimeLimit" type="xs:integer" default="0"/>
29645        <xs:attribute name="enforceTimeLimit" type="xs:boolean" default="false"/>
29646        <xs:attribute name="ignoreDeprecatedCodeUnitsFromCodeCoverage" type="xs:boolean" default="false"/>
29647        <xs:attribute name="timeoutForSmallTests" type="xs:integer" default="1"/>
29648        <xs:attribute name="timeoutForMediumTests" type="xs:integer" default="10"/>
29649        <xs:attribute name="timeoutForLargeTests" type="xs:integer" default="60"/>
29650        <xs:attribute name="testSuiteLoaderClass" type="xs:string" default="PHPUnit\Runner\StandardTestSuiteLoader"/>
29651        <xs:attribute name="testSuiteLoaderFile" type="xs:anyURI"/>
29652        <xs:attribute name="defaultTestSuite" type="xs:string" default=""/>
29653        <xs:attribute name="verbose" type="xs:boolean" default="false"/>
29654        <xs:attribute name="testdox" type="xs:boolean" default="false"/>
29655        <xs:attribute name="stderr" type="xs:boolean" default="false"/>
29656        <xs:attribute name="reverseDefectList" type="xs:boolean" default="false"/>
29657        <xs:attribute name="registerMockObjectsFromTestArgumentsRecursively" type="xs:boolean" default="false"/>
29658        <xs:attribute name="extensionsDirectory" type="xs:anyURI"/>
29659        <xs:attribute name="executionOrder" type="executionOrderType" default="default"/>
29660        <xs:attribute name="resolveDependencies" type="xs:boolean" default="true"/>
29661        <xs:attribute name="noInteraction" type="xs:boolean" default="false"/>
29662    </xs:attributeGroup>
29663    <xs:group name="configGroup">
29664        <xs:all>
29665            <xs:element ref="testSuiteFacet" minOccurs="0"/>
29666            <xs:element name="groups" type="groupsType" minOccurs="0"/>
29667            <xs:element name="testdoxGroups" type="groupsType" minOccurs="0"/>
29668            <xs:element name="filter" type="filtersType" minOccurs="0"/>
29669            <xs:element name="logging" type="loggersType" minOccurs="0"/>
29670            <xs:element name="extensions" type="extensionsType" minOccurs="0"/>
29671            <xs:element name="listeners" type="listenersType" minOccurs="0"/>
29672            <xs:element name="php" type="phpType" minOccurs="0"/>
29673        </xs:all>
29674    </xs:group>
29675    <xs:element name="testSuiteFacet" abstract="true"/>
29676    <xs:element name="testsuite" type="testSuiteType" substitutionGroup="testSuiteFacet"/>
29677    <xs:element name="testsuites" type="testSuitesType" substitutionGroup="testSuiteFacet"/>
29678    <xs:complexType name="testSuitesType">
29679        <xs:sequence>
29680            <xs:element name="testsuite" type="testSuiteType" maxOccurs="unbounded"/>
29681        </xs:sequence>
29682    </xs:complexType>
29683    <xs:complexType name="testSuiteType">
29684        <xs:sequence>
29685            <xs:group ref="pathGroup"/>
29686            <xs:element name="exclude" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
29687        </xs:sequence>
29688        <xs:attribute name="name" type="xs:string" use="required"/>
29689    </xs:complexType>
29690</xs:schema>
29691<?xml version="1.0" encoding="UTF-8"?>
29692<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
29693    <xs:annotation>
29694        <xs:documentation source="https://phpunit.de/documentation.html">
29695            This Schema file defines the rules by which the XML configuration file of PHPUnit 9.2 may be structured.
29696        </xs:documentation>
29697        <xs:appinfo source="https://phpunit.de/documentation.html"/>
29698    </xs:annotation>
29699    <xs:element name="phpunit" type="phpUnitType">
29700        <xs:annotation>
29701            <xs:documentation>Root Element</xs:documentation>
29702        </xs:annotation>
29703    </xs:element>
29704    <xs:complexType name="filtersType">
29705        <xs:sequence>
29706            <xs:element name="whitelist" type="whiteListType" minOccurs="0"/>
29707        </xs:sequence>
29708    </xs:complexType>
29709    <xs:complexType name="filterType">
29710        <xs:sequence>
29711            <xs:choice maxOccurs="unbounded" minOccurs="0">
29712                <xs:group ref="pathGroup"/>
29713                <xs:element name="exclude">
29714                    <xs:complexType>
29715                        <xs:group ref="pathGroup"/>
29716                    </xs:complexType>
29717                </xs:element>
29718            </xs:choice>
29719        </xs:sequence>
29720    </xs:complexType>
29721    <xs:complexType name="whiteListType">
29722        <xs:complexContent>
29723            <xs:extension base="filterType">
29724                <xs:attribute name="addUncoveredFilesFromWhitelist" default="true" type="xs:boolean"/>
29725                <xs:attribute name="processUncoveredFilesFromWhitelist" default="false" type="xs:boolean"/>
29726            </xs:extension>
29727        </xs:complexContent>
29728    </xs:complexType>
29729    <xs:complexType name="groupsType">
29730        <xs:choice>
29731            <xs:sequence>
29732                <xs:element name="include" type="groupType"/>
29733                <xs:element name="exclude" type="groupType" minOccurs="0"/>
29734            </xs:sequence>
29735            <xs:sequence>
29736                <xs:element name="exclude" type="groupType"/>
29737            </xs:sequence>
29738        </xs:choice>
29739    </xs:complexType>
29740    <xs:complexType name="groupType">
29741        <xs:sequence>
29742            <xs:element name="group" type="xs:string" maxOccurs="unbounded"/>
29743        </xs:sequence>
29744    </xs:complexType>
29745    <xs:complexType name="extensionsType">
29746        <xs:sequence>
29747            <xs:element name="extension" type="objectType" maxOccurs="unbounded"/>
29748        </xs:sequence>
29749    </xs:complexType>
29750    <xs:complexType name="listenersType">
29751        <xs:sequence>
29752            <xs:element name="listener" type="objectType" maxOccurs="unbounded"/>
29753        </xs:sequence>
29754    </xs:complexType>
29755    <xs:complexType name="objectType">
29756        <xs:sequence>
29757            <xs:element name="arguments" minOccurs="0">
29758                <xs:complexType>
29759                    <xs:group ref="argumentsGroup"/>
29760                </xs:complexType>
29761            </xs:element>
29762        </xs:sequence>
29763        <xs:attribute name="class" type="xs:string" use="required"/>
29764        <xs:attribute name="file" type="xs:anyURI"/>
29765    </xs:complexType>
29766    <xs:complexType name="arrayType">
29767        <xs:sequence>
29768            <xs:element name="element" type="argumentType" minOccurs="0" maxOccurs="unbounded"/>
29769        </xs:sequence>
29770    </xs:complexType>
29771    <xs:complexType name="argumentType">
29772        <xs:group ref="argumentChoice"/>
29773        <xs:attribute name="key" use="required"/>
29774    </xs:complexType>
29775    <xs:group name="argumentsGroup">
29776        <xs:sequence>
29777            <xs:choice minOccurs="0" maxOccurs="unbounded">
29778                <xs:element name="array" type="arrayType" />
29779                <xs:element name="integer" type="xs:integer" />
29780                <xs:element name="string" type="xs:string" />
29781                <xs:element name="double" type="xs:double" />
29782                <xs:element name="null" />
29783                <xs:element name="object" type="objectType" />
29784                <xs:element name="file" type="xs:anyURI" />
29785                <xs:element name="directory" type="xs:anyURI" />
29786                <xs:element name="boolean" type="xs:boolean" />
29787            </xs:choice>
29788        </xs:sequence>
29789    </xs:group>
29790    <xs:group name="argumentChoice">
29791        <xs:choice>
29792            <xs:element name="array" type="arrayType" minOccurs="0" maxOccurs="unbounded"/>
29793            <xs:element name="integer" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
29794            <xs:element name="string" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
29795            <xs:element name="double" type="xs:double" minOccurs="0" maxOccurs="unbounded"/>
29796            <xs:element name="null" minOccurs="0" maxOccurs="unbounded"/>
29797            <xs:element name="object" type="objectType" minOccurs="0" maxOccurs="unbounded"/>
29798            <xs:element name="file" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
29799            <xs:element name="directory" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
29800            <xs:element name="boolean" type="xs:boolean" minOccurs="0" maxOccurs="unbounded"/>
29801        </xs:choice>
29802    </xs:group>
29803    <xs:simpleType name="columnsType">
29804        <xs:union>
29805            <xs:simpleType>
29806                <xs:restriction base="xs:integer"/>
29807            </xs:simpleType>
29808            <xs:simpleType>
29809                <xs:restriction base="xs:string">
29810                    <xs:enumeration value="max"/>
29811                </xs:restriction>
29812            </xs:simpleType>
29813        </xs:union>
29814    </xs:simpleType>
29815    <xs:complexType name="loggersType">
29816        <xs:sequence>
29817            <xs:element name="log" type="loggerType" maxOccurs="unbounded"/>
29818        </xs:sequence>
29819    </xs:complexType>
29820    <xs:complexType name="loggerType">
29821        <xs:attribute name="type">
29822            <xs:simpleType>
29823                <xs:restriction base="xs:string">
29824                    <xs:enumeration value="coverage-html"/>
29825                    <xs:enumeration value="coverage-text"/>
29826                    <xs:enumeration value="coverage-clover"/>
29827                    <xs:enumeration value="coverage-crap4j"/>
29828                    <xs:enumeration value="coverage-xml"/>
29829                    <xs:enumeration value="coverage-php"/>
29830                    <xs:enumeration value="plain"/>
29831                    <xs:enumeration value="teamcity"/>
29832                    <xs:enumeration value="junit"/>
29833                    <xs:enumeration value="testdox-html"/>
29834                    <xs:enumeration value="testdox-text"/>
29835                    <xs:enumeration value="testdox-xml"/>
29836                </xs:restriction>
29837            </xs:simpleType>
29838        </xs:attribute>
29839        <xs:attribute name="target" type="xs:anyURI"/>
29840        <xs:attribute name="lowUpperBound" type="xs:nonNegativeInteger" default="50"/>
29841        <xs:attribute name="highLowerBound" type="xs:nonNegativeInteger" default="90"/>
29842        <xs:attribute name="showUncoveredFiles" type="xs:boolean" default="false"/>
29843        <xs:attribute name="showOnlySummary" type="xs:boolean" default="false"/>
29844        <xs:attribute name="threshold" type="xs:nonNegativeInteger" default="30"/>
29845    </xs:complexType>
29846    <xs:group name="pathGroup">
29847        <xs:sequence>
29848            <xs:choice minOccurs="0" maxOccurs="unbounded">
29849                <xs:element name="directory" type="directoryFilterType"/>
29850                <xs:element name="file" type="fileFilterType"/>
29851            </xs:choice>
29852        </xs:sequence>
29853    </xs:group>
29854    <xs:complexType name="directoryFilterType">
29855        <xs:simpleContent>
29856            <xs:extension base="xs:string">
29857                <xs:attribute type="xs:string" name="prefix" default=""/>
29858                <xs:attribute type="xs:string" name="suffix" default="Test.php"/>
29859                <xs:attributeGroup ref="phpVersionGroup"/>
29860            </xs:extension>
29861        </xs:simpleContent>
29862    </xs:complexType>
29863    <xs:simpleType name="executionOrderType">
29864        <xs:restriction base="xs:string">
29865            <xs:enumeration value="default"/>
29866            <xs:enumeration value="defects"/>
29867            <xs:enumeration value="depends"/>
29868            <xs:enumeration value="depends,defects"/>
29869            <xs:enumeration value="depends,duration"/>
29870            <xs:enumeration value="depends,random"/>
29871            <xs:enumeration value="depends,reverse"/>
29872            <xs:enumeration value="depends,size"/>
29873            <xs:enumeration value="duration"/>
29874            <xs:enumeration value="no-depends"/>
29875            <xs:enumeration value="no-depends,defects"/>
29876            <xs:enumeration value="no-depends,duration"/>
29877            <xs:enumeration value="no-depends,random"/>
29878            <xs:enumeration value="no-depends,reverse"/>
29879            <xs:enumeration value="no-depends,size"/>
29880            <xs:enumeration value="random"/>
29881            <xs:enumeration value="reverse"/>
29882            <xs:enumeration value="size"/>
29883        </xs:restriction>
29884    </xs:simpleType>
29885    <xs:complexType name="fileFilterType">
29886        <xs:simpleContent>
29887            <xs:extension base="xs:anyURI">
29888                <xs:attributeGroup ref="phpVersionGroup"/>
29889            </xs:extension>
29890        </xs:simpleContent>
29891    </xs:complexType>
29892    <xs:attributeGroup name="phpVersionGroup">
29893        <xs:attribute name="phpVersion" type="xs:string" default="5.3.0"/>
29894        <xs:attribute name="phpVersionOperator" type="xs:string" default="&gt;="/>
29895    </xs:attributeGroup>
29896    <xs:complexType name="phpType">
29897        <xs:sequence>
29898            <xs:choice maxOccurs="unbounded">
29899                <xs:element name="includePath" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
29900                <xs:element name="ini" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
29901                <xs:element name="const" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
29902                <xs:element name="var" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
29903                <xs:element name="env" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
29904                <xs:element name="post" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
29905                <xs:element name="get" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
29906                <xs:element name="cookie" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
29907                <xs:element name="server" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
29908                <xs:element name="files" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
29909                <xs:element name="request" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
29910            </xs:choice>
29911        </xs:sequence>
29912    </xs:complexType>
29913    <xs:complexType name="namedValueType">
29914        <xs:attribute name="name" use="required" type="xs:string"/>
29915        <xs:attribute name="value" use="required" type="xs:anySimpleType"/>
29916        <xs:attribute name="verbatim" use="optional" type="xs:boolean"/>
29917        <xs:attribute name="force" use="optional" type="xs:boolean"/>
29918    </xs:complexType>
29919    <xs:complexType name="phpUnitType">
29920        <xs:annotation>
29921            <xs:documentation>The main type specifying the document structure</xs:documentation>
29922        </xs:annotation>
29923        <xs:group ref="configGroup"/>
29924        <xs:attributeGroup ref="configAttributeGroup"/>
29925    </xs:complexType>
29926    <xs:attributeGroup name="configAttributeGroup">
29927        <xs:attribute name="backupGlobals" type="xs:boolean" default="false"/>
29928        <xs:attribute name="backupStaticAttributes" type="xs:boolean" default="false"/>
29929        <xs:attribute name="bootstrap" type="xs:anyURI"/>
29930        <xs:attribute name="cacheResult" type="xs:boolean" default="true"/>
29931        <xs:attribute name="cacheResultFile" type="xs:anyURI"/>
29932        <xs:attribute name="cacheTokens" type="xs:boolean" default="false"/>
29933        <xs:attribute name="colors" type="xs:boolean" default="false"/>
29934        <xs:attribute name="columns" type="columnsType" default="80"/>
29935        <xs:attribute name="convertDeprecationsToExceptions" type="xs:boolean" default="true"/>
29936        <xs:attribute name="convertErrorsToExceptions" type="xs:boolean" default="true"/>
29937        <xs:attribute name="convertNoticesToExceptions" type="xs:boolean" default="true"/>
29938        <xs:attribute name="convertWarningsToExceptions" type="xs:boolean" default="true"/>
29939        <xs:attribute name="disableCodeCoverageIgnore" type="xs:boolean" default="false"/>
29940        <xs:attribute name="forceCoversAnnotation" type="xs:boolean" default="false"/>
29941        <xs:attribute name="printerClass" type="xs:string" default="PHPUnit\TextUI\ResultPrinter"/>
29942        <xs:attribute name="printerFile" type="xs:anyURI"/>
29943        <xs:attribute name="processIsolation" type="xs:boolean" default="false"/>
29944        <xs:attribute name="stopOnDefect" type="xs:boolean" default="false"/>
29945        <xs:attribute name="stopOnError" type="xs:boolean" default="false"/>
29946        <xs:attribute name="stopOnFailure" type="xs:boolean" default="false"/>
29947        <xs:attribute name="stopOnWarning" type="xs:boolean" default="false"/>
29948        <xs:attribute name="stopOnIncomplete" type="xs:boolean" default="false"/>
29949        <xs:attribute name="stopOnRisky" type="xs:boolean" default="false"/>
29950        <xs:attribute name="stopOnSkipped" type="xs:boolean" default="false"/>
29951        <xs:attribute name="failOnIncomplete" type="xs:boolean" default="false"/>
29952        <xs:attribute name="failOnRisky" type="xs:boolean" default="false"/>
29953        <xs:attribute name="failOnSkipped" type="xs:boolean" default="false"/>
29954        <xs:attribute name="failOnWarning" type="xs:boolean" default="false"/>
29955        <xs:attribute name="beStrictAboutChangesToGlobalState" type="xs:boolean" default="false"/>
29956        <xs:attribute name="beStrictAboutOutputDuringTests" type="xs:boolean" default="false"/>
29957        <xs:attribute name="beStrictAboutResourceUsageDuringSmallTests" type="xs:boolean" default="false"/>
29958        <xs:attribute name="beStrictAboutTestsThatDoNotTestAnything" type="xs:boolean" default="true"/>
29959        <xs:attribute name="beStrictAboutTodoAnnotatedTests" type="xs:boolean" default="false"/>
29960        <xs:attribute name="beStrictAboutCoversAnnotation" type="xs:boolean" default="false"/>
29961        <xs:attribute name="defaultTimeLimit" type="xs:integer" default="0"/>
29962        <xs:attribute name="enforceTimeLimit" type="xs:boolean" default="false"/>
29963        <xs:attribute name="ignoreDeprecatedCodeUnitsFromCodeCoverage" type="xs:boolean" default="false"/>
29964        <xs:attribute name="timeoutForSmallTests" type="xs:integer" default="1"/>
29965        <xs:attribute name="timeoutForMediumTests" type="xs:integer" default="10"/>
29966        <xs:attribute name="timeoutForLargeTests" type="xs:integer" default="60"/>
29967        <xs:attribute name="testSuiteLoaderClass" type="xs:string" default="PHPUnit\Runner\StandardTestSuiteLoader"/>
29968        <xs:attribute name="testSuiteLoaderFile" type="xs:anyURI"/>
29969        <xs:attribute name="defaultTestSuite" type="xs:string" default=""/>
29970        <xs:attribute name="verbose" type="xs:boolean" default="false"/>
29971        <xs:attribute name="testdox" type="xs:boolean" default="false"/>
29972        <xs:attribute name="stderr" type="xs:boolean" default="false"/>
29973        <xs:attribute name="reverseDefectList" type="xs:boolean" default="false"/>
29974        <xs:attribute name="registerMockObjectsFromTestArgumentsRecursively" type="xs:boolean" default="false"/>
29975        <xs:attribute name="extensionsDirectory" type="xs:anyURI"/>
29976        <xs:attribute name="executionOrder" type="executionOrderType" default="default"/>
29977        <xs:attribute name="resolveDependencies" type="xs:boolean" default="true"/>
29978        <xs:attribute name="noInteraction" type="xs:boolean" default="false"/>
29979    </xs:attributeGroup>
29980    <xs:group name="configGroup">
29981        <xs:all>
29982            <xs:element ref="testSuiteFacet" minOccurs="0"/>
29983            <xs:element name="groups" type="groupsType" minOccurs="0"/>
29984            <xs:element name="testdoxGroups" type="groupsType" minOccurs="0"/>
29985            <xs:element name="filter" type="filtersType" minOccurs="0"/>
29986            <xs:element name="logging" type="loggersType" minOccurs="0"/>
29987            <xs:element name="extensions" type="extensionsType" minOccurs="0"/>
29988            <xs:element name="listeners" type="listenersType" minOccurs="0"/>
29989            <xs:element name="php" type="phpType" minOccurs="0"/>
29990        </xs:all>
29991    </xs:group>
29992    <xs:element name="testSuiteFacet" abstract="true"/>
29993    <xs:element name="testsuite" type="testSuiteType" substitutionGroup="testSuiteFacet"/>
29994    <xs:element name="testsuites" type="testSuitesType" substitutionGroup="testSuiteFacet"/>
29995    <xs:complexType name="testSuitesType">
29996        <xs:sequence>
29997            <xs:element name="testsuite" type="testSuiteType" maxOccurs="unbounded"/>
29998        </xs:sequence>
29999    </xs:complexType>
30000    <xs:complexType name="testSuiteType">
30001        <xs:sequence>
30002            <xs:group ref="pathGroup"/>
30003            <xs:element name="exclude" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
30004        </xs:sequence>
30005        <xs:attribute name="name" type="xs:string" use="required"/>
30006    </xs:complexType>
30007</xs:schema>
30008<?php
30009
30010declare (strict_types=1);
30011/**
30012 * This file is part of phpDocumentor.
30013 *
30014 * For the full copyright and license information, please view the LICENSE
30015 * file that was distributed with this source code.
30016 *
30017 * @link http://phpdoc.org
30018 */
30019namespace PHPUnit\phpDocumentor\Reflection\DocBlock;
30020
30021use InvalidArgumentException;
30022use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Author;
30023use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Covers;
30024use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Deprecated;
30025use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Generic;
30026use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\InvalidTag;
30027use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Link as LinkTag;
30028use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Method;
30029use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Param;
30030use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Property;
30031use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\PropertyRead;
30032use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\PropertyWrite;
30033use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Return_;
30034use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\See as SeeTag;
30035use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Since;
30036use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Source;
30037use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Throws;
30038use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Uses;
30039use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Var_;
30040use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Version;
30041use PHPUnit\phpDocumentor\Reflection\FqsenResolver;
30042use PHPUnit\phpDocumentor\Reflection\Types\Context as TypeContext;
30043use ReflectionMethod;
30044use ReflectionNamedType;
30045use ReflectionParameter;
30046use PHPUnit\Webmozart\Assert\Assert;
30047use function array_merge;
30048use function array_slice;
30049use function call_user_func_array;
30050use function count;
30051use function get_class;
30052use function preg_match;
30053use function strpos;
30054use function trim;
30055/**
30056 * Creates a Tag object given the contents of a tag.
30057 *
30058 * This Factory is capable of determining the appropriate class for a tag and instantiate it using its `create`
30059 * factory method. The `create` factory method of a Tag can have a variable number of arguments; this way you can
30060 * pass the dependencies that you need to construct a tag object.
30061 *
30062 * > Important: each parameter in addition to the body variable for the `create` method must default to null, otherwise
30063 * > it violates the constraint with the interface; it is recommended to use the {@see Assert::notNull()} method to
30064 * > verify that a dependency is actually passed.
30065 *
30066 * This Factory also features a Service Locator component that is used to pass the right dependencies to the
30067 * `create` method of a tag; each dependency should be registered as a service or as a parameter.
30068 *
30069 * When you want to use a Tag of your own with custom handling you need to call the `registerTagHandler` method, pass
30070 * the name of the tag and a Fully Qualified Class Name pointing to a class that implements the Tag interface.
30071 */
30072final class StandardTagFactory implements TagFactory
30073{
30074    /** PCRE regular expression matching a tag name. */
30075    public const REGEX_TAGNAME = '[\\w\\-\\_\\\\:]+';
30076    /**
30077     * @var array<class-string<Tag>> An array with a tag as a key, and an
30078     *                               FQCN to a class that handles it as an array value.
30079     */
30080    private $tagHandlerMappings = [
30081        'author' => Author::class,
30082        'covers' => Covers::class,
30083        'deprecated' => Deprecated::class,
30084        // 'example'        => '\phpDocumentor\Reflection\DocBlock\Tags\Example',
30085        'link' => LinkTag::class,
30086        'method' => Method::class,
30087        'param' => Param::class,
30088        'property-read' => PropertyRead::class,
30089        'property' => Property::class,
30090        'property-write' => PropertyWrite::class,
30091        'return' => Return_::class,
30092        'see' => SeeTag::class,
30093        'since' => Since::class,
30094        'source' => Source::class,
30095        'throw' => Throws::class,
30096        'throws' => Throws::class,
30097        'uses' => Uses::class,
30098        'var' => Var_::class,
30099        'version' => Version::class,
30100    ];
30101    /**
30102     * @var array<class-string<Tag>> An array with a anotation s a key, and an
30103     *      FQCN to a class that handles it as an array value.
30104     */
30105    private $annotationMappings = [];
30106    /**
30107     * @var ReflectionParameter[][] a lazy-loading cache containing parameters
30108     *      for each tagHandler that has been used.
30109     */
30110    private $tagHandlerParameterCache = [];
30111    /** @var FqsenResolver */
30112    private $fqsenResolver;
30113    /**
30114     * @var mixed[] an array representing a simple Service Locator where we can store parameters and
30115     *     services that can be inserted into the Factory Methods of Tag Handlers.
30116     */
30117    private $serviceLocator = [];
30118    /**
30119     * Initialize this tag factory with the means to resolve an FQSEN and optionally a list of tag handlers.
30120     *
30121     * If no tag handlers are provided than the default list in the {@see self::$tagHandlerMappings} property
30122     * is used.
30123     *
30124     * @see self::registerTagHandler() to add a new tag handler to the existing default list.
30125     *
30126     * @param array<class-string<Tag>> $tagHandlers
30127     */
30128    public function __construct(FqsenResolver $fqsenResolver, ?array $tagHandlers = null)
30129    {
30130        $this->fqsenResolver = $fqsenResolver;
30131        if ($tagHandlers !== null) {
30132            $this->tagHandlerMappings = $tagHandlers;
30133        }
30134        $this->addService($fqsenResolver, FqsenResolver::class);
30135    }
30136    public function create(string $tagLine, ?TypeContext $context = null) : Tag
30137    {
30138        if (!$context) {
30139            $context = new TypeContext('');
30140        }
30141        [$tagName, $tagBody] = $this->extractTagParts($tagLine);
30142        return $this->createTag(trim($tagBody), $tagName, $context);
30143    }
30144    /**
30145     * @param mixed $value
30146     */
30147    public function addParameter(string $name, $value) : void
30148    {
30149        $this->serviceLocator[$name] = $value;
30150    }
30151    public function addService(object $service, ?string $alias = null) : void
30152    {
30153        $this->serviceLocator[$alias ?: get_class($service)] = $service;
30154    }
30155    public function registerTagHandler(string $tagName, string $handler) : void
30156    {
30157        Assert::stringNotEmpty($tagName);
30158        Assert::classExists($handler);
30159        Assert::implementsInterface($handler, Tag::class);
30160        if (strpos($tagName, '\\') && $tagName[0] !== '\\') {
30161            throw new InvalidArgumentException('A namespaced tag must have a leading backslash as it must be fully qualified');
30162        }
30163        $this->tagHandlerMappings[$tagName] = $handler;
30164    }
30165    /**
30166     * Extracts all components for a tag.
30167     *
30168     * @return string[]
30169     */
30170    private function extractTagParts(string $tagLine) : array
30171    {
30172        $matches = [];
30173        if (!preg_match('/^@(' . self::REGEX_TAGNAME . ')((?:[\\s\\(\\{])\\s*([^\\s].*)|$)/us', $tagLine, $matches)) {
30174            throw new InvalidArgumentException('The tag "' . $tagLine . '" does not seem to be wellformed, please check it for errors');
30175        }
30176        if (count($matches) < 3) {
30177            $matches[] = '';
30178        }
30179        return array_slice($matches, 1);
30180    }
30181    /**
30182     * Creates a new tag object with the given name and body or returns null if the tag name was recognized but the
30183     * body was invalid.
30184     */
30185    private function createTag(string $body, string $name, TypeContext $context) : Tag
30186    {
30187        $handlerClassName = $this->findHandlerClassName($name, $context);
30188        $arguments = $this->getArgumentsForParametersFromWiring($this->fetchParametersForHandlerFactoryMethod($handlerClassName), $this->getServiceLocatorWithDynamicParameters($context, $name, $body));
30189        try {
30190            $callable = [$handlerClassName, 'create'];
30191            Assert::isCallable($callable);
30192            /** @phpstan-var callable(string): ?Tag $callable */
30193            $tag = call_user_func_array($callable, $arguments);
30194            return $tag ?? InvalidTag::create($body, $name);
30195        } catch (InvalidArgumentException $e) {
30196            return InvalidTag::create($body, $name)->withError($e);
30197        }
30198    }
30199    /**
30200     * Determines the Fully Qualified Class Name of the Factory or Tag (containing a Factory Method `create`).
30201     *
30202     * @return class-string<Tag>
30203     */
30204    private function findHandlerClassName(string $tagName, TypeContext $context) : string
30205    {
30206        $handlerClassName = Generic::class;
30207        if (isset($this->tagHandlerMappings[$tagName])) {
30208            $handlerClassName = $this->tagHandlerMappings[$tagName];
30209        } elseif ($this->isAnnotation($tagName)) {
30210            // TODO: Annotation support is planned for a later stage and as such is disabled for now
30211            $tagName = (string) $this->fqsenResolver->resolve($tagName, $context);
30212            if (isset($this->annotationMappings[$tagName])) {
30213                $handlerClassName = $this->annotationMappings[$tagName];
30214            }
30215        }
30216        return $handlerClassName;
30217    }
30218    /**
30219     * Retrieves the arguments that need to be passed to the Factory Method with the given Parameters.
30220     *
30221     * @param ReflectionParameter[] $parameters
30222     * @param mixed[]               $locator
30223     *
30224     * @return mixed[] A series of values that can be passed to the Factory Method of the tag whose parameters
30225     *     is provided with this method.
30226     */
30227    private function getArgumentsForParametersFromWiring(array $parameters, array $locator) : array
30228    {
30229        $arguments = [];
30230        foreach ($parameters as $parameter) {
30231            $type = $parameter->getType();
30232            $typeHint = null;
30233            if ($type instanceof ReflectionNamedType) {
30234                $typeHint = $type->getName();
30235                if ($typeHint === 'self') {
30236                    $declaringClass = $parameter->getDeclaringClass();
30237                    if ($declaringClass !== null) {
30238                        $typeHint = $declaringClass->getName();
30239                    }
30240                }
30241            }
30242            if (isset($locator[$typeHint])) {
30243                $arguments[] = $locator[$typeHint];
30244                continue;
30245            }
30246            $parameterName = $parameter->getName();
30247            if (isset($locator[$parameterName])) {
30248                $arguments[] = $locator[$parameterName];
30249                continue;
30250            }
30251            $arguments[] = null;
30252        }
30253        return $arguments;
30254    }
30255    /**
30256     * Retrieves a series of ReflectionParameter objects for the static 'create' method of the given
30257     * tag handler class name.
30258     *
30259     * @param class-string $handlerClassName
30260     *
30261     * @return ReflectionParameter[]
30262     */
30263    private function fetchParametersForHandlerFactoryMethod(string $handlerClassName) : array
30264    {
30265        if (!isset($this->tagHandlerParameterCache[$handlerClassName])) {
30266            $methodReflection = new ReflectionMethod($handlerClassName, 'create');
30267            $this->tagHandlerParameterCache[$handlerClassName] = $methodReflection->getParameters();
30268        }
30269        return $this->tagHandlerParameterCache[$handlerClassName];
30270    }
30271    /**
30272     * Returns a copy of this class' Service Locator with added dynamic parameters,
30273     * such as the tag's name, body and Context.
30274     *
30275     * @param TypeContext $context The Context (namespace and aliasses) that may be
30276     *  passed and is used to resolve FQSENs.
30277     * @param string      $tagName The name of the tag that may be
30278     *  passed onto the factory method of the Tag class.
30279     * @param string      $tagBody The body of the tag that may be
30280     *  passed onto the factory method of the Tag class.
30281     *
30282     * @return mixed[]
30283     */
30284    private function getServiceLocatorWithDynamicParameters(TypeContext $context, string $tagName, string $tagBody) : array
30285    {
30286        return array_merge($this->serviceLocator, ['name' => $tagName, 'body' => $tagBody, TypeContext::class => $context]);
30287    }
30288    /**
30289     * Returns whether the given tag belongs to an annotation.
30290     *
30291     * @todo this method should be populated once we implement Annotation notation support.
30292     */
30293    private function isAnnotation(string $tagContent) : bool
30294    {
30295        // 1. Contains a namespace separator
30296        // 2. Contains parenthesis
30297        // 3. Is present in a list of known annotations (make the algorithm smart by first checking is the last part
30298        //    of the annotation class name matches the found tag name
30299        return \false;
30300    }
30301}
30302<?php
30303
30304declare (strict_types=1);
30305/**
30306 * This file is part of phpDocumentor.
30307 *
30308 * For the full copyright and license information, please view the LICENSE
30309 * file that was distributed with this source code.
30310 *
30311 * @link http://phpdoc.org
30312 */
30313namespace PHPUnit\phpDocumentor\Reflection\DocBlock;
30314
30315use PHPUnit\phpDocumentor\Reflection\DocBlock;
30316use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Formatter;
30317use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter;
30318use function sprintf;
30319use function str_repeat;
30320use function str_replace;
30321use function strlen;
30322use function wordwrap;
30323/**
30324 * Converts a DocBlock back from an object to a complete DocComment including Asterisks.
30325 */
30326class Serializer
30327{
30328    /** @var string The string to indent the comment with. */
30329    protected $indentString = ' ';
30330    /** @var int The number of times the indent string is repeated. */
30331    protected $indent = 0;
30332    /** @var bool Whether to indent the first line with the given indent amount and string. */
30333    protected $isFirstLineIndented = \true;
30334    /** @var int|null The max length of a line. */
30335    protected $lineLength;
30336    /** @var Formatter A custom tag formatter. */
30337    protected $tagFormatter;
30338    /**
30339     * Create a Serializer instance.
30340     *
30341     * @param int       $indent          The number of times the indent string is repeated.
30342     * @param string    $indentString    The string to indent the comment with.
30343     * @param bool      $indentFirstLine Whether to indent the first line.
30344     * @param int|null  $lineLength      The max length of a line or NULL to disable line wrapping.
30345     * @param Formatter $tagFormatter    A custom tag formatter, defaults to PassthroughFormatter.
30346     */
30347    public function __construct(int $indent = 0, string $indentString = ' ', bool $indentFirstLine = \true, ?int $lineLength = null, ?Formatter $tagFormatter = null)
30348    {
30349        $this->indent = $indent;
30350        $this->indentString = $indentString;
30351        $this->isFirstLineIndented = $indentFirstLine;
30352        $this->lineLength = $lineLength;
30353        $this->tagFormatter = $tagFormatter ?: new PassthroughFormatter();
30354    }
30355    /**
30356     * Generate a DocBlock comment.
30357     *
30358     * @param DocBlock $docblock The DocBlock to serialize.
30359     *
30360     * @return string The serialized doc block.
30361     */
30362    public function getDocComment(DocBlock $docblock) : string
30363    {
30364        $indent = str_repeat($this->indentString, $this->indent);
30365        $firstIndent = $this->isFirstLineIndented ? $indent : '';
30366        // 3 === strlen(' * ')
30367        $wrapLength = $this->lineLength ? $this->lineLength - strlen($indent) - 3 : null;
30368        $text = $this->removeTrailingSpaces($indent, $this->addAsterisksForEachLine($indent, $this->getSummaryAndDescriptionTextBlock($docblock, $wrapLength)));
30369        $comment = $firstIndent . "/**\n";
30370        if ($text) {
30371            $comment .= $indent . ' * ' . $text . "\n";
30372            $comment .= $indent . " *\n";
30373        }
30374        $comment = $this->addTagBlock($docblock, $wrapLength, $indent, $comment);
30375        return $comment . $indent . ' */';
30376    }
30377    private function removeTrailingSpaces(string $indent, string $text) : string
30378    {
30379        return str_replace(sprintf("\n%s * \n", $indent), sprintf("\n%s *\n", $indent), $text);
30380    }
30381    private function addAsterisksForEachLine(string $indent, string $text) : string
30382    {
30383        return str_replace("\n", sprintf("\n%s * ", $indent), $text);
30384    }
30385    private function getSummaryAndDescriptionTextBlock(DocBlock $docblock, ?int $wrapLength) : string
30386    {
30387        $text = $docblock->getSummary() . ((string) $docblock->getDescription() ? "\n\n" . $docblock->getDescription() : '');
30388        if ($wrapLength !== null) {
30389            $text = wordwrap($text, $wrapLength);
30390            return $text;
30391        }
30392        return $text;
30393    }
30394    private function addTagBlock(DocBlock $docblock, ?int $wrapLength, string $indent, string $comment) : string
30395    {
30396        foreach ($docblock->getTags() as $tag) {
30397            $tagText = $this->tagFormatter->format($tag);
30398            if ($wrapLength !== null) {
30399                $tagText = wordwrap($tagText, $wrapLength);
30400            }
30401            $tagText = str_replace("\n", sprintf("\n%s * ", $indent), $tagText);
30402            $comment .= sprintf("%s * %s\n", $indent, $tagText);
30403        }
30404        return $comment;
30405    }
30406}
30407<?php
30408
30409declare (strict_types=1);
30410/**
30411 * This file is part of phpDocumentor.
30412 *
30413 * For the full copyright and license information, please view the LICENSE
30414 * file that was distributed with this source code.
30415 *
30416 * @link http://phpdoc.org
30417 */
30418namespace PHPUnit\phpDocumentor\Reflection\DocBlock;
30419
30420use InvalidArgumentException;
30421use PHPUnit\phpDocumentor\Reflection\Types\Context as TypeContext;
30422interface TagFactory
30423{
30424    /**
30425     * Adds a parameter to the service locator that can be injected in a tag's factory method.
30426     *
30427     * When calling a tag's "create" method we always check the signature for dependencies to inject. One way is to
30428     * typehint a parameter in the signature so that we can use that interface or class name to inject a dependency
30429     * (see {@see addService()} for more information on that).
30430     *
30431     * Another way is to check the name of the argument against the names in the Service Locator. With this method
30432     * you can add a variable that will be inserted when a tag's create method is not typehinted and has a matching
30433     * name.
30434     *
30435     * Be aware that there are two reserved names:
30436     *
30437     * - name, representing the name of the tag.
30438     * - body, representing the complete body of the tag.
30439     *
30440     * These parameters are injected at the last moment and will override any existing parameter with those names.
30441     *
30442     * @param mixed $value
30443     */
30444    public function addParameter(string $name, $value) : void;
30445    /**
30446     * Factory method responsible for instantiating the correct sub type.
30447     *
30448     * @param string $tagLine The text for this tag, including description.
30449     *
30450     * @return Tag A new tag object.
30451     *
30452     * @throws InvalidArgumentException If an invalid tag line was presented.
30453     */
30454    public function create(string $tagLine, ?TypeContext $context = null) : Tag;
30455    /**
30456     * Registers a service with the Service Locator using the FQCN of the class or the alias, if provided.
30457     *
30458     * When calling a tag's "create" method we always check the signature for dependencies to inject. If a parameter
30459     * has a typehint then the ServiceLocator is queried to see if a Service is registered for that typehint.
30460     *
30461     * Because interfaces are regularly used as type-hints this method provides an alias parameter; if the FQCN of the
30462     * interface is passed as alias then every time that interface is requested the provided service will be returned.
30463     */
30464    public function addService(object $service) : void;
30465    /**
30466     * Registers a handler for tags.
30467     *
30468     * If you want to use your own tags then you can use this method to instruct the TagFactory
30469     * to register the name of a tag with the FQCN of a 'Tag Handler'. The Tag handler should implement
30470     * the {@see Tag} interface (and thus the create method).
30471     *
30472     * @param string                    $tagName Name of tag to register a handler for. When registering a namespaced
30473     *                                   tag, the full name, along with a prefixing slash MUST be provided.
30474     * @param class-string<Tag>         $handler FQCN of handler.
30475     *
30476     * @throws InvalidArgumentException If the tag name is not a string.
30477     * @throws InvalidArgumentException If the tag name is namespaced (contains backslashes) but
30478     *                                   does not start with a backslash.
30479     * @throws InvalidArgumentException If the handler is not a string.
30480     * @throws InvalidArgumentException If the handler is not an existing class.
30481     * @throws InvalidArgumentException If the handler does not implement the {@see Tag} interface.
30482     */
30483    public function registerTagHandler(string $tagName, string $handler) : void;
30484}
30485<?php
30486
30487declare (strict_types=1);
30488/**
30489 * This file is part of phpDocumentor.
30490 *
30491 * For the full copyright and license information, please view the LICENSE
30492 * file that was distributed with this source code.
30493 *
30494 * @link http://phpdoc.org
30495 */
30496namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags;
30497
30498use PHPUnit\phpDocumentor\Reflection\DocBlock\Description;
30499use PHPUnit\phpDocumentor\Reflection\DocBlock\DescriptionFactory;
30500use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Reference\Fqsen as FqsenRef;
30501use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Reference\Reference;
30502use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Reference\Url;
30503use PHPUnit\phpDocumentor\Reflection\Fqsen;
30504use PHPUnit\phpDocumentor\Reflection\FqsenResolver;
30505use PHPUnit\phpDocumentor\Reflection\Types\Context as TypeContext;
30506use PHPUnit\phpDocumentor\Reflection\Utils;
30507use PHPUnit\Webmozart\Assert\Assert;
30508use function array_key_exists;
30509use function explode;
30510use function preg_match;
30511/**
30512 * Reflection class for an {@}see tag in a Docblock.
30513 */
30514final class See extends BaseTag implements Factory\StaticMethod
30515{
30516    /** @var string */
30517    protected $name = 'see';
30518    /** @var Reference */
30519    protected $refers;
30520    /**
30521     * Initializes this tag.
30522     */
30523    public function __construct(Reference $refers, ?Description $description = null)
30524    {
30525        $this->refers = $refers;
30526        $this->description = $description;
30527    }
30528    public static function create(string $body, ?FqsenResolver $typeResolver = null, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null) : self
30529    {
30530        Assert::notNull($descriptionFactory);
30531        $parts = Utils::pregSplit('/\\s+/Su', $body, 2);
30532        $description = isset($parts[1]) ? $descriptionFactory->create($parts[1], $context) : null;
30533        // https://tools.ietf.org/html/rfc2396#section-3
30534        if (preg_match('/\\w:\\/\\/\\w/i', $parts[0])) {
30535            return new static(new Url($parts[0]), $description);
30536        }
30537        return new static(new FqsenRef(self::resolveFqsen($parts[0], $typeResolver, $context)), $description);
30538    }
30539    private static function resolveFqsen(string $parts, ?FqsenResolver $fqsenResolver, ?TypeContext $context) : Fqsen
30540    {
30541        Assert::notNull($fqsenResolver);
30542        $fqsenParts = explode('::', $parts);
30543        $resolved = $fqsenResolver->resolve($fqsenParts[0], $context);
30544        if (!array_key_exists(1, $fqsenParts)) {
30545            return $resolved;
30546        }
30547        return new Fqsen($resolved . '::' . $fqsenParts[1]);
30548    }
30549    /**
30550     * Returns the ref of this tag.
30551     */
30552    public function getReference() : Reference
30553    {
30554        return $this->refers;
30555    }
30556    /**
30557     * Returns a string representation of this tag.
30558     */
30559    public function __toString() : string
30560    {
30561        if ($this->description) {
30562            $description = $this->description->render();
30563        } else {
30564            $description = '';
30565        }
30566        $refers = (string) $this->refers;
30567        return $refers . ($description !== '' ? ($refers !== '' ? ' ' : '') . $description : '');
30568    }
30569}
30570<?php
30571
30572declare (strict_types=1);
30573/**
30574 * This file is part of phpDocumentor.
30575 *
30576 * For the full copyright and license information, please view the LICENSE
30577 * file that was distributed with this source code.
30578 *
30579 * @link      http://phpdoc.org
30580 */
30581namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags;
30582
30583use InvalidArgumentException;
30584use PHPUnit\phpDocumentor\Reflection\DocBlock\Description;
30585use PHPUnit\phpDocumentor\Reflection\DocBlock\DescriptionFactory;
30586use PHPUnit\phpDocumentor\Reflection\DocBlock\StandardTagFactory;
30587use PHPUnit\phpDocumentor\Reflection\Types\Context as TypeContext;
30588use PHPUnit\Webmozart\Assert\Assert;
30589use function preg_match;
30590/**
30591 * Parses a tag definition for a DocBlock.
30592 */
30593final class Generic extends BaseTag implements Factory\StaticMethod
30594{
30595    /**
30596     * Parses a tag and populates the member variables.
30597     *
30598     * @param string      $name        Name of the tag.
30599     * @param Description $description The contents of the given tag.
30600     */
30601    public function __construct(string $name, ?Description $description = null)
30602    {
30603        $this->validateTagName($name);
30604        $this->name = $name;
30605        $this->description = $description;
30606    }
30607    /**
30608     * Creates a new tag that represents any unknown tag type.
30609     *
30610     * @return static
30611     */
30612    public static function create(string $body, string $name = '', ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null) : self
30613    {
30614        Assert::stringNotEmpty($name);
30615        Assert::notNull($descriptionFactory);
30616        $description = $body !== '' ? $descriptionFactory->create($body, $context) : null;
30617        return new static($name, $description);
30618    }
30619    /**
30620     * Returns the tag as a serialized string
30621     */
30622    public function __toString() : string
30623    {
30624        if ($this->description) {
30625            $description = $this->description->render();
30626        } else {
30627            $description = '';
30628        }
30629        return $description;
30630    }
30631    /**
30632     * Validates if the tag name matches the expected format, otherwise throws an exception.
30633     */
30634    private function validateTagName(string $name) : void
30635    {
30636        if (!preg_match('/^' . StandardTagFactory::REGEX_TAGNAME . '$/u', $name)) {
30637            throw new InvalidArgumentException('The tag name "' . $name . '" is not wellformed. Tags may only consist of letters, underscores, ' . 'hyphens and backslashes.');
30638        }
30639    }
30640}
30641<?php
30642
30643declare (strict_types=1);
30644namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags;
30645
30646use Closure;
30647use Exception;
30648use PHPUnit\phpDocumentor\Reflection\DocBlock\Tag;
30649use ReflectionClass;
30650use ReflectionException;
30651use ReflectionFunction;
30652use Throwable;
30653use function array_map;
30654use function get_class;
30655use function get_resource_type;
30656use function is_array;
30657use function is_object;
30658use function is_resource;
30659use function sprintf;
30660/**
30661 * This class represents an exception during the tag creation
30662 *
30663 * Since the internals of the library are relaying on the correct syntax of a docblock
30664 * we cannot simply throw exceptions at all time because the exceptions will break the creation of a
30665 * docklock. Just silently ignore the exceptions is not an option because the user as an issue to fix.
30666 *
30667 * This tag holds that error information until a using application is able to display it. The object wil just behave
30668 * like any normal tag. So the normal application flow will not break.
30669 */
30670final class InvalidTag implements Tag
30671{
30672    /** @var string */
30673    private $name;
30674    /** @var string */
30675    private $body;
30676    /** @var Throwable|null */
30677    private $throwable;
30678    private function __construct(string $name, string $body)
30679    {
30680        $this->name = $name;
30681        $this->body = $body;
30682    }
30683    public function getException() : ?Throwable
30684    {
30685        return $this->throwable;
30686    }
30687    public function getName() : string
30688    {
30689        return $this->name;
30690    }
30691    public static function create(string $body, string $name = '') : self
30692    {
30693        return new self($name, $body);
30694    }
30695    public function withError(Throwable $exception) : self
30696    {
30697        $this->flattenExceptionBacktrace($exception);
30698        $tag = new self($this->name, $this->body);
30699        $tag->throwable = $exception;
30700        return $tag;
30701    }
30702    /**
30703     * Removes all complex types from backtrace
30704     *
30705     * Not all objects are serializable. So we need to remove them from the
30706     * stored exception to be sure that we do not break existing library usage.
30707     */
30708    private function flattenExceptionBacktrace(Throwable $exception) : void
30709    {
30710        $traceProperty = (new ReflectionClass(Exception::class))->getProperty('trace');
30711        $traceProperty->setAccessible(\true);
30712        do {
30713            $trace = $exception->getTrace();
30714            if (isset($trace[0]['args'])) {
30715                $trace = array_map(function (array $call) : array {
30716                    $call['args'] = array_map([$this, 'flattenArguments'], $call['args']);
30717                    return $call;
30718                }, $trace);
30719            }
30720            $traceProperty->setValue($exception, $trace);
30721            $exception = $exception->getPrevious();
30722        } while ($exception !== null);
30723        $traceProperty->setAccessible(\false);
30724    }
30725    /**
30726     * @param mixed $value
30727     *
30728     * @return mixed
30729     *
30730     * @throws ReflectionException
30731     */
30732    private function flattenArguments($value)
30733    {
30734        if ($value instanceof Closure) {
30735            $closureReflection = new ReflectionFunction($value);
30736            $value = sprintf('(Closure at %s:%s)', $closureReflection->getFileName(), $closureReflection->getStartLine());
30737        } elseif (is_object($value)) {
30738            $value = sprintf('object(%s)', get_class($value));
30739        } elseif (is_resource($value)) {
30740            $value = sprintf('resource(%s)', get_resource_type($value));
30741        } elseif (is_array($value)) {
30742            $value = array_map([$this, 'flattenArguments'], $value);
30743        }
30744        return $value;
30745    }
30746    public function render(?Formatter $formatter = null) : string
30747    {
30748        if ($formatter === null) {
30749            $formatter = new Formatter\PassthroughFormatter();
30750        }
30751        return $formatter->format($this);
30752    }
30753    public function __toString() : string
30754    {
30755        return $this->body;
30756    }
30757}
30758<?php
30759
30760declare (strict_types=1);
30761/**
30762 * This file is part of phpDocumentor.
30763 *
30764 * For the full copyright and license information, please view the LICENSE
30765 * file that was distributed with this source code.
30766 *
30767 * @link      http://phpdoc.org
30768 */
30769namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags;
30770
30771use PHPUnit\phpDocumentor\Reflection\DocBlock\Description;
30772use PHPUnit\phpDocumentor\Reflection\DocBlock\DescriptionFactory;
30773use PHPUnit\phpDocumentor\Reflection\Types\Context as TypeContext;
30774use PHPUnit\Webmozart\Assert\Assert;
30775use function preg_match;
30776/**
30777 * Reflection class for a {@}source tag in a Docblock.
30778 */
30779final class Source extends BaseTag implements Factory\StaticMethod
30780{
30781    /** @var string */
30782    protected $name = 'source';
30783    /** @var int The starting line, relative to the structural element's location. */
30784    private $startingLine;
30785    /** @var int|null The number of lines, relative to the starting line. NULL means "to the end". */
30786    private $lineCount;
30787    /**
30788     * @param int|string      $startingLine should be a to int convertible value
30789     * @param int|string|null $lineCount    should be a to int convertible value
30790     */
30791    public function __construct($startingLine, $lineCount = null, ?Description $description = null)
30792    {
30793        Assert::integerish($startingLine);
30794        Assert::nullOrIntegerish($lineCount);
30795        $this->startingLine = (int) $startingLine;
30796        $this->lineCount = $lineCount !== null ? (int) $lineCount : null;
30797        $this->description = $description;
30798    }
30799    public static function create(string $body, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null) : self
30800    {
30801        Assert::stringNotEmpty($body);
30802        Assert::notNull($descriptionFactory);
30803        $startingLine = 1;
30804        $lineCount = null;
30805        $description = null;
30806        // Starting line / Number of lines / Description
30807        if (preg_match('/^([1-9]\\d*)\\s*(?:((?1))\\s+)?(.*)$/sux', $body, $matches)) {
30808            $startingLine = (int) $matches[1];
30809            if (isset($matches[2]) && $matches[2] !== '') {
30810                $lineCount = (int) $matches[2];
30811            }
30812            $description = $matches[3];
30813        }
30814        return new static($startingLine, $lineCount, $descriptionFactory->create($description ?? '', $context));
30815    }
30816    /**
30817     * Gets the starting line.
30818     *
30819     * @return int The starting line, relative to the structural element's
30820     *     location.
30821     */
30822    public function getStartingLine() : int
30823    {
30824        return $this->startingLine;
30825    }
30826    /**
30827     * Returns the number of lines.
30828     *
30829     * @return int|null The number of lines, relative to the starting line. NULL
30830     *     means "to the end".
30831     */
30832    public function getLineCount() : ?int
30833    {
30834        return $this->lineCount;
30835    }
30836    public function __toString() : string
30837    {
30838        if ($this->description) {
30839            $description = $this->description->render();
30840        } else {
30841            $description = '';
30842        }
30843        $startingLine = (string) $this->startingLine;
30844        $lineCount = $this->lineCount !== null ? '' . $this->lineCount : '';
30845        return $startingLine . ($lineCount !== '' ? ($startingLine || $startingLine === '0' ? ' ' : '') . $lineCount : '') . ($description !== '' ? ($startingLine || $startingLine === '0' || $lineCount !== '' ? ' ' : '') . $description : '');
30846    }
30847}
30848<?php
30849
30850declare (strict_types=1);
30851/**
30852 * This file is part of phpDocumentor.
30853 *
30854 * For the full copyright and license information, please view the LICENSE
30855 * file that was distributed with this source code.
30856 *
30857 * @link http://phpdoc.org
30858 */
30859namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags;
30860
30861use InvalidArgumentException;
30862use PHPUnit\phpDocumentor\Reflection\DocBlock\Description;
30863use PHPUnit\phpDocumentor\Reflection\DocBlock\DescriptionFactory;
30864use PHPUnit\phpDocumentor\Reflection\Type;
30865use PHPUnit\phpDocumentor\Reflection\TypeResolver;
30866use PHPUnit\phpDocumentor\Reflection\Types\Context as TypeContext;
30867use PHPUnit\phpDocumentor\Reflection\Types\Mixed_;
30868use PHPUnit\phpDocumentor\Reflection\Types\Void_;
30869use PHPUnit\Webmozart\Assert\Assert;
30870use function array_keys;
30871use function explode;
30872use function implode;
30873use function is_string;
30874use function preg_match;
30875use function sort;
30876use function strpos;
30877use function substr;
30878use function trim;
30879use function var_export;
30880/**
30881 * Reflection class for an {@}method in a Docblock.
30882 */
30883final class Method extends BaseTag implements Factory\StaticMethod
30884{
30885    /** @var string */
30886    protected $name = 'method';
30887    /** @var string */
30888    private $methodName;
30889    /**
30890     * @phpstan-var array<int, array{name: string, type: Type}>
30891     * @var array<int, array<string, Type|string>>
30892     */
30893    private $arguments;
30894    /** @var bool */
30895    private $isStatic;
30896    /** @var Type */
30897    private $returnType;
30898    /**
30899     * @param array<int, array<string, Type|string>> $arguments
30900     *
30901     * @phpstan-param array<int, array{name: string, type: Type}|string> $arguments
30902     */
30903    public function __construct(string $methodName, array $arguments = [], ?Type $returnType = null, bool $static = \false, ?Description $description = null)
30904    {
30905        Assert::stringNotEmpty($methodName);
30906        if ($returnType === null) {
30907            $returnType = new Void_();
30908        }
30909        $this->methodName = $methodName;
30910        $this->arguments = $this->filterArguments($arguments);
30911        $this->returnType = $returnType;
30912        $this->isStatic = $static;
30913        $this->description = $description;
30914    }
30915    public static function create(string $body, ?TypeResolver $typeResolver = null, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null) : ?self
30916    {
30917        Assert::stringNotEmpty($body);
30918        Assert::notNull($typeResolver);
30919        Assert::notNull($descriptionFactory);
30920        // 1. none or more whitespace
30921        // 2. optionally the keyword "static" followed by whitespace
30922        // 3. optionally a word with underscores followed by whitespace : as
30923        //    type for the return value
30924        // 4. then optionally a word with underscores followed by () and
30925        //    whitespace : as method name as used by phpDocumentor
30926        // 5. then a word with underscores, followed by ( and any character
30927        //    until a ) and whitespace : as method name with signature
30928        // 6. any remaining text : as description
30929        if (!preg_match('/^
30930                # Static keyword
30931                # Declares a static method ONLY if type is also present
30932                (?:
30933                    (static)
30934                    \\s+
30935                )?
30936                # Return type
30937                (?:
30938                    (
30939                        (?:[\\w\\|_\\\\]*\\$this[\\w\\|_\\\\]*)
30940                        |
30941                        (?:
30942                            (?:[\\w\\|_\\\\]+)
30943                            # array notation
30944                            (?:\\[\\])*
30945                        )*+
30946                    )
30947                    \\s+
30948                )?
30949                # Method name
30950                ([\\w_]+)
30951                # Arguments
30952                (?:
30953                    \\(([^\\)]*)\\)
30954                )?
30955                \\s*
30956                # Description
30957                (.*)
30958            $/sux', $body, $matches)) {
30959            return null;
30960        }
30961        [, $static, $returnType, $methodName, $argumentLines, $description] = $matches;
30962        $static = $static === 'static';
30963        if ($returnType === '') {
30964            $returnType = 'void';
30965        }
30966        $returnType = $typeResolver->resolve($returnType, $context);
30967        $description = $descriptionFactory->create($description, $context);
30968        /** @phpstan-var array<int, array{name: string, type: Type}> $arguments */
30969        $arguments = [];
30970        if ($argumentLines !== '') {
30971            $argumentsExploded = explode(',', $argumentLines);
30972            foreach ($argumentsExploded as $argument) {
30973                $argument = explode(' ', self::stripRestArg(trim($argument)), 2);
30974                if (strpos($argument[0], '$') === 0) {
30975                    $argumentName = substr($argument[0], 1);
30976                    $argumentType = new Mixed_();
30977                } else {
30978                    $argumentType = $typeResolver->resolve($argument[0], $context);
30979                    $argumentName = '';
30980                    if (isset($argument[1])) {
30981                        $argument[1] = self::stripRestArg($argument[1]);
30982                        $argumentName = substr($argument[1], 1);
30983                    }
30984                }
30985                $arguments[] = ['name' => $argumentName, 'type' => $argumentType];
30986            }
30987        }
30988        return new static($methodName, $arguments, $returnType, $static, $description);
30989    }
30990    /**
30991     * Retrieves the method name.
30992     */
30993    public function getMethodName() : string
30994    {
30995        return $this->methodName;
30996    }
30997    /**
30998     * @return array<int, array<string, Type|string>>
30999     *
31000     * @phpstan-return array<int, array{name: string, type: Type}>
31001     */
31002    public function getArguments() : array
31003    {
31004        return $this->arguments;
31005    }
31006    /**
31007     * Checks whether the method tag describes a static method or not.
31008     *
31009     * @return bool TRUE if the method declaration is for a static method, FALSE otherwise.
31010     */
31011    public function isStatic() : bool
31012    {
31013        return $this->isStatic;
31014    }
31015    public function getReturnType() : Type
31016    {
31017        return $this->returnType;
31018    }
31019    public function __toString() : string
31020    {
31021        $arguments = [];
31022        foreach ($this->arguments as $argument) {
31023            $arguments[] = $argument['type'] . ' $' . $argument['name'];
31024        }
31025        $argumentStr = '(' . implode(', ', $arguments) . ')';
31026        if ($this->description) {
31027            $description = $this->description->render();
31028        } else {
31029            $description = '';
31030        }
31031        $static = $this->isStatic ? 'static' : '';
31032        $returnType = (string) $this->returnType;
31033        $methodName = (string) $this->methodName;
31034        return $static . ($returnType !== '' ? ($static !== '' ? ' ' : '') . $returnType : '') . ($methodName !== '' ? ($static !== '' || $returnType !== '' ? ' ' : '') . $methodName : '') . $argumentStr . ($description !== '' ? ' ' . $description : '');
31035    }
31036    /**
31037     * @param mixed[][]|string[] $arguments
31038     *
31039     * @return mixed[][]
31040     *
31041     * @phpstan-param array<int, array{name: string, type: Type}|string> $arguments
31042     * @phpstan-return array<int, array{name: string, type: Type}>
31043     */
31044    private function filterArguments(array $arguments = []) : array
31045    {
31046        $result = [];
31047        foreach ($arguments as $argument) {
31048            if (is_string($argument)) {
31049                $argument = ['name' => $argument];
31050            }
31051            if (!isset($argument['type'])) {
31052                $argument['type'] = new Mixed_();
31053            }
31054            $keys = array_keys($argument);
31055            sort($keys);
31056            if ($keys !== ['name', 'type']) {
31057                throw new InvalidArgumentException('Arguments can only have the "name" and "type" fields, found: ' . var_export($keys, \true));
31058            }
31059            $result[] = $argument;
31060        }
31061        return $result;
31062    }
31063    private static function stripRestArg(string $argument) : string
31064    {
31065        if (strpos($argument, '...') === 0) {
31066            $argument = trim(substr($argument, 3));
31067        }
31068        return $argument;
31069    }
31070}
31071<?php
31072
31073declare (strict_types=1);
31074/**
31075 * This file is part of phpDocumentor.
31076 *
31077 * For the full copyright and license information, please view the LICENSE
31078 * file that was distributed with this source code.
31079 *
31080 * @link      http://phpdoc.org
31081 */
31082namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags;
31083
31084use PHPUnit\phpDocumentor\Reflection\DocBlock\Tag;
31085interface Formatter
31086{
31087    /**
31088     * Formats a tag into a string representation according to a specific format, such as Markdown.
31089     */
31090    public function format(Tag $tag) : string;
31091}
31092<?php
31093
31094declare (strict_types=1);
31095/**
31096 * This file is part of phpDocumentor.
31097 *
31098 *  For the full copyright and license information, please view the LICENSE
31099 *  file that was distributed with this source code.
31100 *
31101 * @link http://phpdoc.org
31102 */
31103namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Reference;
31104
31105use PHPUnit\Webmozart\Assert\Assert;
31106/**
31107 * Url reference used by {@see \phpDocumentor\Reflection\DocBlock\Tags\See}
31108 */
31109final class Url implements Reference
31110{
31111    /** @var string */
31112    private $uri;
31113    public function __construct(string $uri)
31114    {
31115        Assert::stringNotEmpty($uri);
31116        $this->uri = $uri;
31117    }
31118    public function __toString() : string
31119    {
31120        return $this->uri;
31121    }
31122}
31123<?php
31124
31125declare (strict_types=1);
31126/**
31127 * This file is part of phpDocumentor.
31128 *
31129 *  For the full copyright and license information, please view the LICENSE
31130 *  file that was distributed with this source code.
31131 *
31132 * @link http://phpdoc.org
31133 */
31134namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Reference;
31135
31136use PHPUnit\phpDocumentor\Reflection\Fqsen as RealFqsen;
31137/**
31138 * Fqsen reference used by {@see \phpDocumentor\Reflection\DocBlock\Tags\See}
31139 */
31140final class Fqsen implements Reference
31141{
31142    /** @var RealFqsen */
31143    private $fqsen;
31144    public function __construct(RealFqsen $fqsen)
31145    {
31146        $this->fqsen = $fqsen;
31147    }
31148    /**
31149     * @return string string representation of the referenced fqsen
31150     */
31151    public function __toString() : string
31152    {
31153        return (string) $this->fqsen;
31154    }
31155}
31156<?php
31157
31158declare (strict_types=1);
31159/**
31160 * This file is part of phpDocumentor.
31161 *
31162 *  For the full copyright and license information, please view the LICENSE
31163 *  file that was distributed with this source code.
31164 *
31165 * @link http://phpdoc.org
31166 */
31167namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Reference;
31168
31169/**
31170 * Interface for references in {@see \phpDocumentor\Reflection\DocBlock\Tags\See}
31171 */
31172interface Reference
31173{
31174    public function __toString() : string;
31175}
31176<?php
31177
31178declare (strict_types=1);
31179/**
31180 * This file is part of phpDocumentor.
31181 *
31182 * For the full copyright and license information, please view the LICENSE
31183 * file that was distributed with this source code.
31184 *
31185 * @link http://phpdoc.org
31186 */
31187namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags;
31188
31189use PHPUnit\phpDocumentor\Reflection\DocBlock;
31190use PHPUnit\phpDocumentor\Reflection\DocBlock\Description;
31191/**
31192 * Parses a tag definition for a DocBlock.
31193 */
31194abstract class BaseTag implements DocBlock\Tag
31195{
31196    /** @var string Name of the tag */
31197    protected $name = '';
31198    /** @var Description|null Description of the tag. */
31199    protected $description;
31200    /**
31201     * Gets the name of this tag.
31202     *
31203     * @return string The name of this tag.
31204     */
31205    public function getName() : string
31206    {
31207        return $this->name;
31208    }
31209    public function getDescription() : ?Description
31210    {
31211        return $this->description;
31212    }
31213    public function render(?Formatter $formatter = null) : string
31214    {
31215        if ($formatter === null) {
31216            $formatter = new Formatter\PassthroughFormatter();
31217        }
31218        return $formatter->format($this);
31219    }
31220}
31221<?php
31222
31223declare (strict_types=1);
31224/**
31225 * This file is part of phpDocumentor.
31226 *
31227 * For the full copyright and license information, please view the LICENSE
31228 * file that was distributed with this source code.
31229 *
31230 * @link http://phpdoc.org
31231 */
31232namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags;
31233
31234use InvalidArgumentException;
31235use function filter_var;
31236use function preg_match;
31237use function trim;
31238use const FILTER_VALIDATE_EMAIL;
31239/**
31240 * Reflection class for an {@}author tag in a Docblock.
31241 */
31242final class Author extends BaseTag implements Factory\StaticMethod
31243{
31244    /** @var string register that this is the author tag. */
31245    protected $name = 'author';
31246    /** @var string The name of the author */
31247    private $authorName;
31248    /** @var string The email of the author */
31249    private $authorEmail;
31250    /**
31251     * Initializes this tag with the author name and e-mail.
31252     */
31253    public function __construct(string $authorName, string $authorEmail)
31254    {
31255        if ($authorEmail && !filter_var($authorEmail, \FILTER_VALIDATE_EMAIL)) {
31256            throw new InvalidArgumentException('The author tag does not have a valid e-mail address');
31257        }
31258        $this->authorName = $authorName;
31259        $this->authorEmail = $authorEmail;
31260    }
31261    /**
31262     * Gets the author's name.
31263     *
31264     * @return string The author's name.
31265     */
31266    public function getAuthorName() : string
31267    {
31268        return $this->authorName;
31269    }
31270    /**
31271     * Returns the author's email.
31272     *
31273     * @return string The author's email.
31274     */
31275    public function getEmail() : string
31276    {
31277        return $this->authorEmail;
31278    }
31279    /**
31280     * Returns this tag in string form.
31281     */
31282    public function __toString() : string
31283    {
31284        if ($this->authorEmail) {
31285            $authorEmail = '<' . $this->authorEmail . '>';
31286        } else {
31287            $authorEmail = '';
31288        }
31289        $authorName = (string) $this->authorName;
31290        return $authorName . ($authorEmail !== '' ? ($authorName !== '' ? ' ' : '') . $authorEmail : '');
31291    }
31292    /**
31293     * Attempts to create a new Author object based on †he tag body.
31294     */
31295    public static function create(string $body) : ?self
31296    {
31297        $splitTagContent = preg_match('/^([^\\<]*)(?:\\<([^\\>]*)\\>)?$/u', $body, $matches);
31298        if (!$splitTagContent) {
31299            return null;
31300        }
31301        $authorName = trim($matches[1]);
31302        $email = isset($matches[2]) ? trim($matches[2]) : '';
31303        return new static($authorName, $email);
31304    }
31305}
31306<?php
31307
31308declare (strict_types=1);
31309/**
31310 * This file is part of phpDocumentor.
31311 *
31312 * For the full copyright and license information, please view the LICENSE
31313 * file that was distributed with this source code.
31314 *
31315 * @link      http://phpdoc.org
31316 */
31317namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags;
31318
31319use PHPUnit\phpDocumentor\Reflection\DocBlock\Description;
31320use PHPUnit\phpDocumentor\Reflection\DocBlock\DescriptionFactory;
31321use PHPUnit\phpDocumentor\Reflection\Types\Context as TypeContext;
31322use PHPUnit\Webmozart\Assert\Assert;
31323use function preg_match;
31324/**
31325 * Reflection class for a {@}since tag in a Docblock.
31326 */
31327final class Since extends BaseTag implements Factory\StaticMethod
31328{
31329    /** @var string */
31330    protected $name = 'since';
31331    /**
31332     * PCRE regular expression matching a version vector.
31333     * Assumes the "x" modifier.
31334     */
31335    public const REGEX_VECTOR = '(?:
31336        # Normal release vectors.
31337        \\d\\S*
31338        |
31339        # VCS version vectors. Per PHPCS, they are expected to
31340        # follow the form of the VCS name, followed by ":", followed
31341        # by the version vector itself.
31342        # By convention, popular VCSes like CVS, SVN and GIT use "$"
31343        # around the actual version vector.
31344        [^\\s\\:]+\\:\\s*\\$[^\\$]+\\$
31345    )';
31346    /** @var string|null The version vector. */
31347    private $version;
31348    public function __construct(?string $version = null, ?Description $description = null)
31349    {
31350        Assert::nullOrNotEmpty($version);
31351        $this->version = $version;
31352        $this->description = $description;
31353    }
31354    public static function create(?string $body, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null) : ?self
31355    {
31356        if (empty($body)) {
31357            return new static();
31358        }
31359        $matches = [];
31360        if (!preg_match('/^(' . self::REGEX_VECTOR . ')\\s*(.+)?$/sux', $body, $matches)) {
31361            return null;
31362        }
31363        Assert::notNull($descriptionFactory);
31364        return new static($matches[1], $descriptionFactory->create($matches[2] ?? '', $context));
31365    }
31366    /**
31367     * Gets the version section of the tag.
31368     */
31369    public function getVersion() : ?string
31370    {
31371        return $this->version;
31372    }
31373    /**
31374     * Returns a string representation for this tag.
31375     */
31376    public function __toString() : string
31377    {
31378        if ($this->description) {
31379            $description = $this->description->render();
31380        } else {
31381            $description = '';
31382        }
31383        $version = (string) $this->version;
31384        return $version . ($description !== '' ? ($version !== '' ? ' ' : '') . $description : '');
31385    }
31386}
31387<?php
31388
31389declare (strict_types=1);
31390/**
31391 * This file is part of phpDocumentor.
31392 *
31393 * For the full copyright and license information, please view the LICENSE
31394 * file that was distributed with this source code.
31395 *
31396 * @link      http://phpdoc.org
31397 */
31398namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Formatter;
31399
31400use PHPUnit\phpDocumentor\Reflection\DocBlock\Tag;
31401use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Formatter;
31402use function trim;
31403class PassthroughFormatter implements Formatter
31404{
31405    /**
31406     * Formats the given tag to return a simple plain text version.
31407     */
31408    public function format(Tag $tag) : string
31409    {
31410        return trim('@' . $tag->getName() . ' ' . $tag);
31411    }
31412}
31413<?php
31414
31415declare (strict_types=1);
31416/**
31417 * This file is part of phpDocumentor.
31418 *
31419 * For the full copyright and license information, please view the LICENSE
31420 * file that was distributed with this source code.
31421 *
31422 * @link      http://phpdoc.org
31423 */
31424namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Formatter;
31425
31426use PHPUnit\phpDocumentor\Reflection\DocBlock\Tag;
31427use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Formatter;
31428use function max;
31429use function str_repeat;
31430use function strlen;
31431class AlignFormatter implements Formatter
31432{
31433    /** @var int The maximum tag name length. */
31434    protected $maxLen = 0;
31435    /**
31436     * @param Tag[] $tags All tags that should later be aligned with the formatter.
31437     */
31438    public function __construct(array $tags)
31439    {
31440        foreach ($tags as $tag) {
31441            $this->maxLen = max($this->maxLen, strlen($tag->getName()));
31442        }
31443    }
31444    /**
31445     * Formats the given tag to return a simple plain text version.
31446     */
31447    public function format(Tag $tag) : string
31448    {
31449        return '@' . $tag->getName() . str_repeat(' ', $this->maxLen - strlen($tag->getName()) + 1) . $tag;
31450    }
31451}
31452<?php
31453
31454declare (strict_types=1);
31455/**
31456 * This file is part of phpDocumentor.
31457 *
31458 * For the full copyright and license information, please view the LICENSE
31459 * file that was distributed with this source code.
31460 *
31461 * @link      http://phpdoc.org
31462 */
31463namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags;
31464
31465use PHPUnit\phpDocumentor\Reflection\DocBlock\Description;
31466use PHPUnit\phpDocumentor\Reflection\DocBlock\DescriptionFactory;
31467use PHPUnit\phpDocumentor\Reflection\Type;
31468use PHPUnit\phpDocumentor\Reflection\TypeResolver;
31469use PHPUnit\phpDocumentor\Reflection\Types\Context as TypeContext;
31470use PHPUnit\phpDocumentor\Reflection\Utils;
31471use PHPUnit\Webmozart\Assert\Assert;
31472use function array_shift;
31473use function array_unshift;
31474use function implode;
31475use function strpos;
31476use function substr;
31477use const PREG_SPLIT_DELIM_CAPTURE;
31478/**
31479 * Reflection class for a {@}property-read tag in a Docblock.
31480 */
31481final class PropertyRead extends TagWithType implements Factory\StaticMethod
31482{
31483    /** @var string|null */
31484    protected $variableName;
31485    public function __construct(?string $variableName, ?Type $type = null, ?Description $description = null)
31486    {
31487        Assert::string($variableName);
31488        $this->name = 'property-read';
31489        $this->variableName = $variableName;
31490        $this->type = $type;
31491        $this->description = $description;
31492    }
31493    public static function create(string $body, ?TypeResolver $typeResolver = null, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null) : self
31494    {
31495        Assert::stringNotEmpty($body);
31496        Assert::notNull($typeResolver);
31497        Assert::notNull($descriptionFactory);
31498        [$firstPart, $body] = self::extractTypeFromBody($body);
31499        $type = null;
31500        $parts = Utils::pregSplit('/(\\s+)/Su', $body, 2, \PREG_SPLIT_DELIM_CAPTURE);
31501        $variableName = '';
31502        // if the first item that is encountered is not a variable; it is a type
31503        if ($firstPart && $firstPart[0] !== '$') {
31504            $type = $typeResolver->resolve($firstPart, $context);
31505        } else {
31506            // first part is not a type; we should prepend it to the parts array for further processing
31507            array_unshift($parts, $firstPart);
31508        }
31509        // if the next item starts with a $ it must be the variable name
31510        if (isset($parts[0]) && strpos($parts[0], '$') === 0) {
31511            $variableName = array_shift($parts);
31512            if ($type) {
31513                array_shift($parts);
31514            }
31515            Assert::notNull($variableName);
31516            $variableName = substr($variableName, 1);
31517        }
31518        $description = $descriptionFactory->create(implode('', $parts), $context);
31519        return new static($variableName, $type, $description);
31520    }
31521    /**
31522     * Returns the variable's name.
31523     */
31524    public function getVariableName() : ?string
31525    {
31526        return $this->variableName;
31527    }
31528    /**
31529     * Returns a string representation for this tag.
31530     */
31531    public function __toString() : string
31532    {
31533        if ($this->description) {
31534            $description = $this->description->render();
31535        } else {
31536            $description = '';
31537        }
31538        if ($this->variableName) {
31539            $variableName = '$' . $this->variableName;
31540        } else {
31541            $variableName = '';
31542        }
31543        $type = (string) $this->type;
31544        return $type . ($variableName !== '' ? ($type !== '' ? ' ' : '') . $variableName : '') . ($description !== '' ? ($type !== '' || $variableName !== '' ? ' ' : '') . $description : '');
31545    }
31546}
31547<?php
31548
31549declare (strict_types=1);
31550/**
31551 * This file is part of phpDocumentor.
31552 *
31553 * For the full copyright and license information, please view the LICENSE
31554 * file that was distributed with this source code.
31555 *
31556 * @link      http://phpdoc.org
31557 */
31558namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags;
31559
31560use PHPUnit\phpDocumentor\Reflection\Type;
31561use function in_array;
31562use function strlen;
31563use function substr;
31564use function trim;
31565abstract class TagWithType extends BaseTag
31566{
31567    /** @var ?Type */
31568    protected $type;
31569    /**
31570     * Returns the type section of the variable.
31571     */
31572    public function getType() : ?Type
31573    {
31574        return $this->type;
31575    }
31576    /**
31577     * @return string[]
31578     */
31579    protected static function extractTypeFromBody(string $body) : array
31580    {
31581        $type = '';
31582        $nestingLevel = 0;
31583        for ($i = 0, $iMax = strlen($body); $i < $iMax; $i++) {
31584            $character = $body[$i];
31585            if ($nestingLevel === 0 && trim($character) === '') {
31586                break;
31587            }
31588            $type .= $character;
31589            if (in_array($character, ['<', '(', '[', '{'])) {
31590                $nestingLevel++;
31591                continue;
31592            }
31593            if (in_array($character, ['>', ')', ']', '}'])) {
31594                $nestingLevel--;
31595                continue;
31596            }
31597        }
31598        $description = trim(substr($body, strlen($type)));
31599        return [$type, $description];
31600    }
31601}
31602<?php
31603
31604declare (strict_types=1);
31605/**
31606 * This file is part of phpDocumentor.
31607 *
31608 * For the full copyright and license information, please view the LICENSE
31609 * file that was distributed with this source code.
31610 *
31611 * @link      http://phpdoc.org
31612 */
31613namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Factory;
31614
31615/**
31616 * @deprecated This contract is totally covered by Tag contract. Every class using StaticMethod also use Tag
31617 */
31618interface StaticMethod
31619{
31620    /**
31621     * @return mixed
31622     */
31623    public static function create(string $body);
31624}
31625<?php
31626
31627declare (strict_types=1);
31628/**
31629 * This file is part of phpDocumentor.
31630 *
31631 * For the full copyright and license information, please view the LICENSE
31632 * file that was distributed with this source code.
31633 *
31634 * @link      http://phpdoc.org
31635 */
31636namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags;
31637
31638use PHPUnit\phpDocumentor\Reflection\DocBlock\Description;
31639use PHPUnit\phpDocumentor\Reflection\DocBlock\DescriptionFactory;
31640use PHPUnit\phpDocumentor\Reflection\Type;
31641use PHPUnit\phpDocumentor\Reflection\TypeResolver;
31642use PHPUnit\phpDocumentor\Reflection\Types\Context as TypeContext;
31643use PHPUnit\phpDocumentor\Reflection\Utils;
31644use PHPUnit\Webmozart\Assert\Assert;
31645use function array_shift;
31646use function array_unshift;
31647use function implode;
31648use function strpos;
31649use function substr;
31650use const PREG_SPLIT_DELIM_CAPTURE;
31651/**
31652 * Reflection class for a {@}property-write tag in a Docblock.
31653 */
31654final class PropertyWrite extends TagWithType implements Factory\StaticMethod
31655{
31656    /** @var string */
31657    protected $variableName;
31658    public function __construct(?string $variableName, ?Type $type = null, ?Description $description = null)
31659    {
31660        Assert::string($variableName);
31661        $this->name = 'property-write';
31662        $this->variableName = $variableName;
31663        $this->type = $type;
31664        $this->description = $description;
31665    }
31666    public static function create(string $body, ?TypeResolver $typeResolver = null, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null) : self
31667    {
31668        Assert::stringNotEmpty($body);
31669        Assert::notNull($typeResolver);
31670        Assert::notNull($descriptionFactory);
31671        [$firstPart, $body] = self::extractTypeFromBody($body);
31672        $type = null;
31673        $parts = Utils::pregSplit('/(\\s+)/Su', $body, 2, \PREG_SPLIT_DELIM_CAPTURE);
31674        $variableName = '';
31675        // if the first item that is encountered is not a variable; it is a type
31676        if ($firstPart && $firstPart[0] !== '$') {
31677            $type = $typeResolver->resolve($firstPart, $context);
31678        } else {
31679            // first part is not a type; we should prepend it to the parts array for further processing
31680            array_unshift($parts, $firstPart);
31681        }
31682        // if the next item starts with a $ it must be the variable name
31683        if (isset($parts[0]) && strpos($parts[0], '$') === 0) {
31684            $variableName = array_shift($parts);
31685            if ($type) {
31686                array_shift($parts);
31687            }
31688            Assert::notNull($variableName);
31689            $variableName = substr($variableName, 1);
31690        }
31691        $description = $descriptionFactory->create(implode('', $parts), $context);
31692        return new static($variableName, $type, $description);
31693    }
31694    /**
31695     * Returns the variable's name.
31696     */
31697    public function getVariableName() : ?string
31698    {
31699        return $this->variableName;
31700    }
31701    /**
31702     * Returns a string representation for this tag.
31703     */
31704    public function __toString() : string
31705    {
31706        if ($this->description) {
31707            $description = $this->description->render();
31708        } else {
31709            $description = '';
31710        }
31711        if ($this->variableName) {
31712            $variableName = '$' . $this->variableName;
31713        } else {
31714            $variableName = '';
31715        }
31716        $type = (string) $this->type;
31717        return $type . ($variableName !== '' ? ($type !== '' ? ' ' : '') . $variableName : '') . ($description !== '' ? ($type !== '' || $variableName !== '' ? ' ' : '') . $description : '');
31718    }
31719}
31720<?php
31721
31722declare (strict_types=1);
31723/**
31724 * This file is part of phpDocumentor.
31725 *
31726 * For the full copyright and license information, please view the LICENSE
31727 * file that was distributed with this source code.
31728 *
31729 * @link http://phpdoc.org
31730 */
31731namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags;
31732
31733use PHPUnit\phpDocumentor\Reflection\DocBlock\Description;
31734use PHPUnit\phpDocumentor\Reflection\DocBlock\DescriptionFactory;
31735use PHPUnit\phpDocumentor\Reflection\Types\Context as TypeContext;
31736use PHPUnit\Webmozart\Assert\Assert;
31737use function preg_match;
31738/**
31739 * Reflection class for a {@}version tag in a Docblock.
31740 */
31741final class Version extends BaseTag implements Factory\StaticMethod
31742{
31743    /** @var string */
31744    protected $name = 'version';
31745    /**
31746     * PCRE regular expression matching a version vector.
31747     * Assumes the "x" modifier.
31748     */
31749    public const REGEX_VECTOR = '(?:
31750        # Normal release vectors.
31751        \\d\\S*
31752        |
31753        # VCS version vectors. Per PHPCS, they are expected to
31754        # follow the form of the VCS name, followed by ":", followed
31755        # by the version vector itself.
31756        # By convention, popular VCSes like CVS, SVN and GIT use "$"
31757        # around the actual version vector.
31758        [^\\s\\:]+\\:\\s*\\$[^\\$]+\\$
31759    )';
31760    /** @var string|null The version vector. */
31761    private $version;
31762    public function __construct(?string $version = null, ?Description $description = null)
31763    {
31764        Assert::nullOrStringNotEmpty($version);
31765        $this->version = $version;
31766        $this->description = $description;
31767    }
31768    public static function create(?string $body, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null) : ?self
31769    {
31770        if (empty($body)) {
31771            return new static();
31772        }
31773        $matches = [];
31774        if (!preg_match('/^(' . self::REGEX_VECTOR . ')\\s*(.+)?$/sux', $body, $matches)) {
31775            return null;
31776        }
31777        $description = null;
31778        if ($descriptionFactory !== null) {
31779            $description = $descriptionFactory->create($matches[2] ?? '', $context);
31780        }
31781        return new static($matches[1], $description);
31782    }
31783    /**
31784     * Gets the version section of the tag.
31785     */
31786    public function getVersion() : ?string
31787    {
31788        return $this->version;
31789    }
31790    /**
31791     * Returns a string representation for this tag.
31792     */
31793    public function __toString() : string
31794    {
31795        if ($this->description) {
31796            $description = $this->description->render();
31797        } else {
31798            $description = '';
31799        }
31800        $version = (string) $this->version;
31801        return $version . ($description !== '' ? ($version !== '' ? ' ' : '') . $description : '');
31802    }
31803}
31804<?php
31805
31806declare (strict_types=1);
31807/**
31808 * This file is part of phpDocumentor.
31809 *
31810 * For the full copyright and license information, please view the LICENSE
31811 * file that was distributed with this source code.
31812 *
31813 * @link      http://phpdoc.org
31814 */
31815namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags;
31816
31817use PHPUnit\phpDocumentor\Reflection\DocBlock\Description;
31818use PHPUnit\phpDocumentor\Reflection\DocBlock\DescriptionFactory;
31819use PHPUnit\phpDocumentor\Reflection\Types\Context as TypeContext;
31820use PHPUnit\Webmozart\Assert\Assert;
31821use function preg_match;
31822/**
31823 * Reflection class for a {@}deprecated tag in a Docblock.
31824 */
31825final class Deprecated extends BaseTag implements Factory\StaticMethod
31826{
31827    /** @var string */
31828    protected $name = 'deprecated';
31829    /**
31830     * PCRE regular expression matching a version vector.
31831     * Assumes the "x" modifier.
31832     */
31833    public const REGEX_VECTOR = '(?:
31834        # Normal release vectors.
31835        \\d\\S*
31836        |
31837        # VCS version vectors. Per PHPCS, they are expected to
31838        # follow the form of the VCS name, followed by ":", followed
31839        # by the version vector itself.
31840        # By convention, popular VCSes like CVS, SVN and GIT use "$"
31841        # around the actual version vector.
31842        [^\\s\\:]+\\:\\s*\\$[^\\$]+\\$
31843    )';
31844    /** @var string|null The version vector. */
31845    private $version;
31846    public function __construct(?string $version = null, ?Description $description = null)
31847    {
31848        Assert::nullOrNotEmpty($version);
31849        $this->version = $version;
31850        $this->description = $description;
31851    }
31852    /**
31853     * @return static
31854     */
31855    public static function create(?string $body, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null) : self
31856    {
31857        if (empty($body)) {
31858            return new static();
31859        }
31860        $matches = [];
31861        if (!preg_match('/^(' . self::REGEX_VECTOR . ')\\s*(.+)?$/sux', $body, $matches)) {
31862            return new static(null, $descriptionFactory !== null ? $descriptionFactory->create($body, $context) : null);
31863        }
31864        Assert::notNull($descriptionFactory);
31865        return new static($matches[1], $descriptionFactory->create($matches[2] ?? '', $context));
31866    }
31867    /**
31868     * Gets the version section of the tag.
31869     */
31870    public function getVersion() : ?string
31871    {
31872        return $this->version;
31873    }
31874    /**
31875     * Returns a string representation for this tag.
31876     */
31877    public function __toString() : string
31878    {
31879        if ($this->description) {
31880            $description = $this->description->render();
31881        } else {
31882            $description = '';
31883        }
31884        $version = (string) $this->version;
31885        return $version . ($description !== '' ? ($version !== '' ? ' ' : '') . $description : '');
31886    }
31887}
31888<?php
31889
31890declare (strict_types=1);
31891/**
31892 * This file is part of phpDocumentor.
31893 *
31894 * For the full copyright and license information, please view the LICENSE
31895 * file that was distributed with this source code.
31896 *
31897 * @link http://phpdoc.org
31898 */
31899namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags;
31900
31901use PHPUnit\phpDocumentor\Reflection\DocBlock\Description;
31902use PHPUnit\phpDocumentor\Reflection\DocBlock\DescriptionFactory;
31903use PHPUnit\phpDocumentor\Reflection\Types\Context as TypeContext;
31904use PHPUnit\phpDocumentor\Reflection\Utils;
31905use PHPUnit\Webmozart\Assert\Assert;
31906/**
31907 * Reflection class for a {@}link tag in a Docblock.
31908 */
31909final class Link extends BaseTag implements Factory\StaticMethod
31910{
31911    /** @var string */
31912    protected $name = 'link';
31913    /** @var string */
31914    private $link;
31915    /**
31916     * Initializes a link to a URL.
31917     */
31918    public function __construct(string $link, ?Description $description = null)
31919    {
31920        $this->link = $link;
31921        $this->description = $description;
31922    }
31923    public static function create(string $body, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null) : self
31924    {
31925        Assert::notNull($descriptionFactory);
31926        $parts = Utils::pregSplit('/\\s+/Su', $body, 2);
31927        $description = isset($parts[1]) ? $descriptionFactory->create($parts[1], $context) : null;
31928        return new static($parts[0], $description);
31929    }
31930    /**
31931     * Gets the link
31932     */
31933    public function getLink() : string
31934    {
31935        return $this->link;
31936    }
31937    /**
31938     * Returns a string representation for this tag.
31939     */
31940    public function __toString() : string
31941    {
31942        if ($this->description) {
31943            $description = $this->description->render();
31944        } else {
31945            $description = '';
31946        }
31947        $link = (string) $this->link;
31948        return $link . ($description !== '' ? ($link !== '' ? ' ' : '') . $description : '');
31949    }
31950}
31951<?php
31952
31953declare (strict_types=1);
31954/**
31955 * This file is part of phpDocumentor.
31956 *
31957 * For the full copyright and license information, please view the LICENSE
31958 * file that was distributed with this source code.
31959 *
31960 * @link      http://phpdoc.org
31961 */
31962namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags;
31963
31964use PHPUnit\phpDocumentor\Reflection\DocBlock\Description;
31965use PHPUnit\phpDocumentor\Reflection\DocBlock\DescriptionFactory;
31966use PHPUnit\phpDocumentor\Reflection\Type;
31967use PHPUnit\phpDocumentor\Reflection\TypeResolver;
31968use PHPUnit\phpDocumentor\Reflection\Types\Context as TypeContext;
31969use PHPUnit\phpDocumentor\Reflection\Utils;
31970use PHPUnit\Webmozart\Assert\Assert;
31971use function array_shift;
31972use function array_unshift;
31973use function implode;
31974use function strpos;
31975use function substr;
31976use const PREG_SPLIT_DELIM_CAPTURE;
31977/**
31978 * Reflection class for a {@}var tag in a Docblock.
31979 */
31980final class Var_ extends TagWithType implements Factory\StaticMethod
31981{
31982    /** @var string|null */
31983    protected $variableName = '';
31984    public function __construct(?string $variableName, ?Type $type = null, ?Description $description = null)
31985    {
31986        Assert::string($variableName);
31987        $this->name = 'var';
31988        $this->variableName = $variableName;
31989        $this->type = $type;
31990        $this->description = $description;
31991    }
31992    public static function create(string $body, ?TypeResolver $typeResolver = null, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null) : self
31993    {
31994        Assert::stringNotEmpty($body);
31995        Assert::notNull($typeResolver);
31996        Assert::notNull($descriptionFactory);
31997        [$firstPart, $body] = self::extractTypeFromBody($body);
31998        $parts = Utils::pregSplit('/(\\s+)/Su', $body, 2, \PREG_SPLIT_DELIM_CAPTURE);
31999        $type = null;
32000        $variableName = '';
32001        // if the first item that is encountered is not a variable; it is a type
32002        if ($firstPart && $firstPart[0] !== '$') {
32003            $type = $typeResolver->resolve($firstPart, $context);
32004        } else {
32005            // first part is not a type; we should prepend it to the parts array for further processing
32006            array_unshift($parts, $firstPart);
32007        }
32008        // if the next item starts with a $ it must be the variable name
32009        if (isset($parts[0]) && strpos($parts[0], '$') === 0) {
32010            $variableName = array_shift($parts);
32011            if ($type) {
32012                array_shift($parts);
32013            }
32014            Assert::notNull($variableName);
32015            $variableName = substr($variableName, 1);
32016        }
32017        $description = $descriptionFactory->create(implode('', $parts), $context);
32018        return new static($variableName, $type, $description);
32019    }
32020    /**
32021     * Returns the variable's name.
32022     */
32023    public function getVariableName() : ?string
32024    {
32025        return $this->variableName;
32026    }
32027    /**
32028     * Returns a string representation for this tag.
32029     */
32030    public function __toString() : string
32031    {
32032        if ($this->description) {
32033            $description = $this->description->render();
32034        } else {
32035            $description = '';
32036        }
32037        if ($this->variableName) {
32038            $variableName = '$' . $this->variableName;
32039        } else {
32040            $variableName = '';
32041        }
32042        $type = (string) $this->type;
32043        return $type . ($variableName !== '' ? ($type !== '' ? ' ' : '') . $variableName : '') . ($description !== '' ? ($type !== '' || $variableName !== '' ? ' ' : '') . $description : '');
32044    }
32045}
32046<?php
32047
32048declare (strict_types=1);
32049/**
32050 * This file is part of phpDocumentor.
32051 *
32052 * For the full copyright and license information, please view the LICENSE
32053 * file that was distributed with this source code.
32054 *
32055 * @link      http://phpdoc.org
32056 */
32057namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags;
32058
32059use PHPUnit\phpDocumentor\Reflection\DocBlock\Description;
32060use PHPUnit\phpDocumentor\Reflection\DocBlock\DescriptionFactory;
32061use PHPUnit\phpDocumentor\Reflection\Type;
32062use PHPUnit\phpDocumentor\Reflection\TypeResolver;
32063use PHPUnit\phpDocumentor\Reflection\Types\Context as TypeContext;
32064use PHPUnit\Webmozart\Assert\Assert;
32065/**
32066 * Reflection class for a {@}return tag in a Docblock.
32067 */
32068final class Return_ extends TagWithType implements Factory\StaticMethod
32069{
32070    public function __construct(Type $type, ?Description $description = null)
32071    {
32072        $this->name = 'return';
32073        $this->type = $type;
32074        $this->description = $description;
32075    }
32076    public static function create(string $body, ?TypeResolver $typeResolver = null, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null) : self
32077    {
32078        Assert::notNull($typeResolver);
32079        Assert::notNull($descriptionFactory);
32080        [$type, $description] = self::extractTypeFromBody($body);
32081        $type = $typeResolver->resolve($type, $context);
32082        $description = $descriptionFactory->create($description, $context);
32083        return new static($type, $description);
32084    }
32085    public function __toString() : string
32086    {
32087        if ($this->description) {
32088            $description = $this->description->render();
32089        } else {
32090            $description = '';
32091        }
32092        $type = $this->type ? '' . $this->type : 'mixed';
32093        return $type . ($description !== '' ? ($type !== '' ? ' ' : '') . $description : '');
32094    }
32095}
32096<?php
32097
32098declare (strict_types=1);
32099/**
32100 * This file is part of phpDocumentor.
32101 *
32102 * For the full copyright and license information, please view the LICENSE
32103 * file that was distributed with this source code.
32104 *
32105 * @link http://phpdoc.org
32106 */
32107namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags;
32108
32109use PHPUnit\phpDocumentor\Reflection\DocBlock\Description;
32110use PHPUnit\phpDocumentor\Reflection\DocBlock\DescriptionFactory;
32111use PHPUnit\phpDocumentor\Reflection\Fqsen;
32112use PHPUnit\phpDocumentor\Reflection\FqsenResolver;
32113use PHPUnit\phpDocumentor\Reflection\Types\Context as TypeContext;
32114use PHPUnit\phpDocumentor\Reflection\Utils;
32115use PHPUnit\Webmozart\Assert\Assert;
32116use function array_key_exists;
32117use function explode;
32118/**
32119 * Reflection class for a @covers tag in a Docblock.
32120 */
32121final class Covers extends BaseTag implements Factory\StaticMethod
32122{
32123    /** @var string */
32124    protected $name = 'covers';
32125    /** @var Fqsen */
32126    private $refers;
32127    /**
32128     * Initializes this tag.
32129     */
32130    public function __construct(Fqsen $refers, ?Description $description = null)
32131    {
32132        $this->refers = $refers;
32133        $this->description = $description;
32134    }
32135    public static function create(string $body, ?DescriptionFactory $descriptionFactory = null, ?FqsenResolver $resolver = null, ?TypeContext $context = null) : self
32136    {
32137        Assert::stringNotEmpty($body);
32138        Assert::notNull($descriptionFactory);
32139        Assert::notNull($resolver);
32140        $parts = Utils::pregSplit('/\\s+/Su', $body, 2);
32141        return new static(self::resolveFqsen($parts[0], $resolver, $context), $descriptionFactory->create($parts[1] ?? '', $context));
32142    }
32143    private static function resolveFqsen(string $parts, ?FqsenResolver $fqsenResolver, ?TypeContext $context) : Fqsen
32144    {
32145        Assert::notNull($fqsenResolver);
32146        $fqsenParts = explode('::', $parts);
32147        $resolved = $fqsenResolver->resolve($fqsenParts[0], $context);
32148        if (!array_key_exists(1, $fqsenParts)) {
32149            return $resolved;
32150        }
32151        return new Fqsen($resolved . '::' . $fqsenParts[1]);
32152    }
32153    /**
32154     * Returns the structural element this tag refers to.
32155     */
32156    public function getReference() : Fqsen
32157    {
32158        return $this->refers;
32159    }
32160    /**
32161     * Returns a string representation of this tag.
32162     */
32163    public function __toString() : string
32164    {
32165        if ($this->description) {
32166            $description = $this->description->render();
32167        } else {
32168            $description = '';
32169        }
32170        $refers = (string) $this->refers;
32171        return $refers . ($description !== '' ? ($refers !== '' ? ' ' : '') . $description : '');
32172    }
32173}
32174<?php
32175
32176declare (strict_types=1);
32177/**
32178 * This file is part of phpDocumentor.
32179 *
32180 * For the full copyright and license information, please view the LICENSE
32181 * file that was distributed with this source code.
32182 *
32183 * @link      http://phpdoc.org
32184 */
32185namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags;
32186
32187use PHPUnit\phpDocumentor\Reflection\DocBlock\Tag;
32188use PHPUnit\Webmozart\Assert\Assert;
32189use function array_key_exists;
32190use function preg_match;
32191use function rawurlencode;
32192use function str_replace;
32193use function strpos;
32194use function trim;
32195/**
32196 * Reflection class for a {@}example tag in a Docblock.
32197 */
32198final class Example implements Tag, Factory\StaticMethod
32199{
32200    /** @var string Path to a file to use as an example. May also be an absolute URI. */
32201    private $filePath;
32202    /**
32203     * @var bool Whether the file path component represents an URI. This determines how the file portion
32204     *     appears at {@link getContent()}.
32205     */
32206    private $isURI;
32207    /** @var int */
32208    private $startingLine;
32209    /** @var int */
32210    private $lineCount;
32211    /** @var string|null */
32212    private $content;
32213    public function __construct(string $filePath, bool $isURI, int $startingLine, int $lineCount, ?string $content)
32214    {
32215        Assert::stringNotEmpty($filePath);
32216        Assert::greaterThanEq($startingLine, 1);
32217        Assert::greaterThanEq($lineCount, 0);
32218        $this->filePath = $filePath;
32219        $this->startingLine = $startingLine;
32220        $this->lineCount = $lineCount;
32221        if ($content !== null) {
32222            $this->content = trim($content);
32223        }
32224        $this->isURI = $isURI;
32225    }
32226    public function getContent() : string
32227    {
32228        if ($this->content === null || $this->content === '') {
32229            $filePath = $this->filePath;
32230            if ($this->isURI) {
32231                $filePath = $this->isUriRelative($this->filePath) ? str_replace('%2F', '/', rawurlencode($this->filePath)) : $this->filePath;
32232            }
32233            return trim($filePath);
32234        }
32235        return $this->content;
32236    }
32237    public function getDescription() : ?string
32238    {
32239        return $this->content;
32240    }
32241    public static function create(string $body) : ?Tag
32242    {
32243        // File component: File path in quotes or File URI / Source information
32244        if (!preg_match('/^\\s*(?:(\\"[^\\"]+\\")|(\\S+))(?:\\s+(.*))?$/sux', $body, $matches)) {
32245            return null;
32246        }
32247        $filePath = null;
32248        $fileUri = null;
32249        if ($matches[1] !== '') {
32250            $filePath = $matches[1];
32251        } else {
32252            $fileUri = $matches[2];
32253        }
32254        $startingLine = 1;
32255        $lineCount = 0;
32256        $description = null;
32257        if (array_key_exists(3, $matches)) {
32258            $description = $matches[3];
32259            // Starting line / Number of lines / Description
32260            if (preg_match('/^([1-9]\\d*)(?:\\s+((?1))\\s*)?(.*)$/sux', $matches[3], $contentMatches)) {
32261                $startingLine = (int) $contentMatches[1];
32262                if (isset($contentMatches[2])) {
32263                    $lineCount = (int) $contentMatches[2];
32264                }
32265                if (array_key_exists(3, $contentMatches)) {
32266                    $description = $contentMatches[3];
32267                }
32268            }
32269        }
32270        return new static($filePath ?? $fileUri ?? '', $fileUri !== null, $startingLine, $lineCount, $description);
32271    }
32272    /**
32273     * Returns the file path.
32274     *
32275     * @return string Path to a file to use as an example.
32276     *     May also be an absolute URI.
32277     */
32278    public function getFilePath() : string
32279    {
32280        return trim($this->filePath, '"');
32281    }
32282    /**
32283     * Returns a string representation for this tag.
32284     */
32285    public function __toString() : string
32286    {
32287        $filePath = (string) $this->filePath;
32288        $isDefaultLine = $this->startingLine === 1 && $this->lineCount === 0;
32289        $startingLine = !$isDefaultLine ? (string) $this->startingLine : '';
32290        $lineCount = !$isDefaultLine ? (string) $this->lineCount : '';
32291        $content = (string) $this->content;
32292        return $filePath . ($startingLine !== '' ? ($filePath !== '' ? ' ' : '') . $startingLine : '') . ($lineCount !== '' ? ($filePath !== '' || $startingLine !== '' ? ' ' : '') . $lineCount : '') . ($content !== '' ? ($filePath !== '' || $startingLine !== '' || $lineCount !== '' ? ' ' : '') . $content : '');
32293    }
32294    /**
32295     * Returns true if the provided URI is relative or contains a complete scheme (and thus is absolute).
32296     */
32297    private function isUriRelative(string $uri) : bool
32298    {
32299        return strpos($uri, ':') === \false;
32300    }
32301    public function getStartingLine() : int
32302    {
32303        return $this->startingLine;
32304    }
32305    public function getLineCount() : int
32306    {
32307        return $this->lineCount;
32308    }
32309    public function getName() : string
32310    {
32311        return 'example';
32312    }
32313    public function render(?Formatter $formatter = null) : string
32314    {
32315        if ($formatter === null) {
32316            $formatter = new Formatter\PassthroughFormatter();
32317        }
32318        return $formatter->format($this);
32319    }
32320}
32321<?php
32322
32323declare (strict_types=1);
32324/**
32325 * This file is part of phpDocumentor.
32326 *
32327 * For the full copyright and license information, please view the LICENSE
32328 * file that was distributed with this source code.
32329 *
32330 * @link      http://phpdoc.org
32331 */
32332namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags;
32333
32334use PHPUnit\phpDocumentor\Reflection\DocBlock\Description;
32335use PHPUnit\phpDocumentor\Reflection\DocBlock\DescriptionFactory;
32336use PHPUnit\phpDocumentor\Reflection\Type;
32337use PHPUnit\phpDocumentor\Reflection\TypeResolver;
32338use PHPUnit\phpDocumentor\Reflection\Types\Context as TypeContext;
32339use PHPUnit\phpDocumentor\Reflection\Utils;
32340use PHPUnit\Webmozart\Assert\Assert;
32341use function array_shift;
32342use function array_unshift;
32343use function implode;
32344use function strpos;
32345use function substr;
32346use const PREG_SPLIT_DELIM_CAPTURE;
32347/**
32348 * Reflection class for the {@}param tag in a Docblock.
32349 */
32350final class Param extends TagWithType implements Factory\StaticMethod
32351{
32352    /** @var string|null */
32353    private $variableName;
32354    /** @var bool determines whether this is a variadic argument */
32355    private $isVariadic;
32356    /** @var bool determines whether this is passed by reference */
32357    private $isReference;
32358    public function __construct(?string $variableName, ?Type $type = null, bool $isVariadic = \false, ?Description $description = null, bool $isReference = \false)
32359    {
32360        $this->name = 'param';
32361        $this->variableName = $variableName;
32362        $this->type = $type;
32363        $this->isVariadic = $isVariadic;
32364        $this->description = $description;
32365        $this->isReference = $isReference;
32366    }
32367    public static function create(string $body, ?TypeResolver $typeResolver = null, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null) : self
32368    {
32369        Assert::stringNotEmpty($body);
32370        Assert::notNull($typeResolver);
32371        Assert::notNull($descriptionFactory);
32372        [$firstPart, $body] = self::extractTypeFromBody($body);
32373        $type = null;
32374        $parts = Utils::pregSplit('/(\\s+)/Su', $body, 2, \PREG_SPLIT_DELIM_CAPTURE);
32375        $variableName = '';
32376        $isVariadic = \false;
32377        $isReference = \false;
32378        // if the first item that is encountered is not a variable; it is a type
32379        if ($firstPart && !self::strStartsWithVariable($firstPart)) {
32380            $type = $typeResolver->resolve($firstPart, $context);
32381        } else {
32382            // first part is not a type; we should prepend it to the parts array for further processing
32383            array_unshift($parts, $firstPart);
32384        }
32385        // if the next item starts with a $ or ...$ or &$ or &...$ it must be the variable name
32386        if (isset($parts[0]) && self::strStartsWithVariable($parts[0])) {
32387            $variableName = array_shift($parts);
32388            if ($type) {
32389                array_shift($parts);
32390            }
32391            Assert::notNull($variableName);
32392            if (strpos($variableName, '$') === 0) {
32393                $variableName = substr($variableName, 1);
32394            } elseif (strpos($variableName, '&$') === 0) {
32395                $isReference = \true;
32396                $variableName = substr($variableName, 2);
32397            } elseif (strpos($variableName, '...$') === 0) {
32398                $isVariadic = \true;
32399                $variableName = substr($variableName, 4);
32400            } elseif (strpos($variableName, '&...$') === 0) {
32401                $isVariadic = \true;
32402                $isReference = \true;
32403                $variableName = substr($variableName, 5);
32404            }
32405        }
32406        $description = $descriptionFactory->create(implode('', $parts), $context);
32407        return new static($variableName, $type, $isVariadic, $description, $isReference);
32408    }
32409    /**
32410     * Returns the variable's name.
32411     */
32412    public function getVariableName() : ?string
32413    {
32414        return $this->variableName;
32415    }
32416    /**
32417     * Returns whether this tag is variadic.
32418     */
32419    public function isVariadic() : bool
32420    {
32421        return $this->isVariadic;
32422    }
32423    /**
32424     * Returns whether this tag is passed by reference.
32425     */
32426    public function isReference() : bool
32427    {
32428        return $this->isReference;
32429    }
32430    /**
32431     * Returns a string representation for this tag.
32432     */
32433    public function __toString() : string
32434    {
32435        if ($this->description) {
32436            $description = $this->description->render();
32437        } else {
32438            $description = '';
32439        }
32440        $variableName = '';
32441        if ($this->variableName) {
32442            $variableName .= ($this->isReference ? '&' : '') . ($this->isVariadic ? '...' : '');
32443            $variableName .= '$' . $this->variableName;
32444        }
32445        $type = (string) $this->type;
32446        return $type . ($variableName !== '' ? ($type !== '' ? ' ' : '') . $variableName : '') . ($description !== '' ? ($type !== '' || $variableName !== '' ? ' ' : '') . $description : '');
32447    }
32448    private static function strStartsWithVariable(string $str) : bool
32449    {
32450        return strpos($str, '$') === 0 || strpos($str, '...$') === 0 || strpos($str, '&$') === 0 || strpos($str, '&...$') === 0;
32451    }
32452}
32453<?php
32454
32455declare (strict_types=1);
32456/**
32457 * This file is part of phpDocumentor.
32458 *
32459 * For the full copyright and license information, please view the LICENSE
32460 * file that was distributed with this source code.
32461 *
32462 * @link http://phpdoc.org
32463 */
32464namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags;
32465
32466use PHPUnit\phpDocumentor\Reflection\DocBlock\Description;
32467use PHPUnit\phpDocumentor\Reflection\DocBlock\DescriptionFactory;
32468use PHPUnit\phpDocumentor\Reflection\Fqsen;
32469use PHPUnit\phpDocumentor\Reflection\FqsenResolver;
32470use PHPUnit\phpDocumentor\Reflection\Types\Context as TypeContext;
32471use PHPUnit\phpDocumentor\Reflection\Utils;
32472use PHPUnit\Webmozart\Assert\Assert;
32473use function array_key_exists;
32474use function explode;
32475/**
32476 * Reflection class for a {@}uses tag in a Docblock.
32477 */
32478final class Uses extends BaseTag implements Factory\StaticMethod
32479{
32480    /** @var string */
32481    protected $name = 'uses';
32482    /** @var Fqsen */
32483    protected $refers;
32484    /**
32485     * Initializes this tag.
32486     */
32487    public function __construct(Fqsen $refers, ?Description $description = null)
32488    {
32489        $this->refers = $refers;
32490        $this->description = $description;
32491    }
32492    public static function create(string $body, ?FqsenResolver $resolver = null, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null) : self
32493    {
32494        Assert::notNull($resolver);
32495        Assert::notNull($descriptionFactory);
32496        $parts = Utils::pregSplit('/\\s+/Su', $body, 2);
32497        return new static(self::resolveFqsen($parts[0], $resolver, $context), $descriptionFactory->create($parts[1] ?? '', $context));
32498    }
32499    private static function resolveFqsen(string $parts, ?FqsenResolver $fqsenResolver, ?TypeContext $context) : Fqsen
32500    {
32501        Assert::notNull($fqsenResolver);
32502        $fqsenParts = explode('::', $parts);
32503        $resolved = $fqsenResolver->resolve($fqsenParts[0], $context);
32504        if (!array_key_exists(1, $fqsenParts)) {
32505            return $resolved;
32506        }
32507        return new Fqsen($resolved . '::' . $fqsenParts[1]);
32508    }
32509    /**
32510     * Returns the structural element this tag refers to.
32511     */
32512    public function getReference() : Fqsen
32513    {
32514        return $this->refers;
32515    }
32516    /**
32517     * Returns a string representation of this tag.
32518     */
32519    public function __toString() : string
32520    {
32521        if ($this->description) {
32522            $description = $this->description->render();
32523        } else {
32524            $description = '';
32525        }
32526        $refers = (string) $this->refers;
32527        return $refers . ($description !== '' ? ($refers !== '' ? ' ' : '') . $description : '');
32528    }
32529}
32530<?php
32531
32532declare (strict_types=1);
32533/**
32534 * This file is part of phpDocumentor.
32535 *
32536 * For the full copyright and license information, please view the LICENSE
32537 * file that was distributed with this source code.
32538 *
32539 * @link      http://phpdoc.org
32540 */
32541namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags;
32542
32543use PHPUnit\phpDocumentor\Reflection\DocBlock\Description;
32544use PHPUnit\phpDocumentor\Reflection\DocBlock\DescriptionFactory;
32545use PHPUnit\phpDocumentor\Reflection\Type;
32546use PHPUnit\phpDocumentor\Reflection\TypeResolver;
32547use PHPUnit\phpDocumentor\Reflection\Types\Context as TypeContext;
32548use PHPUnit\Webmozart\Assert\Assert;
32549/**
32550 * Reflection class for a {@}throws tag in a Docblock.
32551 */
32552final class Throws extends TagWithType implements Factory\StaticMethod
32553{
32554    public function __construct(Type $type, ?Description $description = null)
32555    {
32556        $this->name = 'throws';
32557        $this->type = $type;
32558        $this->description = $description;
32559    }
32560    public static function create(string $body, ?TypeResolver $typeResolver = null, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null) : self
32561    {
32562        Assert::notNull($typeResolver);
32563        Assert::notNull($descriptionFactory);
32564        [$type, $description] = self::extractTypeFromBody($body);
32565        $type = $typeResolver->resolve($type, $context);
32566        $description = $descriptionFactory->create($description, $context);
32567        return new static($type, $description);
32568    }
32569    public function __toString() : string
32570    {
32571        if ($this->description) {
32572            $description = $this->description->render();
32573        } else {
32574            $description = '';
32575        }
32576        $type = (string) $this->type;
32577        return $type . ($description !== '' ? ($type !== '' ? ' ' : '') . $description : '');
32578    }
32579}
32580<?php
32581
32582declare (strict_types=1);
32583/**
32584 * This file is part of phpDocumentor.
32585 *
32586 * For the full copyright and license information, please view the LICENSE
32587 * file that was distributed with this source code.
32588 *
32589 * @link      http://phpdoc.org
32590 */
32591namespace PHPUnit\phpDocumentor\Reflection\DocBlock\Tags;
32592
32593use PHPUnit\phpDocumentor\Reflection\DocBlock\Description;
32594use PHPUnit\phpDocumentor\Reflection\DocBlock\DescriptionFactory;
32595use PHPUnit\phpDocumentor\Reflection\Type;
32596use PHPUnit\phpDocumentor\Reflection\TypeResolver;
32597use PHPUnit\phpDocumentor\Reflection\Types\Context as TypeContext;
32598use PHPUnit\phpDocumentor\Reflection\Utils;
32599use PHPUnit\Webmozart\Assert\Assert;
32600use function array_shift;
32601use function array_unshift;
32602use function implode;
32603use function strpos;
32604use function substr;
32605use const PREG_SPLIT_DELIM_CAPTURE;
32606/**
32607 * Reflection class for a {@}property tag in a Docblock.
32608 */
32609final class Property extends TagWithType implements Factory\StaticMethod
32610{
32611    /** @var string|null */
32612    protected $variableName;
32613    public function __construct(?string $variableName, ?Type $type = null, ?Description $description = null)
32614    {
32615        Assert::string($variableName);
32616        $this->name = 'property';
32617        $this->variableName = $variableName;
32618        $this->type = $type;
32619        $this->description = $description;
32620    }
32621    public static function create(string $body, ?TypeResolver $typeResolver = null, ?DescriptionFactory $descriptionFactory = null, ?TypeContext $context = null) : self
32622    {
32623        Assert::stringNotEmpty($body);
32624        Assert::notNull($typeResolver);
32625        Assert::notNull($descriptionFactory);
32626        [$firstPart, $body] = self::extractTypeFromBody($body);
32627        $type = null;
32628        $parts = Utils::pregSplit('/(\\s+)/Su', $body, 2, \PREG_SPLIT_DELIM_CAPTURE);
32629        $variableName = '';
32630        // if the first item that is encountered is not a variable; it is a type
32631        if ($firstPart && $firstPart[0] !== '$') {
32632            $type = $typeResolver->resolve($firstPart, $context);
32633        } else {
32634            // first part is not a type; we should prepend it to the parts array for further processing
32635            array_unshift($parts, $firstPart);
32636        }
32637        // if the next item starts with a $ it must be the variable name
32638        if (isset($parts[0]) && strpos($parts[0], '$') === 0) {
32639            $variableName = array_shift($parts);
32640            if ($type) {
32641                array_shift($parts);
32642            }
32643            Assert::notNull($variableName);
32644            $variableName = substr($variableName, 1);
32645        }
32646        $description = $descriptionFactory->create(implode('', $parts), $context);
32647        return new static($variableName, $type, $description);
32648    }
32649    /**
32650     * Returns the variable's name.
32651     */
32652    public function getVariableName() : ?string
32653    {
32654        return $this->variableName;
32655    }
32656    /**
32657     * Returns a string representation for this tag.
32658     */
32659    public function __toString() : string
32660    {
32661        if ($this->description) {
32662            $description = $this->description->render();
32663        } else {
32664            $description = '';
32665        }
32666        if ($this->variableName) {
32667            $variableName = '$' . $this->variableName;
32668        } else {
32669            $variableName = '';
32670        }
32671        $type = (string) $this->type;
32672        return $type . ($variableName !== '' ? ($type !== '' ? ' ' : '') . $variableName : '') . ($description !== '' ? ($type !== '' || $variableName !== '' ? ' ' : '') . $description : '');
32673    }
32674}
32675<?php
32676
32677declare (strict_types=1);
32678/**
32679 * This file is part of phpDocumentor.
32680 *
32681 * For the full copyright and license information, please view the LICENSE
32682 * file that was distributed with this source code.
32683 *
32684 * @link      http://phpdoc.org
32685 */
32686namespace PHPUnit\phpDocumentor\Reflection\DocBlock;
32687
32688use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Formatter;
32689interface Tag
32690{
32691    public function getName() : string;
32692    /**
32693     * @return Tag|mixed Class that implements Tag
32694     *
32695     * @phpstan-return ?Tag
32696     */
32697    public static function create(string $body);
32698    public function render(?Formatter $formatter = null) : string;
32699    public function __toString() : string;
32700}
32701<?php
32702
32703declare (strict_types=1);
32704/**
32705 * This file is part of phpDocumentor.
32706 *
32707 * For the full copyright and license information, please view the LICENSE
32708 * file that was distributed with this source code.
32709 *
32710 * @link      http://phpdoc.org
32711 */
32712namespace PHPUnit\phpDocumentor\Reflection\DocBlock;
32713
32714use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Example;
32715use function array_slice;
32716use function file;
32717use function getcwd;
32718use function implode;
32719use function is_readable;
32720use function rtrim;
32721use function sprintf;
32722use function trim;
32723use const DIRECTORY_SEPARATOR;
32724/**
32725 * Class used to find an example file's location based on a given ExampleDescriptor.
32726 */
32727class ExampleFinder
32728{
32729    /** @var string */
32730    private $sourceDirectory = '';
32731    /** @var string[] */
32732    private $exampleDirectories = [];
32733    /**
32734     * Attempts to find the example contents for the given descriptor.
32735     */
32736    public function find(Example $example) : string
32737    {
32738        $filename = $example->getFilePath();
32739        $file = $this->getExampleFileContents($filename);
32740        if (!$file) {
32741            return sprintf('** File not found : %s **', $filename);
32742        }
32743        return implode('', array_slice($file, $example->getStartingLine() - 1, $example->getLineCount()));
32744    }
32745    /**
32746     * Registers the project's root directory where an 'examples' folder can be expected.
32747     */
32748    public function setSourceDirectory(string $directory = '') : void
32749    {
32750        $this->sourceDirectory = $directory;
32751    }
32752    /**
32753     * Returns the project's root directory where an 'examples' folder can be expected.
32754     */
32755    public function getSourceDirectory() : string
32756    {
32757        return $this->sourceDirectory;
32758    }
32759    /**
32760     * Registers a series of directories that may contain examples.
32761     *
32762     * @param string[] $directories
32763     */
32764    public function setExampleDirectories(array $directories) : void
32765    {
32766        $this->exampleDirectories = $directories;
32767    }
32768    /**
32769     * Returns a series of directories that may contain examples.
32770     *
32771     * @return string[]
32772     */
32773    public function getExampleDirectories() : array
32774    {
32775        return $this->exampleDirectories;
32776    }
32777    /**
32778     * Attempts to find the requested example file and returns its contents or null if no file was found.
32779     *
32780     * This method will try several methods in search of the given example file, the first one it encounters is
32781     * returned:
32782     *
32783     * 1. Iterates through all examples folders for the given filename
32784     * 2. Checks the source folder for the given filename
32785     * 3. Checks the 'examples' folder in the current working directory for examples
32786     * 4. Checks the path relative to the current working directory for the given filename
32787     *
32788     * @return string[] all lines of the example file
32789     */
32790    private function getExampleFileContents(string $filename) : ?array
32791    {
32792        $normalizedPath = null;
32793        foreach ($this->exampleDirectories as $directory) {
32794            $exampleFileFromConfig = $this->constructExamplePath($directory, $filename);
32795            if (is_readable($exampleFileFromConfig)) {
32796                $normalizedPath = $exampleFileFromConfig;
32797                break;
32798            }
32799        }
32800        if (!$normalizedPath) {
32801            if (is_readable($this->getExamplePathFromSource($filename))) {
32802                $normalizedPath = $this->getExamplePathFromSource($filename);
32803            } elseif (is_readable($this->getExamplePathFromExampleDirectory($filename))) {
32804                $normalizedPath = $this->getExamplePathFromExampleDirectory($filename);
32805            } elseif (is_readable($filename)) {
32806                $normalizedPath = $filename;
32807            }
32808        }
32809        $lines = $normalizedPath && is_readable($normalizedPath) ? file($normalizedPath) : \false;
32810        return $lines !== \false ? $lines : null;
32811    }
32812    /**
32813     * Get example filepath based on the example directory inside your project.
32814     */
32815    private function getExamplePathFromExampleDirectory(string $file) : string
32816    {
32817        return getcwd() . \DIRECTORY_SEPARATOR . 'examples' . \DIRECTORY_SEPARATOR . $file;
32818    }
32819    /**
32820     * Returns a path to the example file in the given directory..
32821     */
32822    private function constructExamplePath(string $directory, string $file) : string
32823    {
32824        return rtrim($directory, '\\/') . \DIRECTORY_SEPARATOR . $file;
32825    }
32826    /**
32827     * Get example filepath based on sourcecode.
32828     */
32829    private function getExamplePathFromSource(string $file) : string
32830    {
32831        return sprintf('%s%s%s', trim($this->getSourceDirectory(), '\\/'), \DIRECTORY_SEPARATOR, trim($file, '"'));
32832    }
32833}
32834<?php
32835
32836declare (strict_types=1);
32837/**
32838 * This file is part of phpDocumentor.
32839 *
32840 * For the full copyright and license information, please view the LICENSE
32841 * file that was distributed with this source code.
32842 *
32843 * @link      http://phpdoc.org
32844 */
32845namespace PHPUnit\phpDocumentor\Reflection\DocBlock;
32846
32847use PHPUnit\phpDocumentor\Reflection\Types\Context as TypeContext;
32848use PHPUnit\phpDocumentor\Reflection\Utils;
32849use function count;
32850use function explode;
32851use function implode;
32852use function ltrim;
32853use function min;
32854use function str_replace;
32855use function strlen;
32856use function strpos;
32857use function substr;
32858use function trim;
32859use const PREG_SPLIT_DELIM_CAPTURE;
32860/**
32861 * Creates a new Description object given a body of text.
32862 *
32863 * Descriptions in phpDocumentor are somewhat complex entities as they can contain one or more tags inside their
32864 * body that can be replaced with a readable output. The replacing is done by passing a Formatter object to the
32865 * Description object's `render` method.
32866 *
32867 * In addition to the above does a Description support two types of escape sequences:
32868 *
32869 * 1. `{@}` to escape the `@` character to prevent it from being interpreted as part of a tag, i.e. `{{@}link}`
32870 * 2. `{}` to escape the `}` character, this can be used if you want to use the `}` character in the description
32871 *    of an inline tag.
32872 *
32873 * If a body consists of multiple lines then this factory will also remove any superfluous whitespace at the beginning
32874 * of each line while maintaining any indentation that is used. This will prevent formatting parsers from tripping
32875 * over unexpected spaces as can be observed with tag descriptions.
32876 */
32877class DescriptionFactory
32878{
32879    /** @var TagFactory */
32880    private $tagFactory;
32881    /**
32882     * Initializes this factory with the means to construct (inline) tags.
32883     */
32884    public function __construct(TagFactory $tagFactory)
32885    {
32886        $this->tagFactory = $tagFactory;
32887    }
32888    /**
32889     * Returns the parsed text of this description.
32890     */
32891    public function create(string $contents, ?TypeContext $context = null) : Description
32892    {
32893        $tokens = $this->lex($contents);
32894        $count = count($tokens);
32895        $tagCount = 0;
32896        $tags = [];
32897        for ($i = 1; $i < $count; $i += 2) {
32898            $tags[] = $this->tagFactory->create($tokens[$i], $context);
32899            $tokens[$i] = '%' . ++$tagCount . '$s';
32900        }
32901        //In order to allow "literal" inline tags, the otherwise invalid
32902        //sequence "{@}" is changed to "@", and "{}" is changed to "}".
32903        //"%" is escaped to "%%" because of vsprintf.
32904        //See unit tests for examples.
32905        for ($i = 0; $i < $count; $i += 2) {
32906            $tokens[$i] = str_replace(['{@}', '{}', '%'], ['@', '}', '%%'], $tokens[$i]);
32907        }
32908        return new Description(implode('', $tokens), $tags);
32909    }
32910    /**
32911     * Strips the contents from superfluous whitespace and splits the description into a series of tokens.
32912     *
32913     * @return string[] A series of tokens of which the description text is composed.
32914     */
32915    private function lex(string $contents) : array
32916    {
32917        $contents = $this->removeSuperfluousStartingWhitespace($contents);
32918        // performance optimalization; if there is no inline tag, don't bother splitting it up.
32919        if (strpos($contents, '{@') === \false) {
32920            return [$contents];
32921        }
32922        return Utils::pregSplit('/\\{
32923                # "{@}" is not a valid inline tag. This ensures that we do not treat it as one, but treat it literally.
32924                (?!@\\})
32925                # We want to capture the whole tag line, but without the inline tag delimiters.
32926                (\\@
32927                    # Match everything up to the next delimiter.
32928                    [^{}]*
32929                    # Nested inline tag content should not be captured, or it will appear in the result separately.
32930                    (?:
32931                        # Match nested inline tags.
32932                        (?:
32933                            # Because we did not catch the tag delimiters earlier, we must be explicit with them here.
32934                            # Notice that this also matches "{}", as a way to later introduce it as an escape sequence.
32935                            \\{(?1)?\\}
32936                            |
32937                            # Make sure we match hanging "{".
32938                            \\{
32939                        )
32940                        # Match content after the nested inline tag.
32941                        [^{}]*
32942                    )* # If there are more inline tags, match them as well. We use "*" since there may not be any
32943                       # nested inline tags.
32944                )
32945            \\}/Sux', $contents, 0, \PREG_SPLIT_DELIM_CAPTURE);
32946    }
32947    /**
32948     * Removes the superfluous from a multi-line description.
32949     *
32950     * When a description has more than one line then it can happen that the second and subsequent lines have an
32951     * additional indentation. This is commonly in use with tags like this:
32952     *
32953     *     {@}since 1.1.0 This is an example
32954     *         description where we have an
32955     *         indentation in the second and
32956     *         subsequent lines.
32957     *
32958     * If we do not normalize the indentation then we have superfluous whitespace on the second and subsequent
32959     * lines and this may cause rendering issues when, for example, using a Markdown converter.
32960     */
32961    private function removeSuperfluousStartingWhitespace(string $contents) : string
32962    {
32963        $lines = explode("\n", $contents);
32964        // if there is only one line then we don't have lines with superfluous whitespace and
32965        // can use the contents as-is
32966        if (count($lines) <= 1) {
32967            return $contents;
32968        }
32969        // determine how many whitespace characters need to be stripped
32970        $startingSpaceCount = 9999999;
32971        for ($i = 1, $iMax = count($lines); $i < $iMax; ++$i) {
32972            // lines with a no length do not count as they are not indented at all
32973            if (trim($lines[$i]) === '') {
32974                continue;
32975            }
32976            // determine the number of prefixing spaces by checking the difference in line length before and after
32977            // an ltrim
32978            $startingSpaceCount = min($startingSpaceCount, strlen($lines[$i]) - strlen(ltrim($lines[$i])));
32979        }
32980        // strip the number of spaces from each line
32981        if ($startingSpaceCount > 0) {
32982            for ($i = 1, $iMax = count($lines); $i < $iMax; ++$i) {
32983                $lines[$i] = substr($lines[$i], $startingSpaceCount);
32984            }
32985        }
32986        return implode("\n", $lines);
32987    }
32988}
32989<?php
32990
32991declare (strict_types=1);
32992/**
32993 * This file is part of phpDocumentor.
32994 *
32995 * For the full copyright and license information, please view the LICENSE
32996 * file that was distributed with this source code.
32997 *
32998 * @link      http://phpdoc.org
32999 */
33000namespace PHPUnit\phpDocumentor\Reflection\DocBlock;
33001
33002use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Formatter;
33003use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter;
33004use function vsprintf;
33005/**
33006 * Object representing to description for a DocBlock.
33007 *
33008 * A Description object can consist of plain text but can also include tags. A Description Formatter can then combine
33009 * a body template with sprintf-style placeholders together with formatted tags in order to reconstitute a complete
33010 * description text using the format that you would prefer.
33011 *
33012 * Because parsing a Description text can be a verbose process this is handled by the {@see DescriptionFactory}. It is
33013 * thus recommended to use that to create a Description object, like this:
33014 *
33015 *     $description = $descriptionFactory->create('This is a {@see Description}', $context);
33016 *
33017 * The description factory will interpret the given body and create a body template and list of tags from them, and pass
33018 * that onto the constructor if this class.
33019 *
33020 * > The $context variable is a class of type {@see \phpDocumentor\Reflection\Types\Context} and contains the namespace
33021 * > and the namespace aliases that apply to this DocBlock. These are used by the Factory to resolve and expand partial
33022 * > type names and FQSENs.
33023 *
33024 * If you do not want to use the DescriptionFactory you can pass a body template and tag listing like this:
33025 *
33026 *     $description = new Description(
33027 *         'This is a %1$s',
33028 *         [ new See(new Fqsen('\phpDocumentor\Reflection\DocBlock\Description')) ]
33029 *     );
33030 *
33031 * It is generally recommended to use the Factory as that will also apply escaping rules, while the Description object
33032 * is mainly responsible for rendering.
33033 *
33034 * @see DescriptionFactory to create a new Description.
33035 * @see Description\Formatter for the formatting of the body and tags.
33036 */
33037class Description
33038{
33039    /** @var string */
33040    private $bodyTemplate;
33041    /** @var Tag[] */
33042    private $tags;
33043    /**
33044     * Initializes a Description with its body (template) and a listing of the tags used in the body template.
33045     *
33046     * @param Tag[] $tags
33047     */
33048    public function __construct(string $bodyTemplate, array $tags = [])
33049    {
33050        $this->bodyTemplate = $bodyTemplate;
33051        $this->tags = $tags;
33052    }
33053    /**
33054     * Returns the body template.
33055     */
33056    public function getBodyTemplate() : string
33057    {
33058        return $this->bodyTemplate;
33059    }
33060    /**
33061     * Returns the tags for this DocBlock.
33062     *
33063     * @return Tag[]
33064     */
33065    public function getTags() : array
33066    {
33067        return $this->tags;
33068    }
33069    /**
33070     * Renders this description as a string where the provided formatter will format the tags in the expected string
33071     * format.
33072     */
33073    public function render(?Formatter $formatter = null) : string
33074    {
33075        if ($formatter === null) {
33076            $formatter = new PassthroughFormatter();
33077        }
33078        $tags = [];
33079        foreach ($this->tags as $tag) {
33080            $tags[] = '{' . $formatter->format($tag) . '}';
33081        }
33082        return vsprintf($this->bodyTemplate, $tags);
33083    }
33084    /**
33085     * Returns a plain string representation of this description.
33086     */
33087    public function __toString() : string
33088    {
33089        return $this->render();
33090    }
33091}
33092<?php
33093
33094declare (strict_types=1);
33095/**
33096 * This file is part of phpDocumentor.
33097 *
33098 * For the full copyright and license information, please view the LICENSE
33099 * file that was distributed with this source code.
33100 *
33101 * @link      http://phpdoc.org
33102 */
33103namespace PHPUnit\phpDocumentor\Reflection;
33104
33105use InvalidArgumentException;
33106use LogicException;
33107use PHPUnit\phpDocumentor\Reflection\DocBlock\DescriptionFactory;
33108use PHPUnit\phpDocumentor\Reflection\DocBlock\StandardTagFactory;
33109use PHPUnit\phpDocumentor\Reflection\DocBlock\Tag;
33110use PHPUnit\phpDocumentor\Reflection\DocBlock\TagFactory;
33111use PHPUnit\Webmozart\Assert\Assert;
33112use function array_shift;
33113use function count;
33114use function explode;
33115use function is_object;
33116use function method_exists;
33117use function preg_match;
33118use function preg_replace;
33119use function str_replace;
33120use function strpos;
33121use function substr;
33122use function trim;
33123final class DocBlockFactory implements DocBlockFactoryInterface
33124{
33125    /** @var DocBlock\DescriptionFactory */
33126    private $descriptionFactory;
33127    /** @var DocBlock\TagFactory */
33128    private $tagFactory;
33129    /**
33130     * Initializes this factory with the required subcontractors.
33131     */
33132    public function __construct(DescriptionFactory $descriptionFactory, TagFactory $tagFactory)
33133    {
33134        $this->descriptionFactory = $descriptionFactory;
33135        $this->tagFactory = $tagFactory;
33136    }
33137    /**
33138     * Factory method for easy instantiation.
33139     *
33140     * @param array<string, class-string<Tag>> $additionalTags
33141     */
33142    public static function createInstance(array $additionalTags = []) : self
33143    {
33144        $fqsenResolver = new FqsenResolver();
33145        $tagFactory = new StandardTagFactory($fqsenResolver);
33146        $descriptionFactory = new DescriptionFactory($tagFactory);
33147        $tagFactory->addService($descriptionFactory);
33148        $tagFactory->addService(new TypeResolver($fqsenResolver));
33149        $docBlockFactory = new self($descriptionFactory, $tagFactory);
33150        foreach ($additionalTags as $tagName => $tagHandler) {
33151            $docBlockFactory->registerTagHandler($tagName, $tagHandler);
33152        }
33153        return $docBlockFactory;
33154    }
33155    /**
33156     * @param object|string $docblock A string containing the DocBlock to parse or an object supporting the
33157     *                                getDocComment method (such as a ReflectionClass object).
33158     */
33159    public function create($docblock, ?Types\Context $context = null, ?Location $location = null) : DocBlock
33160    {
33161        if (is_object($docblock)) {
33162            if (!method_exists($docblock, 'getDocComment')) {
33163                $exceptionMessage = 'Invalid object passed; the given object must support the getDocComment method';
33164                throw new InvalidArgumentException($exceptionMessage);
33165            }
33166            $docblock = $docblock->getDocComment();
33167            Assert::string($docblock);
33168        }
33169        Assert::stringNotEmpty($docblock);
33170        if ($context === null) {
33171            $context = new Types\Context('');
33172        }
33173        $parts = $this->splitDocBlock($this->stripDocComment($docblock));
33174        [$templateMarker, $summary, $description, $tags] = $parts;
33175        return new DocBlock($summary, $description ? $this->descriptionFactory->create($description, $context) : null, $this->parseTagBlock($tags, $context), $context, $location, $templateMarker === '#@+', $templateMarker === '#@-');
33176    }
33177    /**
33178     * @param class-string<Tag> $handler
33179     */
33180    public function registerTagHandler(string $tagName, string $handler) : void
33181    {
33182        $this->tagFactory->registerTagHandler($tagName, $handler);
33183    }
33184    /**
33185     * Strips the asterisks from the DocBlock comment.
33186     *
33187     * @param string $comment String containing the comment text.
33188     */
33189    private function stripDocComment(string $comment) : string
33190    {
33191        $comment = preg_replace('#[ \\t]*(?:\\/\\*\\*|\\*\\/|\\*)?[ \\t]?(.*)?#u', '$1', $comment);
33192        Assert::string($comment);
33193        $comment = trim($comment);
33194        // reg ex above is not able to remove */ from a single line docblock
33195        if (substr($comment, -2) === '*/') {
33196            $comment = trim(substr($comment, 0, -2));
33197        }
33198        return str_replace(["\r\n", "\r"], "\n", $comment);
33199    }
33200    // phpcs:disable
33201    /**
33202     * Splits the DocBlock into a template marker, summary, description and block of tags.
33203     *
33204     * @param string $comment Comment to split into the sub-parts.
33205     *
33206     * @return string[] containing the template marker (if any), summary, description and a string containing the tags.
33207     *
33208     * @author Mike van Riel <me@mikevanriel.com> for extending the regex with template marker support.
33209     *
33210     * @author Richard van Velzen (@_richardJ) Special thanks to Richard for the regex responsible for the split.
33211     */
33212    private function splitDocBlock(string $comment) : array
33213    {
33214        // phpcs:enable
33215        // Performance improvement cheat: if the first character is an @ then only tags are in this DocBlock. This
33216        // method does not split tags so we return this verbatim as the fourth result (tags). This saves us the
33217        // performance impact of running a regular expression
33218        if (strpos($comment, '@') === 0) {
33219            return ['', '', '', $comment];
33220        }
33221        // clears all extra horizontal whitespace from the line endings to prevent parsing issues
33222        $comment = preg_replace('/\\h*$/Sum', '', $comment);
33223        Assert::string($comment);
33224        /*
33225         * Splits the docblock into a template marker, summary, description and tags section.
33226         *
33227         * - The template marker is empty, #@+ or #@- if the DocBlock starts with either of those (a newline may
33228         *   occur after it and will be stripped).
33229         * - The short description is started from the first character until a dot is encountered followed by a
33230         *   newline OR two consecutive newlines (horizontal whitespace is taken into account to consider spacing
33231         *   errors). This is optional.
33232         * - The long description, any character until a new line is encountered followed by an @ and word
33233         *   characters (a tag). This is optional.
33234         * - Tags; the remaining characters
33235         *
33236         * Big thanks to RichardJ for contributing this Regular Expression
33237         */
33238        preg_match('/
33239            \\A
33240            # 1. Extract the template marker
33241            (?:(\\#\\@\\+|\\#\\@\\-)\\n?)?
33242
33243            # 2. Extract the summary
33244            (?:
33245              (?! @\\pL ) # The summary may not start with an @
33246              (
33247                [^\\n.]+
33248                (?:
33249                  (?! \\. \\n | \\n{2} )     # End summary upon a dot followed by newline or two newlines
33250                  [\\n.]* (?! [ \\t]* @\\pL ) # End summary when an @ is found as first character on a new line
33251                  [^\\n.]+                 # Include anything else
33252                )*
33253                \\.?
33254              )?
33255            )
33256
33257            # 3. Extract the description
33258            (?:
33259              \\s*        # Some form of whitespace _must_ precede a description because a summary must be there
33260              (?! @\\pL ) # The description may not start with an @
33261              (
33262                [^\\n]+
33263                (?: \\n+
33264                  (?! [ \\t]* @\\pL ) # End description when an @ is found as first character on a new line
33265                  [^\\n]+            # Include anything else
33266                )*
33267              )
33268            )?
33269
33270            # 4. Extract the tags (anything that follows)
33271            (\\s+ [\\s\\S]*)? # everything that follows
33272            /ux', $comment, $matches);
33273        array_shift($matches);
33274        while (count($matches) < 4) {
33275            $matches[] = '';
33276        }
33277        return $matches;
33278    }
33279    /**
33280     * Creates the tag objects.
33281     *
33282     * @param string        $tags    Tag block to parse.
33283     * @param Types\Context $context Context of the parsed Tag
33284     *
33285     * @return DocBlock\Tag[]
33286     */
33287    private function parseTagBlock(string $tags, Types\Context $context) : array
33288    {
33289        $tags = $this->filterTagBlock($tags);
33290        if ($tags === null) {
33291            return [];
33292        }
33293        $result = [];
33294        $lines = $this->splitTagBlockIntoTagLines($tags);
33295        foreach ($lines as $key => $tagLine) {
33296            $result[$key] = $this->tagFactory->create(trim($tagLine), $context);
33297        }
33298        return $result;
33299    }
33300    /**
33301     * @return string[]
33302     */
33303    private function splitTagBlockIntoTagLines(string $tags) : array
33304    {
33305        $result = [];
33306        foreach (explode("\n", $tags) as $tagLine) {
33307            if ($tagLine !== '' && strpos($tagLine, '@') === 0) {
33308                $result[] = $tagLine;
33309            } else {
33310                $result[count($result) - 1] .= "\n" . $tagLine;
33311            }
33312        }
33313        return $result;
33314    }
33315    private function filterTagBlock(string $tags) : ?string
33316    {
33317        $tags = trim($tags);
33318        if (!$tags) {
33319            return null;
33320        }
33321        if ($tags[0] !== '@') {
33322            // @codeCoverageIgnoreStart
33323            // Can't simulate this; this only happens if there is an error with the parsing of the DocBlock that
33324            // we didn't foresee.
33325            throw new LogicException('A tag block started with text instead of an at-sign(@): ' . $tags);
33326            // @codeCoverageIgnoreEnd
33327        }
33328        return $tags;
33329    }
33330}
33331<?php
33332
33333declare (strict_types=1);
33334/**
33335 * This file is part of phpDocumentor.
33336 *
33337 * For the full copyright and license information, please view the LICENSE
33338 * file that was distributed with this source code.
33339 *
33340 * @link      http://phpdoc.org
33341 */
33342namespace PHPUnit\phpDocumentor\Reflection;
33343
33344use PHPUnit\phpDocumentor\Reflection\Exception\PcreException;
33345use function preg_last_error;
33346use function preg_split as php_preg_split;
33347abstract class Utils
33348{
33349    /**
33350     * Wrapper function for phps preg_split
33351     *
33352     * This function is inspired by {@link https://github.com/thecodingmachine/safe/blob/master/generated/pcre.php}. But
33353     * since this library is all about performance we decided to strip everything we don't need. Reducing the amount
33354     * of files that have to be loaded, ect.
33355     *
33356     * @param string $pattern The pattern to search for, as a string.
33357     * @param string $subject The input string.
33358     * @param int|null $limit If specified, then only substrings up to limit are returned with the
33359     *      rest of the string being placed in the last substring. A limit of -1 or 0 means "no limit".
33360     * @param int $flags flags can be any combination of the following flags (combined with the | bitwise operator):
33361     * *PREG_SPLIT_NO_EMPTY*
33362     *      If this flag is set, only non-empty pieces will be returned by preg_split().
33363     * *PREG_SPLIT_DELIM_CAPTURE*
33364     *      If this flag is set, parenthesized expression in the delimiter pattern will be captured
33365     *      and returned as well.
33366     * *PREG_SPLIT_OFFSET_CAPTURE*
33367     *      If this flag is set, for every occurring match the appendant string offset will also be returned.
33368     *      Note that this changes the return value in an array where every element is an array consisting of the
33369     *      matched string at offset 0 and its string offset into subject at offset 1.
33370     *
33371     * @return string[] Returns an array containing substrings of subject split along boundaries matched by pattern
33372     *
33373     * @throws PcreException
33374     */
33375    public static function pregSplit(string $pattern, string $subject, ?int $limit = -1, int $flags = 0) : array
33376    {
33377        $parts = php_preg_split($pattern, $subject, $limit, $flags);
33378        if ($parts === \false) {
33379            throw PcreException::createFromPhpError(preg_last_error());
33380        }
33381        return $parts;
33382    }
33383}
33384<?php
33385
33386declare (strict_types=1);
33387namespace PHPUnit\phpDocumentor\Reflection\Exception;
33388
33389use InvalidArgumentException;
33390use const PREG_BACKTRACK_LIMIT_ERROR;
33391use const PREG_BAD_UTF8_ERROR;
33392use const PREG_BAD_UTF8_OFFSET_ERROR;
33393use const PREG_INTERNAL_ERROR;
33394use const PREG_JIT_STACKLIMIT_ERROR;
33395use const PREG_NO_ERROR;
33396use const PREG_RECURSION_LIMIT_ERROR;
33397final class PcreException extends InvalidArgumentException
33398{
33399    public static function createFromPhpError(int $errorCode) : self
33400    {
33401        switch ($errorCode) {
33402            case \PREG_BACKTRACK_LIMIT_ERROR:
33403                return new self('Backtrack limit error');
33404            case \PREG_RECURSION_LIMIT_ERROR:
33405                return new self('Recursion limit error');
33406            case \PREG_BAD_UTF8_ERROR:
33407                return new self('Bad UTF8 error');
33408            case \PREG_BAD_UTF8_OFFSET_ERROR:
33409                return new self('Bad UTF8 offset error');
33410            case \PREG_JIT_STACKLIMIT_ERROR:
33411                return new self('Jit stacklimit error');
33412            case \PREG_NO_ERROR:
33413            case \PREG_INTERNAL_ERROR:
33414            default:
33415        }
33416        return new self('Unknown Pcre error');
33417    }
33418}
33419<?php
33420
33421declare (strict_types=1);
33422/**
33423 * This file is part of phpDocumentor.
33424 *
33425 * For the full copyright and license information, please view the LICENSE
33426 * file that was distributed with this source code.
33427 *
33428 * @link      http://phpdoc.org
33429 */
33430namespace PHPUnit\phpDocumentor\Reflection;
33431
33432use PHPUnit\phpDocumentor\Reflection\DocBlock\Tag;
33433use PHPUnit\Webmozart\Assert\Assert;
33434final class DocBlock
33435{
33436    /** @var string The opening line for this docblock. */
33437    private $summary;
33438    /** @var DocBlock\Description The actual description for this docblock. */
33439    private $description;
33440    /** @var Tag[] An array containing all the tags in this docblock; except inline. */
33441    private $tags = [];
33442    /** @var Types\Context|null Information about the context of this DocBlock. */
33443    private $context;
33444    /** @var Location|null Information about the location of this DocBlock. */
33445    private $location;
33446    /** @var bool Is this DocBlock (the start of) a template? */
33447    private $isTemplateStart;
33448    /** @var bool Does this DocBlock signify the end of a DocBlock template? */
33449    private $isTemplateEnd;
33450    /**
33451     * @param DocBlock\Tag[] $tags
33452     * @param Types\Context  $context  The context in which the DocBlock occurs.
33453     * @param Location       $location The location within the file that this DocBlock occurs in.
33454     */
33455    public function __construct(string $summary = '', ?DocBlock\Description $description = null, array $tags = [], ?Types\Context $context = null, ?Location $location = null, bool $isTemplateStart = \false, bool $isTemplateEnd = \false)
33456    {
33457        Assert::allIsInstanceOf($tags, Tag::class);
33458        $this->summary = $summary;
33459        $this->description = $description ?: new DocBlock\Description('');
33460        foreach ($tags as $tag) {
33461            $this->addTag($tag);
33462        }
33463        $this->context = $context;
33464        $this->location = $location;
33465        $this->isTemplateEnd = $isTemplateEnd;
33466        $this->isTemplateStart = $isTemplateStart;
33467    }
33468    public function getSummary() : string
33469    {
33470        return $this->summary;
33471    }
33472    public function getDescription() : DocBlock\Description
33473    {
33474        return $this->description;
33475    }
33476    /**
33477     * Returns the current context.
33478     */
33479    public function getContext() : ?Types\Context
33480    {
33481        return $this->context;
33482    }
33483    /**
33484     * Returns the current location.
33485     */
33486    public function getLocation() : ?Location
33487    {
33488        return $this->location;
33489    }
33490    /**
33491     * Returns whether this DocBlock is the start of a Template section.
33492     *
33493     * A Docblock may serve as template for a series of subsequent DocBlocks. This is indicated by a special marker
33494     * (`#@+`) that is appended directly after the opening `/**` of a DocBlock.
33495     *
33496     * An example of such an opening is:
33497     *
33498     * ```
33499     * /**#@+
33500     *  * My DocBlock
33501     *  * /
33502     * ```
33503     *
33504     * The description and tags (not the summary!) are copied onto all subsequent DocBlocks and also applied to all
33505     * elements that follow until another DocBlock is found that contains the closing marker (`#@-`).
33506     *
33507     * @see self::isTemplateEnd() for the check whether a closing marker was provided.
33508     */
33509    public function isTemplateStart() : bool
33510    {
33511        return $this->isTemplateStart;
33512    }
33513    /**
33514     * Returns whether this DocBlock is the end of a Template section.
33515     *
33516     * @see self::isTemplateStart() for a more complete description of the Docblock Template functionality.
33517     */
33518    public function isTemplateEnd() : bool
33519    {
33520        return $this->isTemplateEnd;
33521    }
33522    /**
33523     * Returns the tags for this DocBlock.
33524     *
33525     * @return Tag[]
33526     */
33527    public function getTags() : array
33528    {
33529        return $this->tags;
33530    }
33531    /**
33532     * Returns an array of tags matching the given name. If no tags are found
33533     * an empty array is returned.
33534     *
33535     * @param string $name String to search by.
33536     *
33537     * @return Tag[]
33538     */
33539    public function getTagsByName(string $name) : array
33540    {
33541        $result = [];
33542        foreach ($this->getTags() as $tag) {
33543            if ($tag->getName() !== $name) {
33544                continue;
33545            }
33546            $result[] = $tag;
33547        }
33548        return $result;
33549    }
33550    /**
33551     * Checks if a tag of a certain type is present in this DocBlock.
33552     *
33553     * @param string $name Tag name to check for.
33554     */
33555    public function hasTag(string $name) : bool
33556    {
33557        foreach ($this->getTags() as $tag) {
33558            if ($tag->getName() === $name) {
33559                return \true;
33560            }
33561        }
33562        return \false;
33563    }
33564    /**
33565     * Remove a tag from this DocBlock.
33566     *
33567     * @param Tag $tagToRemove The tag to remove.
33568     */
33569    public function removeTag(Tag $tagToRemove) : void
33570    {
33571        foreach ($this->tags as $key => $tag) {
33572            if ($tag === $tagToRemove) {
33573                unset($this->tags[$key]);
33574                break;
33575            }
33576        }
33577    }
33578    /**
33579     * Adds a tag to this DocBlock.
33580     *
33581     * @param Tag $tag The tag to add.
33582     */
33583    private function addTag(Tag $tag) : void
33584    {
33585        $this->tags[] = $tag;
33586    }
33587}
33588The MIT License (MIT)
33589
33590Copyright (c) 2010 Mike van Riel
33591
33592Permission is hereby granted, free of charge, to any person obtaining a copy
33593of this software and associated documentation files (the "Software"), to deal
33594in the Software without restriction, including without limitation the rights
33595to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
33596copies of the Software, and to permit persons to whom the Software is
33597furnished to do so, subject to the following conditions:
33598
33599The above copyright notice and this permission notice shall be included in
33600all copies or substantial portions of the Software.
33601
33602THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
33603IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33604FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
33605AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33606LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
33607OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
33608THE SOFTWARE.
33609<?php
33610
33611declare (strict_types=1);
33612namespace PHPUnit\phpDocumentor\Reflection;
33613
33614use PHPUnit\phpDocumentor\Reflection\DocBlock\Tag;
33615// phpcs:ignore SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming.SuperfluousSuffix
33616interface DocBlockFactoryInterface
33617{
33618    /**
33619     * Factory method for easy instantiation.
33620     *
33621     * @param array<string, class-string<Tag>> $additionalTags
33622     */
33623    public static function createInstance(array $additionalTags = []) : DocBlockFactory;
33624    /**
33625     * @param string|object $docblock
33626     */
33627    public function create($docblock, ?Types\Context $context = null, ?Location $location = null) : DocBlock;
33628}
33629<?php
33630
33631declare (strict_types=1);
33632/**
33633 * This file is part of phpDocumentor.
33634 *
33635 * For the full copyright and license information, please view the LICENSE
33636 * file that was distributed with this source code.
33637 *
33638 * @link      http://phpdoc.org
33639 */
33640namespace PHPUnit\phpDocumentor\Reflection\Types;
33641
33642use PHPUnit\phpDocumentor\Reflection\Type;
33643/**
33644 * Value Object representing the 'resource' Type.
33645 *
33646 * @psalm-immutable
33647 */
33648final class Resource_ implements Type
33649{
33650    /**
33651     * Returns a rendered output of the Type as it would be used in a DocBlock.
33652     */
33653    public function __toString() : string
33654    {
33655        return 'resource';
33656    }
33657}
33658<?php
33659
33660declare (strict_types=1);
33661/**
33662 * This file is part of phpDocumentor.
33663 *
33664 * For the full copyright and license information, please view the LICENSE
33665 * file that was distributed with this source code.
33666 *
33667 * @link      http://phpdoc.org
33668 */
33669namespace PHPUnit\phpDocumentor\Reflection\Types;
33670
33671use PHPUnit\phpDocumentor\Reflection\Type;
33672/**
33673 * Value Object representing a Compound Type.
33674 *
33675 * A Compound Type is not so much a special keyword or object reference but is a series of Types that are separated
33676 * using an OR operator (`|`). This combination of types signifies that whatever is associated with this compound type
33677 * may contain a value with any of the given types.
33678 *
33679 * @psalm-immutable
33680 */
33681final class Compound extends AggregatedType
33682{
33683    /**
33684     * Initializes a compound type (i.e. `string|int`) and tests if the provided types all implement the Type interface.
33685     *
33686     * @param array<Type> $types
33687     */
33688    public function __construct(array $types)
33689    {
33690        parent::__construct($types, '|');
33691    }
33692}
33693<?php
33694
33695declare (strict_types=1);
33696/**
33697 * This file is part of phpDocumentor.
33698 *
33699 * For the full copyright and license information, please view the LICENSE
33700 * file that was distributed with this source code.
33701 *
33702 * @link      http://phpdoc.org
33703 */
33704namespace PHPUnit\phpDocumentor\Reflection\Types;
33705
33706use PHPUnit\phpDocumentor\Reflection\Type;
33707/**
33708 * Value object representing Integer type
33709 *
33710 * @psalm-immutable
33711 */
33712class Integer implements Type
33713{
33714    /**
33715     * Returns a rendered output of the Type as it would be used in a DocBlock.
33716     */
33717    public function __toString() : string
33718    {
33719        return 'int';
33720    }
33721}
33722<?php
33723
33724declare (strict_types=1);
33725/**
33726 * This file is part of phpDocumentor.
33727 *
33728 * For the full copyright and license information, please view the LICENSE
33729 * file that was distributed with this source code.
33730 *
33731 * @link      http://phpdoc.org
33732 */
33733namespace PHPUnit\phpDocumentor\Reflection\Types;
33734
33735use PHPUnit\phpDocumentor\Reflection\Type;
33736/**
33737 * Value Object representing the return-type 'never'.
33738 *
33739 * Never is generally only used when working with return types as it signifies that the method that only
33740 * ever throw or exit.
33741 *
33742 * @psalm-immutable
33743 */
33744final class Never_ implements Type
33745{
33746    /**
33747     * Returns a rendered output of the Type as it would be used in a DocBlock.
33748     */
33749    public function __toString() : string
33750    {
33751        return 'never';
33752    }
33753}
33754<?php
33755
33756declare (strict_types=1);
33757/**
33758 * This file is part of phpDocumentor.
33759 *
33760 * For the full copyright and license information, please view the LICENSE
33761 * file that was distributed with this source code.
33762 *
33763 * @link      http://phpdoc.org
33764 */
33765namespace PHPUnit\phpDocumentor\Reflection\Types;
33766
33767use PHPUnit\phpDocumentor\Reflection\Type;
33768/**
33769 * Value Object representing a null value or type.
33770 *
33771 * @psalm-immutable
33772 */
33773final class Null_ implements Type
33774{
33775    /**
33776     * Returns a rendered output of the Type as it would be used in a DocBlock.
33777     */
33778    public function __toString() : string
33779    {
33780        return 'null';
33781    }
33782}
33783<?php
33784
33785declare (strict_types=1);
33786/**
33787 * This file is part of phpDocumentor.
33788 *
33789 * For the full copyright and license information, please view the LICENSE
33790 * file that was distributed with this source code.
33791 *
33792 * @link      http://phpdoc.org
33793 */
33794namespace PHPUnit\phpDocumentor\Reflection\Types;
33795
33796use PHPUnit\phpDocumentor\Reflection\Type;
33797/**
33798 * Value Object representing the 'parent' type.
33799 *
33800 * Parent, as a Type, represents the parent class of class in which the associated element was defined.
33801 *
33802 * @psalm-immutable
33803 */
33804final class Parent_ implements Type
33805{
33806    /**
33807     * Returns a rendered output of the Type as it would be used in a DocBlock.
33808     */
33809    public function __toString() : string
33810    {
33811        return 'parent';
33812    }
33813}
33814<?php
33815
33816declare (strict_types=1);
33817/**
33818 * This file is part of phpDocumentor.
33819 *
33820 * For the full copyright and license information, please view the LICENSE
33821 * file that was distributed with this source code.
33822 *
33823 * @link      http://phpdoc.org
33824 */
33825namespace PHPUnit\phpDocumentor\Reflection\Types;
33826
33827use PHPUnit\phpDocumentor\Reflection\Type;
33828/**
33829 * Value Object representing the return-type 'void'.
33830 *
33831 * Void is generally only used when working with return types as it signifies that the method intentionally does not
33832 * return any value.
33833 *
33834 * @psalm-immutable
33835 */
33836final class Void_ implements Type
33837{
33838    /**
33839     * Returns a rendered output of the Type as it would be used in a DocBlock.
33840     */
33841    public function __toString() : string
33842    {
33843        return 'void';
33844    }
33845}
33846<?php
33847
33848declare (strict_types=1);
33849/**
33850 * This file is part of phpDocumentor.
33851 *
33852 * For the full copyright and license information, please view the LICENSE
33853 * file that was distributed with this source code.
33854 *
33855 * @link      http://phpdoc.org
33856 */
33857namespace PHPUnit\phpDocumentor\Reflection\Types;
33858
33859use PHPUnit\phpDocumentor\Reflection\Type;
33860/**
33861 * Value Object representing a Boolean type.
33862 *
33863 * @psalm-immutable
33864 */
33865class Boolean implements Type
33866{
33867    /**
33868     * Returns a rendered output of the Type as it would be used in a DocBlock.
33869     */
33870    public function __toString() : string
33871    {
33872        return 'bool';
33873    }
33874}
33875<?php
33876
33877declare (strict_types=1);
33878/**
33879 * This file is part of phpDocumentor.
33880 *
33881 * For the full copyright and license information, please view the LICENSE
33882 * file that was distributed with this source code.
33883 *
33884 * @link      http://phpdoc.org
33885 */
33886namespace PHPUnit\phpDocumentor\Reflection\Types;
33887
33888/**
33889 * Value Object representing a array-key Type.
33890 *
33891 * A array-key Type is the supertype (but not a union) of int and string.
33892 *
33893 * @psalm-immutable
33894 */
33895final class ArrayKey extends AggregatedType
33896{
33897    public function __construct()
33898    {
33899        parent::__construct([new String_(), new Integer()], '|');
33900    }
33901    public function __toString() : string
33902    {
33903        return 'array-key';
33904    }
33905}
33906<?php
33907
33908declare (strict_types=1);
33909/**
33910 * This file is part of phpDocumentor.
33911 *
33912 * For the full copyright and license information, please view the LICENSE
33913 * file that was distributed with this source code.
33914 *
33915 * @link      http://phpdoc.org
33916 */
33917namespace PHPUnit\phpDocumentor\Reflection\Types;
33918
33919use ArrayIterator;
33920use InvalidArgumentException;
33921use ReflectionClass;
33922use ReflectionClassConstant;
33923use ReflectionMethod;
33924use ReflectionParameter;
33925use ReflectionProperty;
33926use Reflector;
33927use RuntimeException;
33928use UnexpectedValueException;
33929use function define;
33930use function defined;
33931use function file_exists;
33932use function file_get_contents;
33933use function get_class;
33934use function in_array;
33935use function is_string;
33936use function strrpos;
33937use function substr;
33938use function token_get_all;
33939use function trim;
33940use const T_AS;
33941use const T_CLASS;
33942use const T_CURLY_OPEN;
33943use const T_DOLLAR_OPEN_CURLY_BRACES;
33944use const T_NAME_FULLY_QUALIFIED;
33945use const T_NAME_QUALIFIED;
33946use const T_NAMESPACE;
33947use const T_NS_SEPARATOR;
33948use const T_STRING;
33949use const T_USE;
33950if (!defined('T_NAME_QUALIFIED')) {
33951    define('T_NAME_QUALIFIED', 'T_NAME_QUALIFIED');
33952}
33953if (!defined('T_NAME_FULLY_QUALIFIED')) {
33954    define('T_NAME_FULLY_QUALIFIED', 'T_NAME_FULLY_QUALIFIED');
33955}
33956/**
33957 * Convenience class to create a Context for DocBlocks when not using the Reflection Component of phpDocumentor.
33958 *
33959 * For a DocBlock to be able to resolve types that use partial namespace names or rely on namespace imports we need to
33960 * provide a bit of context so that the DocBlock can read that and based on it decide how to resolve the types to
33961 * Fully Qualified names.
33962 *
33963 * @see Context for more information.
33964 */
33965final class ContextFactory
33966{
33967    /** The literal used at the end of a use statement. */
33968    private const T_LITERAL_END_OF_USE = ';';
33969    /** The literal used between sets of use statements */
33970    private const T_LITERAL_USE_SEPARATOR = ',';
33971    /**
33972     * Build a Context given a Class Reflection.
33973     *
33974     * @see Context for more information on Contexts.
33975     */
33976    public function createFromReflector(Reflector $reflector) : Context
33977    {
33978        if ($reflector instanceof ReflectionClass) {
33979            //phpcs:ignore SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.MissingVariable
33980            /** @var ReflectionClass<object> $reflector */
33981            return $this->createFromReflectionClass($reflector);
33982        }
33983        if ($reflector instanceof ReflectionParameter) {
33984            return $this->createFromReflectionParameter($reflector);
33985        }
33986        if ($reflector instanceof ReflectionMethod) {
33987            return $this->createFromReflectionMethod($reflector);
33988        }
33989        if ($reflector instanceof ReflectionProperty) {
33990            return $this->createFromReflectionProperty($reflector);
33991        }
33992        if ($reflector instanceof ReflectionClassConstant) {
33993            return $this->createFromReflectionClassConstant($reflector);
33994        }
33995        throw new UnexpectedValueException('Unhandled \\Reflector instance given:  ' . get_class($reflector));
33996    }
33997    private function createFromReflectionParameter(ReflectionParameter $parameter) : Context
33998    {
33999        $class = $parameter->getDeclaringClass();
34000        if (!$class) {
34001            throw new InvalidArgumentException('Unable to get class of ' . $parameter->getName());
34002        }
34003        return $this->createFromReflectionClass($class);
34004    }
34005    private function createFromReflectionMethod(ReflectionMethod $method) : Context
34006    {
34007        $class = $method->getDeclaringClass();
34008        return $this->createFromReflectionClass($class);
34009    }
34010    private function createFromReflectionProperty(ReflectionProperty $property) : Context
34011    {
34012        $class = $property->getDeclaringClass();
34013        return $this->createFromReflectionClass($class);
34014    }
34015    private function createFromReflectionClassConstant(ReflectionClassConstant $constant) : Context
34016    {
34017        //phpcs:ignore SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.MissingVariable
34018        /** @phpstan-var ReflectionClass<object> $class */
34019        $class = $constant->getDeclaringClass();
34020        return $this->createFromReflectionClass($class);
34021    }
34022    /**
34023     * @phpstan-param ReflectionClass<object> $class
34024     */
34025    private function createFromReflectionClass(ReflectionClass $class) : Context
34026    {
34027        $fileName = $class->getFileName();
34028        $namespace = $class->getNamespaceName();
34029        if (is_string($fileName) && file_exists($fileName)) {
34030            $contents = file_get_contents($fileName);
34031            if ($contents === \false) {
34032                throw new RuntimeException('Unable to read file "' . $fileName . '"');
34033            }
34034            return $this->createForNamespace($namespace, $contents);
34035        }
34036        return new Context($namespace, []);
34037    }
34038    /**
34039     * Build a Context for a namespace in the provided file contents.
34040     *
34041     * @see Context for more information on Contexts.
34042     *
34043     * @param string $namespace    It does not matter if a `\` precedes the namespace name,
34044     * this method first normalizes.
34045     * @param string $fileContents The file's contents to retrieve the aliases from with the given namespace.
34046     */
34047    public function createForNamespace(string $namespace, string $fileContents) : Context
34048    {
34049        $namespace = trim($namespace, '\\');
34050        $useStatements = [];
34051        $currentNamespace = '';
34052        $tokens = new ArrayIterator(token_get_all($fileContents));
34053        while ($tokens->valid()) {
34054            $currentToken = $tokens->current();
34055            switch ($currentToken[0]) {
34056                case \T_NAMESPACE:
34057                    $currentNamespace = $this->parseNamespace($tokens);
34058                    break;
34059                case \T_CLASS:
34060                    // Fast-forward the iterator through the class so that any
34061                    // T_USE tokens found within are skipped - these are not
34062                    // valid namespace use statements so should be ignored.
34063                    $braceLevel = 0;
34064                    $firstBraceFound = \false;
34065                    while ($tokens->valid() && ($braceLevel > 0 || !$firstBraceFound)) {
34066                        $currentToken = $tokens->current();
34067                        if ($currentToken === '{' || in_array($currentToken[0], [\T_CURLY_OPEN, \T_DOLLAR_OPEN_CURLY_BRACES], \true)) {
34068                            if (!$firstBraceFound) {
34069                                $firstBraceFound = \true;
34070                            }
34071                            ++$braceLevel;
34072                        }
34073                        if ($currentToken === '}') {
34074                            --$braceLevel;
34075                        }
34076                        $tokens->next();
34077                    }
34078                    break;
34079                case \T_USE:
34080                    if ($currentNamespace === $namespace) {
34081                        $useStatements += $this->parseUseStatement($tokens);
34082                    }
34083                    break;
34084            }
34085            $tokens->next();
34086        }
34087        return new Context($namespace, $useStatements);
34088    }
34089    /**
34090     * Deduce the name from tokens when we are at the T_NAMESPACE token.
34091     *
34092     * @param ArrayIterator<int, string|array{0:int,1:string,2:int}> $tokens
34093     */
34094    private function parseNamespace(ArrayIterator $tokens) : string
34095    {
34096        // skip to the first string or namespace separator
34097        $this->skipToNextStringOrNamespaceSeparator($tokens);
34098        $name = '';
34099        $acceptedTokens = [\T_STRING, \T_NS_SEPARATOR, \T_NAME_QUALIFIED];
34100        while ($tokens->valid() && in_array($tokens->current()[0], $acceptedTokens, \true)) {
34101            $name .= $tokens->current()[1];
34102            $tokens->next();
34103        }
34104        return $name;
34105    }
34106    /**
34107     * Deduce the names of all imports when we are at the T_USE token.
34108     *
34109     * @param ArrayIterator<int, string|array{0:int,1:string,2:int}> $tokens
34110     *
34111     * @return string[]
34112     * @psalm-return array<string, string>
34113     */
34114    private function parseUseStatement(ArrayIterator $tokens) : array
34115    {
34116        $uses = [];
34117        while ($tokens->valid()) {
34118            $this->skipToNextStringOrNamespaceSeparator($tokens);
34119            $uses += $this->extractUseStatements($tokens);
34120            $currentToken = $tokens->current();
34121            if ($currentToken[0] === self::T_LITERAL_END_OF_USE) {
34122                return $uses;
34123            }
34124        }
34125        return $uses;
34126    }
34127    /**
34128     * Fast-forwards the iterator as longs as we don't encounter a T_STRING or T_NS_SEPARATOR token.
34129     *
34130     * @param ArrayIterator<int, string|array{0:int,1:string,2:int}> $tokens
34131     */
34132    private function skipToNextStringOrNamespaceSeparator(ArrayIterator $tokens) : void
34133    {
34134        while ($tokens->valid()) {
34135            $currentToken = $tokens->current();
34136            if (in_array($currentToken[0], [\T_STRING, \T_NS_SEPARATOR], \true)) {
34137                break;
34138            }
34139            if ($currentToken[0] === \T_NAME_QUALIFIED) {
34140                break;
34141            }
34142            if (defined('T_NAME_FULLY_QUALIFIED') && $currentToken[0] === \T_NAME_FULLY_QUALIFIED) {
34143                break;
34144            }
34145            $tokens->next();
34146        }
34147    }
34148    /**
34149     * Deduce the namespace name and alias of an import when we are at the T_USE token or have not reached the end of
34150     * a USE statement yet. This will return a key/value array of the alias => namespace.
34151     *
34152     * @param ArrayIterator<int, string|array{0:int,1:string,2:int}> $tokens
34153     *
34154     * @return string[]
34155     * @psalm-return array<string, string>
34156     *
34157     * @psalm-suppress TypeDoesNotContainType
34158     */
34159    private function extractUseStatements(ArrayIterator $tokens) : array
34160    {
34161        $extractedUseStatements = [];
34162        $groupedNs = '';
34163        $currentNs = '';
34164        $currentAlias = '';
34165        $state = 'start';
34166        while ($tokens->valid()) {
34167            $currentToken = $tokens->current();
34168            $tokenId = is_string($currentToken) ? $currentToken : $currentToken[0];
34169            $tokenValue = is_string($currentToken) ? null : $currentToken[1];
34170            switch ($state) {
34171                case 'start':
34172                    switch ($tokenId) {
34173                        case \T_STRING:
34174                        case \T_NS_SEPARATOR:
34175                            $currentNs .= (string) $tokenValue;
34176                            $currentAlias = $tokenValue;
34177                            break;
34178                        case \T_NAME_QUALIFIED:
34179                        case \T_NAME_FULLY_QUALIFIED:
34180                            $currentNs .= (string) $tokenValue;
34181                            $currentAlias = substr((string) $tokenValue, (int) strrpos((string) $tokenValue, '\\') + 1);
34182                            break;
34183                        case \T_CURLY_OPEN:
34184                        case '{':
34185                            $state = 'grouped';
34186                            $groupedNs = $currentNs;
34187                            break;
34188                        case \T_AS:
34189                            $state = 'start-alias';
34190                            break;
34191                        case self::T_LITERAL_USE_SEPARATOR:
34192                        case self::T_LITERAL_END_OF_USE:
34193                            $state = 'end';
34194                            break;
34195                        default:
34196                            break;
34197                    }
34198                    break;
34199                case 'start-alias':
34200                    switch ($tokenId) {
34201                        case \T_STRING:
34202                            $currentAlias = $tokenValue;
34203                            break;
34204                        case self::T_LITERAL_USE_SEPARATOR:
34205                        case self::T_LITERAL_END_OF_USE:
34206                            $state = 'end';
34207                            break;
34208                        default:
34209                            break;
34210                    }
34211                    break;
34212                case 'grouped':
34213                    switch ($tokenId) {
34214                        case \T_STRING:
34215                        case \T_NS_SEPARATOR:
34216                            $currentNs .= (string) $tokenValue;
34217                            $currentAlias = $tokenValue;
34218                            break;
34219                        case \T_AS:
34220                            $state = 'grouped-alias';
34221                            break;
34222                        case self::T_LITERAL_USE_SEPARATOR:
34223                            $state = 'grouped';
34224                            $extractedUseStatements[(string) $currentAlias] = $currentNs;
34225                            $currentNs = $groupedNs;
34226                            $currentAlias = '';
34227                            break;
34228                        case self::T_LITERAL_END_OF_USE:
34229                            $state = 'end';
34230                            break;
34231                        default:
34232                            break;
34233                    }
34234                    break;
34235                case 'grouped-alias':
34236                    switch ($tokenId) {
34237                        case \T_STRING:
34238                            $currentAlias = $tokenValue;
34239                            break;
34240                        case self::T_LITERAL_USE_SEPARATOR:
34241                            $state = 'grouped';
34242                            $extractedUseStatements[(string) $currentAlias] = $currentNs;
34243                            $currentNs = $groupedNs;
34244                            $currentAlias = '';
34245                            break;
34246                        case self::T_LITERAL_END_OF_USE:
34247                            $state = 'end';
34248                            break;
34249                        default:
34250                            break;
34251                    }
34252            }
34253            if ($state === 'end') {
34254                break;
34255            }
34256            $tokens->next();
34257        }
34258        if ($groupedNs !== $currentNs) {
34259            $extractedUseStatements[(string) $currentAlias] = $currentNs;
34260        }
34261        return $extractedUseStatements;
34262    }
34263}
34264<?php
34265
34266declare (strict_types=1);
34267/**
34268 * This file is part of phpDocumentor.
34269 *
34270 * For the full copyright and license information, please view the LICENSE
34271 * file that was distributed with this source code.
34272 *
34273 * @link      http://phpdoc.org
34274 */
34275namespace PHPUnit\phpDocumentor\Reflection\Types;
34276
34277use PHPUnit\phpDocumentor\Reflection\Type;
34278/**
34279 * Represents a list of values. This is an abstract class for Array_ and Collection.
34280 *
34281 * @psalm-immutable
34282 */
34283abstract class AbstractList implements Type
34284{
34285    /** @var Type */
34286    protected $valueType;
34287    /** @var Type|null */
34288    protected $keyType;
34289    /** @var Type */
34290    protected $defaultKeyType;
34291    /**
34292     * Initializes this representation of an array with the given Type.
34293     */
34294    public function __construct(?Type $valueType = null, ?Type $keyType = null)
34295    {
34296        if ($valueType === null) {
34297            $valueType = new Mixed_();
34298        }
34299        $this->valueType = $valueType;
34300        $this->defaultKeyType = new Compound([new String_(), new Integer()]);
34301        $this->keyType = $keyType;
34302    }
34303    /**
34304     * Returns the type for the keys of this array.
34305     */
34306    public function getKeyType() : Type
34307    {
34308        return $this->keyType ?? $this->defaultKeyType;
34309    }
34310    /**
34311     * Returns the value for the keys of this array.
34312     */
34313    public function getValueType() : Type
34314    {
34315        return $this->valueType;
34316    }
34317    /**
34318     * Returns a rendered output of the Type as it would be used in a DocBlock.
34319     */
34320    public function __toString() : string
34321    {
34322        if ($this->keyType) {
34323            return 'array<' . $this->keyType . ',' . $this->valueType . '>';
34324        }
34325        if ($this->valueType instanceof Mixed_) {
34326            return 'array';
34327        }
34328        if ($this->valueType instanceof Compound) {
34329            return '(' . $this->valueType . ')[]';
34330        }
34331        return $this->valueType . '[]';
34332    }
34333}
34334<?php
34335
34336declare (strict_types=1);
34337/**
34338 * This file is part of phpDocumentor.
34339 *
34340 * For the full copyright and license information, please view the LICENSE
34341 * file that was distributed with this source code.
34342 *
34343 * @link      http://phpdoc.org
34344 */
34345namespace PHPUnit\phpDocumentor\Reflection\Types;
34346
34347use PHPUnit\phpDocumentor\Reflection\Type;
34348/**
34349 * Value Object representing the type 'string'.
34350 *
34351 * @psalm-immutable
34352 */
34353class String_ implements Type
34354{
34355    /**
34356     * Returns a rendered output of the Type as it would be used in a DocBlock.
34357     */
34358    public function __toString() : string
34359    {
34360        return 'string';
34361    }
34362}
34363<?php
34364
34365declare (strict_types=1);
34366/**
34367 * This file is part of phpDocumentor.
34368 *
34369 * For the full copyright and license information, please view the LICENSE
34370 * file that was distributed with this source code.
34371 *
34372 * @link      http://phpdoc.org
34373 */
34374namespace PHPUnit\phpDocumentor\Reflection\Types;
34375
34376use PHPUnit\phpDocumentor\Reflection\Fqsen;
34377use PHPUnit\phpDocumentor\Reflection\Type;
34378/**
34379 * Value Object representing the type 'string'.
34380 *
34381 * @psalm-immutable
34382 */
34383final class ClassString implements Type
34384{
34385    /** @var Fqsen|null */
34386    private $fqsen;
34387    /**
34388     * Initializes this representation of a class string with the given Fqsen.
34389     */
34390    public function __construct(?Fqsen $fqsen = null)
34391    {
34392        $this->fqsen = $fqsen;
34393    }
34394    /**
34395     * Returns the FQSEN associated with this object.
34396     */
34397    public function getFqsen() : ?Fqsen
34398    {
34399        return $this->fqsen;
34400    }
34401    /**
34402     * Returns a rendered output of the Type as it would be used in a DocBlock.
34403     */
34404    public function __toString() : string
34405    {
34406        if ($this->fqsen === null) {
34407            return 'class-string';
34408        }
34409        return 'class-string<' . (string) $this->fqsen . '>';
34410    }
34411}
34412<?php
34413
34414declare (strict_types=1);
34415/**
34416 * This file is part of phpDocumentor.
34417 *
34418 * For the full copyright and license information, please view the LICENSE
34419 * file that was distributed with this source code.
34420 *
34421 * @link      http://phpdoc.org
34422 */
34423namespace PHPUnit\phpDocumentor\Reflection\Types;
34424
34425use PHPUnit\phpDocumentor\Reflection\Type;
34426/**
34427 * Value Object representing the 'self' type.
34428 *
34429 * Self, as a Type, represents the class in which the associated element was defined.
34430 *
34431 * @psalm-immutable
34432 */
34433final class Self_ implements Type
34434{
34435    /**
34436     * Returns a rendered output of the Type as it would be used in a DocBlock.
34437     */
34438    public function __toString() : string
34439    {
34440        return 'self';
34441    }
34442}
34443<?php
34444
34445declare (strict_types=1);
34446/**
34447 * This file is part of phpDocumentor.
34448 *
34449 * For the full copyright and license information, please view the LICENSE
34450 * file that was distributed with this source code.
34451 *
34452 * @link      http://phpdoc.org
34453 */
34454namespace PHPUnit\phpDocumentor\Reflection\Types;
34455
34456use PHPUnit\phpDocumentor\Reflection\Type;
34457/**
34458 * Value Object representing a Float.
34459 *
34460 * @psalm-immutable
34461 */
34462final class Float_ implements Type
34463{
34464    /**
34465     * Returns a rendered output of the Type as it would be used in a DocBlock.
34466     */
34467    public function __toString() : string
34468    {
34469        return 'float';
34470    }
34471}
34472<?php
34473
34474declare (strict_types=1);
34475/**
34476 * This file is part of phpDocumentor.
34477 *
34478 * For the full copyright and license information, please view the LICENSE
34479 * file that was distributed with this source code.
34480 *
34481 * @link      http://phpdoc.org
34482 */
34483namespace PHPUnit\phpDocumentor\Reflection\Types;
34484
34485use PHPUnit\phpDocumentor\Reflection\Type;
34486/**
34487 * Value Object representing the 'static' type.
34488 *
34489 * Self, as a Type, represents the class in which the associated element was called. This differs from self as self does
34490 * not take inheritance into account but static means that the return type is always that of the class of the called
34491 * element.
34492 *
34493 * See the documentation on late static binding in the PHP Documentation for more information on the difference between
34494 * static and self.
34495 *
34496 * @psalm-immutable
34497 */
34498final class Static_ implements Type
34499{
34500    /**
34501     * Returns a rendered output of the Type as it would be used in a DocBlock.
34502     */
34503    public function __toString() : string
34504    {
34505        return 'static';
34506    }
34507}
34508<?php
34509
34510declare (strict_types=1);
34511/**
34512 * This file is part of phpDocumentor.
34513 *
34514 * For the full copyright and license information, please view the LICENSE
34515 * file that was distributed with this source code.
34516 *
34517 * @link      http://phpdoc.org
34518 */
34519namespace PHPUnit\phpDocumentor\Reflection\Types;
34520
34521use function strlen;
34522use function substr;
34523use function trim;
34524/**
34525 * Provides information about the Context in which the DocBlock occurs that receives this context.
34526 *
34527 * A DocBlock does not know of its own accord in which namespace it occurs and which namespace aliases are applicable
34528 * for the block of code in which it is in. This information is however necessary to resolve Class names in tags since
34529 * you can provide a short form or make use of namespace aliases.
34530 *
34531 * The phpDocumentor Reflection component knows how to create this class but if you use the DocBlock parser from your
34532 * own application it is possible to generate a Context class using the ContextFactory; this will analyze the file in
34533 * which an associated class resides for its namespace and imports.
34534 *
34535 * @see ContextFactory::createFromClassReflector()
34536 * @see ContextFactory::createForNamespace()
34537 *
34538 * @psalm-immutable
34539 */
34540final class Context
34541{
34542    /** @var string The current namespace. */
34543    private $namespace;
34544    /**
34545     * @var string[] List of namespace aliases => Fully Qualified Namespace.
34546     * @psalm-var array<string, string>
34547     */
34548    private $namespaceAliases;
34549    /**
34550     * Initializes the new context and normalizes all passed namespaces to be in Qualified Namespace Name (QNN)
34551     * format (without a preceding `\`).
34552     *
34553     * @param string   $namespace        The namespace where this DocBlock resides in.
34554     * @param string[] $namespaceAliases List of namespace aliases => Fully Qualified Namespace.
34555     * @psalm-param array<string, string> $namespaceAliases
34556     */
34557    public function __construct(string $namespace, array $namespaceAliases = [])
34558    {
34559        $this->namespace = $namespace !== 'global' && $namespace !== 'default' ? trim($namespace, '\\') : '';
34560        foreach ($namespaceAliases as $alias => $fqnn) {
34561            if ($fqnn[0] === '\\') {
34562                $fqnn = substr($fqnn, 1);
34563            }
34564            if ($fqnn[strlen($fqnn) - 1] === '\\') {
34565                $fqnn = substr($fqnn, 0, -1);
34566            }
34567            $namespaceAliases[$alias] = $fqnn;
34568        }
34569        $this->namespaceAliases = $namespaceAliases;
34570    }
34571    /**
34572     * Returns the Qualified Namespace Name (thus without `\` in front) where the associated element is in.
34573     */
34574    public function getNamespace() : string
34575    {
34576        return $this->namespace;
34577    }
34578    /**
34579     * Returns a list of Qualified Namespace Names (thus without `\` in front) that are imported, the keys represent
34580     * the alias for the imported Namespace.
34581     *
34582     * @return string[]
34583     * @psalm-return array<string, string>
34584     */
34585    public function getNamespaceAliases() : array
34586    {
34587        return $this->namespaceAliases;
34588    }
34589}
34590<?php
34591
34592declare (strict_types=1);
34593/**
34594 * This file is part of phpDocumentor.
34595 *
34596 * For the full copyright and license information, please view the LICENSE
34597 * file that was distributed with this source code.
34598 *
34599 * @link      http://phpdoc.org
34600 */
34601namespace PHPUnit\phpDocumentor\Reflection\Types;
34602
34603/**
34604 * Represents an array type as described in the PSR-5, the PHPDoc Standard.
34605 *
34606 * An array can be represented in two forms:
34607 *
34608 * 1. Untyped (`array`), where the key and value type is unknown and hence classified as 'Mixed_'.
34609 * 2. Types (`string[]`), where the value type is provided by preceding an opening and closing square bracket with a
34610 *    type name.
34611 *
34612 * @psalm-immutable
34613 */
34614final class Array_ extends AbstractList
34615{
34616}
34617<?php
34618
34619declare (strict_types=1);
34620/**
34621 * This file is part of phpDocumentor.
34622 *
34623 * For the full copyright and license information, please view the LICENSE
34624 * file that was distributed with this source code.
34625 *
34626 * @link      http://phpdoc.org
34627 */
34628namespace PHPUnit\phpDocumentor\Reflection\Types;
34629
34630use InvalidArgumentException;
34631use PHPUnit\phpDocumentor\Reflection\Fqsen;
34632use PHPUnit\phpDocumentor\Reflection\Type;
34633use function strpos;
34634/**
34635 * Value Object representing an object.
34636 *
34637 * An object can be either typed or untyped. When an object is typed it means that it has an identifier, the FQSEN,
34638 * pointing to an element in PHP. Object types that are untyped do not refer to a specific class but represent objects
34639 * in general.
34640 *
34641 * @psalm-immutable
34642 */
34643final class Object_ implements Type
34644{
34645    /** @var Fqsen|null */
34646    private $fqsen;
34647    /**
34648     * Initializes this object with an optional FQSEN, if not provided this object is considered 'untyped'.
34649     *
34650     * @throws InvalidArgumentException When provided $fqsen is not a valid type.
34651     */
34652    public function __construct(?Fqsen $fqsen = null)
34653    {
34654        if (strpos((string) $fqsen, '::') !== \false || strpos((string) $fqsen, '()') !== \false) {
34655            throw new InvalidArgumentException('Object types can only refer to a class, interface or trait but a method, function, constant or ' . 'property was received: ' . (string) $fqsen);
34656        }
34657        $this->fqsen = $fqsen;
34658    }
34659    /**
34660     * Returns the FQSEN associated with this object.
34661     */
34662    public function getFqsen() : ?Fqsen
34663    {
34664        return $this->fqsen;
34665    }
34666    public function __toString() : string
34667    {
34668        if ($this->fqsen) {
34669            return (string) $this->fqsen;
34670        }
34671        return 'object';
34672    }
34673}
34674<?php
34675
34676declare (strict_types=1);
34677/**
34678 * This file is part of phpDocumentor.
34679 *
34680 * For the full copyright and license information, please view the LICENSE
34681 * file that was distributed with this source code.
34682 *
34683 * @link      http://phpdoc.org
34684 */
34685namespace PHPUnit\phpDocumentor\Reflection\Types;
34686
34687use PHPUnit\phpDocumentor\Reflection\Type;
34688/**
34689 * Value Object representing a Callable type.
34690 *
34691 * @psalm-immutable
34692 */
34693final class Callable_ implements Type
34694{
34695    /**
34696     * Returns a rendered output of the Type as it would be used in a DocBlock.
34697     */
34698    public function __toString() : string
34699    {
34700        return 'callable';
34701    }
34702}
34703<?php
34704
34705declare (strict_types=1);
34706/**
34707 * This file is part of phpDocumentor.
34708 *
34709 * For the full copyright and license information, please view the LICENSE
34710 * file that was distributed with this source code.
34711 *
34712 * @link      http://phpdoc.org
34713 */
34714namespace PHPUnit\phpDocumentor\Reflection\Types;
34715
34716use PHPUnit\phpDocumentor\Reflection\Fqsen;
34717use PHPUnit\phpDocumentor\Reflection\Type;
34718/**
34719 * Represents a collection type as described in the PSR-5, the PHPDoc Standard.
34720 *
34721 * A collection can be represented in two forms:
34722 *
34723 * 1. `ACollectionObject<aValueType>`
34724 * 2. `ACollectionObject<aValueType,aKeyType>`
34725 *
34726 * - ACollectionObject can be 'array' or an object that can act as an array
34727 * - aValueType and aKeyType can be any type expression
34728 *
34729 * @psalm-immutable
34730 */
34731final class Collection extends AbstractList
34732{
34733    /** @var Fqsen|null */
34734    private $fqsen;
34735    /**
34736     * Initializes this representation of an array with the given Type or Fqsen.
34737     */
34738    public function __construct(?Fqsen $fqsen, Type $valueType, ?Type $keyType = null)
34739    {
34740        parent::__construct($valueType, $keyType);
34741        $this->fqsen = $fqsen;
34742    }
34743    /**
34744     * Returns the FQSEN associated with this object.
34745     */
34746    public function getFqsen() : ?Fqsen
34747    {
34748        return $this->fqsen;
34749    }
34750    /**
34751     * Returns a rendered output of the Type as it would be used in a DocBlock.
34752     */
34753    public function __toString() : string
34754    {
34755        $objectType = (string) ($this->fqsen ?? 'object');
34756        if ($this->keyType === null) {
34757            return $objectType . '<' . $this->valueType . '>';
34758        }
34759        return $objectType . '<' . $this->keyType . ',' . $this->valueType . '>';
34760    }
34761}
34762<?php
34763
34764declare (strict_types=1);
34765/**
34766 * This file is part of phpDocumentor.
34767 *
34768 * For the full copyright and license information, please view the LICENSE
34769 * file that was distributed with this source code.
34770 *
34771 * @link      http://phpdoc.org
34772 */
34773namespace PHPUnit\phpDocumentor\Reflection\Types;
34774
34775use PHPUnit\phpDocumentor\Reflection\Type;
34776/**
34777 * Value Object representing the 'scalar' pseudo-type, which is either a string, integer, float or boolean.
34778 *
34779 * @psalm-immutable
34780 */
34781final class Scalar implements Type
34782{
34783    /**
34784     * Returns a rendered output of the Type as it would be used in a DocBlock.
34785     */
34786    public function __toString() : string
34787    {
34788        return 'scalar';
34789    }
34790}
34791<?php
34792
34793declare (strict_types=1);
34794/**
34795 * This file is part of phpDocumentor.
34796 *
34797 * For the full copyright and license information, please view the LICENSE
34798 * file that was distributed with this source code.
34799 *
34800 * @link      http://phpdoc.org
34801 */
34802namespace PHPUnit\phpDocumentor\Reflection\Types;
34803
34804use PHPUnit\phpDocumentor\Reflection\Type;
34805/**
34806 * Represents an expression type as described in the PSR-5, the PHPDoc Standard.
34807 *
34808 * @psalm-immutable
34809 */
34810final class Expression implements Type
34811{
34812    /** @var Type */
34813    protected $valueType;
34814    /**
34815     * Initializes this representation of an array with the given Type.
34816     */
34817    public function __construct(Type $valueType)
34818    {
34819        $this->valueType = $valueType;
34820    }
34821    /**
34822     * Returns the value for the keys of this array.
34823     */
34824    public function getValueType() : Type
34825    {
34826        return $this->valueType;
34827    }
34828    /**
34829     * Returns a rendered output of the Type as it would be used in a DocBlock.
34830     */
34831    public function __toString() : string
34832    {
34833        return '(' . $this->valueType . ')';
34834    }
34835}
34836<?php
34837
34838declare (strict_types=1);
34839/**
34840 * This file is part of phpDocumentor.
34841 *
34842 * For the full copyright and license information, please view the LICENSE
34843 * file that was distributed with this source code.
34844 *
34845 * @link      http://phpdoc.org
34846 */
34847namespace PHPUnit\phpDocumentor\Reflection\Types;
34848
34849use PHPUnit\phpDocumentor\Reflection\Type;
34850/**
34851 * Value Object representing an unknown, or mixed, type.
34852 *
34853 * @psalm-immutable
34854 */
34855final class Mixed_ implements Type
34856{
34857    /**
34858     * Returns a rendered output of the Type as it would be used in a DocBlock.
34859     */
34860    public function __toString() : string
34861    {
34862        return 'mixed';
34863    }
34864}
34865<?php
34866
34867/**
34868 * This file is part of phpDocumentor.
34869 *
34870 *  For the full copyright and license information, please view the LICENSE
34871 *  file that was distributed with this source code.
34872 *
34873 * @link      http://phpdoc.org
34874 */
34875declare (strict_types=1);
34876namespace PHPUnit\phpDocumentor\Reflection\Types;
34877
34878use ArrayIterator;
34879use IteratorAggregate;
34880use PHPUnit\phpDocumentor\Reflection\Type;
34881use function array_key_exists;
34882use function implode;
34883/**
34884 * Base class for aggregated types like Compound and Intersection
34885 *
34886 * A Aggregated Type is not so much a special keyword or object reference but is a series of Types that are separated
34887 * using separator.
34888 *
34889 * @psalm-immutable
34890 * @template-implements IteratorAggregate<int, Type>
34891 */
34892abstract class AggregatedType implements Type, IteratorAggregate
34893{
34894    /**
34895     * @psalm-allow-private-mutation
34896     * @var array<int, Type>
34897     */
34898    private $types = [];
34899    /** @var string */
34900    private $token;
34901    /**
34902     * @param array<Type> $types
34903     */
34904    public function __construct(array $types, string $token)
34905    {
34906        foreach ($types as $type) {
34907            $this->add($type);
34908        }
34909        $this->token = $token;
34910    }
34911    /**
34912     * Returns the type at the given index.
34913     */
34914    public function get(int $index) : ?Type
34915    {
34916        if (!$this->has($index)) {
34917            return null;
34918        }
34919        return $this->types[$index];
34920    }
34921    /**
34922     * Tests if this compound type has a type with the given index.
34923     */
34924    public function has(int $index) : bool
34925    {
34926        return array_key_exists($index, $this->types);
34927    }
34928    /**
34929     * Tests if this compound type contains the given type.
34930     */
34931    public function contains(Type $type) : bool
34932    {
34933        foreach ($this->types as $typePart) {
34934            // if the type is duplicate; do not add it
34935            if ((string) $typePart === (string) $type) {
34936                return \true;
34937            }
34938        }
34939        return \false;
34940    }
34941    /**
34942     * Returns a rendered output of the Type as it would be used in a DocBlock.
34943     */
34944    public function __toString() : string
34945    {
34946        return implode($this->token, $this->types);
34947    }
34948    /**
34949     * @return ArrayIterator<int, Type>
34950     */
34951    public function getIterator() : ArrayIterator
34952    {
34953        return new ArrayIterator($this->types);
34954    }
34955    /**
34956     * @psalm-suppress ImpureMethodCall
34957     */
34958    private function add(Type $type) : void
34959    {
34960        if ($type instanceof self) {
34961            foreach ($type->getIterator() as $subType) {
34962                $this->add($subType);
34963            }
34964            return;
34965        }
34966        // if the type is duplicate; do not add it
34967        if ($this->contains($type)) {
34968            return;
34969        }
34970        $this->types[] = $type;
34971    }
34972}
34973<?php
34974
34975declare (strict_types=1);
34976/**
34977 * This file is part of phpDocumentor.
34978 *
34979 * For the full copyright and license information, please view the LICENSE
34980 * file that was distributed with this source code.
34981 *
34982 * @link      http://phpdoc.org
34983 */
34984namespace PHPUnit\phpDocumentor\Reflection\Types;
34985
34986/**
34987 * Value Object representing iterable type
34988 *
34989 * @psalm-immutable
34990 */
34991final class Iterable_ extends AbstractList
34992{
34993    /**
34994     * Returns a rendered output of the Type as it would be used in a DocBlock.
34995     */
34996    public function __toString() : string
34997    {
34998        if ($this->keyType) {
34999            return 'iterable<' . $this->keyType . ',' . $this->valueType . '>';
35000        }
35001        if ($this->valueType instanceof Mixed_) {
35002            return 'iterable';
35003        }
35004        return 'iterable<' . $this->valueType . '>';
35005    }
35006}
35007<?php
35008
35009/**
35010 * This file is part of phpDocumentor.
35011 *
35012 *  For the full copyright and license information, please view the LICENSE
35013 *  file that was distributed with this source code.
35014 *
35015 *  @link      http://phpdoc.org
35016 */
35017declare (strict_types=1);
35018namespace PHPUnit\phpDocumentor\Reflection\Types;
35019
35020use PHPUnit\phpDocumentor\Reflection\Type;
35021/**
35022 * Value Object representing a Compound Type.
35023 *
35024 * A Intersection Type is not so much a special keyword or object reference but is a series of Types that are separated
35025 * using an AND operator (`&`). This combination of types signifies that whatever is associated with this Intersection
35026 * type may contain a value with any of the given types.
35027 *
35028 * @psalm-immutable
35029 */
35030final class Intersection extends AggregatedType
35031{
35032    /**
35033     * Initializes a intersection type (i.e. `\A&\B`) and tests if the provided types all implement the Type interface.
35034     *
35035     * @param array<Type> $types
35036     */
35037    public function __construct(array $types)
35038    {
35039        parent::__construct($types, '&');
35040    }
35041}
35042<?php
35043
35044declare (strict_types=1);
35045/**
35046 * This file is part of phpDocumentor.
35047 *
35048 * For the full copyright and license information, please view the LICENSE
35049 * file that was distributed with this source code.
35050 *
35051 * @link      http://phpdoc.org
35052 */
35053namespace PHPUnit\phpDocumentor\Reflection\Types;
35054
35055use PHPUnit\phpDocumentor\Reflection\Type;
35056/**
35057 * Value Object representing the '$this' pseudo-type.
35058 *
35059 * $this, as a Type, represents the instance of the class associated with the element as it was called. $this is
35060 * commonly used when documenting fluent interfaces since it represents that the same object is returned.
35061 *
35062 * @psalm-immutable
35063 */
35064final class This implements Type
35065{
35066    /**
35067     * Returns a rendered output of the Type as it would be used in a DocBlock.
35068     */
35069    public function __toString() : string
35070    {
35071        return '$this';
35072    }
35073}
35074<?php
35075
35076declare (strict_types=1);
35077/**
35078 * This file is part of phpDocumentor.
35079 *
35080 * For the full copyright and license information, please view the LICENSE
35081 * file that was distributed with this source code.
35082 *
35083 * @link      http://phpdoc.org
35084 */
35085namespace PHPUnit\phpDocumentor\Reflection\Types;
35086
35087use PHPUnit\phpDocumentor\Reflection\Type;
35088/**
35089 * Value Object representing a nullable type. The real type is wrapped.
35090 *
35091 * @psalm-immutable
35092 */
35093final class Nullable implements Type
35094{
35095    /** @var Type The actual type that is wrapped */
35096    private $realType;
35097    /**
35098     * Initialises this nullable type using the real type embedded
35099     */
35100    public function __construct(Type $realType)
35101    {
35102        $this->realType = $realType;
35103    }
35104    /**
35105     * Provide access to the actual type directly, if needed.
35106     */
35107    public function getActualType() : Type
35108    {
35109        return $this->realType;
35110    }
35111    /**
35112     * Returns a rendered output of the Type as it would be used in a DocBlock.
35113     */
35114    public function __toString() : string
35115    {
35116        return '?' . $this->realType->__toString();
35117    }
35118}
35119<?php
35120
35121declare (strict_types=1);
35122/**
35123 * This file is part of phpDocumentor.
35124 *
35125 * For the full copyright and license information, please view the LICENSE
35126 * file that was distributed with this source code.
35127 *
35128 * @link      http://phpdoc.org
35129 */
35130namespace PHPUnit\phpDocumentor\Reflection\Types;
35131
35132use PHPUnit\phpDocumentor\Reflection\Fqsen;
35133use PHPUnit\phpDocumentor\Reflection\Type;
35134/**
35135 * Value Object representing the type 'string'.
35136 *
35137 * @psalm-immutable
35138 */
35139final class InterfaceString implements Type
35140{
35141    /** @var Fqsen|null */
35142    private $fqsen;
35143    /**
35144     * Initializes this representation of a class string with the given Fqsen.
35145     */
35146    public function __construct(?Fqsen $fqsen = null)
35147    {
35148        $this->fqsen = $fqsen;
35149    }
35150    /**
35151     * Returns the FQSEN associated with this object.
35152     */
35153    public function getFqsen() : ?Fqsen
35154    {
35155        return $this->fqsen;
35156    }
35157    /**
35158     * Returns a rendered output of the Type as it would be used in a DocBlock.
35159     */
35160    public function __toString() : string
35161    {
35162        if ($this->fqsen === null) {
35163            return 'interface-string';
35164        }
35165        return 'interface-string<' . (string) $this->fqsen . '>';
35166    }
35167}
35168<?php
35169
35170declare (strict_types=1);
35171/**
35172 * This file is part of phpDocumentor.
35173 *
35174 * For the full copyright and license information, please view the LICENSE
35175 * file that was distributed with this source code.
35176 *
35177 * @link      http://phpdoc.org
35178 */
35179namespace PHPUnit\phpDocumentor\Reflection;
35180
35181use InvalidArgumentException;
35182use PHPUnit\phpDocumentor\Reflection\Types\Context;
35183use function explode;
35184use function implode;
35185use function strpos;
35186/**
35187 * Resolver for Fqsen using Context information
35188 *
35189 * @psalm-immutable
35190 */
35191class FqsenResolver
35192{
35193    /** @var string Definition of the NAMESPACE operator in PHP */
35194    private const OPERATOR_NAMESPACE = '\\';
35195    public function resolve(string $fqsen, ?Context $context = null) : Fqsen
35196    {
35197        if ($context === null) {
35198            $context = new Context('');
35199        }
35200        if ($this->isFqsen($fqsen)) {
35201            return new Fqsen($fqsen);
35202        }
35203        return $this->resolvePartialStructuralElementName($fqsen, $context);
35204    }
35205    /**
35206     * Tests whether the given type is a Fully Qualified Structural Element Name.
35207     */
35208    private function isFqsen(string $type) : bool
35209    {
35210        return strpos($type, self::OPERATOR_NAMESPACE) === 0;
35211    }
35212    /**
35213     * Resolves a partial Structural Element Name (i.e. `Reflection\DocBlock`) to its FQSEN representation
35214     * (i.e. `\phpDocumentor\Reflection\DocBlock`) based on the Namespace and aliases mentioned in the Context.
35215     *
35216     * @throws InvalidArgumentException When type is not a valid FQSEN.
35217     */
35218    private function resolvePartialStructuralElementName(string $type, Context $context) : Fqsen
35219    {
35220        $typeParts = explode(self::OPERATOR_NAMESPACE, $type, 2);
35221        $namespaceAliases = $context->getNamespaceAliases();
35222        // if the first segment is not an alias; prepend namespace name and return
35223        if (!isset($namespaceAliases[$typeParts[0]])) {
35224            $namespace = $context->getNamespace();
35225            if ($namespace !== '') {
35226                $namespace .= self::OPERATOR_NAMESPACE;
35227            }
35228            return new Fqsen(self::OPERATOR_NAMESPACE . $namespace . $type);
35229        }
35230        $typeParts[0] = $namespaceAliases[$typeParts[0]];
35231        return new Fqsen(self::OPERATOR_NAMESPACE . implode(self::OPERATOR_NAMESPACE, $typeParts));
35232    }
35233}
35234<?php
35235
35236declare (strict_types=1);
35237/**
35238 * This file is part of phpDocumentor.
35239 *
35240 * For the full copyright and license information, please view the LICENSE
35241 * file that was distributed with this source code.
35242 *
35243 * @link      http://phpdoc.org
35244 */
35245namespace PHPUnit\phpDocumentor\Reflection\PseudoTypes;
35246
35247use PHPUnit\phpDocumentor\Reflection\PseudoType;
35248use PHPUnit\phpDocumentor\Reflection\Type;
35249use PHPUnit\phpDocumentor\Reflection\Types\String_;
35250/**
35251 * Value Object representing the type 'string'.
35252 *
35253 * @psalm-immutable
35254 */
35255final class HtmlEscapedString extends String_ implements PseudoType
35256{
35257    public function underlyingType() : Type
35258    {
35259        return new String_();
35260    }
35261    /**
35262     * Returns a rendered output of the Type as it would be used in a DocBlock.
35263     */
35264    public function __toString() : string
35265    {
35266        return 'html-escaped-string';
35267    }
35268}
35269<?php
35270
35271declare (strict_types=1);
35272/**
35273 * This file is part of phpDocumentor.
35274 *
35275 * For the full copyright and license information, please view the LICENSE
35276 * file that was distributed with this source code.
35277 *
35278 * @link https://phpdoc.org
35279 */
35280namespace PHPUnit\phpDocumentor\Reflection\PseudoTypes;
35281
35282use PHPUnit\phpDocumentor\Reflection\PseudoType;
35283use PHPUnit\phpDocumentor\Reflection\Type;
35284use PHPUnit\phpDocumentor\Reflection\Types\Boolean;
35285use function class_alias;
35286/**
35287 * Value Object representing the PseudoType 'False', which is a Boolean type.
35288 *
35289 * @psalm-immutable
35290 */
35291final class False_ extends Boolean implements PseudoType
35292{
35293    public function underlyingType() : Type
35294    {
35295        return new Boolean();
35296    }
35297    public function __toString() : string
35298    {
35299        return 'false';
35300    }
35301}
35302class_alias('PHPUnit\\phpDocumentor\\Reflection\\PseudoTypes\\False_', 'PHPUnit\\phpDocumentor\\Reflection\\Types\\False_', \false);
35303<?php
35304
35305declare (strict_types=1);
35306/**
35307 * This file is part of phpDocumentor.
35308 *
35309 * For the full copyright and license information, please view the LICENSE
35310 * file that was distributed with this source code.
35311 *
35312 * @link      http://phpdoc.org
35313 */
35314namespace PHPUnit\phpDocumentor\Reflection\PseudoTypes;
35315
35316use PHPUnit\phpDocumentor\Reflection\PseudoType;
35317use PHPUnit\phpDocumentor\Reflection\Type;
35318use PHPUnit\phpDocumentor\Reflection\Types\String_;
35319/**
35320 * Value Object representing the type 'string'.
35321 *
35322 * @psalm-immutable
35323 */
35324final class NonEmptyString extends String_ implements PseudoType
35325{
35326    public function underlyingType() : Type
35327    {
35328        return new String_();
35329    }
35330    /**
35331     * Returns a rendered output of the Type as it would be used in a DocBlock.
35332     */
35333    public function __toString() : string
35334    {
35335        return 'non-empty-string';
35336    }
35337}
35338<?php
35339
35340declare (strict_types=1);
35341/**
35342 * This file is part of phpDocumentor.
35343 *
35344 * For the full copyright and license information, please view the LICENSE
35345 * file that was distributed with this source code.
35346 *
35347 * @link      http://phpdoc.org
35348 */
35349namespace PHPUnit\phpDocumentor\Reflection\PseudoTypes;
35350
35351use PHPUnit\phpDocumentor\Reflection\PseudoType;
35352use PHPUnit\phpDocumentor\Reflection\Type;
35353use PHPUnit\phpDocumentor\Reflection\Types\String_;
35354/**
35355 * Value Object representing the type 'string'.
35356 *
35357 * @psalm-immutable
35358 */
35359final class TraitString extends String_ implements PseudoType
35360{
35361    public function underlyingType() : Type
35362    {
35363        return new String_();
35364    }
35365    /**
35366     * Returns a rendered output of the Type as it would be used in a DocBlock.
35367     */
35368    public function __toString() : string
35369    {
35370        return 'trait-string';
35371    }
35372}
35373<?php
35374
35375declare (strict_types=1);
35376/**
35377 * This file is part of phpDocumentor.
35378 *
35379 * For the full copyright and license information, please view the LICENSE
35380 * file that was distributed with this source code.
35381 *
35382 * @link https://phpdoc.org
35383 */
35384namespace PHPUnit\phpDocumentor\Reflection\PseudoTypes;
35385
35386use PHPUnit\phpDocumentor\Reflection\PseudoType;
35387use PHPUnit\phpDocumentor\Reflection\Type;
35388use PHPUnit\phpDocumentor\Reflection\Types\Boolean;
35389use function class_alias;
35390/**
35391 * Value Object representing the PseudoType 'False', which is a Boolean type.
35392 *
35393 * @psalm-immutable
35394 */
35395final class True_ extends Boolean implements PseudoType
35396{
35397    public function underlyingType() : Type
35398    {
35399        return new Boolean();
35400    }
35401    public function __toString() : string
35402    {
35403        return 'true';
35404    }
35405}
35406class_alias('PHPUnit\\phpDocumentor\\Reflection\\PseudoTypes\\True_', 'PHPUnit\\phpDocumentor\\Reflection\\Types\\True_', \false);
35407<?php
35408
35409declare (strict_types=1);
35410/**
35411 * This file is part of phpDocumentor.
35412 *
35413 * For the full copyright and license information, please view the LICENSE
35414 * file that was distributed with this source code.
35415 *
35416 * @link      http://phpdoc.org
35417 */
35418namespace PHPUnit\phpDocumentor\Reflection\PseudoTypes;
35419
35420use PHPUnit\phpDocumentor\Reflection\PseudoType;
35421use PHPUnit\phpDocumentor\Reflection\Type;
35422use PHPUnit\phpDocumentor\Reflection\Types\String_;
35423/**
35424 * Value Object representing the type 'string'.
35425 *
35426 * @psalm-immutable
35427 */
35428final class CallableString extends String_ implements PseudoType
35429{
35430    public function underlyingType() : Type
35431    {
35432        return new String_();
35433    }
35434    /**
35435     * Returns a rendered output of the Type as it would be used in a DocBlock.
35436     */
35437    public function __toString() : string
35438    {
35439        return 'callable-string';
35440    }
35441}
35442<?php
35443
35444declare (strict_types=1);
35445/**
35446 * This file is part of phpDocumentor.
35447 *
35448 * For the full copyright and license information, please view the LICENSE
35449 * file that was distributed with this source code.
35450 *
35451 * @link      http://phpdoc.org
35452 */
35453namespace PHPUnit\phpDocumentor\Reflection\PseudoTypes;
35454
35455use PHPUnit\phpDocumentor\Reflection\PseudoType;
35456use PHPUnit\phpDocumentor\Reflection\Type;
35457use PHPUnit\phpDocumentor\Reflection\Types\String_;
35458/**
35459 * Value Object representing the type 'string'.
35460 *
35461 * @psalm-immutable
35462 */
35463final class NonEmptyLowercaseString extends String_ implements PseudoType
35464{
35465    public function underlyingType() : Type
35466    {
35467        return new String_();
35468    }
35469    /**
35470     * Returns a rendered output of the Type as it would be used in a DocBlock.
35471     */
35472    public function __toString() : string
35473    {
35474        return 'non-empty-lowercase-string';
35475    }
35476}
35477<?php
35478
35479declare (strict_types=1);
35480/**
35481 * This file is part of phpDocumentor.
35482 *
35483 * For the full copyright and license information, please view the LICENSE
35484 * file that was distributed with this source code.
35485 *
35486 * @link      http://phpdoc.org
35487 */
35488namespace PHPUnit\phpDocumentor\Reflection\PseudoTypes;
35489
35490use PHPUnit\phpDocumentor\Reflection\PseudoType;
35491use PHPUnit\phpDocumentor\Reflection\Type;
35492use PHPUnit\phpDocumentor\Reflection\Types\String_;
35493/**
35494 * Value Object representing the type 'string'.
35495 *
35496 * @psalm-immutable
35497 */
35498final class NumericString extends String_ implements PseudoType
35499{
35500    public function underlyingType() : Type
35501    {
35502        return new String_();
35503    }
35504    /**
35505     * Returns a rendered output of the Type as it would be used in a DocBlock.
35506     */
35507    public function __toString() : string
35508    {
35509        return 'numeric-string';
35510    }
35511}
35512<?php
35513
35514declare (strict_types=1);
35515/**
35516 * This file is part of phpDocumentor.
35517 *
35518 * For the full copyright and license information, please view the LICENSE
35519 * file that was distributed with this source code.
35520 *
35521 * @link      http://phpdoc.org
35522 */
35523namespace PHPUnit\phpDocumentor\Reflection\PseudoTypes;
35524
35525use PHPUnit\phpDocumentor\Reflection\PseudoType;
35526use PHPUnit\phpDocumentor\Reflection\Type;
35527use PHPUnit\phpDocumentor\Reflection\Types\String_;
35528/**
35529 * Value Object representing the type 'string'.
35530 *
35531 * @psalm-immutable
35532 */
35533final class LowercaseString extends String_ implements PseudoType
35534{
35535    public function underlyingType() : Type
35536    {
35537        return new String_();
35538    }
35539    /**
35540     * Returns a rendered output of the Type as it would be used in a DocBlock.
35541     */
35542    public function __toString() : string
35543    {
35544        return 'lowercase-string';
35545    }
35546}
35547<?php
35548
35549declare (strict_types=1);
35550/**
35551 * This file is part of phpDocumentor.
35552 *
35553 * For the full copyright and license information, please view the LICENSE
35554 * file that was distributed with this source code.
35555 *
35556 * @link      http://phpdoc.org
35557 */
35558namespace PHPUnit\phpDocumentor\Reflection\PseudoTypes;
35559
35560use PHPUnit\phpDocumentor\Reflection\PseudoType;
35561use PHPUnit\phpDocumentor\Reflection\Type;
35562use PHPUnit\phpDocumentor\Reflection\Types\Integer;
35563/**
35564 * Value Object representing the type 'string'.
35565 *
35566 * @psalm-immutable
35567 */
35568final class PositiveInteger extends Integer implements PseudoType
35569{
35570    public function underlyingType() : Type
35571    {
35572        return new Integer();
35573    }
35574    /**
35575     * Returns a rendered output of the Type as it would be used in a DocBlock.
35576     */
35577    public function __toString() : string
35578    {
35579        return 'positive-int';
35580    }
35581}
35582<?php
35583
35584declare (strict_types=1);
35585/**
35586 * This file is part of phpDocumentor.
35587 *
35588 * For the full copyright and license information, please view the LICENSE
35589 * file that was distributed with this source code.
35590 *
35591 * @link      http://phpdoc.org
35592 */
35593namespace PHPUnit\phpDocumentor\Reflection;
35594
35595/**
35596 * @psalm-immutable
35597 */
35598interface Type
35599{
35600    /**
35601     * Returns a rendered output of the Type as it would be used in a DocBlock.
35602     */
35603    public function __toString() : string;
35604}
35605<?php
35606
35607declare (strict_types=1);
35608/**
35609 * This file is part of phpDocumentor.
35610 *
35611 * For the full copyright and license information, please view the LICENSE
35612 * file that was distributed with this source code.
35613 *
35614 * @link      http://phpdoc.org
35615 */
35616namespace PHPUnit\phpDocumentor\Reflection;
35617
35618interface PseudoType extends Type
35619{
35620    public function underlyingType() : Type;
35621}
35622The MIT License (MIT)
35623
35624Copyright (c) 2010 Mike van Riel
35625
35626Permission is hereby granted, free of charge, to any person obtaining a copy
35627of this software and associated documentation files (the "Software"), to deal
35628in the Software without restriction, including without limitation the rights
35629to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
35630copies of the Software, and to permit persons to whom the Software is
35631furnished to do so, subject to the following conditions:
35632
35633The above copyright notice and this permission notice shall be included in
35634all copies or substantial portions of the Software.
35635
35636THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35637IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35638FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
35639AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35640LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
35641OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
35642THE SOFTWARE.
35643<?php
35644
35645declare (strict_types=1);
35646/**
35647 * This file is part of phpDocumentor.
35648 *
35649 * For the full copyright and license information, please view the LICENSE
35650 * file that was distributed with this source code.
35651 *
35652 * @link      http://phpdoc.org
35653 */
35654namespace PHPUnit\phpDocumentor\Reflection;
35655
35656use ArrayIterator;
35657use InvalidArgumentException;
35658use PHPUnit\phpDocumentor\Reflection\Types\Array_;
35659use PHPUnit\phpDocumentor\Reflection\Types\ClassString;
35660use PHPUnit\phpDocumentor\Reflection\Types\Collection;
35661use PHPUnit\phpDocumentor\Reflection\Types\Compound;
35662use PHPUnit\phpDocumentor\Reflection\Types\Context;
35663use PHPUnit\phpDocumentor\Reflection\Types\Expression;
35664use PHPUnit\phpDocumentor\Reflection\Types\Integer;
35665use PHPUnit\phpDocumentor\Reflection\Types\InterfaceString;
35666use PHPUnit\phpDocumentor\Reflection\Types\Intersection;
35667use PHPUnit\phpDocumentor\Reflection\Types\Iterable_;
35668use PHPUnit\phpDocumentor\Reflection\Types\Nullable;
35669use PHPUnit\phpDocumentor\Reflection\Types\Object_;
35670use PHPUnit\phpDocumentor\Reflection\Types\String_;
35671use RuntimeException;
35672use function array_key_exists;
35673use function array_pop;
35674use function array_values;
35675use function class_exists;
35676use function class_implements;
35677use function count;
35678use function end;
35679use function in_array;
35680use function key;
35681use function preg_split;
35682use function strpos;
35683use function strtolower;
35684use function trim;
35685use const PREG_SPLIT_DELIM_CAPTURE;
35686use const PREG_SPLIT_NO_EMPTY;
35687final class TypeResolver
35688{
35689    /** @var string Definition of the ARRAY operator for types */
35690    private const OPERATOR_ARRAY = '[]';
35691    /** @var string Definition of the NAMESPACE operator in PHP */
35692    private const OPERATOR_NAMESPACE = '\\';
35693    /** @var int the iterator parser is inside a compound context */
35694    private const PARSER_IN_COMPOUND = 0;
35695    /** @var int the iterator parser is inside a nullable expression context */
35696    private const PARSER_IN_NULLABLE = 1;
35697    /** @var int the iterator parser is inside an array expression context */
35698    private const PARSER_IN_ARRAY_EXPRESSION = 2;
35699    /** @var int the iterator parser is inside a collection expression context */
35700    private const PARSER_IN_COLLECTION_EXPRESSION = 3;
35701    /**
35702     * @var array<string, string> List of recognized keywords and unto which Value Object they map
35703     * @psalm-var array<string, class-string<Type>>
35704     */
35705    private $keywords = ['string' => Types\String_::class, 'class-string' => Types\ClassString::class, 'interface-string' => Types\InterfaceString::class, 'html-escaped-string' => PseudoTypes\HtmlEscapedString::class, 'lowercase-string' => PseudoTypes\LowercaseString::class, 'non-empty-lowercase-string' => PseudoTypes\NonEmptyLowercaseString::class, 'non-empty-string' => PseudoTypes\NonEmptyString::class, 'numeric-string' => PseudoTypes\NumericString::class, 'trait-string' => PseudoTypes\TraitString::class, 'int' => Types\Integer::class, 'integer' => Types\Integer::class, 'positive-int' => PseudoTypes\PositiveInteger::class, 'bool' => Types\Boolean::class, 'boolean' => Types\Boolean::class, 'real' => Types\Float_::class, 'float' => Types\Float_::class, 'double' => Types\Float_::class, 'object' => Types\Object_::class, 'mixed' => Types\Mixed_::class, 'array' => Types\Array_::class, 'array-key' => Types\ArrayKey::class, 'resource' => Types\Resource_::class, 'void' => Types\Void_::class, 'null' => Types\Null_::class, 'scalar' => Types\Scalar::class, 'callback' => Types\Callable_::class, 'callable' => Types\Callable_::class, 'callable-string' => PseudoTypes\CallableString::class, 'false' => PseudoTypes\False_::class, 'true' => PseudoTypes\True_::class, 'self' => Types\Self_::class, '$this' => Types\This::class, 'static' => Types\Static_::class, 'parent' => Types\Parent_::class, 'iterable' => Types\Iterable_::class, 'never' => Types\Never_::class];
35706    /**
35707     * @var FqsenResolver
35708     * @psalm-readonly
35709     */
35710    private $fqsenResolver;
35711    /**
35712     * Initializes this TypeResolver with the means to create and resolve Fqsen objects.
35713     */
35714    public function __construct(?FqsenResolver $fqsenResolver = null)
35715    {
35716        $this->fqsenResolver = $fqsenResolver ?: new FqsenResolver();
35717    }
35718    /**
35719     * Analyzes the given type and returns the FQCN variant.
35720     *
35721     * When a type is provided this method checks whether it is not a keyword or
35722     * Fully Qualified Class Name. If so it will use the given namespace and
35723     * aliases to expand the type to a FQCN representation.
35724     *
35725     * This method only works as expected if the namespace and aliases are set;
35726     * no dynamic reflection is being performed here.
35727     *
35728     * @uses Context::getNamespaceAliases() to check whether the first part of the relative type name should not be
35729     * replaced with another namespace.
35730     * @uses Context::getNamespace()        to determine with what to prefix the type name.
35731     *
35732     * @param string $type The relative or absolute type.
35733     */
35734    public function resolve(string $type, ?Context $context = null) : Type
35735    {
35736        $type = trim($type);
35737        if (!$type) {
35738            throw new InvalidArgumentException('Attempted to resolve "' . $type . '" but it appears to be empty');
35739        }
35740        if ($context === null) {
35741            $context = new Context('');
35742        }
35743        // split the type string into tokens `|`, `?`, `<`, `>`, `,`, `(`, `)`, `[]`, '<', '>' and type names
35744        $tokens = preg_split('/(\\||\\?|<|>|&|, ?|\\(|\\)|\\[\\]+)/', $type, -1, \PREG_SPLIT_NO_EMPTY | \PREG_SPLIT_DELIM_CAPTURE);
35745        if ($tokens === \false) {
35746            throw new InvalidArgumentException('Unable to split the type string "' . $type . '" into tokens');
35747        }
35748        /** @var ArrayIterator<int, string|null> $tokenIterator */
35749        $tokenIterator = new ArrayIterator($tokens);
35750        return $this->parseTypes($tokenIterator, $context, self::PARSER_IN_COMPOUND);
35751    }
35752    /**
35753     * Analyse each tokens and creates types
35754     *
35755     * @param ArrayIterator<int, string|null> $tokens        the iterator on tokens
35756     * @param int                        $parserContext on of self::PARSER_* constants, indicating
35757     * the context where we are in the parsing
35758     */
35759    private function parseTypes(ArrayIterator $tokens, Context $context, int $parserContext) : Type
35760    {
35761        $types = [];
35762        $token = '';
35763        $compoundToken = '|';
35764        while ($tokens->valid()) {
35765            $token = $tokens->current();
35766            if ($token === null) {
35767                throw new RuntimeException('Unexpected nullable character');
35768            }
35769            if ($token === '|' || $token === '&') {
35770                if (count($types) === 0) {
35771                    throw new RuntimeException('A type is missing before a type separator');
35772                }
35773                if (!in_array($parserContext, [self::PARSER_IN_COMPOUND, self::PARSER_IN_ARRAY_EXPRESSION, self::PARSER_IN_COLLECTION_EXPRESSION], \true)) {
35774                    throw new RuntimeException('Unexpected type separator');
35775                }
35776                $compoundToken = $token;
35777                $tokens->next();
35778            } elseif ($token === '?') {
35779                if (!in_array($parserContext, [self::PARSER_IN_COMPOUND, self::PARSER_IN_ARRAY_EXPRESSION, self::PARSER_IN_COLLECTION_EXPRESSION], \true)) {
35780                    throw new RuntimeException('Unexpected nullable character');
35781                }
35782                $tokens->next();
35783                $type = $this->parseTypes($tokens, $context, self::PARSER_IN_NULLABLE);
35784                $types[] = new Nullable($type);
35785            } elseif ($token === '(') {
35786                $tokens->next();
35787                $type = $this->parseTypes($tokens, $context, self::PARSER_IN_ARRAY_EXPRESSION);
35788                $token = $tokens->current();
35789                if ($token === null) {
35790                    // Someone did not properly close their array expression ..
35791                    break;
35792                }
35793                $tokens->next();
35794                $resolvedType = new Expression($type);
35795                $types[] = $resolvedType;
35796            } elseif ($parserContext === self::PARSER_IN_ARRAY_EXPRESSION && isset($token[0]) && $token[0] === ')') {
35797                break;
35798            } elseif ($token === '<') {
35799                if (count($types) === 0) {
35800                    throw new RuntimeException('Unexpected collection operator "<", class name is missing');
35801                }
35802                $classType = array_pop($types);
35803                if ($classType !== null) {
35804                    if ((string) $classType === 'class-string') {
35805                        $types[] = $this->resolveClassString($tokens, $context);
35806                    } elseif ((string) $classType === 'interface-string') {
35807                        $types[] = $this->resolveInterfaceString($tokens, $context);
35808                    } else {
35809                        $types[] = $this->resolveCollection($tokens, $classType, $context);
35810                    }
35811                }
35812                $tokens->next();
35813            } elseif ($parserContext === self::PARSER_IN_COLLECTION_EXPRESSION && ($token === '>' || trim($token) === ',')) {
35814                break;
35815            } elseif ($token === self::OPERATOR_ARRAY) {
35816                end($types);
35817                $last = key($types);
35818                $lastItem = $types[$last];
35819                if ($lastItem instanceof Expression) {
35820                    $lastItem = $lastItem->getValueType();
35821                }
35822                $types[$last] = new Array_($lastItem);
35823                $tokens->next();
35824            } else {
35825                $type = $this->resolveSingleType($token, $context);
35826                $tokens->next();
35827                if ($parserContext === self::PARSER_IN_NULLABLE) {
35828                    return $type;
35829                }
35830                $types[] = $type;
35831            }
35832        }
35833        if ($token === '|' || $token === '&') {
35834            throw new RuntimeException('A type is missing after a type separator');
35835        }
35836        if (count($types) === 0) {
35837            if ($parserContext === self::PARSER_IN_NULLABLE) {
35838                throw new RuntimeException('A type is missing after a nullable character');
35839            }
35840            if ($parserContext === self::PARSER_IN_ARRAY_EXPRESSION) {
35841                throw new RuntimeException('A type is missing in an array expression');
35842            }
35843            if ($parserContext === self::PARSER_IN_COLLECTION_EXPRESSION) {
35844                throw new RuntimeException('A type is missing in a collection expression');
35845            }
35846        } elseif (count($types) === 1) {
35847            return $types[0];
35848        }
35849        if ($compoundToken === '|') {
35850            return new Compound(array_values($types));
35851        }
35852        return new Intersection(array_values($types));
35853    }
35854    /**
35855     * resolve the given type into a type object
35856     *
35857     * @param string $type the type string, representing a single type
35858     *
35859     * @return Type|Array_|Object_
35860     *
35861     * @psalm-mutation-free
35862     */
35863    private function resolveSingleType(string $type, Context $context) : object
35864    {
35865        switch (\true) {
35866            case $this->isKeyword($type):
35867                return $this->resolveKeyword($type);
35868            case $this->isFqsen($type):
35869                return $this->resolveTypedObject($type);
35870            case $this->isPartialStructuralElementName($type):
35871                return $this->resolveTypedObject($type, $context);
35872            // @codeCoverageIgnoreStart
35873            default:
35874                // I haven't got the foggiest how the logic would come here but added this as a defense.
35875                throw new RuntimeException('Unable to resolve type "' . $type . '", there is no known method to resolve it');
35876        }
35877        // @codeCoverageIgnoreEnd
35878    }
35879    /**
35880     * Adds a keyword to the list of Keywords and associates it with a specific Value Object.
35881     *
35882     * @psalm-param class-string<Type> $typeClassName
35883     */
35884    public function addKeyword(string $keyword, string $typeClassName) : void
35885    {
35886        if (!class_exists($typeClassName)) {
35887            throw new InvalidArgumentException('The Value Object that needs to be created with a keyword "' . $keyword . '" must be an existing class' . ' but we could not find the class ' . $typeClassName);
35888        }
35889        $interfaces = class_implements($typeClassName);
35890        if ($interfaces === \false) {
35891            throw new InvalidArgumentException('The Value Object that needs to be created with a keyword "' . $keyword . '" must be an existing class' . ' but we could not find the class ' . $typeClassName);
35892        }
35893        if (!in_array(Type::class, $interfaces, \true)) {
35894            throw new InvalidArgumentException('The class "' . $typeClassName . '" must implement the interface "phpDocumentor\\Reflection\\Type"');
35895        }
35896        $this->keywords[$keyword] = $typeClassName;
35897    }
35898    /**
35899     * Detects whether the given type represents a PHPDoc keyword.
35900     *
35901     * @param string $type A relative or absolute type as defined in the phpDocumentor documentation.
35902     *
35903     * @psalm-mutation-free
35904     */
35905    private function isKeyword(string $type) : bool
35906    {
35907        return array_key_exists(strtolower($type), $this->keywords);
35908    }
35909    /**
35910     * Detects whether the given type represents a relative structural element name.
35911     *
35912     * @param string $type A relative or absolute type as defined in the phpDocumentor documentation.
35913     *
35914     * @psalm-mutation-free
35915     */
35916    private function isPartialStructuralElementName(string $type) : bool
35917    {
35918        return isset($type[0]) && $type[0] !== self::OPERATOR_NAMESPACE && !$this->isKeyword($type);
35919    }
35920    /**
35921     * Tests whether the given type is a Fully Qualified Structural Element Name.
35922     *
35923     * @psalm-mutation-free
35924     */
35925    private function isFqsen(string $type) : bool
35926    {
35927        return strpos($type, self::OPERATOR_NAMESPACE) === 0;
35928    }
35929    /**
35930     * Resolves the given keyword (such as `string`) into a Type object representing that keyword.
35931     *
35932     * @psalm-mutation-free
35933     */
35934    private function resolveKeyword(string $type) : Type
35935    {
35936        $className = $this->keywords[strtolower($type)];
35937        return new $className();
35938    }
35939    /**
35940     * Resolves the given FQSEN string into an FQSEN object.
35941     *
35942     * @psalm-mutation-free
35943     */
35944    private function resolveTypedObject(string $type, ?Context $context = null) : Object_
35945    {
35946        return new Object_($this->fqsenResolver->resolve($type, $context));
35947    }
35948    /**
35949     * Resolves class string
35950     *
35951     * @param ArrayIterator<int, (string|null)> $tokens
35952     */
35953    private function resolveClassString(ArrayIterator $tokens, Context $context) : Type
35954    {
35955        $tokens->next();
35956        $classType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION);
35957        if (!$classType instanceof Object_ || $classType->getFqsen() === null) {
35958            throw new RuntimeException($classType . ' is not a class string');
35959        }
35960        $token = $tokens->current();
35961        if ($token !== '>') {
35962            if (empty($token)) {
35963                throw new RuntimeException('class-string: ">" is missing');
35964            }
35965            throw new RuntimeException('Unexpected character "' . $token . '", ">" is missing');
35966        }
35967        return new ClassString($classType->getFqsen());
35968    }
35969    /**
35970     * Resolves class string
35971     *
35972     * @param ArrayIterator<int, (string|null)> $tokens
35973     */
35974    private function resolveInterfaceString(ArrayIterator $tokens, Context $context) : Type
35975    {
35976        $tokens->next();
35977        $classType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION);
35978        if (!$classType instanceof Object_ || $classType->getFqsen() === null) {
35979            throw new RuntimeException($classType . ' is not a interface string');
35980        }
35981        $token = $tokens->current();
35982        if ($token !== '>') {
35983            if (empty($token)) {
35984                throw new RuntimeException('interface-string: ">" is missing');
35985            }
35986            throw new RuntimeException('Unexpected character "' . $token . '", ">" is missing');
35987        }
35988        return new InterfaceString($classType->getFqsen());
35989    }
35990    /**
35991     * Resolves the collection values and keys
35992     *
35993     * @param ArrayIterator<int, (string|null)> $tokens
35994     *
35995     * @return Array_|Iterable_|Collection
35996     */
35997    private function resolveCollection(ArrayIterator $tokens, Type $classType, Context $context) : Type
35998    {
35999        $isArray = (string) $classType === 'array';
36000        $isIterable = (string) $classType === 'iterable';
36001        // allow only "array", "iterable" or class name before "<"
36002        if (!$isArray && !$isIterable && (!$classType instanceof Object_ || $classType->getFqsen() === null)) {
36003            throw new RuntimeException($classType . ' is not a collection');
36004        }
36005        $tokens->next();
36006        $valueType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION);
36007        $keyType = null;
36008        $token = $tokens->current();
36009        if ($token !== null && trim($token) === ',') {
36010            // if we have a comma, then we just parsed the key type, not the value type
36011            $keyType = $valueType;
36012            if ($isArray) {
36013                // check the key type for an "array" collection. We allow only
36014                // strings or integers.
36015                if (!$keyType instanceof String_ && !$keyType instanceof Integer && !$keyType instanceof Compound) {
36016                    throw new RuntimeException('An array can have only integers or strings as keys');
36017                }
36018                if ($keyType instanceof Compound) {
36019                    foreach ($keyType->getIterator() as $item) {
36020                        if (!$item instanceof String_ && !$item instanceof Integer) {
36021                            throw new RuntimeException('An array can have only integers or strings as keys');
36022                        }
36023                    }
36024                }
36025            }
36026            $tokens->next();
36027            // now let's parse the value type
36028            $valueType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION);
36029        }
36030        $token = $tokens->current();
36031        if ($token !== '>') {
36032            if (empty($token)) {
36033                throw new RuntimeException('Collection: ">" is missing');
36034            }
36035            throw new RuntimeException('Unexpected character "' . $token . '", ">" is missing');
36036        }
36037        if ($isArray) {
36038            return new Array_($valueType, $keyType);
36039        }
36040        if ($isIterable) {
36041            return new Iterable_($valueType, $keyType);
36042        }
36043        if ($classType instanceof Object_) {
36044            return $this->makeCollectionFromObject($classType, $valueType, $keyType);
36045        }
36046        throw new RuntimeException('Invalid $classType provided');
36047    }
36048    /**
36049     * @psalm-pure
36050     */
36051    private function makeCollectionFromObject(Object_ $object, Type $valueType, ?Type $keyType = null) : Collection
36052    {
36053        return new Collection($object->getFqsen(), $valueType, $keyType);
36054    }
36055}
36056<?php
36057
36058declare (strict_types=1);
36059/*
36060 * This file is part of sebastian/environment.
36061 *
36062 * (c) Sebastian Bergmann <sebastian@phpunit.de>
36063 *
36064 * For the full copyright and license information, please view the LICENSE
36065 * file that was distributed with this source code.
36066 */
36067namespace PHPUnit\SebastianBergmann\Environment;
36068
36069use const DIRECTORY_SEPARATOR;
36070use const STDIN;
36071use const STDOUT;
36072use function defined;
36073use function fclose;
36074use function fstat;
36075use function function_exists;
36076use function getenv;
36077use function is_resource;
36078use function is_string;
36079use function posix_isatty;
36080use function preg_match;
36081use function proc_close;
36082use function proc_open;
36083use function sapi_windows_vt100_support;
36084use function shell_exec;
36085use function stream_get_contents;
36086use function stream_isatty;
36087use function trim;
36088final class Console
36089{
36090    /**
36091     * @var int
36092     */
36093    public const STDIN = 0;
36094    /**
36095     * @var int
36096     */
36097    public const STDOUT = 1;
36098    /**
36099     * @var int
36100     */
36101    public const STDERR = 2;
36102    /**
36103     * Returns true if STDOUT supports colorization.
36104     *
36105     * This code has been copied and adapted from
36106     * Symfony\Component\Console\Output\StreamOutput.
36107     */
36108    public function hasColorSupport() : bool
36109    {
36110        if ('Hyper' === getenv('TERM_PROGRAM')) {
36111            return \true;
36112        }
36113        if ($this->isWindows()) {
36114            // @codeCoverageIgnoreStart
36115            return defined('STDOUT') && function_exists('sapi_windows_vt100_support') && @sapi_windows_vt100_support(\STDOUT) || \false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') || 'xterm' === getenv('TERM');
36116            // @codeCoverageIgnoreEnd
36117        }
36118        if (!defined('STDOUT')) {
36119            // @codeCoverageIgnoreStart
36120            return \false;
36121            // @codeCoverageIgnoreEnd
36122        }
36123        return $this->isInteractive(\STDOUT);
36124    }
36125    /**
36126     * Returns the number of columns of the terminal.
36127     *
36128     * @codeCoverageIgnore
36129     */
36130    public function getNumberOfColumns() : int
36131    {
36132        if (!$this->isInteractive(defined('STDIN') ? \STDIN : self::STDIN)) {
36133            return 80;
36134        }
36135        if ($this->isWindows()) {
36136            return $this->getNumberOfColumnsWindows();
36137        }
36138        return $this->getNumberOfColumnsInteractive();
36139    }
36140    /**
36141     * Returns if the file descriptor is an interactive terminal or not.
36142     *
36143     * Normally, we want to use a resource as a parameter, yet sadly it's not always awailable,
36144     * eg when running code in interactive console (`php -a`), STDIN/STDOUT/STDERR constants are not defined.
36145     *
36146     * @param int|resource $fileDescriptor
36147     */
36148    public function isInteractive($fileDescriptor = self::STDOUT) : bool
36149    {
36150        if (is_resource($fileDescriptor)) {
36151            // These functions require a descriptor that is a real resource, not a numeric ID of it
36152            if (function_exists('stream_isatty') && @stream_isatty($fileDescriptor)) {
36153                return \true;
36154            }
36155            // Check if formatted mode is S_IFCHR
36156            if (function_exists('fstat') && @stream_isatty($fileDescriptor)) {
36157                $stat = @fstat(\STDOUT);
36158                return $stat ? 020000 === ($stat['mode'] & 0170000) : \false;
36159            }
36160            return \false;
36161        }
36162        return function_exists('posix_isatty') && @posix_isatty($fileDescriptor);
36163    }
36164    private function isWindows() : bool
36165    {
36166        return \DIRECTORY_SEPARATOR === '\\';
36167    }
36168    /**
36169     * @codeCoverageIgnore
36170     */
36171    private function getNumberOfColumnsInteractive() : int
36172    {
36173        if (function_exists('shell_exec') && preg_match('#\\d+ (\\d+)#', shell_exec('stty size') ?: '', $match) === 1) {
36174            if ((int) $match[1] > 0) {
36175                return (int) $match[1];
36176            }
36177        }
36178        if (function_exists('shell_exec') && preg_match('#columns = (\\d+);#', shell_exec('stty') ?: '', $match) === 1) {
36179            if ((int) $match[1] > 0) {
36180                return (int) $match[1];
36181            }
36182        }
36183        return 80;
36184    }
36185    /**
36186     * @codeCoverageIgnore
36187     */
36188    private function getNumberOfColumnsWindows() : int
36189    {
36190        $ansicon = getenv('ANSICON');
36191        $columns = 80;
36192        if (is_string($ansicon) && preg_match('/^(\\d+)x\\d+ \\(\\d+x(\\d+)\\)$/', trim($ansicon), $matches)) {
36193            $columns = (int) $matches[1];
36194        } elseif (function_exists('proc_open')) {
36195            $process = proc_open('mode CON', [1 => ['pipe', 'w'], 2 => ['pipe', 'w']], $pipes, null, null, ['suppress_errors' => \true]);
36196            if (is_resource($process)) {
36197                $info = stream_get_contents($pipes[1]);
36198                fclose($pipes[1]);
36199                fclose($pipes[2]);
36200                proc_close($process);
36201                if (preg_match('/--------+\\r?\\n.+?(\\d+)\\r?\\n.+?(\\d+)\\r?\\n/', $info, $matches)) {
36202                    $columns = (int) $matches[2];
36203                }
36204            }
36205        }
36206        return $columns - 1;
36207    }
36208}
36209<?php
36210
36211declare (strict_types=1);
36212/*
36213 * This file is part of sebastian/environment.
36214 *
36215 * (c) Sebastian Bergmann <sebastian@phpunit.de>
36216 *
36217 * For the full copyright and license information, please view the LICENSE
36218 * file that was distributed with this source code.
36219 */
36220namespace PHPUnit\SebastianBergmann\Environment;
36221
36222use const DIRECTORY_SEPARATOR;
36223use const PHP_OS;
36224use const PHP_OS_FAMILY;
36225use function defined;
36226final class OperatingSystem
36227{
36228    /**
36229     * Returns PHP_OS_FAMILY (if defined (which it is on PHP >= 7.2)).
36230     * Returns a string (compatible with PHP_OS_FAMILY) derived from PHP_OS otherwise.
36231     */
36232    public function getFamily() : string
36233    {
36234        if (defined('PHP_OS_FAMILY')) {
36235            return \PHP_OS_FAMILY;
36236        }
36237        if (\DIRECTORY_SEPARATOR === '\\') {
36238            return 'Windows';
36239        }
36240        switch (\PHP_OS) {
36241            case 'Darwin':
36242                return 'Darwin';
36243            case 'DragonFly':
36244            case 'FreeBSD':
36245            case 'NetBSD':
36246            case 'OpenBSD':
36247                return 'BSD';
36248            case 'Linux':
36249                return 'Linux';
36250            case 'SunOS':
36251                return 'Solaris';
36252            default:
36253                return 'Unknown';
36254        }
36255    }
36256}
36257<?php
36258
36259declare (strict_types=1);
36260/*
36261 * This file is part of sebastian/environment.
36262 *
36263 * (c) Sebastian Bergmann <sebastian@phpunit.de>
36264 *
36265 * For the full copyright and license information, please view the LICENSE
36266 * file that was distributed with this source code.
36267 */
36268namespace PHPUnit\SebastianBergmann\Environment;
36269
36270use const PHP_BINARY;
36271use const PHP_BINDIR;
36272use const PHP_MAJOR_VERSION;
36273use const PHP_SAPI;
36274use const PHP_VERSION;
36275use function array_map;
36276use function array_merge;
36277use function defined;
36278use function escapeshellarg;
36279use function explode;
36280use function extension_loaded;
36281use function getenv;
36282use function ini_get;
36283use function is_readable;
36284use function parse_ini_file;
36285use function php_ini_loaded_file;
36286use function php_ini_scanned_files;
36287use function phpversion;
36288use function sprintf;
36289use function strpos;
36290/**
36291 * Utility class for HHVM/PHP environment handling.
36292 */
36293final class Runtime
36294{
36295    /**
36296     * @var string
36297     */
36298    private static $binary;
36299    /**
36300     * Returns true when Xdebug or PCOV is available or
36301     * the runtime used is PHPDBG.
36302     */
36303    public function canCollectCodeCoverage() : bool
36304    {
36305        return $this->hasXdebug() || $this->hasPCOV() || $this->hasPHPDBGCodeCoverage();
36306    }
36307    /**
36308     * Returns true when Zend OPcache is loaded, enabled,
36309     * and is configured to discard comments.
36310     */
36311    public function discardsComments() : bool
36312    {
36313        if (!$this->isOpcacheActive()) {
36314            return \false;
36315        }
36316        if (ini_get('opcache.save_comments') !== '0') {
36317            return \false;
36318        }
36319        return \true;
36320    }
36321    /**
36322     * Returns true when Zend OPcache is loaded, enabled,
36323     * and is configured to perform just-in-time compilation.
36324     */
36325    public function performsJustInTimeCompilation() : bool
36326    {
36327        if (\PHP_MAJOR_VERSION < 8) {
36328            return \false;
36329        }
36330        if (!$this->isOpcacheActive()) {
36331            return \false;
36332        }
36333        if (strpos(ini_get('opcache.jit'), '0') === 0) {
36334            return \false;
36335        }
36336        return \true;
36337    }
36338    /**
36339     * Returns the path to the binary of the current runtime.
36340     * Appends ' --php' to the path when the runtime is HHVM.
36341     */
36342    public function getBinary() : string
36343    {
36344        // HHVM
36345        if (self::$binary === null && $this->isHHVM()) {
36346            // @codeCoverageIgnoreStart
36347            if ((self::$binary = getenv('PHP_BINARY')) === \false) {
36348                self::$binary = \PHP_BINARY;
36349            }
36350            self::$binary = escapeshellarg(self::$binary) . ' --php' . ' -d hhvm.php7.all=1';
36351            // @codeCoverageIgnoreEnd
36352        }
36353        if (self::$binary === null && \PHP_BINARY !== '') {
36354            self::$binary = escapeshellarg(\PHP_BINARY);
36355        }
36356        if (self::$binary === null) {
36357            // @codeCoverageIgnoreStart
36358            $possibleBinaryLocations = [\PHP_BINDIR . '/php', \PHP_BINDIR . '/php-cli.exe', \PHP_BINDIR . '/php.exe'];
36359            foreach ($possibleBinaryLocations as $binary) {
36360                if (is_readable($binary)) {
36361                    self::$binary = escapeshellarg($binary);
36362                    break;
36363                }
36364            }
36365            // @codeCoverageIgnoreEnd
36366        }
36367        if (self::$binary === null) {
36368            // @codeCoverageIgnoreStart
36369            self::$binary = 'php';
36370            // @codeCoverageIgnoreEnd
36371        }
36372        return self::$binary;
36373    }
36374    public function getNameWithVersion() : string
36375    {
36376        return $this->getName() . ' ' . $this->getVersion();
36377    }
36378    public function getNameWithVersionAndCodeCoverageDriver() : string
36379    {
36380        if (!$this->canCollectCodeCoverage() || $this->hasPHPDBGCodeCoverage()) {
36381            return $this->getNameWithVersion();
36382        }
36383        if ($this->hasPCOV()) {
36384            return sprintf('%s with PCOV %s', $this->getNameWithVersion(), phpversion('pcov'));
36385        }
36386        if ($this->hasXdebug()) {
36387            return sprintf('%s with Xdebug %s', $this->getNameWithVersion(), phpversion('xdebug'));
36388        }
36389    }
36390    public function getName() : string
36391    {
36392        if ($this->isHHVM()) {
36393            // @codeCoverageIgnoreStart
36394            return 'HHVM';
36395            // @codeCoverageIgnoreEnd
36396        }
36397        if ($this->isPHPDBG()) {
36398            // @codeCoverageIgnoreStart
36399            return 'PHPDBG';
36400            // @codeCoverageIgnoreEnd
36401        }
36402        return 'PHP';
36403    }
36404    public function getVendorUrl() : string
36405    {
36406        if ($this->isHHVM()) {
36407            // @codeCoverageIgnoreStart
36408            return 'http://hhvm.com/';
36409            // @codeCoverageIgnoreEnd
36410        }
36411        return 'https://secure.php.net/';
36412    }
36413    public function getVersion() : string
36414    {
36415        if ($this->isHHVM()) {
36416            // @codeCoverageIgnoreStart
36417            return HHVM_VERSION;
36418            // @codeCoverageIgnoreEnd
36419        }
36420        return \PHP_VERSION;
36421    }
36422    /**
36423     * Returns true when the runtime used is PHP and Xdebug is loaded.
36424     */
36425    public function hasXdebug() : bool
36426    {
36427        return ($this->isPHP() || $this->isHHVM()) && extension_loaded('xdebug');
36428    }
36429    /**
36430     * Returns true when the runtime used is HHVM.
36431     */
36432    public function isHHVM() : bool
36433    {
36434        return defined('HHVM_VERSION');
36435    }
36436    /**
36437     * Returns true when the runtime used is PHP without the PHPDBG SAPI.
36438     */
36439    public function isPHP() : bool
36440    {
36441        return !$this->isHHVM() && !$this->isPHPDBG();
36442    }
36443    /**
36444     * Returns true when the runtime used is PHP with the PHPDBG SAPI.
36445     */
36446    public function isPHPDBG() : bool
36447    {
36448        return \PHP_SAPI === 'phpdbg' && !$this->isHHVM();
36449    }
36450    /**
36451     * Returns true when the runtime used is PHP with the PHPDBG SAPI
36452     * and the phpdbg_*_oplog() functions are available (PHP >= 7.0).
36453     */
36454    public function hasPHPDBGCodeCoverage() : bool
36455    {
36456        return $this->isPHPDBG();
36457    }
36458    /**
36459     * Returns true when the runtime used is PHP with PCOV loaded and enabled.
36460     */
36461    public function hasPCOV() : bool
36462    {
36463        return $this->isPHP() && extension_loaded('pcov') && ini_get('pcov.enabled');
36464    }
36465    /**
36466     * Parses the loaded php.ini file (if any) as well as all
36467     * additional php.ini files from the additional ini dir for
36468     * a list of all configuration settings loaded from files
36469     * at startup. Then checks for each php.ini setting passed
36470     * via the `$values` parameter whether this setting has
36471     * been changed at runtime. Returns an array of strings
36472     * where each string has the format `key=value` denoting
36473     * the name of a changed php.ini setting with its new value.
36474     *
36475     * @return string[]
36476     */
36477    public function getCurrentSettings(array $values) : array
36478    {
36479        $diff = [];
36480        $files = [];
36481        if ($file = php_ini_loaded_file()) {
36482            $files[] = $file;
36483        }
36484        if ($scanned = php_ini_scanned_files()) {
36485            $files = array_merge($files, array_map('trim', explode(",\n", $scanned)));
36486        }
36487        foreach ($files as $ini) {
36488            $config = parse_ini_file($ini, \true);
36489            foreach ($values as $value) {
36490                $set = ini_get($value);
36491                if (isset($config[$value]) && $set != $config[$value]) {
36492                    $diff[] = sprintf('%s=%s', $value, $set);
36493                }
36494            }
36495        }
36496        return $diff;
36497    }
36498    private function isOpcacheActive() : bool
36499    {
36500        if (!extension_loaded('Zend OPcache')) {
36501            return \false;
36502        }
36503        if ((\PHP_SAPI === 'cli' || \PHP_SAPI === 'phpdbg') && ini_get('opcache.enable_cli') === '1') {
36504            return \true;
36505        }
36506        if (\PHP_SAPI !== 'cli' && \PHP_SAPI !== 'phpdbg' && ini_get('opcache.enable') === '1') {
36507            return \true;
36508        }
36509        return \false;
36510    }
36511}
36512sebastian/environment
36513
36514Copyright (c) 2014-2020, Sebastian Bergmann <sebastian@phpunit.de>.
36515All rights reserved.
36516
36517Redistribution and use in source and binary forms, with or without
36518modification, are permitted provided that the following conditions
36519are met:
36520
36521 * Redistributions of source code must retain the above copyright
36522   notice, this list of conditions and the following disclaimer.
36523
36524 * Redistributions in binary form must reproduce the above copyright
36525   notice, this list of conditions and the following disclaimer in
36526   the documentation and/or other materials provided with the
36527   distribution.
36528
36529 * Neither the name of Sebastian Bergmann nor the names of his
36530   contributors may be used to endorse or promote products derived
36531   from this software without specific prior written permission.
36532
36533THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
36534"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
36535LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
36536FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
36537COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
36538INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
36539BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
36540LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36541CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36542LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
36543ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36544POSSIBILITY OF SUCH DAMAGE.
36545<?php
36546
36547declare (strict_types=1);
36548/*
36549 * This file is part of sebastian/comparator.
36550 *
36551 * (c) Sebastian Bergmann <sebastian@phpunit.de>
36552 *
36553 * For the full copyright and license information, please view the LICENSE
36554 * file that was distributed with this source code.
36555 */
36556namespace PHPUnit\SebastianBergmann\Comparator;
36557
36558use RuntimeException;
36559use PHPUnit\SebastianBergmann\Diff\Differ;
36560use PHPUnit\SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder;
36561/**
36562 * Thrown when an assertion for string equality failed.
36563 */
36564class ComparisonFailure extends RuntimeException
36565{
36566    /**
36567     * Expected value of the retrieval which does not match $actual.
36568     *
36569     * @var mixed
36570     */
36571    protected $expected;
36572    /**
36573     * Actually retrieved value which does not match $expected.
36574     *
36575     * @var mixed
36576     */
36577    protected $actual;
36578    /**
36579     * The string representation of the expected value.
36580     *
36581     * @var string
36582     */
36583    protected $expectedAsString;
36584    /**
36585     * The string representation of the actual value.
36586     *
36587     * @var string
36588     */
36589    protected $actualAsString;
36590    /**
36591     * @var bool
36592     */
36593    protected $identical;
36594    /**
36595     * Optional message which is placed in front of the first line
36596     * returned by toString().
36597     *
36598     * @var string
36599     */
36600    protected $message;
36601    /**
36602     * Initialises with the expected value and the actual value.
36603     *
36604     * @param mixed  $expected         expected value retrieved
36605     * @param mixed  $actual           actual value retrieved
36606     * @param string $expectedAsString
36607     * @param string $actualAsString
36608     * @param bool   $identical
36609     * @param string $message          a string which is prefixed on all returned lines
36610     *                                 in the difference output
36611     */
36612    public function __construct($expected, $actual, $expectedAsString, $actualAsString, $identical = \false, $message = '')
36613    {
36614        $this->expected = $expected;
36615        $this->actual = $actual;
36616        $this->expectedAsString = $expectedAsString;
36617        $this->actualAsString = $actualAsString;
36618        $this->message = $message;
36619    }
36620    public function getActual()
36621    {
36622        return $this->actual;
36623    }
36624    public function getExpected()
36625    {
36626        return $this->expected;
36627    }
36628    /**
36629     * @return string
36630     */
36631    public function getActualAsString()
36632    {
36633        return $this->actualAsString;
36634    }
36635    /**
36636     * @return string
36637     */
36638    public function getExpectedAsString()
36639    {
36640        return $this->expectedAsString;
36641    }
36642    /**
36643     * @return string
36644     */
36645    public function getDiff()
36646    {
36647        if (!$this->actualAsString && !$this->expectedAsString) {
36648            return '';
36649        }
36650        $differ = new Differ(new UnifiedDiffOutputBuilder("\n--- Expected\n+++ Actual\n"));
36651        return $differ->diff($this->expectedAsString, $this->actualAsString);
36652    }
36653    /**
36654     * @return string
36655     */
36656    public function toString()
36657    {
36658        return $this->message . $this->getDiff();
36659    }
36660}
36661<?php
36662
36663declare (strict_types=1);
36664/*
36665 * This file is part of sebastian/comparator.
36666 *
36667 * (c) Sebastian Bergmann <sebastian@phpunit.de>
36668 *
36669 * For the full copyright and license information, please view the LICENSE
36670 * file that was distributed with this source code.
36671 */
36672namespace PHPUnit\SebastianBergmann\Comparator;
36673
36674use function is_resource;
36675/**
36676 * Compares resources for equality.
36677 */
36678class ResourceComparator extends Comparator
36679{
36680    /**
36681     * Returns whether the comparator can compare two values.
36682     *
36683     * @param mixed $expected The first value to compare
36684     * @param mixed $actual   The second value to compare
36685     *
36686     * @return bool
36687     */
36688    public function accepts($expected, $actual)
36689    {
36690        return is_resource($expected) && is_resource($actual);
36691    }
36692    /**
36693     * Asserts that two values are equal.
36694     *
36695     * @param mixed $expected     First value to compare
36696     * @param mixed $actual       Second value to compare
36697     * @param float $delta        Allowed numerical distance between two values to consider them equal
36698     * @param bool  $canonicalize Arrays are sorted before comparison when set to true
36699     * @param bool  $ignoreCase   Case is ignored when set to true
36700     *
36701     * @throws ComparisonFailure
36702     */
36703    public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = \false, $ignoreCase = \false)
36704    {
36705        if ($actual != $expected) {
36706            throw new ComparisonFailure($expected, $actual, $this->exporter->export($expected), $this->exporter->export($actual));
36707        }
36708    }
36709}
36710<?php
36711
36712declare (strict_types=1);
36713/*
36714 * This file is part of sebastian/comparator.
36715 *
36716 * (c) Sebastian Bergmann <sebastian@phpunit.de>
36717 *
36718 * For the full copyright and license information, please view the LICENSE
36719 * file that was distributed with this source code.
36720 */
36721namespace PHPUnit\SebastianBergmann\Comparator;
36722
36723use function is_float;
36724use function is_numeric;
36725/**
36726 * Compares doubles for equality.
36727 */
36728class DoubleComparator extends NumericComparator
36729{
36730    /**
36731     * Smallest value available in PHP.
36732     *
36733     * @var float
36734     */
36735    public const EPSILON = 1.0E-10;
36736    /**
36737     * Returns whether the comparator can compare two values.
36738     *
36739     * @param mixed $expected The first value to compare
36740     * @param mixed $actual   The second value to compare
36741     *
36742     * @return bool
36743     */
36744    public function accepts($expected, $actual)
36745    {
36746        return (is_float($expected) || is_float($actual)) && is_numeric($expected) && is_numeric($actual);
36747    }
36748    /**
36749     * Asserts that two values are equal.
36750     *
36751     * @param mixed $expected     First value to compare
36752     * @param mixed $actual       Second value to compare
36753     * @param float $delta        Allowed numerical distance between two values to consider them equal
36754     * @param bool  $canonicalize Arrays are sorted before comparison when set to true
36755     * @param bool  $ignoreCase   Case is ignored when set to true
36756     *
36757     * @throws ComparisonFailure
36758     */
36759    public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = \false, $ignoreCase = \false)
36760    {
36761        if ($delta == 0) {
36762            $delta = self::EPSILON;
36763        }
36764        parent::assertEquals($expected, $actual, $delta, $canonicalize, $ignoreCase);
36765    }
36766}
36767<?php
36768
36769declare (strict_types=1);
36770/*
36771 * This file is part of sebastian/comparator.
36772 *
36773 * (c) Sebastian Bergmann <sebastian@phpunit.de>
36774 *
36775 * For the full copyright and license information, please view the LICENSE
36776 * file that was distributed with this source code.
36777 */
36778namespace PHPUnit\SebastianBergmann\Comparator;
36779
36780use function abs;
36781use function is_float;
36782use function is_infinite;
36783use function is_nan;
36784use function is_numeric;
36785use function is_string;
36786use function sprintf;
36787/**
36788 * Compares numerical values for equality.
36789 */
36790class NumericComparator extends ScalarComparator
36791{
36792    /**
36793     * Returns whether the comparator can compare two values.
36794     *
36795     * @param mixed $expected The first value to compare
36796     * @param mixed $actual   The second value to compare
36797     *
36798     * @return bool
36799     */
36800    public function accepts($expected, $actual)
36801    {
36802        // all numerical values, but not if one of them is a double
36803        // or both of them are strings
36804        return is_numeric($expected) && is_numeric($actual) && !(is_float($expected) || is_float($actual)) && !(is_string($expected) && is_string($actual));
36805    }
36806    /**
36807     * Asserts that two values are equal.
36808     *
36809     * @param mixed $expected     First value to compare
36810     * @param mixed $actual       Second value to compare
36811     * @param float $delta        Allowed numerical distance between two values to consider them equal
36812     * @param bool  $canonicalize Arrays are sorted before comparison when set to true
36813     * @param bool  $ignoreCase   Case is ignored when set to true
36814     *
36815     * @throws ComparisonFailure
36816     */
36817    public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = \false, $ignoreCase = \false)
36818    {
36819        if ($this->isInfinite($actual) && $this->isInfinite($expected)) {
36820            return;
36821        }
36822        if (($this->isInfinite($actual) xor $this->isInfinite($expected)) || ($this->isNan($actual) || $this->isNan($expected)) || abs($actual - $expected) > $delta) {
36823            throw new ComparisonFailure($expected, $actual, '', '', \false, sprintf('Failed asserting that %s matches expected %s.', $this->exporter->export($actual), $this->exporter->export($expected)));
36824        }
36825    }
36826    private function isInfinite($value) : bool
36827    {
36828        return is_float($value) && is_infinite($value);
36829    }
36830    private function isNan($value) : bool
36831    {
36832        return is_float($value) && is_nan($value);
36833    }
36834}
36835<?php
36836
36837declare (strict_types=1);
36838/*
36839 * This file is part of sebastian/comparator.
36840 *
36841 * (c) Sebastian Bergmann <sebastian@phpunit.de>
36842 *
36843 * For the full copyright and license information, please view the LICENSE
36844 * file that was distributed with this source code.
36845 */
36846namespace PHPUnit\SebastianBergmann\Comparator;
36847
36848use function array_unshift;
36849/**
36850 * Factory for comparators which compare values for equality.
36851 */
36852class Factory
36853{
36854    /**
36855     * @var Factory
36856     */
36857    private static $instance;
36858    /**
36859     * @var Comparator[]
36860     */
36861    private $customComparators = [];
36862    /**
36863     * @var Comparator[]
36864     */
36865    private $defaultComparators = [];
36866    /**
36867     * @return Factory
36868     */
36869    public static function getInstance()
36870    {
36871        if (self::$instance === null) {
36872            self::$instance = new self();
36873            // @codeCoverageIgnore
36874        }
36875        return self::$instance;
36876    }
36877    /**
36878     * Constructs a new factory.
36879     */
36880    public function __construct()
36881    {
36882        $this->registerDefaultComparators();
36883    }
36884    /**
36885     * Returns the correct comparator for comparing two values.
36886     *
36887     * @param mixed $expected The first value to compare
36888     * @param mixed $actual   The second value to compare
36889     *
36890     * @return Comparator
36891     */
36892    public function getComparatorFor($expected, $actual)
36893    {
36894        foreach ($this->customComparators as $comparator) {
36895            if ($comparator->accepts($expected, $actual)) {
36896                return $comparator;
36897            }
36898        }
36899        foreach ($this->defaultComparators as $comparator) {
36900            if ($comparator->accepts($expected, $actual)) {
36901                return $comparator;
36902            }
36903        }
36904        throw new RuntimeException('No suitable Comparator implementation found');
36905    }
36906    /**
36907     * Registers a new comparator.
36908     *
36909     * This comparator will be returned by getComparatorFor() if its accept() method
36910     * returns TRUE for the compared values. It has higher priority than the
36911     * existing comparators, meaning that its accept() method will be invoked
36912     * before those of the other comparators.
36913     *
36914     * @param Comparator $comparator The comparator to be registered
36915     */
36916    public function register(Comparator $comparator)
36917    {
36918        array_unshift($this->customComparators, $comparator);
36919        $comparator->setFactory($this);
36920    }
36921    /**
36922     * Unregisters a comparator.
36923     *
36924     * This comparator will no longer be considered by getComparatorFor().
36925     *
36926     * @param Comparator $comparator The comparator to be unregistered
36927     */
36928    public function unregister(Comparator $comparator)
36929    {
36930        foreach ($this->customComparators as $key => $_comparator) {
36931            if ($comparator === $_comparator) {
36932                unset($this->customComparators[$key]);
36933            }
36934        }
36935    }
36936    /**
36937     * Unregisters all non-default comparators.
36938     */
36939    public function reset()
36940    {
36941        $this->customComparators = [];
36942    }
36943    private function registerDefaultComparators() : void
36944    {
36945        $this->registerDefaultComparator(new MockObjectComparator());
36946        $this->registerDefaultComparator(new DateTimeComparator());
36947        $this->registerDefaultComparator(new DOMNodeComparator());
36948        $this->registerDefaultComparator(new SplObjectStorageComparator());
36949        $this->registerDefaultComparator(new ExceptionComparator());
36950        $this->registerDefaultComparator(new ObjectComparator());
36951        $this->registerDefaultComparator(new ResourceComparator());
36952        $this->registerDefaultComparator(new ArrayComparator());
36953        $this->registerDefaultComparator(new DoubleComparator());
36954        $this->registerDefaultComparator(new NumericComparator());
36955        $this->registerDefaultComparator(new ScalarComparator());
36956        $this->registerDefaultComparator(new TypeComparator());
36957    }
36958    private function registerDefaultComparator(Comparator $comparator) : void
36959    {
36960        $this->defaultComparators[] = $comparator;
36961        $comparator->setFactory($this);
36962    }
36963}
36964<?php
36965
36966declare (strict_types=1);
36967/*
36968 * This file is part of sebastian/comparator.
36969 *
36970 * (c) Sebastian Bergmann <sebastian@phpunit.de>
36971 *
36972 * For the full copyright and license information, please view the LICENSE
36973 * file that was distributed with this source code.
36974 */
36975namespace PHPUnit\SebastianBergmann\Comparator;
36976
36977use function sprintf;
36978use function strtolower;
36979use DOMDocument;
36980use DOMNode;
36981use ValueError;
36982/**
36983 * Compares DOMNode instances for equality.
36984 */
36985class DOMNodeComparator extends ObjectComparator
36986{
36987    /**
36988     * Returns whether the comparator can compare two values.
36989     *
36990     * @param mixed $expected The first value to compare
36991     * @param mixed $actual   The second value to compare
36992     *
36993     * @return bool
36994     */
36995    public function accepts($expected, $actual)
36996    {
36997        return $expected instanceof DOMNode && $actual instanceof DOMNode;
36998    }
36999    /**
37000     * Asserts that two values are equal.
37001     *
37002     * @param mixed $expected     First value to compare
37003     * @param mixed $actual       Second value to compare
37004     * @param float $delta        Allowed numerical distance between two values to consider them equal
37005     * @param bool  $canonicalize Arrays are sorted before comparison when set to true
37006     * @param bool  $ignoreCase   Case is ignored when set to true
37007     * @param array $processed    List of already processed elements (used to prevent infinite recursion)
37008     *
37009     * @throws ComparisonFailure
37010     */
37011    public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = \false, $ignoreCase = \false, array &$processed = [])
37012    {
37013        $expectedAsString = $this->nodeToText($expected, \true, $ignoreCase);
37014        $actualAsString = $this->nodeToText($actual, \true, $ignoreCase);
37015        if ($expectedAsString !== $actualAsString) {
37016            $type = $expected instanceof DOMDocument ? 'documents' : 'nodes';
37017            throw new ComparisonFailure($expected, $actual, $expectedAsString, $actualAsString, \false, sprintf("Failed asserting that two DOM %s are equal.\n", $type));
37018        }
37019    }
37020    /**
37021     * Returns the normalized, whitespace-cleaned, and indented textual
37022     * representation of a DOMNode.
37023     */
37024    private function nodeToText(DOMNode $node, bool $canonicalize, bool $ignoreCase) : string
37025    {
37026        if ($canonicalize) {
37027            $document = new DOMDocument();
37028            try {
37029                @$document->loadXML($node->C14N());
37030            } catch (ValueError $e) {
37031            }
37032            $node = $document;
37033        }
37034        $document = $node instanceof DOMDocument ? $node : $node->ownerDocument;
37035        $document->formatOutput = \true;
37036        $document->normalizeDocument();
37037        $text = $node instanceof DOMDocument ? $node->saveXML() : $document->saveXML($node);
37038        return $ignoreCase ? strtolower($text) : $text;
37039    }
37040}
37041<?php
37042
37043declare (strict_types=1);
37044/*
37045 * This file is part of sebastian/comparator.
37046 *
37047 * (c) Sebastian Bergmann <sebastian@phpunit.de>
37048 *
37049 * For the full copyright and license information, please view the LICENSE
37050 * file that was distributed with this source code.
37051 */
37052namespace PHPUnit\SebastianBergmann\Comparator;
37053
37054use function get_class;
37055use function in_array;
37056use function is_object;
37057use function sprintf;
37058use function substr_replace;
37059/**
37060 * Compares objects for equality.
37061 */
37062class ObjectComparator extends ArrayComparator
37063{
37064    /**
37065     * Returns whether the comparator can compare two values.
37066     *
37067     * @param mixed $expected The first value to compare
37068     * @param mixed $actual   The second value to compare
37069     *
37070     * @return bool
37071     */
37072    public function accepts($expected, $actual)
37073    {
37074        return is_object($expected) && is_object($actual);
37075    }
37076    /**
37077     * Asserts that two values are equal.
37078     *
37079     * @param mixed $expected     First value to compare
37080     * @param mixed $actual       Second value to compare
37081     * @param float $delta        Allowed numerical distance between two values to consider them equal
37082     * @param bool  $canonicalize Arrays are sorted before comparison when set to true
37083     * @param bool  $ignoreCase   Case is ignored when set to true
37084     * @param array $processed    List of already processed elements (used to prevent infinite recursion)
37085     *
37086     * @throws ComparisonFailure
37087     */
37088    public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = \false, $ignoreCase = \false, array &$processed = [])
37089    {
37090        if (get_class($actual) !== get_class($expected)) {
37091            throw new ComparisonFailure($expected, $actual, $this->exporter->export($expected), $this->exporter->export($actual), \false, sprintf('%s is not instance of expected class "%s".', $this->exporter->export($actual), get_class($expected)));
37092        }
37093        // don't compare twice to allow for cyclic dependencies
37094        if (in_array([$actual, $expected], $processed, \true) || in_array([$expected, $actual], $processed, \true)) {
37095            return;
37096        }
37097        $processed[] = [$actual, $expected];
37098        // don't compare objects if they are identical
37099        // this helps to avoid the error "maximum function nesting level reached"
37100        // CAUTION: this conditional clause is not tested
37101        if ($actual !== $expected) {
37102            try {
37103                parent::assertEquals($this->toArray($expected), $this->toArray($actual), $delta, $canonicalize, $ignoreCase, $processed);
37104            } catch (ComparisonFailure $e) {
37105                throw new ComparisonFailure(
37106                    $expected,
37107                    $actual,
37108                    // replace "Array" with "MyClass object"
37109                    substr_replace($e->getExpectedAsString(), get_class($expected) . ' Object', 0, 5),
37110                    substr_replace($e->getActualAsString(), get_class($actual) . ' Object', 0, 5),
37111                    \false,
37112                    'Failed asserting that two objects are equal.'
37113                );
37114            }
37115        }
37116    }
37117    /**
37118     * Converts an object to an array containing all of its private, protected
37119     * and public properties.
37120     *
37121     * @param object $object
37122     *
37123     * @return array
37124     */
37125    protected function toArray($object)
37126    {
37127        return $this->exporter->toArray($object);
37128    }
37129}
37130<?php
37131
37132declare (strict_types=1);
37133/*
37134 * This file is part of sebastian/comparator.
37135 *
37136 * (c) Sebastian Bergmann <sebastian@phpunit.de>
37137 *
37138 * For the full copyright and license information, please view the LICENSE
37139 * file that was distributed with this source code.
37140 */
37141namespace PHPUnit\SebastianBergmann\Comparator;
37142
37143use function is_object;
37144use function is_scalar;
37145use function is_string;
37146use function method_exists;
37147use function sprintf;
37148use function strtolower;
37149/**
37150 * Compares scalar or NULL values for equality.
37151 */
37152class ScalarComparator extends Comparator
37153{
37154    /**
37155     * Returns whether the comparator can compare two values.
37156     *
37157     * @param mixed $expected The first value to compare
37158     * @param mixed $actual   The second value to compare
37159     *
37160     * @return bool
37161     *
37162     * @since  Method available since Release 3.6.0
37163     */
37164    public function accepts($expected, $actual)
37165    {
37166        return (is_scalar($expected) xor null === $expected) && (is_scalar($actual) xor null === $actual) || is_string($expected) && is_object($actual) && method_exists($actual, '__toString') || is_object($expected) && method_exists($expected, '__toString') && is_string($actual);
37167    }
37168    /**
37169     * Asserts that two values are equal.
37170     *
37171     * @param mixed $expected     First value to compare
37172     * @param mixed $actual       Second value to compare
37173     * @param float $delta        Allowed numerical distance between two values to consider them equal
37174     * @param bool  $canonicalize Arrays are sorted before comparison when set to true
37175     * @param bool  $ignoreCase   Case is ignored when set to true
37176     *
37177     * @throws ComparisonFailure
37178     */
37179    public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = \false, $ignoreCase = \false)
37180    {
37181        $expectedToCompare = $expected;
37182        $actualToCompare = $actual;
37183        // always compare as strings to avoid strange behaviour
37184        // otherwise 0 == 'Foobar'
37185        if (is_string($expected) || is_string($actual)) {
37186            $expectedToCompare = (string) $expectedToCompare;
37187            $actualToCompare = (string) $actualToCompare;
37188            if ($ignoreCase) {
37189                $expectedToCompare = strtolower($expectedToCompare);
37190                $actualToCompare = strtolower($actualToCompare);
37191            }
37192        }
37193        if ($expectedToCompare !== $actualToCompare && is_string($expected) && is_string($actual)) {
37194            throw new ComparisonFailure($expected, $actual, $this->exporter->export($expected), $this->exporter->export($actual), \false, 'Failed asserting that two strings are equal.');
37195        }
37196        if ($expectedToCompare != $actualToCompare) {
37197            throw new ComparisonFailure(
37198                $expected,
37199                $actual,
37200                // no diff is required
37201                '',
37202                '',
37203                \false,
37204                sprintf('Failed asserting that %s matches expected %s.', $this->exporter->export($actual), $this->exporter->export($expected))
37205            );
37206        }
37207    }
37208}
37209<?php
37210
37211declare (strict_types=1);
37212/*
37213 * This file is part of sebastian/comparator.
37214 *
37215 * (c) Sebastian Bergmann <sebastian@phpunit.de>
37216 *
37217 * For the full copyright and license information, please view the LICENSE
37218 * file that was distributed with this source code.
37219 */
37220namespace PHPUnit\SebastianBergmann\Comparator;
37221
37222use function abs;
37223use function floor;
37224use function sprintf;
37225use DateInterval;
37226use DateTime;
37227use DateTimeInterface;
37228use DateTimeZone;
37229use Exception;
37230/**
37231 * Compares DateTimeInterface instances for equality.
37232 */
37233class DateTimeComparator extends ObjectComparator
37234{
37235    /**
37236     * Returns whether the comparator can compare two values.
37237     *
37238     * @param mixed $expected The first value to compare
37239     * @param mixed $actual   The second value to compare
37240     *
37241     * @return bool
37242     */
37243    public function accepts($expected, $actual)
37244    {
37245        return ($expected instanceof DateTime || $expected instanceof DateTimeInterface) && ($actual instanceof DateTime || $actual instanceof DateTimeInterface);
37246    }
37247    /**
37248     * Asserts that two values are equal.
37249     *
37250     * @param mixed $expected     First value to compare
37251     * @param mixed $actual       Second value to compare
37252     * @param float $delta        Allowed numerical distance between two values to consider them equal
37253     * @param bool  $canonicalize Arrays are sorted before comparison when set to true
37254     * @param bool  $ignoreCase   Case is ignored when set to true
37255     * @param array $processed    List of already processed elements (used to prevent infinite recursion)
37256     *
37257     * @throws Exception
37258     * @throws ComparisonFailure
37259     */
37260    public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = \false, $ignoreCase = \false, array &$processed = [])
37261    {
37262        /** @var DateTimeInterface $expected */
37263        /** @var DateTimeInterface $actual */
37264        $absDelta = abs($delta);
37265        $delta = new DateInterval(sprintf('PT%dS', $absDelta));
37266        $delta->f = $absDelta - floor($absDelta);
37267        $actualClone = (clone $actual)->setTimezone(new DateTimeZone('UTC'));
37268        $expectedLower = (clone $expected)->setTimezone(new DateTimeZone('UTC'))->sub($delta);
37269        $expectedUpper = (clone $expected)->setTimezone(new DateTimeZone('UTC'))->add($delta);
37270        if ($actualClone < $expectedLower || $actualClone > $expectedUpper) {
37271            throw new ComparisonFailure($expected, $actual, $this->dateTimeToString($expected), $this->dateTimeToString($actual), \false, 'Failed asserting that two DateTime objects are equal.');
37272        }
37273    }
37274    /**
37275     * Returns an ISO 8601 formatted string representation of a datetime or
37276     * 'Invalid DateTimeInterface object' if the provided DateTimeInterface was not properly
37277     * initialized.
37278     */
37279    private function dateTimeToString(DateTimeInterface $datetime) : string
37280    {
37281        $string = $datetime->format('Y-m-d\\TH:i:s.uO');
37282        return $string ?: 'Invalid DateTimeInterface object';
37283    }
37284}
37285<?php
37286
37287declare (strict_types=1);
37288/*
37289 * This file is part of sebastian/comparator.
37290 *
37291 * (c) Sebastian Bergmann <sebastian@phpunit.de>
37292 *
37293 * For the full copyright and license information, please view the LICENSE
37294 * file that was distributed with this source code.
37295 */
37296namespace PHPUnit\SebastianBergmann\Comparator;
37297
37298use function gettype;
37299use function sprintf;
37300/**
37301 * Compares values for type equality.
37302 */
37303class TypeComparator extends Comparator
37304{
37305    /**
37306     * Returns whether the comparator can compare two values.
37307     *
37308     * @param mixed $expected The first value to compare
37309     * @param mixed $actual   The second value to compare
37310     *
37311     * @return bool
37312     */
37313    public function accepts($expected, $actual)
37314    {
37315        return \true;
37316    }
37317    /**
37318     * Asserts that two values are equal.
37319     *
37320     * @param mixed $expected     First value to compare
37321     * @param mixed $actual       Second value to compare
37322     * @param float $delta        Allowed numerical distance between two values to consider them equal
37323     * @param bool  $canonicalize Arrays are sorted before comparison when set to true
37324     * @param bool  $ignoreCase   Case is ignored when set to true
37325     *
37326     * @throws ComparisonFailure
37327     */
37328    public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = \false, $ignoreCase = \false)
37329    {
37330        if (gettype($expected) != gettype($actual)) {
37331            throw new ComparisonFailure(
37332                $expected,
37333                $actual,
37334                // we don't need a diff
37335                '',
37336                '',
37337                \false,
37338                sprintf('%s does not match expected type "%s".', $this->exporter->shortenedExport($actual), gettype($expected))
37339            );
37340        }
37341    }
37342}
37343<?php
37344
37345declare (strict_types=1);
37346/*
37347 * This file is part of sebastian/comparator.
37348 *
37349 * (c) Sebastian Bergmann <sebastian@phpunit.de>
37350 *
37351 * For the full copyright and license information, please view the LICENSE
37352 * file that was distributed with this source code.
37353 */
37354namespace PHPUnit\SebastianBergmann\Comparator;
37355
37356use Exception;
37357/**
37358 * Compares Exception instances for equality.
37359 */
37360class ExceptionComparator extends ObjectComparator
37361{
37362    /**
37363     * Returns whether the comparator can compare two values.
37364     *
37365     * @param mixed $expected The first value to compare
37366     * @param mixed $actual   The second value to compare
37367     *
37368     * @return bool
37369     */
37370    public function accepts($expected, $actual)
37371    {
37372        return $expected instanceof Exception && $actual instanceof Exception;
37373    }
37374    /**
37375     * Converts an object to an array containing all of its private, protected
37376     * and public properties.
37377     *
37378     * @param object $object
37379     *
37380     * @return array
37381     */
37382    protected function toArray($object)
37383    {
37384        $array = parent::toArray($object);
37385        unset($array['file'], $array['line'], $array['trace'], $array['string'], $array['xdebug_message']);
37386        return $array;
37387    }
37388}
37389<?php
37390
37391declare (strict_types=1);
37392/*
37393 * This file is part of sebastian/comparator.
37394 *
37395 * (c) Sebastian Bergmann <sebastian@phpunit.de>
37396 *
37397 * For the full copyright and license information, please view the LICENSE
37398 * file that was distributed with this source code.
37399 */
37400namespace PHPUnit\SebastianBergmann\Comparator;
37401
37402final class RuntimeException extends \RuntimeException implements Exception
37403{
37404}
37405<?php
37406
37407declare (strict_types=1);
37408/*
37409 * This file is part of sebastian/comparator.
37410 *
37411 * (c) Sebastian Bergmann <sebastian@phpunit.de>
37412 *
37413 * For the full copyright and license information, please view the LICENSE
37414 * file that was distributed with this source code.
37415 */
37416namespace PHPUnit\SebastianBergmann\Comparator;
37417
37418use Throwable;
37419interface Exception extends Throwable
37420{
37421}
37422<?php
37423
37424declare (strict_types=1);
37425/*
37426 * This file is part of sebastian/comparator.
37427 *
37428 * (c) Sebastian Bergmann <sebastian@phpunit.de>
37429 *
37430 * For the full copyright and license information, please view the LICENSE
37431 * file that was distributed with this source code.
37432 */
37433namespace PHPUnit\SebastianBergmann\Comparator;
37434
37435use SplObjectStorage;
37436/**
37437 * Compares \SplObjectStorage instances for equality.
37438 */
37439class SplObjectStorageComparator extends Comparator
37440{
37441    /**
37442     * Returns whether the comparator can compare two values.
37443     *
37444     * @param mixed $expected The first value to compare
37445     * @param mixed $actual   The second value to compare
37446     *
37447     * @return bool
37448     */
37449    public function accepts($expected, $actual)
37450    {
37451        return $expected instanceof SplObjectStorage && $actual instanceof SplObjectStorage;
37452    }
37453    /**
37454     * Asserts that two values are equal.
37455     *
37456     * @param mixed $expected     First value to compare
37457     * @param mixed $actual       Second value to compare
37458     * @param float $delta        Allowed numerical distance between two values to consider them equal
37459     * @param bool  $canonicalize Arrays are sorted before comparison when set to true
37460     * @param bool  $ignoreCase   Case is ignored when set to true
37461     *
37462     * @throws ComparisonFailure
37463     */
37464    public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = \false, $ignoreCase = \false)
37465    {
37466        foreach ($actual as $object) {
37467            if (!$expected->contains($object)) {
37468                throw new ComparisonFailure($expected, $actual, $this->exporter->export($expected), $this->exporter->export($actual), \false, 'Failed asserting that two objects are equal.');
37469            }
37470        }
37471        foreach ($expected as $object) {
37472            if (!$actual->contains($object)) {
37473                throw new ComparisonFailure($expected, $actual, $this->exporter->export($expected), $this->exporter->export($actual), \false, 'Failed asserting that two objects are equal.');
37474            }
37475        }
37476    }
37477}
37478<?php
37479
37480declare (strict_types=1);
37481/*
37482 * This file is part of sebastian/comparator.
37483 *
37484 * (c) Sebastian Bergmann <sebastian@phpunit.de>
37485 *
37486 * For the full copyright and license information, please view the LICENSE
37487 * file that was distributed with this source code.
37488 */
37489namespace PHPUnit\SebastianBergmann\Comparator;
37490
37491use PHPUnit\SebastianBergmann\Exporter\Exporter;
37492/**
37493 * Abstract base class for comparators which compare values for equality.
37494 */
37495abstract class Comparator
37496{
37497    /**
37498     * @var Factory
37499     */
37500    protected $factory;
37501    /**
37502     * @var Exporter
37503     */
37504    protected $exporter;
37505    public function __construct()
37506    {
37507        $this->exporter = new Exporter();
37508    }
37509    public function setFactory(Factory $factory)
37510    {
37511        $this->factory = $factory;
37512    }
37513    /**
37514     * Returns whether the comparator can compare two values.
37515     *
37516     * @param mixed $expected The first value to compare
37517     * @param mixed $actual   The second value to compare
37518     *
37519     * @return bool
37520     */
37521    public abstract function accepts($expected, $actual);
37522    /**
37523     * Asserts that two values are equal.
37524     *
37525     * @param mixed $expected     First value to compare
37526     * @param mixed $actual       Second value to compare
37527     * @param float $delta        Allowed numerical distance between two values to consider them equal
37528     * @param bool  $canonicalize Arrays are sorted before comparison when set to true
37529     * @param bool  $ignoreCase   Case is ignored when set to true
37530     *
37531     * @throws ComparisonFailure
37532     */
37533    public abstract function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = \false, $ignoreCase = \false);
37534}
37535<?php
37536
37537declare (strict_types=1);
37538/*
37539 * This file is part of sebastian/comparator.
37540 *
37541 * (c) Sebastian Bergmann <sebastian@phpunit.de>
37542 *
37543 * For the full copyright and license information, please view the LICENSE
37544 * file that was distributed with this source code.
37545 */
37546namespace PHPUnit\SebastianBergmann\Comparator;
37547
37548use function array_key_exists;
37549use function is_array;
37550use function sort;
37551use function sprintf;
37552use function str_replace;
37553use function trim;
37554/**
37555 * Compares arrays for equality.
37556 *
37557 * Arrays are equal if they contain the same key-value pairs.
37558 * The order of the keys does not matter.
37559 * The types of key-value pairs do not matter.
37560 */
37561class ArrayComparator extends Comparator
37562{
37563    /**
37564     * Returns whether the comparator can compare two values.
37565     *
37566     * @param mixed $expected The first value to compare
37567     * @param mixed $actual   The second value to compare
37568     *
37569     * @return bool
37570     */
37571    public function accepts($expected, $actual)
37572    {
37573        return is_array($expected) && is_array($actual);
37574    }
37575    /**
37576     * Asserts that two arrays are equal.
37577     *
37578     * @param mixed $expected     First value to compare
37579     * @param mixed $actual       Second value to compare
37580     * @param float $delta        Allowed numerical distance between two values to consider them equal
37581     * @param bool  $canonicalize Arrays are sorted before comparison when set to true
37582     * @param bool  $ignoreCase   Case is ignored when set to true
37583     * @param array $processed    List of already processed elements (used to prevent infinite recursion)
37584     *
37585     * @throws ComparisonFailure
37586     */
37587    public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = \false, $ignoreCase = \false, array &$processed = [])
37588    {
37589        if ($canonicalize) {
37590            sort($expected);
37591            sort($actual);
37592        }
37593        $remaining = $actual;
37594        $actualAsString = "Array (\n";
37595        $expectedAsString = "Array (\n";
37596        $equal = \true;
37597        foreach ($expected as $key => $value) {
37598            unset($remaining[$key]);
37599            if (!array_key_exists($key, $actual)) {
37600                $expectedAsString .= sprintf("    %s => %s\n", $this->exporter->export($key), $this->exporter->shortenedExport($value));
37601                $equal = \false;
37602                continue;
37603            }
37604            try {
37605                $comparator = $this->factory->getComparatorFor($value, $actual[$key]);
37606                $comparator->assertEquals($value, $actual[$key], $delta, $canonicalize, $ignoreCase, $processed);
37607                $expectedAsString .= sprintf("    %s => %s\n", $this->exporter->export($key), $this->exporter->shortenedExport($value));
37608                $actualAsString .= sprintf("    %s => %s\n", $this->exporter->export($key), $this->exporter->shortenedExport($actual[$key]));
37609            } catch (ComparisonFailure $e) {
37610                $expectedAsString .= sprintf("    %s => %s\n", $this->exporter->export($key), $e->getExpectedAsString() ? $this->indent($e->getExpectedAsString()) : $this->exporter->shortenedExport($e->getExpected()));
37611                $actualAsString .= sprintf("    %s => %s\n", $this->exporter->export($key), $e->getActualAsString() ? $this->indent($e->getActualAsString()) : $this->exporter->shortenedExport($e->getActual()));
37612                $equal = \false;
37613            }
37614        }
37615        foreach ($remaining as $key => $value) {
37616            $actualAsString .= sprintf("    %s => %s\n", $this->exporter->export($key), $this->exporter->shortenedExport($value));
37617            $equal = \false;
37618        }
37619        $expectedAsString .= ')';
37620        $actualAsString .= ')';
37621        if (!$equal) {
37622            throw new ComparisonFailure($expected, $actual, $expectedAsString, $actualAsString, \false, 'Failed asserting that two arrays are equal.');
37623        }
37624    }
37625    protected function indent($lines)
37626    {
37627        return trim(str_replace("\n", "\n    ", $lines));
37628    }
37629}
37630Comparator
37631
37632Copyright (c) 2002-2020, Sebastian Bergmann <sebastian@phpunit.de>.
37633All rights reserved.
37634
37635Redistribution and use in source and binary forms, with or without
37636modification, are permitted provided that the following conditions
37637are met:
37638
37639 * Redistributions of source code must retain the above copyright
37640   notice, this list of conditions and the following disclaimer.
37641
37642 * Redistributions in binary form must reproduce the above copyright
37643   notice, this list of conditions and the following disclaimer in
37644   the documentation and/or other materials provided with the
37645   distribution.
37646
37647 * Neither the name of Sebastian Bergmann nor the names of his
37648   contributors may be used to endorse or promote products derived
37649   from this software without specific prior written permission.
37650
37651THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
37652"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
37653LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
37654FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
37655COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
37656INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
37657BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
37658LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
37659CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37660LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37661ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37662POSSIBILITY OF SUCH DAMAGE.
37663<?php
37664
37665declare (strict_types=1);
37666/*
37667 * This file is part of sebastian/comparator.
37668 *
37669 * (c) Sebastian Bergmann <sebastian@phpunit.de>
37670 *
37671 * For the full copyright and license information, please view the LICENSE
37672 * file that was distributed with this source code.
37673 */
37674namespace PHPUnit\SebastianBergmann\Comparator;
37675
37676use PHPUnit\Framework\MockObject\MockObject;
37677/**
37678 * Compares PHPUnit\Framework\MockObject\MockObject instances for equality.
37679 */
37680class MockObjectComparator extends ObjectComparator
37681{
37682    /**
37683     * Returns whether the comparator can compare two values.
37684     *
37685     * @param mixed $expected The first value to compare
37686     * @param mixed $actual   The second value to compare
37687     *
37688     * @return bool
37689     */
37690    public function accepts($expected, $actual)
37691    {
37692        return $expected instanceof MockObject && $actual instanceof MockObject;
37693    }
37694    /**
37695     * Converts an object to an array containing all of its private, protected
37696     * and public properties.
37697     *
37698     * @param object $object
37699     *
37700     * @return array
37701     */
37702    protected function toArray($object)
37703    {
37704        $array = parent::toArray($object);
37705        unset($array['__phpunit_invocationMocker']);
37706        return $array;
37707    }
37708}
37709<?php
37710
37711declare (strict_types=1);
37712/*
37713 * This file is part of PharIo\Manifest.
37714 *
37715 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
37716 *
37717 * For the full copyright and license information, please view the LICENSE
37718 * file that was distributed with this source code.
37719 */
37720namespace PHPUnit\PharIo\Manifest;
37721
37722use PHPUnit\PharIo\Version\Exception as VersionException;
37723use PHPUnit\PharIo\Version\Version;
37724use PHPUnit\PharIo\Version\VersionConstraintParser;
37725class ManifestDocumentMapper
37726{
37727    public function map(ManifestDocument $document) : Manifest
37728    {
37729        try {
37730            $contains = $document->getContainsElement();
37731            $type = $this->mapType($contains);
37732            $copyright = $this->mapCopyright($document->getCopyrightElement());
37733            $requirements = $this->mapRequirements($document->getRequiresElement());
37734            $bundledComponents = $this->mapBundledComponents($document);
37735            return new Manifest(new ApplicationName($contains->getName()), new Version($contains->getVersion()), $type, $copyright, $requirements, $bundledComponents);
37736        } catch (VersionException $e) {
37737            throw new ManifestDocumentMapperException($e->getMessage(), (int) $e->getCode(), $e);
37738        } catch (Exception $e) {
37739            throw new ManifestDocumentMapperException($e->getMessage(), (int) $e->getCode(), $e);
37740        }
37741    }
37742    private function mapType(ContainsElement $contains) : Type
37743    {
37744        switch ($contains->getType()) {
37745            case 'application':
37746                return Type::application();
37747            case 'library':
37748                return Type::library();
37749            case 'extension':
37750                return $this->mapExtension($contains->getExtensionElement());
37751        }
37752        throw new ManifestDocumentMapperException(\sprintf('Unsupported type %s', $contains->getType()));
37753    }
37754    private function mapCopyright(CopyrightElement $copyright) : CopyrightInformation
37755    {
37756        $authors = new AuthorCollection();
37757        foreach ($copyright->getAuthorElements() as $authorElement) {
37758            $authors->add(new Author($authorElement->getName(), new Email($authorElement->getEmail())));
37759        }
37760        $licenseElement = $copyright->getLicenseElement();
37761        $license = new License($licenseElement->getType(), new Url($licenseElement->getUrl()));
37762        return new CopyrightInformation($authors, $license);
37763    }
37764    private function mapRequirements(RequiresElement $requires) : RequirementCollection
37765    {
37766        $collection = new RequirementCollection();
37767        $phpElement = $requires->getPHPElement();
37768        $parser = new VersionConstraintParser();
37769        try {
37770            $versionConstraint = $parser->parse($phpElement->getVersion());
37771        } catch (VersionException $e) {
37772            throw new ManifestDocumentMapperException(\sprintf('Unsupported version constraint - %s', $e->getMessage()), (int) $e->getCode(), $e);
37773        }
37774        $collection->add(new PhpVersionRequirement($versionConstraint));
37775        if (!$phpElement->hasExtElements()) {
37776            return $collection;
37777        }
37778        foreach ($phpElement->getExtElements() as $extElement) {
37779            $collection->add(new PhpExtensionRequirement($extElement->getName()));
37780        }
37781        return $collection;
37782    }
37783    private function mapBundledComponents(ManifestDocument $document) : BundledComponentCollection
37784    {
37785        $collection = new BundledComponentCollection();
37786        if (!$document->hasBundlesElement()) {
37787            return $collection;
37788        }
37789        foreach ($document->getBundlesElement()->getComponentElements() as $componentElement) {
37790            $collection->add(new BundledComponent($componentElement->getName(), new Version($componentElement->getVersion())));
37791        }
37792        return $collection;
37793    }
37794    private function mapExtension(ExtensionElement $extension) : Extension
37795    {
37796        try {
37797            $versionConstraint = (new VersionConstraintParser())->parse($extension->getCompatible());
37798            return Type::extension(new ApplicationName($extension->getFor()), $versionConstraint);
37799        } catch (VersionException $e) {
37800            throw new ManifestDocumentMapperException(\sprintf('Unsupported version constraint - %s', $e->getMessage()), (int) $e->getCode(), $e);
37801        }
37802    }
37803}
37804<?php
37805
37806declare (strict_types=1);
37807namespace PHPUnit\PharIo\Manifest;
37808
37809class ManifestDocumentMapperException extends \RuntimeException implements Exception
37810{
37811}
37812<?php
37813
37814declare (strict_types=1);
37815/*
37816 * This file is part of PharIo\Manifest.
37817 *
37818 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
37819 *
37820 * For the full copyright and license information, please view the LICENSE
37821 * file that was distributed with this source code.
37822 */
37823namespace PHPUnit\PharIo\Manifest;
37824
37825class InvalidUrlException extends \InvalidArgumentException implements Exception
37826{
37827}
37828<?php
37829
37830declare (strict_types=1);
37831/*
37832 * This file is part of PharIo\Manifest.
37833 *
37834 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
37835 *
37836 * For the full copyright and license information, please view the LICENSE
37837 * file that was distributed with this source code.
37838 */
37839namespace PHPUnit\PharIo\Manifest;
37840
37841class InvalidApplicationNameException extends \InvalidArgumentException implements Exception
37842{
37843    public const InvalidFormat = 2;
37844}
37845<?php
37846
37847declare (strict_types=1);
37848namespace PHPUnit\PharIo\Manifest;
37849
37850class ManifestElementException extends \RuntimeException implements Exception
37851{
37852}
37853<?php
37854
37855declare (strict_types=1);
37856namespace PHPUnit\PharIo\Manifest;
37857
37858class ManifestLoaderException extends \Exception implements Exception
37859{
37860}
37861<?php
37862
37863declare (strict_types=1);
37864namespace PHPUnit\PharIo\Manifest;
37865
37866class ManifestDocumentException extends \RuntimeException implements Exception
37867{
37868}
37869<?php
37870
37871declare (strict_types=1);
37872/*
37873 * This file is part of PharIo\Manifest.
37874 *
37875 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
37876 *
37877 * For the full copyright and license information, please view the LICENSE
37878 * file that was distributed with this source code.
37879 */
37880namespace PHPUnit\PharIo\Manifest;
37881
37882class InvalidEmailException extends \InvalidArgumentException implements Exception
37883{
37884}
37885<?php
37886
37887declare (strict_types=1);
37888/*
37889 * This file is part of PharIo\Manifest.
37890 *
37891 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
37892 *
37893 * For the full copyright and license information, please view the LICENSE
37894 * file that was distributed with this source code.
37895 */
37896namespace PHPUnit\PharIo\Manifest;
37897
37898interface Exception extends \Throwable
37899{
37900}
37901<?php
37902
37903declare (strict_types=1);
37904/*
37905 * This file is part of PharIo\Manifest.
37906 *
37907 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
37908 *
37909 * For the full copyright and license information, please view the LICENSE
37910 * file that was distributed with this source code.
37911 */
37912namespace PHPUnit\PharIo\Manifest;
37913
37914use LibXMLError;
37915class ManifestDocumentLoadingException extends \Exception implements Exception
37916{
37917    /** @var LibXMLError[] */
37918    private $libxmlErrors;
37919    /**
37920     * ManifestDocumentLoadingException constructor.
37921     *
37922     * @param LibXMLError[] $libxmlErrors
37923     */
37924    public function __construct(array $libxmlErrors)
37925    {
37926        $this->libxmlErrors = $libxmlErrors;
37927        $first = $this->libxmlErrors[0];
37928        parent::__construct(\sprintf('%s (Line: %d / Column: %d / File: %s)', $first->message, $first->line, $first->column, $first->file), $first->code);
37929    }
37930    /**
37931     * @return LibXMLError[]
37932     */
37933    public function getLibxmlErrors() : array
37934    {
37935        return $this->libxmlErrors;
37936    }
37937}
37938<?php
37939
37940declare (strict_types=1);
37941/*
37942 * This file is part of PharIo\Manifest.
37943 *
37944 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
37945 *
37946 * For the full copyright and license information, please view the LICENSE
37947 * file that was distributed with this source code.
37948 */
37949namespace PHPUnit\PharIo\Manifest;
37950
37951class ElementCollectionException extends \InvalidArgumentException implements Exception
37952{
37953}
37954<?php
37955
37956declare (strict_types=1);
37957/*
37958 * This file is part of PharIo\Manifest.
37959 *
37960 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
37961 *
37962 * For the full copyright and license information, please view the LICENSE
37963 * file that was distributed with this source code.
37964 */
37965namespace PHPUnit\PharIo\Manifest;
37966
37967use PHPUnit\PharIo\Version\AnyVersionConstraint;
37968use PHPUnit\PharIo\Version\Version;
37969use PHPUnit\PharIo\Version\VersionConstraint;
37970use XMLWriter;
37971/** @psalm-suppress MissingConstructor */
37972class ManifestSerializer
37973{
37974    /** @var XMLWriter */
37975    private $xmlWriter;
37976    public function serializeToFile(Manifest $manifest, string $filename) : void
37977    {
37978        \file_put_contents($filename, $this->serializeToString($manifest));
37979    }
37980    public function serializeToString(Manifest $manifest) : string
37981    {
37982        $this->startDocument();
37983        $this->addContains($manifest->getName(), $manifest->getVersion(), $manifest->getType());
37984        $this->addCopyright($manifest->getCopyrightInformation());
37985        $this->addRequirements($manifest->getRequirements());
37986        $this->addBundles($manifest->getBundledComponents());
37987        return $this->finishDocument();
37988    }
37989    private function startDocument() : void
37990    {
37991        $xmlWriter = new XMLWriter();
37992        $xmlWriter->openMemory();
37993        $xmlWriter->setIndent(\true);
37994        $xmlWriter->setIndentString(\str_repeat(' ', 4));
37995        $xmlWriter->startDocument('1.0', 'UTF-8');
37996        $xmlWriter->startElement('phar');
37997        $xmlWriter->writeAttribute('xmlns', 'https://phar.io/xml/manifest/1.0');
37998        $this->xmlWriter = $xmlWriter;
37999    }
38000    private function finishDocument() : string
38001    {
38002        $this->xmlWriter->endElement();
38003        $this->xmlWriter->endDocument();
38004        return $this->xmlWriter->outputMemory();
38005    }
38006    private function addContains(ApplicationName $name, Version $version, Type $type) : void
38007    {
38008        $this->xmlWriter->startElement('contains');
38009        $this->xmlWriter->writeAttribute('name', $name->asString());
38010        $this->xmlWriter->writeAttribute('version', $version->getVersionString());
38011        switch (\true) {
38012            case $type->isApplication():
38013                $this->xmlWriter->writeAttribute('type', 'application');
38014                break;
38015            case $type->isLibrary():
38016                $this->xmlWriter->writeAttribute('type', 'library');
38017                break;
38018            case $type->isExtension():
38019                $this->xmlWriter->writeAttribute('type', 'extension');
38020                /* @var $type Extension */
38021                $this->addExtension($type->getApplicationName(), $type->getVersionConstraint());
38022                break;
38023            default:
38024                $this->xmlWriter->writeAttribute('type', 'custom');
38025        }
38026        $this->xmlWriter->endElement();
38027    }
38028    private function addCopyright(CopyrightInformation $copyrightInformation) : void
38029    {
38030        $this->xmlWriter->startElement('copyright');
38031        foreach ($copyrightInformation->getAuthors() as $author) {
38032            $this->xmlWriter->startElement('author');
38033            $this->xmlWriter->writeAttribute('name', $author->getName());
38034            $this->xmlWriter->writeAttribute('email', $author->getEmail()->asString());
38035            $this->xmlWriter->endElement();
38036        }
38037        $license = $copyrightInformation->getLicense();
38038        $this->xmlWriter->startElement('license');
38039        $this->xmlWriter->writeAttribute('type', $license->getName());
38040        $this->xmlWriter->writeAttribute('url', $license->getUrl()->asString());
38041        $this->xmlWriter->endElement();
38042        $this->xmlWriter->endElement();
38043    }
38044    private function addRequirements(RequirementCollection $requirementCollection) : void
38045    {
38046        $phpRequirement = new AnyVersionConstraint();
38047        $extensions = [];
38048        foreach ($requirementCollection as $requirement) {
38049            if ($requirement instanceof PhpVersionRequirement) {
38050                $phpRequirement = $requirement->getVersionConstraint();
38051                continue;
38052            }
38053            if ($requirement instanceof PhpExtensionRequirement) {
38054                $extensions[] = $requirement->asString();
38055            }
38056        }
38057        $this->xmlWriter->startElement('requires');
38058        $this->xmlWriter->startElement('php');
38059        $this->xmlWriter->writeAttribute('version', $phpRequirement->asString());
38060        foreach ($extensions as $extension) {
38061            $this->xmlWriter->startElement('ext');
38062            $this->xmlWriter->writeAttribute('name', $extension);
38063            $this->xmlWriter->endElement();
38064        }
38065        $this->xmlWriter->endElement();
38066        $this->xmlWriter->endElement();
38067    }
38068    private function addBundles(BundledComponentCollection $bundledComponentCollection) : void
38069    {
38070        if (\count($bundledComponentCollection) === 0) {
38071            return;
38072        }
38073        $this->xmlWriter->startElement('bundles');
38074        foreach ($bundledComponentCollection as $bundledComponent) {
38075            $this->xmlWriter->startElement('component');
38076            $this->xmlWriter->writeAttribute('name', $bundledComponent->getName());
38077            $this->xmlWriter->writeAttribute('version', $bundledComponent->getVersion()->getVersionString());
38078            $this->xmlWriter->endElement();
38079        }
38080        $this->xmlWriter->endElement();
38081    }
38082    private function addExtension(ApplicationName $applicationName, VersionConstraint $versionConstraint) : void
38083    {
38084        $this->xmlWriter->startElement('extension');
38085        $this->xmlWriter->writeAttribute('for', $applicationName->asString());
38086        $this->xmlWriter->writeAttribute('compatible', $versionConstraint->asString());
38087        $this->xmlWriter->endElement();
38088    }
38089}
38090<?php
38091
38092declare (strict_types=1);
38093/*
38094 * This file is part of PharIo\Manifest.
38095 *
38096 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38097 *
38098 * For the full copyright and license information, please view the LICENSE
38099 * file that was distributed with this source code.
38100 */
38101namespace PHPUnit\PharIo\Manifest;
38102
38103class ExtElement extends ManifestElement
38104{
38105    public function getName() : string
38106    {
38107        return $this->getAttributeValue('name');
38108    }
38109}
38110<?php
38111
38112declare (strict_types=1);
38113/*
38114 * This file is part of PharIo\Manifest.
38115 *
38116 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38117 *
38118 * For the full copyright and license information, please view the LICENSE
38119 * file that was distributed with this source code.
38120 */
38121namespace PHPUnit\PharIo\Manifest;
38122
38123class CopyrightElement extends ManifestElement
38124{
38125    public function getAuthorElements() : AuthorElementCollection
38126    {
38127        return new AuthorElementCollection($this->getChildrenByName('author'));
38128    }
38129    public function getLicenseElement() : LicenseElement
38130    {
38131        return new LicenseElement($this->getChildByName('license'));
38132    }
38133}
38134<?php
38135
38136declare (strict_types=1);
38137/*
38138 * This file is part of PharIo\Manifest.
38139 *
38140 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38141 *
38142 * For the full copyright and license information, please view the LICENSE
38143 * file that was distributed with this source code.
38144 */
38145namespace PHPUnit\PharIo\Manifest;
38146
38147class PhpElement extends ManifestElement
38148{
38149    public function getVersion() : string
38150    {
38151        return $this->getAttributeValue('version');
38152    }
38153    public function hasExtElements() : bool
38154    {
38155        return $this->hasChild('ext');
38156    }
38157    public function getExtElements() : ExtElementCollection
38158    {
38159        return new ExtElementCollection($this->getChildrenByName('ext'));
38160    }
38161}
38162<?php
38163
38164declare (strict_types=1);
38165/*
38166 * This file is part of PharIo\Manifest.
38167 *
38168 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38169 *
38170 * For the full copyright and license information, please view the LICENSE
38171 * file that was distributed with this source code.
38172 */
38173namespace PHPUnit\PharIo\Manifest;
38174
38175class AuthorElementCollection extends ElementCollection
38176{
38177    public function current() : AuthorElement
38178    {
38179        return new AuthorElement($this->getCurrentElement());
38180    }
38181}
38182<?php
38183
38184declare (strict_types=1);
38185/*
38186 * This file is part of PharIo\Manifest.
38187 *
38188 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38189 *
38190 * For the full copyright and license information, please view the LICENSE
38191 * file that was distributed with this source code.
38192 */
38193namespace PHPUnit\PharIo\Manifest;
38194
38195use DOMElement;
38196use DOMNodeList;
38197abstract class ElementCollection implements \Iterator
38198{
38199    /** @var DOMElement[] */
38200    private $nodes = [];
38201    /** @var int */
38202    private $position;
38203    public function __construct(DOMNodeList $nodeList)
38204    {
38205        $this->position = 0;
38206        $this->importNodes($nodeList);
38207    }
38208    #[\ReturnTypeWillChange]
38209    public abstract function current();
38210    public function next() : void
38211    {
38212        $this->position++;
38213    }
38214    public function key() : int
38215    {
38216        return $this->position;
38217    }
38218    public function valid() : bool
38219    {
38220        return $this->position < \count($this->nodes);
38221    }
38222    public function rewind() : void
38223    {
38224        $this->position = 0;
38225    }
38226    protected function getCurrentElement() : DOMElement
38227    {
38228        return $this->nodes[$this->position];
38229    }
38230    private function importNodes(DOMNodeList $nodeList) : void
38231    {
38232        foreach ($nodeList as $node) {
38233            if (!$node instanceof DOMElement) {
38234                throw new ElementCollectionException(\sprintf('\\DOMElement expected, got \\%s', \get_class($node)));
38235            }
38236            $this->nodes[] = $node;
38237        }
38238    }
38239}
38240<?php
38241
38242declare (strict_types=1);
38243/*
38244 * This file is part of PharIo\Manifest.
38245 *
38246 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38247 *
38248 * For the full copyright and license information, please view the LICENSE
38249 * file that was distributed with this source code.
38250 */
38251namespace PHPUnit\PharIo\Manifest;
38252
38253class ExtensionElement extends ManifestElement
38254{
38255    public function getFor() : string
38256    {
38257        return $this->getAttributeValue('for');
38258    }
38259    public function getCompatible() : string
38260    {
38261        return $this->getAttributeValue('compatible');
38262    }
38263}
38264<?php
38265
38266declare (strict_types=1);
38267/*
38268 * This file is part of PharIo\Manifest.
38269 *
38270 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38271 *
38272 * For the full copyright and license information, please view the LICENSE
38273 * file that was distributed with this source code.
38274 */
38275namespace PHPUnit\PharIo\Manifest;
38276
38277class LicenseElement extends ManifestElement
38278{
38279    public function getType() : string
38280    {
38281        return $this->getAttributeValue('type');
38282    }
38283    public function getUrl() : string
38284    {
38285        return $this->getAttributeValue('url');
38286    }
38287}
38288<?php
38289
38290declare (strict_types=1);
38291/*
38292 * This file is part of PharIo\Manifest.
38293 *
38294 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38295 *
38296 * For the full copyright and license information, please view the LICENSE
38297 * file that was distributed with this source code.
38298 */
38299namespace PHPUnit\PharIo\Manifest;
38300
38301class ExtElementCollection extends ElementCollection
38302{
38303    public function current() : ExtElement
38304    {
38305        return new ExtElement($this->getCurrentElement());
38306    }
38307}
38308<?php
38309
38310declare (strict_types=1);
38311/*
38312 * This file is part of PharIo\Manifest.
38313 *
38314 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38315 *
38316 * For the full copyright and license information, please view the LICENSE
38317 * file that was distributed with this source code.
38318 */
38319namespace PHPUnit\PharIo\Manifest;
38320
38321class RequiresElement extends ManifestElement
38322{
38323    public function getPHPElement() : PhpElement
38324    {
38325        return new PhpElement($this->getChildByName('php'));
38326    }
38327}
38328<?php
38329
38330declare (strict_types=1);
38331/*
38332 * This file is part of PharIo\Manifest.
38333 *
38334 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38335 *
38336 * For the full copyright and license information, please view the LICENSE
38337 * file that was distributed with this source code.
38338 */
38339namespace PHPUnit\PharIo\Manifest;
38340
38341class BundlesElement extends ManifestElement
38342{
38343    public function getComponentElements() : ComponentElementCollection
38344    {
38345        return new ComponentElementCollection($this->getChildrenByName('component'));
38346    }
38347}
38348<?php
38349
38350declare (strict_types=1);
38351/*
38352 * This file is part of PharIo\Manifest.
38353 *
38354 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38355 *
38356 * For the full copyright and license information, please view the LICENSE
38357 * file that was distributed with this source code.
38358 */
38359namespace PHPUnit\PharIo\Manifest;
38360
38361class ContainsElement extends ManifestElement
38362{
38363    public function getName() : string
38364    {
38365        return $this->getAttributeValue('name');
38366    }
38367    public function getVersion() : string
38368    {
38369        return $this->getAttributeValue('version');
38370    }
38371    public function getType() : string
38372    {
38373        return $this->getAttributeValue('type');
38374    }
38375    public function getExtensionElement() : ExtensionElement
38376    {
38377        return new ExtensionElement($this->getChildByName('extension'));
38378    }
38379}
38380<?php
38381
38382declare (strict_types=1);
38383/*
38384 * This file is part of PharIo\Manifest.
38385 *
38386 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38387 *
38388 * For the full copyright and license information, please view the LICENSE
38389 * file that was distributed with this source code.
38390 */
38391namespace PHPUnit\PharIo\Manifest;
38392
38393use DOMDocument;
38394use DOMElement;
38395class ManifestDocument
38396{
38397    public const XMLNS = 'https://phar.io/xml/manifest/1.0';
38398    /** @var DOMDocument */
38399    private $dom;
38400    public static function fromFile(string $filename) : ManifestDocument
38401    {
38402        if (!\file_exists($filename)) {
38403            throw new ManifestDocumentException(\sprintf('File "%s" not found', $filename));
38404        }
38405        return self::fromString(\file_get_contents($filename));
38406    }
38407    public static function fromString(string $xmlString) : ManifestDocument
38408    {
38409        $prev = \libxml_use_internal_errors(\true);
38410        \libxml_clear_errors();
38411        $dom = new DOMDocument();
38412        $dom->loadXML($xmlString);
38413        $errors = \libxml_get_errors();
38414        \libxml_use_internal_errors($prev);
38415        if (\count($errors) !== 0) {
38416            throw new ManifestDocumentLoadingException($errors);
38417        }
38418        return new self($dom);
38419    }
38420    private function __construct(DOMDocument $dom)
38421    {
38422        $this->ensureCorrectDocumentType($dom);
38423        $this->dom = $dom;
38424    }
38425    public function getContainsElement() : ContainsElement
38426    {
38427        return new ContainsElement($this->fetchElementByName('contains'));
38428    }
38429    public function getCopyrightElement() : CopyrightElement
38430    {
38431        return new CopyrightElement($this->fetchElementByName('copyright'));
38432    }
38433    public function getRequiresElement() : RequiresElement
38434    {
38435        return new RequiresElement($this->fetchElementByName('requires'));
38436    }
38437    public function hasBundlesElement() : bool
38438    {
38439        return $this->dom->getElementsByTagNameNS(self::XMLNS, 'bundles')->length === 1;
38440    }
38441    public function getBundlesElement() : BundlesElement
38442    {
38443        return new BundlesElement($this->fetchElementByName('bundles'));
38444    }
38445    private function ensureCorrectDocumentType(DOMDocument $dom) : void
38446    {
38447        $root = $dom->documentElement;
38448        if ($root->localName !== 'phar' || $root->namespaceURI !== self::XMLNS) {
38449            throw new ManifestDocumentException('Not a phar.io manifest document');
38450        }
38451    }
38452    private function fetchElementByName(string $elementName) : DOMElement
38453    {
38454        $element = $this->dom->getElementsByTagNameNS(self::XMLNS, $elementName)->item(0);
38455        if (!$element instanceof DOMElement) {
38456            throw new ManifestDocumentException(\sprintf('Element %s missing', $elementName));
38457        }
38458        return $element;
38459    }
38460}
38461<?php
38462
38463declare (strict_types=1);
38464/*
38465 * This file is part of PharIo\Manifest.
38466 *
38467 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38468 *
38469 * For the full copyright and license information, please view the LICENSE
38470 * file that was distributed with this source code.
38471 */
38472namespace PHPUnit\PharIo\Manifest;
38473
38474class ComponentElement extends ManifestElement
38475{
38476    public function getName() : string
38477    {
38478        return $this->getAttributeValue('name');
38479    }
38480    public function getVersion() : string
38481    {
38482        return $this->getAttributeValue('version');
38483    }
38484}
38485<?php
38486
38487declare (strict_types=1);
38488/*
38489 * This file is part of PharIo\Manifest.
38490 *
38491 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38492 *
38493 * For the full copyright and license information, please view the LICENSE
38494 * file that was distributed with this source code.
38495 */
38496namespace PHPUnit\PharIo\Manifest;
38497
38498use DOMElement;
38499use DOMNodeList;
38500class ManifestElement
38501{
38502    public const XMLNS = 'https://phar.io/xml/manifest/1.0';
38503    /** @var DOMElement */
38504    private $element;
38505    public function __construct(DOMElement $element)
38506    {
38507        $this->element = $element;
38508    }
38509    protected function getAttributeValue(string $name) : string
38510    {
38511        if (!$this->element->hasAttribute($name)) {
38512            throw new ManifestElementException(\sprintf('Attribute %s not set on element %s', $name, $this->element->localName));
38513        }
38514        return $this->element->getAttribute($name);
38515    }
38516    protected function getChildByName(string $elementName) : DOMElement
38517    {
38518        $element = $this->element->getElementsByTagNameNS(self::XMLNS, $elementName)->item(0);
38519        if (!$element instanceof DOMElement) {
38520            throw new ManifestElementException(\sprintf('Element %s missing', $elementName));
38521        }
38522        return $element;
38523    }
38524    protected function getChildrenByName(string $elementName) : DOMNodeList
38525    {
38526        $elementList = $this->element->getElementsByTagNameNS(self::XMLNS, $elementName);
38527        if ($elementList->length === 0) {
38528            throw new ManifestElementException(\sprintf('Element(s) %s missing', $elementName));
38529        }
38530        return $elementList;
38531    }
38532    protected function hasChild(string $elementName) : bool
38533    {
38534        return $this->element->getElementsByTagNameNS(self::XMLNS, $elementName)->length !== 0;
38535    }
38536}
38537<?php
38538
38539declare (strict_types=1);
38540/*
38541 * This file is part of PharIo\Manifest.
38542 *
38543 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38544 *
38545 * For the full copyright and license information, please view the LICENSE
38546 * file that was distributed with this source code.
38547 */
38548namespace PHPUnit\PharIo\Manifest;
38549
38550class AuthorElement extends ManifestElement
38551{
38552    public function getName() : string
38553    {
38554        return $this->getAttributeValue('name');
38555    }
38556    public function getEmail() : string
38557    {
38558        return $this->getAttributeValue('email');
38559    }
38560}
38561<?php
38562
38563declare (strict_types=1);
38564/*
38565 * This file is part of PharIo\Manifest.
38566 *
38567 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38568 *
38569 * For the full copyright and license information, please view the LICENSE
38570 * file that was distributed with this source code.
38571 */
38572namespace PHPUnit\PharIo\Manifest;
38573
38574class ComponentElementCollection extends ElementCollection
38575{
38576    public function current() : ComponentElement
38577    {
38578        return new ComponentElement($this->getCurrentElement());
38579    }
38580}
38581Phar.io - Manifest
38582
38583Copyright (c) 2016-2019 Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>, and contributors
38584All rights reserved.
38585
38586Redistribution and use in source and binary forms, with or without modification,
38587are permitted provided that the following conditions are met:
38588
38589* Redistributions of source code must retain the above copyright notice,
38590  this list of conditions and the following disclaimer.
38591
38592* Redistributions in binary form must reproduce the above copyright notice,
38593  this list of conditions and the following disclaimer in the documentation
38594  and/or other materials provided with the distribution.
38595
38596* Neither the name of Arne Blankerts nor the names of contributors
38597  may be used to endorse or promote products derived from this software
38598  without specific prior written permission.
38599
38600THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
38601AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT  * NOT LIMITED TO,
38602THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
38603PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
38604BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
38605OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
38606SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38607INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
38608CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38609ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38610POSSIBILITY OF SUCH DAMAGE.
38611
38612<?php
38613
38614declare (strict_types=1);
38615/*
38616 * This file is part of PharIo\Manifest.
38617 *
38618 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38619 *
38620 * For the full copyright and license information, please view the LICENSE
38621 * file that was distributed with this source code.
38622 */
38623namespace PHPUnit\PharIo\Manifest;
38624
38625use PHPUnit\PharIo\Version\Version;
38626class Manifest
38627{
38628    /** @var ApplicationName */
38629    private $name;
38630    /** @var Version */
38631    private $version;
38632    /** @var Type */
38633    private $type;
38634    /** @var CopyrightInformation */
38635    private $copyrightInformation;
38636    /** @var RequirementCollection */
38637    private $requirements;
38638    /** @var BundledComponentCollection */
38639    private $bundledComponents;
38640    public function __construct(ApplicationName $name, Version $version, Type $type, CopyrightInformation $copyrightInformation, RequirementCollection $requirements, BundledComponentCollection $bundledComponents)
38641    {
38642        $this->name = $name;
38643        $this->version = $version;
38644        $this->type = $type;
38645        $this->copyrightInformation = $copyrightInformation;
38646        $this->requirements = $requirements;
38647        $this->bundledComponents = $bundledComponents;
38648    }
38649    public function getName() : ApplicationName
38650    {
38651        return $this->name;
38652    }
38653    public function getVersion() : Version
38654    {
38655        return $this->version;
38656    }
38657    public function getType() : Type
38658    {
38659        return $this->type;
38660    }
38661    public function getCopyrightInformation() : CopyrightInformation
38662    {
38663        return $this->copyrightInformation;
38664    }
38665    public function getRequirements() : RequirementCollection
38666    {
38667        return $this->requirements;
38668    }
38669    public function getBundledComponents() : BundledComponentCollection
38670    {
38671        return $this->bundledComponents;
38672    }
38673    public function isApplication() : bool
38674    {
38675        return $this->type->isApplication();
38676    }
38677    public function isLibrary() : bool
38678    {
38679        return $this->type->isLibrary();
38680    }
38681    public function isExtension() : bool
38682    {
38683        return $this->type->isExtension();
38684    }
38685    public function isExtensionFor(ApplicationName $application, Version $version = null) : bool
38686    {
38687        if (!$this->isExtension()) {
38688            return \false;
38689        }
38690        /** @var Extension $type */
38691        $type = $this->type;
38692        if ($version !== null) {
38693            return $type->isCompatibleWith($application, $version);
38694        }
38695        return $type->isExtensionFor($application);
38696    }
38697}
38698<?php
38699
38700declare (strict_types=1);
38701/*
38702 * This file is part of PharIo\Manifest.
38703 *
38704 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38705 *
38706 * For the full copyright and license information, please view the LICENSE
38707 * file that was distributed with this source code.
38708 */
38709namespace PHPUnit\PharIo\Manifest;
38710
38711class Url
38712{
38713    /** @var string */
38714    private $url;
38715    public function __construct(string $url)
38716    {
38717        $this->ensureUrlIsValid($url);
38718        $this->url = $url;
38719    }
38720    public function asString() : string
38721    {
38722        return $this->url;
38723    }
38724    /**
38725     * @param string $url
38726     *
38727     * @throws InvalidUrlException
38728     */
38729    private function ensureUrlIsValid($url) : void
38730    {
38731        if (\filter_var($url, \FILTER_VALIDATE_URL) === \false) {
38732            throw new InvalidUrlException();
38733        }
38734    }
38735}
38736<?php
38737
38738declare (strict_types=1);
38739/*
38740 * This file is part of PharIo\Manifest.
38741 *
38742 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38743 *
38744 * For the full copyright and license information, please view the LICENSE
38745 * file that was distributed with this source code.
38746 */
38747namespace PHPUnit\PharIo\Manifest;
38748
38749class AuthorCollectionIterator implements \Iterator
38750{
38751    /** @var Author[] */
38752    private $authors;
38753    /** @var int */
38754    private $position = 0;
38755    public function __construct(AuthorCollection $authors)
38756    {
38757        $this->authors = $authors->getAuthors();
38758    }
38759    public function rewind() : void
38760    {
38761        $this->position = 0;
38762    }
38763    public function valid() : bool
38764    {
38765        return $this->position < \count($this->authors);
38766    }
38767    public function key() : int
38768    {
38769        return $this->position;
38770    }
38771    public function current() : Author
38772    {
38773        return $this->authors[$this->position];
38774    }
38775    public function next() : void
38776    {
38777        $this->position++;
38778    }
38779}
38780<?php
38781
38782declare (strict_types=1);
38783/*
38784 * This file is part of PharIo\Manifest.
38785 *
38786 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38787 *
38788 * For the full copyright and license information, please view the LICENSE
38789 * file that was distributed with this source code.
38790 */
38791namespace PHPUnit\PharIo\Manifest;
38792
38793class Author
38794{
38795    /** @var string */
38796    private $name;
38797    /** @var Email */
38798    private $email;
38799    public function __construct(string $name, Email $email)
38800    {
38801        $this->name = $name;
38802        $this->email = $email;
38803    }
38804    public function asString() : string
38805    {
38806        return \sprintf('%s <%s>', $this->name, $this->email->asString());
38807    }
38808    public function getName() : string
38809    {
38810        return $this->name;
38811    }
38812    public function getEmail() : Email
38813    {
38814        return $this->email;
38815    }
38816}
38817<?php
38818
38819declare (strict_types=1);
38820/*
38821 * This file is part of PharIo\Manifest.
38822 *
38823 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38824 *
38825 * For the full copyright and license information, please view the LICENSE
38826 * file that was distributed with this source code.
38827 */
38828namespace PHPUnit\PharIo\Manifest;
38829
38830class ApplicationName
38831{
38832    /** @var string */
38833    private $name;
38834    public function __construct(string $name)
38835    {
38836        $this->ensureValidFormat($name);
38837        $this->name = $name;
38838    }
38839    public function asString() : string
38840    {
38841        return $this->name;
38842    }
38843    public function isEqual(ApplicationName $name) : bool
38844    {
38845        return $this->name === $name->name;
38846    }
38847    private function ensureValidFormat(string $name) : void
38848    {
38849        if (!\preg_match('#\\w/\\w#', $name)) {
38850            throw new InvalidApplicationNameException(\sprintf('Format of name "%s" is not valid - expected: vendor/packagename', $name), InvalidApplicationNameException::InvalidFormat);
38851        }
38852    }
38853}
38854<?php
38855
38856declare (strict_types=1);
38857/*
38858 * This file is part of PharIo\Manifest.
38859 *
38860 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38861 *
38862 * For the full copyright and license information, please view the LICENSE
38863 * file that was distributed with this source code.
38864 */
38865namespace PHPUnit\PharIo\Manifest;
38866
38867class Application extends Type
38868{
38869    public function isApplication() : bool
38870    {
38871        return \true;
38872    }
38873}
38874<?php
38875
38876declare (strict_types=1);
38877/*
38878 * This file is part of PharIo\Manifest.
38879 *
38880 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38881 *
38882 * For the full copyright and license information, please view the LICENSE
38883 * file that was distributed with this source code.
38884 */
38885namespace PHPUnit\PharIo\Manifest;
38886
38887use PHPUnit\PharIo\Version\VersionConstraint;
38888class PhpVersionRequirement implements Requirement
38889{
38890    /** @var VersionConstraint */
38891    private $versionConstraint;
38892    public function __construct(VersionConstraint $versionConstraint)
38893    {
38894        $this->versionConstraint = $versionConstraint;
38895    }
38896    public function getVersionConstraint() : VersionConstraint
38897    {
38898        return $this->versionConstraint;
38899    }
38900}
38901<?php
38902
38903declare (strict_types=1);
38904/*
38905 * This file is part of PharIo\Manifest.
38906 *
38907 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38908 *
38909 * For the full copyright and license information, please view the LICENSE
38910 * file that was distributed with this source code.
38911 */
38912namespace PHPUnit\PharIo\Manifest;
38913
38914class License
38915{
38916    /** @var string */
38917    private $name;
38918    /** @var Url */
38919    private $url;
38920    public function __construct(string $name, Url $url)
38921    {
38922        $this->name = $name;
38923        $this->url = $url;
38924    }
38925    public function getName() : string
38926    {
38927        return $this->name;
38928    }
38929    public function getUrl() : Url
38930    {
38931        return $this->url;
38932    }
38933}
38934<?php
38935
38936declare (strict_types=1);
38937/*
38938 * This file is part of PharIo\Manifest.
38939 *
38940 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38941 *
38942 * For the full copyright and license information, please view the LICENSE
38943 * file that was distributed with this source code.
38944 */
38945namespace PHPUnit\PharIo\Manifest;
38946
38947class Library extends Type
38948{
38949    public function isLibrary() : bool
38950    {
38951        return \true;
38952    }
38953}
38954<?php
38955
38956declare (strict_types=1);
38957/*
38958 * This file is part of PharIo\Manifest.
38959 *
38960 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38961 *
38962 * For the full copyright and license information, please view the LICENSE
38963 * file that was distributed with this source code.
38964 */
38965namespace PHPUnit\PharIo\Manifest;
38966
38967class AuthorCollection implements \Countable, \IteratorAggregate
38968{
38969    /** @var Author[] */
38970    private $authors = [];
38971    public function add(Author $author) : void
38972    {
38973        $this->authors[] = $author;
38974    }
38975    /**
38976     * @return Author[]
38977     */
38978    public function getAuthors() : array
38979    {
38980        return $this->authors;
38981    }
38982    public function count() : int
38983    {
38984        return \count($this->authors);
38985    }
38986    public function getIterator() : AuthorCollectionIterator
38987    {
38988        return new AuthorCollectionIterator($this);
38989    }
38990}
38991<?php
38992
38993declare (strict_types=1);
38994/*
38995 * This file is part of PharIo\Manifest.
38996 *
38997 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
38998 *
38999 * For the full copyright and license information, please view the LICENSE
39000 * file that was distributed with this source code.
39001 */
39002namespace PHPUnit\PharIo\Manifest;
39003
39004interface Requirement
39005{
39006}
39007<?php
39008
39009declare (strict_types=1);
39010/*
39011 * This file is part of PharIo\Manifest.
39012 *
39013 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
39014 *
39015 * For the full copyright and license information, please view the LICENSE
39016 * file that was distributed with this source code.
39017 */
39018namespace PHPUnit\PharIo\Manifest;
39019
39020use PHPUnit\PharIo\Version\Version;
39021use PHPUnit\PharIo\Version\VersionConstraint;
39022class Extension extends Type
39023{
39024    /** @var ApplicationName */
39025    private $application;
39026    /** @var VersionConstraint */
39027    private $versionConstraint;
39028    public function __construct(ApplicationName $application, VersionConstraint $versionConstraint)
39029    {
39030        $this->application = $application;
39031        $this->versionConstraint = $versionConstraint;
39032    }
39033    public function getApplicationName() : ApplicationName
39034    {
39035        return $this->application;
39036    }
39037    public function getVersionConstraint() : VersionConstraint
39038    {
39039        return $this->versionConstraint;
39040    }
39041    public function isExtension() : bool
39042    {
39043        return \true;
39044    }
39045    public function isExtensionFor(ApplicationName $name) : bool
39046    {
39047        return $this->application->isEqual($name);
39048    }
39049    public function isCompatibleWith(ApplicationName $name, Version $version) : bool
39050    {
39051        return $this->isExtensionFor($name) && $this->versionConstraint->complies($version);
39052    }
39053}
39054<?php
39055
39056declare (strict_types=1);
39057/*
39058 * This file is part of PharIo\Manifest.
39059 *
39060 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
39061 *
39062 * For the full copyright and license information, please view the LICENSE
39063 * file that was distributed with this source code.
39064 */
39065namespace PHPUnit\PharIo\Manifest;
39066
39067class BundledComponentCollectionIterator implements \Iterator
39068{
39069    /** @var BundledComponent[] */
39070    private $bundledComponents;
39071    /** @var int */
39072    private $position = 0;
39073    public function __construct(BundledComponentCollection $bundledComponents)
39074    {
39075        $this->bundledComponents = $bundledComponents->getBundledComponents();
39076    }
39077    public function rewind() : void
39078    {
39079        $this->position = 0;
39080    }
39081    public function valid() : bool
39082    {
39083        return $this->position < \count($this->bundledComponents);
39084    }
39085    public function key() : int
39086    {
39087        return $this->position;
39088    }
39089    public function current() : BundledComponent
39090    {
39091        return $this->bundledComponents[$this->position];
39092    }
39093    public function next() : void
39094    {
39095        $this->position++;
39096    }
39097}
39098<?php
39099
39100declare (strict_types=1);
39101/*
39102 * This file is part of PharIo\Manifest.
39103 *
39104 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
39105 *
39106 * For the full copyright and license information, please view the LICENSE
39107 * file that was distributed with this source code.
39108 */
39109namespace PHPUnit\PharIo\Manifest;
39110
39111class RequirementCollection implements \Countable, \IteratorAggregate
39112{
39113    /** @var Requirement[] */
39114    private $requirements = [];
39115    public function add(Requirement $requirement) : void
39116    {
39117        $this->requirements[] = $requirement;
39118    }
39119    /**
39120     * @return Requirement[]
39121     */
39122    public function getRequirements() : array
39123    {
39124        return $this->requirements;
39125    }
39126    public function count() : int
39127    {
39128        return \count($this->requirements);
39129    }
39130    public function getIterator() : RequirementCollectionIterator
39131    {
39132        return new RequirementCollectionIterator($this);
39133    }
39134}
39135<?php
39136
39137declare (strict_types=1);
39138/*
39139 * This file is part of PharIo\Manifest.
39140 *
39141 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
39142 *
39143 * For the full copyright and license information, please view the LICENSE
39144 * file that was distributed with this source code.
39145 */
39146namespace PHPUnit\PharIo\Manifest;
39147
39148class RequirementCollectionIterator implements \Iterator
39149{
39150    /** @var Requirement[] */
39151    private $requirements;
39152    /** @var int */
39153    private $position = 0;
39154    public function __construct(RequirementCollection $requirements)
39155    {
39156        $this->requirements = $requirements->getRequirements();
39157    }
39158    public function rewind() : void
39159    {
39160        $this->position = 0;
39161    }
39162    public function valid() : bool
39163    {
39164        return $this->position < \count($this->requirements);
39165    }
39166    public function key() : int
39167    {
39168        return $this->position;
39169    }
39170    public function current() : Requirement
39171    {
39172        return $this->requirements[$this->position];
39173    }
39174    public function next() : void
39175    {
39176        $this->position++;
39177    }
39178}
39179<?php
39180
39181declare (strict_types=1);
39182/*
39183 * This file is part of PharIo\Manifest.
39184 *
39185 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
39186 *
39187 * For the full copyright and license information, please view the LICENSE
39188 * file that was distributed with this source code.
39189 */
39190namespace PHPUnit\PharIo\Manifest;
39191
39192class Email
39193{
39194    /** @var string */
39195    private $email;
39196    public function __construct(string $email)
39197    {
39198        $this->ensureEmailIsValid($email);
39199        $this->email = $email;
39200    }
39201    public function asString() : string
39202    {
39203        return $this->email;
39204    }
39205    private function ensureEmailIsValid(string $url) : void
39206    {
39207        if (\filter_var($url, \FILTER_VALIDATE_EMAIL) === \false) {
39208            throw new InvalidEmailException();
39209        }
39210    }
39211}
39212<?php
39213
39214declare (strict_types=1);
39215/*
39216 * This file is part of PharIo\Manifest.
39217 *
39218 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
39219 *
39220 * For the full copyright and license information, please view the LICENSE
39221 * file that was distributed with this source code.
39222 */
39223namespace PHPUnit\PharIo\Manifest;
39224
39225use PHPUnit\PharIo\Version\VersionConstraint;
39226abstract class Type
39227{
39228    public static function application() : Application
39229    {
39230        return new Application();
39231    }
39232    public static function library() : Library
39233    {
39234        return new Library();
39235    }
39236    public static function extension(ApplicationName $application, VersionConstraint $versionConstraint) : Extension
39237    {
39238        return new Extension($application, $versionConstraint);
39239    }
39240    /** @psalm-assert-if-true Application $this */
39241    public function isApplication() : bool
39242    {
39243        return \false;
39244    }
39245    /** @psalm-assert-if-true Library $this */
39246    public function isLibrary() : bool
39247    {
39248        return \false;
39249    }
39250    /** @psalm-assert-if-true Extension $this */
39251    public function isExtension() : bool
39252    {
39253        return \false;
39254    }
39255}
39256<?php
39257
39258declare (strict_types=1);
39259/*
39260 * This file is part of PharIo\Manifest.
39261 *
39262 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
39263 *
39264 * For the full copyright and license information, please view the LICENSE
39265 * file that was distributed with this source code.
39266 */
39267namespace PHPUnit\PharIo\Manifest;
39268
39269class BundledComponentCollection implements \Countable, \IteratorAggregate
39270{
39271    /** @var BundledComponent[] */
39272    private $bundledComponents = [];
39273    public function add(BundledComponent $bundledComponent) : void
39274    {
39275        $this->bundledComponents[] = $bundledComponent;
39276    }
39277    /**
39278     * @return BundledComponent[]
39279     */
39280    public function getBundledComponents() : array
39281    {
39282        return $this->bundledComponents;
39283    }
39284    public function count() : int
39285    {
39286        return \count($this->bundledComponents);
39287    }
39288    public function getIterator() : BundledComponentCollectionIterator
39289    {
39290        return new BundledComponentCollectionIterator($this);
39291    }
39292}
39293<?php
39294
39295declare (strict_types=1);
39296/*
39297 * This file is part of PharIo\Manifest.
39298 *
39299 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
39300 *
39301 * For the full copyright and license information, please view the LICENSE
39302 * file that was distributed with this source code.
39303 */
39304namespace PHPUnit\PharIo\Manifest;
39305
39306class PhpExtensionRequirement implements Requirement
39307{
39308    /** @var string */
39309    private $extension;
39310    public function __construct(string $extension)
39311    {
39312        $this->extension = $extension;
39313    }
39314    public function asString() : string
39315    {
39316        return $this->extension;
39317    }
39318}
39319<?php
39320
39321declare (strict_types=1);
39322/*
39323 * This file is part of PharIo\Manifest.
39324 *
39325 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
39326 *
39327 * For the full copyright and license information, please view the LICENSE
39328 * file that was distributed with this source code.
39329 */
39330namespace PHPUnit\PharIo\Manifest;
39331
39332use PHPUnit\PharIo\Version\Version;
39333class BundledComponent
39334{
39335    /** @var string */
39336    private $name;
39337    /** @var Version */
39338    private $version;
39339    public function __construct(string $name, Version $version)
39340    {
39341        $this->name = $name;
39342        $this->version = $version;
39343    }
39344    public function getName() : string
39345    {
39346        return $this->name;
39347    }
39348    public function getVersion() : Version
39349    {
39350        return $this->version;
39351    }
39352}
39353<?php
39354
39355declare (strict_types=1);
39356/*
39357 * This file is part of PharIo\Manifest.
39358 *
39359 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
39360 *
39361 * For the full copyright and license information, please view the LICENSE
39362 * file that was distributed with this source code.
39363 */
39364namespace PHPUnit\PharIo\Manifest;
39365
39366class CopyrightInformation
39367{
39368    /** @var AuthorCollection */
39369    private $authors;
39370    /** @var License */
39371    private $license;
39372    public function __construct(AuthorCollection $authors, License $license)
39373    {
39374        $this->authors = $authors;
39375        $this->license = $license;
39376    }
39377    public function getAuthors() : AuthorCollection
39378    {
39379        return $this->authors;
39380    }
39381    public function getLicense() : License
39382    {
39383        return $this->license;
39384    }
39385}
39386<?php
39387
39388declare (strict_types=1);
39389/*
39390 * This file is part of PharIo\Manifest.
39391 *
39392 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
39393 *
39394 * For the full copyright and license information, please view the LICENSE
39395 * file that was distributed with this source code.
39396 */
39397namespace PHPUnit\PharIo\Manifest;
39398
39399class ManifestLoader
39400{
39401    public static function fromFile(string $filename) : Manifest
39402    {
39403        try {
39404            return (new ManifestDocumentMapper())->map(ManifestDocument::fromFile($filename));
39405        } catch (Exception $e) {
39406            throw new ManifestLoaderException(\sprintf('Loading %s failed.', $filename), (int) $e->getCode(), $e);
39407        }
39408    }
39409    public static function fromPhar(string $filename) : Manifest
39410    {
39411        return self::fromFile('phar://' . $filename . '/manifest.xml');
39412    }
39413    public static function fromString(string $manifest) : Manifest
39414    {
39415        try {
39416            return (new ManifestDocumentMapper())->map(ManifestDocument::fromString($manifest));
39417        } catch (Exception $e) {
39418            throw new ManifestLoaderException('Processing string failed', (int) $e->getCode(), $e);
39419        }
39420    }
39421}
39422<?php
39423
39424declare (strict_types=1);
39425/*
39426 * This file is part of sebastian/cli-parser.
39427 *
39428 * (c) Sebastian Bergmann <sebastian@phpunit.de>
39429 *
39430 * For the full copyright and license information, please view the LICENSE
39431 * file that was distributed with this source code.
39432 */
39433namespace PHPUnit\SebastianBergmann\CliParser;
39434
39435use function sprintf;
39436use RuntimeException;
39437final class AmbiguousOptionException extends RuntimeException implements Exception
39438{
39439    public function __construct(string $option)
39440    {
39441        parent::__construct(sprintf('Option "%s" is ambiguous', $option));
39442    }
39443}
39444<?php
39445
39446declare (strict_types=1);
39447/*
39448 * This file is part of sebastian/cli-parser.
39449 *
39450 * (c) Sebastian Bergmann <sebastian@phpunit.de>
39451 *
39452 * For the full copyright and license information, please view the LICENSE
39453 * file that was distributed with this source code.
39454 */
39455namespace PHPUnit\SebastianBergmann\CliParser;
39456
39457use function sprintf;
39458use RuntimeException;
39459final class UnknownOptionException extends RuntimeException implements Exception
39460{
39461    public function __construct(string $option)
39462    {
39463        parent::__construct(sprintf('Unknown option "%s"', $option));
39464    }
39465}
39466<?php
39467
39468declare (strict_types=1);
39469/*
39470 * This file is part of sebastian/cli-parser.
39471 *
39472 * (c) Sebastian Bergmann <sebastian@phpunit.de>
39473 *
39474 * For the full copyright and license information, please view the LICENSE
39475 * file that was distributed with this source code.
39476 */
39477namespace PHPUnit\SebastianBergmann\CliParser;
39478
39479use function sprintf;
39480use RuntimeException;
39481final class OptionDoesNotAllowArgumentException extends RuntimeException implements Exception
39482{
39483    public function __construct(string $option)
39484    {
39485        parent::__construct(sprintf('Option "%s" does not allow an argument', $option));
39486    }
39487}
39488<?php
39489
39490declare (strict_types=1);
39491/*
39492 * This file is part of sebastian/cli-parser.
39493 *
39494 * (c) Sebastian Bergmann <sebastian@phpunit.de>
39495 *
39496 * For the full copyright and license information, please view the LICENSE
39497 * file that was distributed with this source code.
39498 */
39499namespace PHPUnit\SebastianBergmann\CliParser;
39500
39501use Throwable;
39502interface Exception extends Throwable
39503{
39504}
39505<?php
39506
39507declare (strict_types=1);
39508/*
39509 * This file is part of sebastian/cli-parser.
39510 *
39511 * (c) Sebastian Bergmann <sebastian@phpunit.de>
39512 *
39513 * For the full copyright and license information, please view the LICENSE
39514 * file that was distributed with this source code.
39515 */
39516namespace PHPUnit\SebastianBergmann\CliParser;
39517
39518use function sprintf;
39519use RuntimeException;
39520final class RequiredOptionArgumentMissingException extends RuntimeException implements Exception
39521{
39522    public function __construct(string $option)
39523    {
39524        parent::__construct(sprintf('Required argument for option "%s" is missing', $option));
39525    }
39526}
39527<?php
39528
39529declare (strict_types=1);
39530/*
39531 * This file is part of sebastian/cli-parser.
39532 *
39533 * (c) Sebastian Bergmann <sebastian@phpunit.de>
39534 *
39535 * For the full copyright and license information, please view the LICENSE
39536 * file that was distributed with this source code.
39537 */
39538namespace PHPUnit\SebastianBergmann\CliParser;
39539
39540use function array_map;
39541use function array_merge;
39542use function array_shift;
39543use function array_slice;
39544use function assert;
39545use function count;
39546use function current;
39547use function explode;
39548use function is_array;
39549use function is_int;
39550use function is_string;
39551use function key;
39552use function next;
39553use function preg_replace;
39554use function reset;
39555use function sort;
39556use function strlen;
39557use function strpos;
39558use function strstr;
39559use function substr;
39560final class Parser
39561{
39562    /**
39563     * @psalm-param list<string> $argv
39564     * @psalm-param list<string> $longOptions
39565     *
39566     * @throws AmbiguousOptionException
39567     * @throws RequiredOptionArgumentMissingException
39568     * @throws OptionDoesNotAllowArgumentException
39569     * @throws UnknownOptionException
39570     */
39571    public function parse(array $argv, string $shortOptions, array $longOptions = null) : array
39572    {
39573        if (empty($argv)) {
39574            return [[], []];
39575        }
39576        $options = [];
39577        $nonOptions = [];
39578        if ($longOptions) {
39579            sort($longOptions);
39580        }
39581        if (isset($argv[0][0]) && $argv[0][0] !== '-') {
39582            array_shift($argv);
39583        }
39584        reset($argv);
39585        $argv = array_map('trim', $argv);
39586        while (\false !== ($arg = current($argv))) {
39587            $i = key($argv);
39588            assert(is_int($i));
39589            next($argv);
39590            if ($arg === '') {
39591                continue;
39592            }
39593            if ($arg === '--') {
39594                $nonOptions = array_merge($nonOptions, array_slice($argv, $i + 1));
39595                break;
39596            }
39597            if ($arg[0] !== '-' || strlen($arg) > 1 && $arg[1] === '-' && !$longOptions) {
39598                $nonOptions[] = $arg;
39599                continue;
39600            }
39601            if (strlen($arg) > 1 && $arg[1] === '-' && is_array($longOptions)) {
39602                $this->parseLongOption(substr($arg, 2), $longOptions, $options, $argv);
39603            } else {
39604                $this->parseShortOption(substr($arg, 1), $shortOptions, $options, $argv);
39605            }
39606        }
39607        return [$options, $nonOptions];
39608    }
39609    /**
39610     * @throws RequiredOptionArgumentMissingException
39611     */
39612    private function parseShortOption(string $arg, string $shortOptions, array &$opts, array &$args) : void
39613    {
39614        $argLength = strlen($arg);
39615        for ($i = 0; $i < $argLength; $i++) {
39616            $option = $arg[$i];
39617            $optionArgument = null;
39618            if ($arg[$i] === ':' || ($spec = strstr($shortOptions, $option)) === \false) {
39619                throw new UnknownOptionException('-' . $option);
39620            }
39621            assert(is_string($spec));
39622            if (strlen($spec) > 1 && $spec[1] === ':') {
39623                if ($i + 1 < $argLength) {
39624                    $opts[] = [$option, substr($arg, $i + 1)];
39625                    break;
39626                }
39627                if (!(strlen($spec) > 2 && $spec[2] === ':')) {
39628                    $optionArgument = current($args);
39629                    if (!$optionArgument) {
39630                        throw new RequiredOptionArgumentMissingException('-' . $option);
39631                    }
39632                    assert(is_string($optionArgument));
39633                    next($args);
39634                }
39635            }
39636            $opts[] = [$option, $optionArgument];
39637        }
39638    }
39639    /**
39640     * @psalm-param list<string> $longOptions
39641     *
39642     * @throws AmbiguousOptionException
39643     * @throws RequiredOptionArgumentMissingException
39644     * @throws OptionDoesNotAllowArgumentException
39645     * @throws UnknownOptionException
39646     */
39647    private function parseLongOption(string $arg, array $longOptions, array &$opts, array &$args) : void
39648    {
39649        $count = count($longOptions);
39650        $list = explode('=', $arg);
39651        $option = $list[0];
39652        $optionArgument = null;
39653        if (count($list) > 1) {
39654            $optionArgument = $list[1];
39655        }
39656        $optionLength = strlen($option);
39657        foreach ($longOptions as $i => $longOption) {
39658            $opt_start = substr($longOption, 0, $optionLength);
39659            if ($opt_start !== $option) {
39660                continue;
39661            }
39662            $opt_rest = substr($longOption, $optionLength);
39663            if ($opt_rest !== '' && $i + 1 < $count && $option[0] !== '=' && strpos($longOptions[$i + 1], $option) === 0) {
39664                throw new AmbiguousOptionException('--' . $option);
39665            }
39666            if (substr($longOption, -1) === '=') {
39667                /* @noinspection StrlenInEmptyStringCheckContextInspection */
39668                if (substr($longOption, -2) !== '==' && !strlen((string) $optionArgument)) {
39669                    if (\false === ($optionArgument = current($args))) {
39670                        throw new RequiredOptionArgumentMissingException('--' . $option);
39671                    }
39672                    next($args);
39673                }
39674            } elseif ($optionArgument) {
39675                throw new OptionDoesNotAllowArgumentException('--' . $option);
39676            }
39677            $fullOption = '--' . preg_replace('/={1,2}$/', '', $longOption);
39678            $opts[] = [$fullOption, $optionArgument];
39679            return;
39680        }
39681        throw new UnknownOptionException('--' . $option);
39682    }
39683}
39684sebastian/cli-parser
39685
39686Copyright (c) 2020, Sebastian Bergmann <sebastian@phpunit.de>.
39687All rights reserved.
39688
39689Redistribution and use in source and binary forms, with or without
39690modification, are permitted provided that the following conditions
39691are met:
39692
39693 * Redistributions of source code must retain the above copyright
39694   notice, this list of conditions and the following disclaimer.
39695
39696 * Redistributions in binary form must reproduce the above copyright
39697   notice, this list of conditions and the following disclaimer in
39698   the documentation and/or other materials provided with the
39699   distribution.
39700
39701 * Neither the name of Sebastian Bergmann nor the names of his
39702   contributors may be used to endorse or promote products derived
39703   from this software without specific prior written permission.
39704
39705THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
39706"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
39707LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
39708FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
39709COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
39710INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
39711BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
39712LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
39713CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
39714LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
39715ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39716POSSIBILITY OF SUCH DAMAGE.
39717<?php
39718
39719namespace PHPUnit;
39720
39721/*
39722 * This file is part of the Symfony package.
39723 *
39724 * (c) Fabien Potencier <fabien@symfony.com>
39725 *
39726 * For the full copyright and license information, please view the LICENSE
39727 * file that was distributed with this source code.
39728 */
39729use PHPUnit\Symfony\Polyfill\Ctype as p;
39730if (\PHP_VERSION_ID >= 80000) {
39731    return require __DIR__ . '/bootstrap80.php';
39732}
39733if (!\function_exists('ctype_alnum')) {
39734    function ctype_alnum($text)
39735    {
39736        return p\Ctype::ctype_alnum($text);
39737    }
39738}
39739if (!\function_exists('ctype_alpha')) {
39740    function ctype_alpha($text)
39741    {
39742        return p\Ctype::ctype_alpha($text);
39743    }
39744}
39745if (!\function_exists('ctype_cntrl')) {
39746    function ctype_cntrl($text)
39747    {
39748        return p\Ctype::ctype_cntrl($text);
39749    }
39750}
39751if (!\function_exists('ctype_digit')) {
39752    function ctype_digit($text)
39753    {
39754        return p\Ctype::ctype_digit($text);
39755    }
39756}
39757if (!\function_exists('ctype_graph')) {
39758    function ctype_graph($text)
39759    {
39760        return p\Ctype::ctype_graph($text);
39761    }
39762}
39763if (!\function_exists('ctype_lower')) {
39764    function ctype_lower($text)
39765    {
39766        return p\Ctype::ctype_lower($text);
39767    }
39768}
39769if (!\function_exists('ctype_print')) {
39770    function ctype_print($text)
39771    {
39772        return p\Ctype::ctype_print($text);
39773    }
39774}
39775if (!\function_exists('ctype_punct')) {
39776    function ctype_punct($text)
39777    {
39778        return p\Ctype::ctype_punct($text);
39779    }
39780}
39781if (!\function_exists('ctype_space')) {
39782    function ctype_space($text)
39783    {
39784        return p\Ctype::ctype_space($text);
39785    }
39786}
39787if (!\function_exists('ctype_upper')) {
39788    function ctype_upper($text)
39789    {
39790        return p\Ctype::ctype_upper($text);
39791    }
39792}
39793if (!\function_exists('ctype_xdigit')) {
39794    function ctype_xdigit($text)
39795    {
39796        return p\Ctype::ctype_xdigit($text);
39797    }
39798}
39799<?php
39800
39801namespace PHPUnit;
39802
39803/*
39804 * This file is part of the Symfony package.
39805 *
39806 * (c) Fabien Potencier <fabien@symfony.com>
39807 *
39808 * For the full copyright and license information, please view the LICENSE
39809 * file that was distributed with this source code.
39810 */
39811use PHPUnit\Symfony\Polyfill\Ctype as p;
39812if (!\function_exists('ctype_alnum')) {
39813    function ctype_alnum(mixed $text) : bool
39814    {
39815        return p\Ctype::ctype_alnum($text);
39816    }
39817}
39818if (!\function_exists('ctype_alpha')) {
39819    function ctype_alpha(mixed $text) : bool
39820    {
39821        return p\Ctype::ctype_alpha($text);
39822    }
39823}
39824if (!\function_exists('ctype_cntrl')) {
39825    function ctype_cntrl(mixed $text) : bool
39826    {
39827        return p\Ctype::ctype_cntrl($text);
39828    }
39829}
39830if (!\function_exists('ctype_digit')) {
39831    function ctype_digit(mixed $text) : bool
39832    {
39833        return p\Ctype::ctype_digit($text);
39834    }
39835}
39836if (!\function_exists('ctype_graph')) {
39837    function ctype_graph(mixed $text) : bool
39838    {
39839        return p\Ctype::ctype_graph($text);
39840    }
39841}
39842if (!\function_exists('ctype_lower')) {
39843    function ctype_lower(mixed $text) : bool
39844    {
39845        return p\Ctype::ctype_lower($text);
39846    }
39847}
39848if (!\function_exists('ctype_print')) {
39849    function ctype_print(mixed $text) : bool
39850    {
39851        return p\Ctype::ctype_print($text);
39852    }
39853}
39854if (!\function_exists('ctype_punct')) {
39855    function ctype_punct(mixed $text) : bool
39856    {
39857        return p\Ctype::ctype_punct($text);
39858    }
39859}
39860if (!\function_exists('ctype_space')) {
39861    function ctype_space(mixed $text) : bool
39862    {
39863        return p\Ctype::ctype_space($text);
39864    }
39865}
39866if (!\function_exists('ctype_upper')) {
39867    function ctype_upper(mixed $text) : bool
39868    {
39869        return p\Ctype::ctype_upper($text);
39870    }
39871}
39872if (!\function_exists('ctype_xdigit')) {
39873    function ctype_xdigit(mixed $text) : bool
39874    {
39875        return p\Ctype::ctype_xdigit($text);
39876    }
39877}
39878<?php
39879
39880/*
39881 * This file is part of the Symfony package.
39882 *
39883 * (c) Fabien Potencier <fabien@symfony.com>
39884 *
39885 * For the full copyright and license information, please view the LICENSE
39886 * file that was distributed with this source code.
39887 */
39888namespace PHPUnit\Symfony\Polyfill\Ctype;
39889
39890/**
39891 * Ctype implementation through regex.
39892 *
39893 * @internal
39894 *
39895 * @author Gert de Pagter <BackEndTea@gmail.com>
39896 */
39897final class Ctype
39898{
39899    /**
39900     * Returns TRUE if every character in text is either a letter or a digit, FALSE otherwise.
39901     *
39902     * @see https://php.net/ctype-alnum
39903     *
39904     * @param string|int $text
39905     *
39906     * @return bool
39907     */
39908    public static function ctype_alnum($text)
39909    {
39910        $text = self::convert_int_to_char_for_ctype($text);
39911        return \is_string($text) && '' !== $text && !\preg_match('/[^A-Za-z0-9]/', $text);
39912    }
39913    /**
39914     * Returns TRUE if every character in text is a letter, FALSE otherwise.
39915     *
39916     * @see https://php.net/ctype-alpha
39917     *
39918     * @param string|int $text
39919     *
39920     * @return bool
39921     */
39922    public static function ctype_alpha($text)
39923    {
39924        $text = self::convert_int_to_char_for_ctype($text);
39925        return \is_string($text) && '' !== $text && !\preg_match('/[^A-Za-z]/', $text);
39926    }
39927    /**
39928     * Returns TRUE if every character in text is a control character from the current locale, FALSE otherwise.
39929     *
39930     * @see https://php.net/ctype-cntrl
39931     *
39932     * @param string|int $text
39933     *
39934     * @return bool
39935     */
39936    public static function ctype_cntrl($text)
39937    {
39938        $text = self::convert_int_to_char_for_ctype($text);
39939        return \is_string($text) && '' !== $text && !\preg_match('/[^\\x00-\\x1f\\x7f]/', $text);
39940    }
39941    /**
39942     * Returns TRUE if every character in the string text is a decimal digit, FALSE otherwise.
39943     *
39944     * @see https://php.net/ctype-digit
39945     *
39946     * @param string|int $text
39947     *
39948     * @return bool
39949     */
39950    public static function ctype_digit($text)
39951    {
39952        $text = self::convert_int_to_char_for_ctype($text);
39953        return \is_string($text) && '' !== $text && !\preg_match('/[^0-9]/', $text);
39954    }
39955    /**
39956     * Returns TRUE if every character in text is printable and actually creates visible output (no white space), FALSE otherwise.
39957     *
39958     * @see https://php.net/ctype-graph
39959     *
39960     * @param string|int $text
39961     *
39962     * @return bool
39963     */
39964    public static function ctype_graph($text)
39965    {
39966        $text = self::convert_int_to_char_for_ctype($text);
39967        return \is_string($text) && '' !== $text && !\preg_match('/[^!-~]/', $text);
39968    }
39969    /**
39970     * Returns TRUE if every character in text is a lowercase letter.
39971     *
39972     * @see https://php.net/ctype-lower
39973     *
39974     * @param string|int $text
39975     *
39976     * @return bool
39977     */
39978    public static function ctype_lower($text)
39979    {
39980        $text = self::convert_int_to_char_for_ctype($text);
39981        return \is_string($text) && '' !== $text && !\preg_match('/[^a-z]/', $text);
39982    }
39983    /**
39984     * Returns TRUE if every character in text will actually create output (including blanks). Returns FALSE if text contains control characters or characters that do not have any output or control function at all.
39985     *
39986     * @see https://php.net/ctype-print
39987     *
39988     * @param string|int $text
39989     *
39990     * @return bool
39991     */
39992    public static function ctype_print($text)
39993    {
39994        $text = self::convert_int_to_char_for_ctype($text);
39995        return \is_string($text) && '' !== $text && !\preg_match('/[^ -~]/', $text);
39996    }
39997    /**
39998     * Returns TRUE if every character in text is printable, but neither letter, digit or blank, FALSE otherwise.
39999     *
40000     * @see https://php.net/ctype-punct
40001     *
40002     * @param string|int $text
40003     *
40004     * @return bool
40005     */
40006    public static function ctype_punct($text)
40007    {
40008        $text = self::convert_int_to_char_for_ctype($text);
40009        return \is_string($text) && '' !== $text && !\preg_match('/[^!-\\/\\:-@\\[-`\\{-~]/', $text);
40010    }
40011    /**
40012     * Returns TRUE if every character in text creates some sort of white space, FALSE otherwise. Besides the blank character this also includes tab, vertical tab, line feed, carriage return and form feed characters.
40013     *
40014     * @see https://php.net/ctype-space
40015     *
40016     * @param string|int $text
40017     *
40018     * @return bool
40019     */
40020    public static function ctype_space($text)
40021    {
40022        $text = self::convert_int_to_char_for_ctype($text);
40023        return \is_string($text) && '' !== $text && !\preg_match('/[^\\s]/', $text);
40024    }
40025    /**
40026     * Returns TRUE if every character in text is an uppercase letter.
40027     *
40028     * @see https://php.net/ctype-upper
40029     *
40030     * @param string|int $text
40031     *
40032     * @return bool
40033     */
40034    public static function ctype_upper($text)
40035    {
40036        $text = self::convert_int_to_char_for_ctype($text);
40037        return \is_string($text) && '' !== $text && !\preg_match('/[^A-Z]/', $text);
40038    }
40039    /**
40040     * Returns TRUE if every character in text is a hexadecimal 'digit', that is a decimal digit or a character from [A-Fa-f] , FALSE otherwise.
40041     *
40042     * @see https://php.net/ctype-xdigit
40043     *
40044     * @param string|int $text
40045     *
40046     * @return bool
40047     */
40048    public static function ctype_xdigit($text)
40049    {
40050        $text = self::convert_int_to_char_for_ctype($text);
40051        return \is_string($text) && '' !== $text && !\preg_match('/[^A-Fa-f0-9]/', $text);
40052    }
40053    /**
40054     * Converts integers to their char versions according to normal ctype behaviour, if needed.
40055     *
40056     * If an integer between -128 and 255 inclusive is provided,
40057     * it is interpreted as the ASCII value of a single character
40058     * (negative values have 256 added in order to allow characters in the Extended ASCII range).
40059     * Any other integer is interpreted as a string containing the decimal digits of the integer.
40060     *
40061     * @param string|int $int
40062     *
40063     * @return mixed
40064     */
40065    private static function convert_int_to_char_for_ctype($int)
40066    {
40067        if (!\is_int($int)) {
40068            return $int;
40069        }
40070        if ($int < -128 || $int > 255) {
40071            return (string) $int;
40072        }
40073        if ($int < 0) {
40074            $int += 256;
40075        }
40076        return \chr($int);
40077    }
40078}
40079Copyright (c) 2018-2019 Fabien Potencier
40080
40081Permission is hereby granted, free of charge, to any person obtaining a copy
40082of this software and associated documentation files (the "Software"), to deal
40083in the Software without restriction, including without limitation the rights
40084to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
40085copies of the Software, and to permit persons to whom the Software is furnished
40086to do so, subject to the following conditions:
40087
40088The above copyright notice and this permission notice shall be included in all
40089copies or substantial portions of the Software.
40090
40091THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
40092IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
40093FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
40094AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
40095LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
40096OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
40097THE SOFTWARE.
40098<?php
40099
40100declare (strict_types=1);
40101/*
40102 * This file is part of sebastian/complexity.
40103 *
40104 * (c) Sebastian Bergmann <sebastian@phpunit.de>
40105 *
40106 * For the full copyright and license information, please view the LICENSE
40107 * file that was distributed with this source code.
40108 */
40109namespace PHPUnit\SebastianBergmann\Complexity;
40110
40111final class RuntimeException extends \RuntimeException implements Exception
40112{
40113}
40114<?php
40115
40116declare (strict_types=1);
40117/*
40118 * This file is part of sebastian/complexity.
40119 *
40120 * (c) Sebastian Bergmann <sebastian@phpunit.de>
40121 *
40122 * For the full copyright and license information, please view the LICENSE
40123 * file that was distributed with this source code.
40124 */
40125namespace PHPUnit\SebastianBergmann\Complexity;
40126
40127use Throwable;
40128interface Exception extends Throwable
40129{
40130}
40131<?php
40132
40133declare (strict_types=1);
40134/*
40135 * This file is part of sebastian/complexity.
40136 *
40137 * (c) Sebastian Bergmann <sebastian@phpunit.de>
40138 *
40139 * For the full copyright and license information, please view the LICENSE
40140 * file that was distributed with this source code.
40141 */
40142namespace PHPUnit\SebastianBergmann\Complexity;
40143
40144use PHPUnit\PhpParser\Error;
40145use PHPUnit\PhpParser\Lexer;
40146use PHPUnit\PhpParser\Node;
40147use PHPUnit\PhpParser\NodeTraverser;
40148use PHPUnit\PhpParser\NodeVisitor\NameResolver;
40149use PHPUnit\PhpParser\NodeVisitor\ParentConnectingVisitor;
40150use PHPUnit\PhpParser\Parser;
40151use PHPUnit\PhpParser\ParserFactory;
40152final class Calculator
40153{
40154    /**
40155     * @throws RuntimeException
40156     */
40157    public function calculateForSourceFile(string $sourceFile) : ComplexityCollection
40158    {
40159        return $this->calculateForSourceString(\file_get_contents($sourceFile));
40160    }
40161    /**
40162     * @throws RuntimeException
40163     */
40164    public function calculateForSourceString(string $source) : ComplexityCollection
40165    {
40166        try {
40167            $nodes = $this->parser()->parse($source);
40168            \assert($nodes !== null);
40169            return $this->calculateForAbstractSyntaxTree($nodes);
40170            // @codeCoverageIgnoreStart
40171        } catch (Error $error) {
40172            throw new RuntimeException($error->getMessage(), (int) $error->getCode(), $error);
40173        }
40174        // @codeCoverageIgnoreEnd
40175    }
40176    /**
40177     * @param Node[] $nodes
40178     *
40179     * @throws RuntimeException
40180     */
40181    public function calculateForAbstractSyntaxTree(array $nodes) : ComplexityCollection
40182    {
40183        $traverser = new NodeTraverser();
40184        $complexityCalculatingVisitor = new ComplexityCalculatingVisitor(\true);
40185        $traverser->addVisitor(new NameResolver());
40186        $traverser->addVisitor(new ParentConnectingVisitor());
40187        $traverser->addVisitor($complexityCalculatingVisitor);
40188        try {
40189            /* @noinspection UnusedFunctionResultInspection */
40190            $traverser->traverse($nodes);
40191            // @codeCoverageIgnoreStart
40192        } catch (Error $error) {
40193            throw new RuntimeException($error->getMessage(), (int) $error->getCode(), $error);
40194        }
40195        // @codeCoverageIgnoreEnd
40196        return $complexityCalculatingVisitor->result();
40197    }
40198    private function parser() : Parser
40199    {
40200        return (new ParserFactory())->create(ParserFactory::PREFER_PHP7, new Lexer());
40201    }
40202}
40203<?php
40204
40205declare (strict_types=1);
40206/*
40207 * This file is part of sebastian/complexity.
40208 *
40209 * (c) Sebastian Bergmann <sebastian@phpunit.de>
40210 *
40211 * For the full copyright and license information, please view the LICENSE
40212 * file that was distributed with this source code.
40213 */
40214namespace PHPUnit\SebastianBergmann\Complexity;
40215
40216use function count;
40217use Countable;
40218use IteratorAggregate;
40219/**
40220 * @psalm-immutable
40221 */
40222final class ComplexityCollection implements Countable, IteratorAggregate
40223{
40224    /**
40225     * @psalm-var list<Complexity>
40226     */
40227    private $items = [];
40228    public static function fromList(Complexity ...$items) : self
40229    {
40230        return new self($items);
40231    }
40232    /**
40233     * @psalm-param list<Complexity> $items
40234     */
40235    private function __construct(array $items)
40236    {
40237        $this->items = $items;
40238    }
40239    /**
40240     * @psalm-return list<Complexity>
40241     */
40242    public function asArray() : array
40243    {
40244        return $this->items;
40245    }
40246    public function getIterator() : ComplexityCollectionIterator
40247    {
40248        return new ComplexityCollectionIterator($this);
40249    }
40250    public function count() : int
40251    {
40252        return count($this->items);
40253    }
40254    public function isEmpty() : bool
40255    {
40256        return empty($this->items);
40257    }
40258    public function cyclomaticComplexity() : int
40259    {
40260        $cyclomaticComplexity = 0;
40261        foreach ($this as $item) {
40262            $cyclomaticComplexity += $item->cyclomaticComplexity();
40263        }
40264        return $cyclomaticComplexity;
40265    }
40266}
40267<?php
40268
40269declare (strict_types=1);
40270/*
40271 * This file is part of sebastian/complexity.
40272 *
40273 * (c) Sebastian Bergmann <sebastian@phpunit.de>
40274 *
40275 * For the full copyright and license information, please view the LICENSE
40276 * file that was distributed with this source code.
40277 */
40278namespace PHPUnit\SebastianBergmann\Complexity;
40279
40280/**
40281 * @psalm-immutable
40282 */
40283final class Complexity
40284{
40285    /**
40286     * @var string
40287     */
40288    private $name;
40289    /**
40290     * @var int
40291     */
40292    private $cyclomaticComplexity;
40293    public function __construct(string $name, int $cyclomaticComplexity)
40294    {
40295        $this->name = $name;
40296        $this->cyclomaticComplexity = $cyclomaticComplexity;
40297    }
40298    public function name() : string
40299    {
40300        return $this->name;
40301    }
40302    public function cyclomaticComplexity() : int
40303    {
40304        return $this->cyclomaticComplexity;
40305    }
40306}
40307<?php
40308
40309declare (strict_types=1);
40310/*
40311 * This file is part of sebastian/complexity.
40312 *
40313 * (c) Sebastian Bergmann <sebastian@phpunit.de>
40314 *
40315 * For the full copyright and license information, please view the LICENSE
40316 * file that was distributed with this source code.
40317 */
40318namespace PHPUnit\SebastianBergmann\Complexity;
40319
40320use Iterator;
40321final class ComplexityCollectionIterator implements Iterator
40322{
40323    /**
40324     * @psalm-var list<Complexity>
40325     */
40326    private $items;
40327    /**
40328     * @var int
40329     */
40330    private $position = 0;
40331    public function __construct(ComplexityCollection $items)
40332    {
40333        $this->items = $items->asArray();
40334    }
40335    public function rewind() : void
40336    {
40337        $this->position = 0;
40338    }
40339    public function valid() : bool
40340    {
40341        return isset($this->items[$this->position]);
40342    }
40343    public function key() : int
40344    {
40345        return $this->position;
40346    }
40347    public function current() : Complexity
40348    {
40349        return $this->items[$this->position];
40350    }
40351    public function next() : void
40352    {
40353        $this->position++;
40354    }
40355}
40356sebastian/complexity
40357
40358Copyright (c) 2020, Sebastian Bergmann <sebastian@phpunit.de>.
40359All rights reserved.
40360
40361Redistribution and use in source and binary forms, with or without
40362modification, are permitted provided that the following conditions
40363are met:
40364
40365 * Redistributions of source code must retain the above copyright
40366   notice, this list of conditions and the following disclaimer.
40367
40368 * Redistributions in binary form must reproduce the above copyright
40369   notice, this list of conditions and the following disclaimer in
40370   the documentation and/or other materials provided with the
40371   distribution.
40372
40373 * Neither the name of Sebastian Bergmann nor the names of his
40374   contributors may be used to endorse or promote products derived
40375   from this software without specific prior written permission.
40376
40377THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
40378"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
40379LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
40380FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
40381COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
40382INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
40383BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
40384LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
40385CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
40386LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
40387ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
40388POSSIBILITY OF SUCH DAMAGE.
40389<?php
40390
40391declare (strict_types=1);
40392/*
40393 * This file is part of sebastian/complexity.
40394 *
40395 * (c) Sebastian Bergmann <sebastian@phpunit.de>
40396 *
40397 * For the full copyright and license information, please view the LICENSE
40398 * file that was distributed with this source code.
40399 */
40400namespace PHPUnit\SebastianBergmann\Complexity;
40401
40402use function assert;
40403use function is_array;
40404use PHPUnit\PhpParser\Node;
40405use PHPUnit\PhpParser\Node\Name;
40406use PHPUnit\PhpParser\Node\Stmt;
40407use PHPUnit\PhpParser\Node\Stmt\Class_;
40408use PHPUnit\PhpParser\Node\Stmt\ClassMethod;
40409use PHPUnit\PhpParser\Node\Stmt\Function_;
40410use PHPUnit\PhpParser\Node\Stmt\Trait_;
40411use PHPUnit\PhpParser\NodeTraverser;
40412use PHPUnit\PhpParser\NodeVisitorAbstract;
40413final class ComplexityCalculatingVisitor extends NodeVisitorAbstract
40414{
40415    /**
40416     * @psalm-var list<Complexity>
40417     */
40418    private $result = [];
40419    /**
40420     * @var bool
40421     */
40422    private $shortCircuitTraversal;
40423    public function __construct(bool $shortCircuitTraversal)
40424    {
40425        $this->shortCircuitTraversal = $shortCircuitTraversal;
40426    }
40427    public function enterNode(Node $node) : ?int
40428    {
40429        if (!$node instanceof ClassMethod && !$node instanceof Function_) {
40430            return null;
40431        }
40432        if ($node instanceof ClassMethod) {
40433            $name = $this->classMethodName($node);
40434        } else {
40435            $name = $this->functionName($node);
40436        }
40437        $statements = $node->getStmts();
40438        assert(is_array($statements));
40439        $this->result[] = new Complexity($name, $this->cyclomaticComplexity($statements));
40440        if ($this->shortCircuitTraversal) {
40441            return NodeTraverser::DONT_TRAVERSE_CHILDREN;
40442        }
40443        return null;
40444    }
40445    public function result() : ComplexityCollection
40446    {
40447        return ComplexityCollection::fromList(...$this->result);
40448    }
40449    /**
40450     * @param Stmt[] $statements
40451     */
40452    private function cyclomaticComplexity(array $statements) : int
40453    {
40454        $traverser = new NodeTraverser();
40455        $cyclomaticComplexityCalculatingVisitor = new CyclomaticComplexityCalculatingVisitor();
40456        $traverser->addVisitor($cyclomaticComplexityCalculatingVisitor);
40457        /* @noinspection UnusedFunctionResultInspection */
40458        $traverser->traverse($statements);
40459        return $cyclomaticComplexityCalculatingVisitor->cyclomaticComplexity();
40460    }
40461    private function classMethodName(ClassMethod $node) : string
40462    {
40463        $parent = $node->getAttribute('parent');
40464        assert($parent instanceof Class_ || $parent instanceof Trait_);
40465        assert(isset($parent->namespacedName));
40466        assert($parent->namespacedName instanceof Name);
40467        return $parent->namespacedName->toString() . '::' . $node->name->toString();
40468    }
40469    private function functionName(Function_ $node) : string
40470    {
40471        assert(isset($node->namespacedName));
40472        assert($node->namespacedName instanceof Name);
40473        return $node->namespacedName->toString();
40474    }
40475}
40476<?php
40477
40478declare (strict_types=1);
40479/*
40480 * This file is part of sebastian/complexity.
40481 *
40482 * (c) Sebastian Bergmann <sebastian@phpunit.de>
40483 *
40484 * For the full copyright and license information, please view the LICENSE
40485 * file that was distributed with this source code.
40486 */
40487namespace PHPUnit\SebastianBergmann\Complexity;
40488
40489use function get_class;
40490use PHPUnit\PhpParser\Node;
40491use PHPUnit\PhpParser\Node\Expr\BinaryOp\BooleanAnd;
40492use PHPUnit\PhpParser\Node\Expr\BinaryOp\BooleanOr;
40493use PHPUnit\PhpParser\Node\Expr\BinaryOp\LogicalAnd;
40494use PHPUnit\PhpParser\Node\Expr\BinaryOp\LogicalOr;
40495use PHPUnit\PhpParser\Node\Expr\Ternary;
40496use PHPUnit\PhpParser\Node\Stmt\Case_;
40497use PHPUnit\PhpParser\Node\Stmt\Catch_;
40498use PHPUnit\PhpParser\Node\Stmt\ElseIf_;
40499use PHPUnit\PhpParser\Node\Stmt\For_;
40500use PHPUnit\PhpParser\Node\Stmt\Foreach_;
40501use PHPUnit\PhpParser\Node\Stmt\If_;
40502use PHPUnit\PhpParser\Node\Stmt\While_;
40503use PHPUnit\PhpParser\NodeVisitorAbstract;
40504final class CyclomaticComplexityCalculatingVisitor extends NodeVisitorAbstract
40505{
40506    /**
40507     * @var int
40508     */
40509    private $cyclomaticComplexity = 1;
40510    public function enterNode(Node $node) : void
40511    {
40512        /* @noinspection GetClassMissUseInspection */
40513        switch (get_class($node)) {
40514            case BooleanAnd::class:
40515            case BooleanOr::class:
40516            case Case_::class:
40517            case Catch_::class:
40518            case ElseIf_::class:
40519            case For_::class:
40520            case Foreach_::class:
40521            case If_::class:
40522            case LogicalAnd::class:
40523            case LogicalOr::class:
40524            case Ternary::class:
40525            case While_::class:
40526                $this->cyclomaticComplexity++;
40527        }
40528    }
40529    public function cyclomaticComplexity() : int
40530    {
40531        return $this->cyclomaticComplexity;
40532    }
40533}
40534Object Reflector
40535
40536Copyright (c) 2017-2020, Sebastian Bergmann <sebastian@phpunit.de>.
40537All rights reserved.
40538
40539Redistribution and use in source and binary forms, with or without
40540modification, are permitted provided that the following conditions
40541are met:
40542
40543 * Redistributions of source code must retain the above copyright
40544   notice, this list of conditions and the following disclaimer.
40545
40546 * Redistributions in binary form must reproduce the above copyright
40547   notice, this list of conditions and the following disclaimer in
40548   the documentation and/or other materials provided with the
40549   distribution.
40550
40551 * Neither the name of Sebastian Bergmann nor the names of his
40552   contributors may be used to endorse or promote products derived
40553   from this software without specific prior written permission.
40554
40555THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
40556"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
40557LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
40558FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
40559COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
40560INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
40561BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
40562LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
40563CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
40564LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
40565ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
40566POSSIBILITY OF SUCH DAMAGE.
40567<?php
40568
40569declare (strict_types=1);
40570/*
40571 * This file is part of sebastian/lines-of-code.
40572 *
40573 * (c) Sebastian Bergmann <sebastian@phpunit.de>
40574 *
40575 * For the full copyright and license information, please view the LICENSE
40576 * file that was distributed with this source code.
40577 */
40578namespace PHPUnit\SebastianBergmann\LinesOfCode;
40579
40580use InvalidArgumentException;
40581final class NegativeValueException extends InvalidArgumentException implements Exception
40582{
40583}
40584<?php
40585
40586declare (strict_types=1);
40587/*
40588 * This file is part of sebastian/lines-of-code.
40589 *
40590 * (c) Sebastian Bergmann <sebastian@phpunit.de>
40591 *
40592 * For the full copyright and license information, please view the LICENSE
40593 * file that was distributed with this source code.
40594 */
40595namespace PHPUnit\SebastianBergmann\LinesOfCode;
40596
40597use LogicException;
40598final class IllogicalValuesException extends LogicException implements Exception
40599{
40600}
40601<?php
40602
40603declare (strict_types=1);
40604/*
40605 * This file is part of sebastian/lines-of-code.
40606 *
40607 * (c) Sebastian Bergmann <sebastian@phpunit.de>
40608 *
40609 * For the full copyright and license information, please view the LICENSE
40610 * file that was distributed with this source code.
40611 */
40612namespace PHPUnit\SebastianBergmann\LinesOfCode;
40613
40614final class RuntimeException extends \RuntimeException implements Exception
40615{
40616}
40617<?php
40618
40619declare (strict_types=1);
40620/*
40621 * This file is part of sebastian/lines-of-code.
40622 *
40623 * (c) Sebastian Bergmann <sebastian@phpunit.de>
40624 *
40625 * For the full copyright and license information, please view the LICENSE
40626 * file that was distributed with this source code.
40627 */
40628namespace PHPUnit\SebastianBergmann\LinesOfCode;
40629
40630use Throwable;
40631interface Exception extends Throwable
40632{
40633}
40634<?php
40635
40636declare (strict_types=1);
40637/*
40638 * This file is part of sebastian/lines-of-code.
40639 *
40640 * (c) Sebastian Bergmann <sebastian@phpunit.de>
40641 *
40642 * For the full copyright and license information, please view the LICENSE
40643 * file that was distributed with this source code.
40644 */
40645namespace PHPUnit\SebastianBergmann\LinesOfCode;
40646
40647use function substr_count;
40648use PHPUnit\PhpParser\Error;
40649use PHPUnit\PhpParser\Lexer;
40650use PHPUnit\PhpParser\Node;
40651use PHPUnit\PhpParser\NodeTraverser;
40652use PHPUnit\PhpParser\Parser;
40653use PHPUnit\PhpParser\ParserFactory;
40654final class Counter
40655{
40656    /**
40657     * @throws RuntimeException
40658     */
40659    public function countInSourceFile(string $sourceFile) : LinesOfCode
40660    {
40661        return $this->countInSourceString(\file_get_contents($sourceFile));
40662    }
40663    /**
40664     * @throws RuntimeException
40665     */
40666    public function countInSourceString(string $source) : LinesOfCode
40667    {
40668        $linesOfCode = substr_count($source, "\n");
40669        if ($linesOfCode === 0 && !empty($source)) {
40670            $linesOfCode = 1;
40671        }
40672        try {
40673            $nodes = $this->parser()->parse($source);
40674            \assert($nodes !== null);
40675            return $this->countInAbstractSyntaxTree($linesOfCode, $nodes);
40676            // @codeCoverageIgnoreStart
40677        } catch (Error $error) {
40678            throw new RuntimeException($error->getMessage(), (int) $error->getCode(), $error);
40679        }
40680        // @codeCoverageIgnoreEnd
40681    }
40682    /**
40683     * @param Node[] $nodes
40684     *
40685     * @throws RuntimeException
40686     */
40687    public function countInAbstractSyntaxTree(int $linesOfCode, array $nodes) : LinesOfCode
40688    {
40689        $traverser = new NodeTraverser();
40690        $visitor = new LineCountingVisitor($linesOfCode);
40691        $traverser->addVisitor($visitor);
40692        try {
40693            /* @noinspection UnusedFunctionResultInspection */
40694            $traverser->traverse($nodes);
40695            // @codeCoverageIgnoreStart
40696        } catch (Error $error) {
40697            throw new RuntimeException($error->getMessage(), (int) $error->getCode(), $error);
40698        }
40699        // @codeCoverageIgnoreEnd
40700        return $visitor->result();
40701    }
40702    private function parser() : Parser
40703    {
40704        return (new ParserFactory())->create(ParserFactory::PREFER_PHP7, new Lexer());
40705    }
40706}
40707<?php
40708
40709declare (strict_types=1);
40710/*
40711 * This file is part of sebastian/lines-of-code.
40712 *
40713 * (c) Sebastian Bergmann <sebastian@phpunit.de>
40714 *
40715 * For the full copyright and license information, please view the LICENSE
40716 * file that was distributed with this source code.
40717 */
40718namespace PHPUnit\SebastianBergmann\LinesOfCode;
40719
40720/**
40721 * @psalm-immutable
40722 */
40723final class LinesOfCode
40724{
40725    /**
40726     * @var int
40727     */
40728    private $linesOfCode;
40729    /**
40730     * @var int
40731     */
40732    private $commentLinesOfCode;
40733    /**
40734     * @var int
40735     */
40736    private $nonCommentLinesOfCode;
40737    /**
40738     * @var int
40739     */
40740    private $logicalLinesOfCode;
40741    /**
40742     * @throws IllogicalValuesException
40743     * @throws NegativeValueException
40744     */
40745    public function __construct(int $linesOfCode, int $commentLinesOfCode, int $nonCommentLinesOfCode, int $logicalLinesOfCode)
40746    {
40747        if ($linesOfCode < 0) {
40748            throw new NegativeValueException('$linesOfCode must not be negative');
40749        }
40750        if ($commentLinesOfCode < 0) {
40751            throw new NegativeValueException('$commentLinesOfCode must not be negative');
40752        }
40753        if ($nonCommentLinesOfCode < 0) {
40754            throw new NegativeValueException('$nonCommentLinesOfCode must not be negative');
40755        }
40756        if ($logicalLinesOfCode < 0) {
40757            throw new NegativeValueException('$logicalLinesOfCode must not be negative');
40758        }
40759        if ($linesOfCode - $commentLinesOfCode !== $nonCommentLinesOfCode) {
40760            throw new IllogicalValuesException('$linesOfCode !== $commentLinesOfCode + $nonCommentLinesOfCode');
40761        }
40762        $this->linesOfCode = $linesOfCode;
40763        $this->commentLinesOfCode = $commentLinesOfCode;
40764        $this->nonCommentLinesOfCode = $nonCommentLinesOfCode;
40765        $this->logicalLinesOfCode = $logicalLinesOfCode;
40766    }
40767    public function linesOfCode() : int
40768    {
40769        return $this->linesOfCode;
40770    }
40771    public function commentLinesOfCode() : int
40772    {
40773        return $this->commentLinesOfCode;
40774    }
40775    public function nonCommentLinesOfCode() : int
40776    {
40777        return $this->nonCommentLinesOfCode;
40778    }
40779    public function logicalLinesOfCode() : int
40780    {
40781        return $this->logicalLinesOfCode;
40782    }
40783    public function plus(self $other) : self
40784    {
40785        return new self($this->linesOfCode() + $other->linesOfCode(), $this->commentLinesOfCode() + $other->commentLinesOfCode(), $this->nonCommentLinesOfCode() + $other->nonCommentLinesOfCode(), $this->logicalLinesOfCode() + $other->logicalLinesOfCode());
40786    }
40787}
40788<?php
40789
40790declare (strict_types=1);
40791/*
40792 * This file is part of sebastian/lines-of-code.
40793 *
40794 * (c) Sebastian Bergmann <sebastian@phpunit.de>
40795 *
40796 * For the full copyright and license information, please view the LICENSE
40797 * file that was distributed with this source code.
40798 */
40799namespace PHPUnit\SebastianBergmann\LinesOfCode;
40800
40801use function array_merge;
40802use function array_unique;
40803use function count;
40804use PHPUnit\PhpParser\Comment;
40805use PHPUnit\PhpParser\Node;
40806use PHPUnit\PhpParser\Node\Expr;
40807use PHPUnit\PhpParser\NodeVisitorAbstract;
40808final class LineCountingVisitor extends NodeVisitorAbstract
40809{
40810    /**
40811     * @var int
40812     */
40813    private $linesOfCode;
40814    /**
40815     * @var Comment[]
40816     */
40817    private $comments = [];
40818    /**
40819     * @var int[]
40820     */
40821    private $linesWithStatements = [];
40822    public function __construct(int $linesOfCode)
40823    {
40824        $this->linesOfCode = $linesOfCode;
40825    }
40826    public function enterNode(Node $node) : void
40827    {
40828        $this->comments = array_merge($this->comments, $node->getComments());
40829        if (!$node instanceof Expr) {
40830            return;
40831        }
40832        $this->linesWithStatements[] = $node->getStartLine();
40833    }
40834    public function result() : LinesOfCode
40835    {
40836        $commentLinesOfCode = 0;
40837        foreach ($this->comments() as $comment) {
40838            $commentLinesOfCode += $comment->getEndLine() - $comment->getStartLine() + 1;
40839        }
40840        return new LinesOfCode($this->linesOfCode, $commentLinesOfCode, $this->linesOfCode - $commentLinesOfCode, count(array_unique($this->linesWithStatements)));
40841    }
40842    /**
40843     * @return Comment[]
40844     */
40845    private function comments() : array
40846    {
40847        $comments = [];
40848        foreach ($this->comments as $comment) {
40849            $comments[$comment->getStartLine() . '_' . $comment->getStartTokenPos() . '_' . $comment->getEndLine() . '_' . $comment->getEndTokenPos()] = $comment;
40850        }
40851        return $comments;
40852    }
40853}
40854sebastian/lines-of-code
40855
40856Copyright (c) 2020, Sebastian Bergmann <sebastian@phpunit.de>.
40857All rights reserved.
40858
40859Redistribution and use in source and binary forms, with or without
40860modification, are permitted provided that the following conditions
40861are met:
40862
40863 * Redistributions of source code must retain the above copyright
40864   notice, this list of conditions and the following disclaimer.
40865
40866 * Redistributions in binary form must reproduce the above copyright
40867   notice, this list of conditions and the following disclaimer in
40868   the documentation and/or other materials provided with the
40869   distribution.
40870
40871 * Neither the name of Sebastian Bergmann nor the names of his
40872   contributors may be used to endorse or promote products derived
40873   from this software without specific prior written permission.
40874
40875THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
40876"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
40877LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
40878FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
40879COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
40880INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
40881BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
40882LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
40883CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
40884LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
40885ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
40886POSSIBILITY OF SUCH DAMAGE.
40887phpunit/phpunit: 9.5.10
40888doctrine/instantiator: 1.4.0
40889myclabs/deep-copy: 1.10.2
40890nikic/php-parser: v4.13.0
40891phar-io/manifest: 2.0.3
40892phar-io/version: 3.1.0
40893phpdocumentor/reflection-common: 2.2.0
40894phpdocumentor/reflection-docblock: 5.2.2
40895phpdocumentor/type-resolver: 1.5.0
40896phpspec/prophecy: 1.14.0
40897phpunit/php-code-coverage: 9.2.7
40898phpunit/php-file-iterator: 3.0.5
40899phpunit/php-invoker: 3.1.1
40900phpunit/php-text-template: 2.0.4
40901phpunit/php-timer: 5.0.3
40902sebastian/cli-parser: 1.0.1
40903sebastian/code-unit: 1.0.8
40904sebastian/code-unit-reverse-lookup: 2.0.3
40905sebastian/comparator: 4.0.6
40906sebastian/complexity: 2.0.2
40907sebastian/diff: 4.0.4
40908sebastian/environment: 5.1.3
40909sebastian/exporter: 4.0.3
40910sebastian/global-state: 5.0.3
40911sebastian/lines-of-code: 1.0.3
40912sebastian/object-enumerator: 4.0.4
40913sebastian/object-reflector: 2.0.4
40914sebastian/recursion-context: 4.0.4
40915sebastian/resource-operations: 3.0.3
40916sebastian/type: 2.3.4
40917sebastian/version: 3.0.2
40918symfony/polyfill-ctype: v1.23.0
40919theseer/tokenizer: 1.2.1
40920webmozart/assert: 1.10.0
40921<?php
40922
40923namespace PHPUnit\Doctrine\Instantiator\Exception;
40924
40925use Exception;
40926use ReflectionClass;
40927use UnexpectedValueException as BaseUnexpectedValueException;
40928use function sprintf;
40929/**
40930 * Exception for given parameters causing invalid/unexpected state on instantiation
40931 */
40932class UnexpectedValueException extends BaseUnexpectedValueException implements ExceptionInterface
40933{
40934    /**
40935     * @template T of object
40936     * @phpstan-param ReflectionClass<T> $reflectionClass
40937     */
40938    public static function fromSerializationTriggeredException(ReflectionClass $reflectionClass, Exception $exception) : self
40939    {
40940        return new self(sprintf('An exception was raised while trying to instantiate an instance of "%s" via un-serialization', $reflectionClass->getName()), 0, $exception);
40941    }
40942    /**
40943     * @template T of object
40944     * @phpstan-param ReflectionClass<T> $reflectionClass
40945     */
40946    public static function fromUncleanUnSerialization(ReflectionClass $reflectionClass, string $errorString, int $errorCode, string $errorFile, int $errorLine) : self
40947    {
40948        return new self(sprintf('Could not produce an instance of "%s" via un-serialization, since an error was triggered ' . 'in file "%s" at line "%d"', $reflectionClass->getName(), $errorFile, $errorLine), 0, new Exception($errorString, $errorCode));
40949    }
40950}
40951<?php
40952
40953namespace PHPUnit\Doctrine\Instantiator\Exception;
40954
40955use Throwable;
40956/**
40957 * Base exception marker interface for the instantiator component
40958 */
40959interface ExceptionInterface extends Throwable
40960{
40961}
40962<?php
40963
40964namespace PHPUnit\Doctrine\Instantiator\Exception;
40965
40966use InvalidArgumentException as BaseInvalidArgumentException;
40967use ReflectionClass;
40968use function interface_exists;
40969use function sprintf;
40970use function trait_exists;
40971/**
40972 * Exception for invalid arguments provided to the instantiator
40973 */
40974class InvalidArgumentException extends BaseInvalidArgumentException implements ExceptionInterface
40975{
40976    public static function fromNonExistingClass(string $className) : self
40977    {
40978        if (interface_exists($className)) {
40979            return new self(sprintf('The provided type "%s" is an interface, and can not be instantiated', $className));
40980        }
40981        if (trait_exists($className)) {
40982            return new self(sprintf('The provided type "%s" is a trait, and can not be instantiated', $className));
40983        }
40984        return new self(sprintf('The provided class "%s" does not exist', $className));
40985    }
40986    /**
40987     * @template T of object
40988     * @phpstan-param ReflectionClass<T> $reflectionClass
40989     */
40990    public static function fromAbstractClass(ReflectionClass $reflectionClass) : self
40991    {
40992        return new self(sprintf('The provided class "%s" is abstract, and can not be instantiated', $reflectionClass->getName()));
40993    }
40994}
40995<?php
40996
40997namespace PHPUnit\Doctrine\Instantiator;
40998
40999use ArrayIterator;
41000use PHPUnit\Doctrine\Instantiator\Exception\InvalidArgumentException;
41001use PHPUnit\Doctrine\Instantiator\Exception\UnexpectedValueException;
41002use Exception;
41003use ReflectionClass;
41004use ReflectionException;
41005use Serializable;
41006use function class_exists;
41007use function is_subclass_of;
41008use function restore_error_handler;
41009use function set_error_handler;
41010use function sprintf;
41011use function strlen;
41012use function unserialize;
41013final class Instantiator implements InstantiatorInterface
41014{
41015    /**
41016     * Markers used internally by PHP to define whether {@see \unserialize} should invoke
41017     * the method {@see \Serializable::unserialize()} when dealing with classes implementing
41018     * the {@see \Serializable} interface.
41019     */
41020    public const SERIALIZATION_FORMAT_USE_UNSERIALIZER = 'C';
41021    public const SERIALIZATION_FORMAT_AVOID_UNSERIALIZER = 'O';
41022    /**
41023     * Used to instantiate specific classes, indexed by class name.
41024     *
41025     * @var callable[]
41026     */
41027    private static $cachedInstantiators = [];
41028    /**
41029     * Array of objects that can directly be cloned, indexed by class name.
41030     *
41031     * @var object[]
41032     */
41033    private static $cachedCloneables = [];
41034    /**
41035     * {@inheritDoc}
41036     */
41037    public function instantiate($className)
41038    {
41039        if (isset(self::$cachedCloneables[$className])) {
41040            return clone self::$cachedCloneables[$className];
41041        }
41042        if (isset(self::$cachedInstantiators[$className])) {
41043            $factory = self::$cachedInstantiators[$className];
41044            return $factory();
41045        }
41046        return $this->buildAndCacheFromFactory($className);
41047    }
41048    /**
41049     * Builds the requested object and caches it in static properties for performance
41050     *
41051     * @return object
41052     *
41053     * @template T of object
41054     * @phpstan-param class-string<T> $className
41055     *
41056     * @phpstan-return T
41057     */
41058    private function buildAndCacheFromFactory(string $className)
41059    {
41060        $factory = self::$cachedInstantiators[$className] = $this->buildFactory($className);
41061        $instance = $factory();
41062        if ($this->isSafeToClone(new ReflectionClass($instance))) {
41063            self::$cachedCloneables[$className] = clone $instance;
41064        }
41065        return $instance;
41066    }
41067    /**
41068     * Builds a callable capable of instantiating the given $className without
41069     * invoking its constructor.
41070     *
41071     * @throws InvalidArgumentException
41072     * @throws UnexpectedValueException
41073     * @throws ReflectionException
41074     *
41075     * @template T of object
41076     * @phpstan-param class-string<T> $className
41077     *
41078     * @phpstan-return callable(): T
41079     */
41080    private function buildFactory(string $className) : callable
41081    {
41082        $reflectionClass = $this->getReflectionClass($className);
41083        if ($this->isInstantiableViaReflection($reflectionClass)) {
41084            return [$reflectionClass, 'newInstanceWithoutConstructor'];
41085        }
41086        $serializedString = sprintf('%s:%d:"%s":0:{}', is_subclass_of($className, Serializable::class) ? self::SERIALIZATION_FORMAT_USE_UNSERIALIZER : self::SERIALIZATION_FORMAT_AVOID_UNSERIALIZER, strlen($className), $className);
41087        $this->checkIfUnSerializationIsSupported($reflectionClass, $serializedString);
41088        return static function () use($serializedString) {
41089            return unserialize($serializedString);
41090        };
41091    }
41092    /**
41093     * @throws InvalidArgumentException
41094     * @throws ReflectionException
41095     *
41096     * @template T of object
41097     * @phpstan-param class-string<T> $className
41098     *
41099     * @phpstan-return ReflectionClass<T>
41100     */
41101    private function getReflectionClass(string $className) : ReflectionClass
41102    {
41103        if (!class_exists($className)) {
41104            throw InvalidArgumentException::fromNonExistingClass($className);
41105        }
41106        $reflection = new ReflectionClass($className);
41107        if ($reflection->isAbstract()) {
41108            throw InvalidArgumentException::fromAbstractClass($reflection);
41109        }
41110        return $reflection;
41111    }
41112    /**
41113     * @throws UnexpectedValueException
41114     *
41115     * @template T of object
41116     * @phpstan-param ReflectionClass<T> $reflectionClass
41117     */
41118    private function checkIfUnSerializationIsSupported(ReflectionClass $reflectionClass, string $serializedString) : void
41119    {
41120        set_error_handler(static function (int $code, string $message, string $file, int $line) use($reflectionClass, &$error) : bool {
41121            $error = UnexpectedValueException::fromUncleanUnSerialization($reflectionClass, $message, $code, $file, $line);
41122            return \true;
41123        });
41124        try {
41125            $this->attemptInstantiationViaUnSerialization($reflectionClass, $serializedString);
41126        } finally {
41127            restore_error_handler();
41128        }
41129        if ($error) {
41130            throw $error;
41131        }
41132    }
41133    /**
41134     * @throws UnexpectedValueException
41135     *
41136     * @template T of object
41137     * @phpstan-param ReflectionClass<T> $reflectionClass
41138     */
41139    private function attemptInstantiationViaUnSerialization(ReflectionClass $reflectionClass, string $serializedString) : void
41140    {
41141        try {
41142            unserialize($serializedString);
41143        } catch (Exception $exception) {
41144            throw UnexpectedValueException::fromSerializationTriggeredException($reflectionClass, $exception);
41145        }
41146    }
41147    /**
41148     * @template T of object
41149     * @phpstan-param ReflectionClass<T> $reflectionClass
41150     */
41151    private function isInstantiableViaReflection(ReflectionClass $reflectionClass) : bool
41152    {
41153        return !($this->hasInternalAncestors($reflectionClass) && $reflectionClass->isFinal());
41154    }
41155    /**
41156     * Verifies whether the given class is to be considered internal
41157     *
41158     * @template T of object
41159     * @phpstan-param ReflectionClass<T> $reflectionClass
41160     */
41161    private function hasInternalAncestors(ReflectionClass $reflectionClass) : bool
41162    {
41163        do {
41164            if ($reflectionClass->isInternal()) {
41165                return \true;
41166            }
41167            $reflectionClass = $reflectionClass->getParentClass();
41168        } while ($reflectionClass);
41169        return \false;
41170    }
41171    /**
41172     * Checks if a class is cloneable
41173     *
41174     * Classes implementing `__clone` cannot be safely cloned, as that may cause side-effects.
41175     *
41176     * @template T of object
41177     * @phpstan-param ReflectionClass<T> $reflectionClass
41178     */
41179    private function isSafeToClone(ReflectionClass $reflectionClass) : bool
41180    {
41181        return $reflectionClass->isCloneable() && !$reflectionClass->hasMethod('__clone') && !$reflectionClass->isSubclassOf(ArrayIterator::class);
41182    }
41183}
41184<?php
41185
41186namespace PHPUnit\Doctrine\Instantiator;
41187
41188use PHPUnit\Doctrine\Instantiator\Exception\ExceptionInterface;
41189/**
41190 * Instantiator provides utility methods to build objects without invoking their constructors
41191 */
41192interface InstantiatorInterface
41193{
41194    /**
41195     * @param string $className
41196     *
41197     * @return object
41198     *
41199     * @throws ExceptionInterface
41200     *
41201     * @template T of object
41202     * @phpstan-param class-string<T> $className
41203     */
41204    public function instantiate($className);
41205}
41206Copyright (c) 2014 Doctrine Project
41207
41208Permission is hereby granted, free of charge, to any person obtaining a copy of
41209this software and associated documentation files (the "Software"), to deal in
41210the Software without restriction, including without limitation the rights to
41211use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
41212of the Software, and to permit persons to whom the Software is furnished to do
41213so, subject to the following conditions:
41214
41215The above copyright notice and this permission notice shall be included in all
41216copies or substantial portions of the Software.
41217
41218THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
41219IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
41220FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
41221AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
41222LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
41223OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
41224SOFTWARE.
41225<?php
41226
41227declare (strict_types=1);
41228/*
41229 * This file is part of resource-operations.
41230 *
41231 * (c) Sebastian Bergmann <sebastian@phpunit.de>
41232 *
41233 * For the full copyright and license information, please view the LICENSE
41234 * file that was distributed with this source code.
41235 */
41236namespace PHPUnit\SebastianBergmann\ResourceOperations;
41237
41238final class ResourceOperations
41239{
41240    /**
41241     * @return string[]
41242     */
41243    public static function getFunctions() : array
41244    {
41245        return ['Directory::close', 'Directory::read', 'Directory::rewind', 'DirectoryIterator::openFile', 'FilesystemIterator::openFile', 'Gmagick::readimagefile', 'HttpResponse::getRequestBodyStream', 'HttpResponse::getStream', 'HttpResponse::setStream', 'Imagick::pingImageFile', 'Imagick::readImageFile', 'Imagick::writeImageFile', 'Imagick::writeImagesFile', 'MongoGridFSCursor::__construct', 'MongoGridFSFile::getResource', 'MysqlndUhConnection::stmtInit', 'MysqlndUhConnection::storeResult', 'MysqlndUhConnection::useResult', 'PDF_activate_item', 'PDF_add_launchlink', 'PDF_add_locallink', 'PDF_add_nameddest', 'PDF_add_note', 'PDF_add_pdflink', 'PDF_add_table_cell', 'PDF_add_textflow', 'PDF_add_thumbnail', 'PDF_add_weblink', 'PDF_arc', 'PDF_arcn', 'PDF_attach_file', 'PDF_begin_document', 'PDF_begin_font', 'PDF_begin_glyph', 'PDF_begin_item', 'PDF_begin_layer', 'PDF_begin_page', 'PDF_begin_page_ext', 'PDF_begin_pattern', 'PDF_begin_template', 'PDF_begin_template_ext', 'PDF_circle', 'PDF_clip', 'PDF_close', 'PDF_close_image', 'PDF_close_pdi', 'PDF_close_pdi_page', 'PDF_closepath', 'PDF_closepath_fill_stroke', 'PDF_closepath_stroke', 'PDF_concat', 'PDF_continue_text', 'PDF_create_3dview', 'PDF_create_action', 'PDF_create_annotation', 'PDF_create_bookmark', 'PDF_create_field', 'PDF_create_fieldgroup', 'PDF_create_gstate', 'PDF_create_pvf', 'PDF_create_textflow', 'PDF_curveto', 'PDF_define_layer', 'PDF_delete', 'PDF_delete_pvf', 'PDF_delete_table', 'PDF_delete_textflow', 'PDF_encoding_set_char', 'PDF_end_document', 'PDF_end_font', 'PDF_end_glyph', 'PDF_end_item', 'PDF_end_layer', 'PDF_end_page', 'PDF_end_page_ext', 'PDF_end_pattern', 'PDF_end_template', 'PDF_endpath', 'PDF_fill', 'PDF_fill_imageblock', 'PDF_fill_pdfblock', 'PDF_fill_stroke', 'PDF_fill_textblock', 'PDF_findfont', 'PDF_fit_image', 'PDF_fit_pdi_page', 'PDF_fit_table', 'PDF_fit_textflow', 'PDF_fit_textline', 'PDF_get_apiname', 'PDF_get_buffer', 'PDF_get_errmsg', 'PDF_get_errnum', 'PDF_get_parameter', 'PDF_get_pdi_parameter', 'PDF_get_pdi_value', 'PDF_get_value', 'PDF_info_font', 'PDF_info_matchbox', 'PDF_info_table', 'PDF_info_textflow', 'PDF_info_textline', 'PDF_initgraphics', 'PDF_lineto', 'PDF_load_3ddata', 'PDF_load_font', 'PDF_load_iccprofile', 'PDF_load_image', 'PDF_makespotcolor', 'PDF_moveto', 'PDF_new', 'PDF_open_ccitt', 'PDF_open_file', 'PDF_open_image', 'PDF_open_image_file', 'PDF_open_memory_image', 'PDF_open_pdi', 'PDF_open_pdi_document', 'PDF_open_pdi_page', 'PDF_pcos_get_number', 'PDF_pcos_get_stream', 'PDF_pcos_get_string', 'PDF_place_image', 'PDF_place_pdi_page', 'PDF_process_pdi', 'PDF_rect', 'PDF_restore', 'PDF_resume_page', 'PDF_rotate', 'PDF_save', 'PDF_scale', 'PDF_set_border_color', 'PDF_set_border_dash', 'PDF_set_border_style', 'PDF_set_gstate', 'PDF_set_info', 'PDF_set_layer_dependency', 'PDF_set_parameter', 'PDF_set_text_pos', 'PDF_set_value', 'PDF_setcolor', 'PDF_setdash', 'PDF_setdashpattern', 'PDF_setflat', 'PDF_setfont', 'PDF_setgray', 'PDF_setgray_fill', 'PDF_setgray_stroke', 'PDF_setlinecap', 'PDF_setlinejoin', 'PDF_setlinewidth', 'PDF_setmatrix', 'PDF_setmiterlimit', 'PDF_setrgbcolor', 'PDF_setrgbcolor_fill', 'PDF_setrgbcolor_stroke', 'PDF_shading', 'PDF_shading_pattern', 'PDF_shfill', 'PDF_show', 'PDF_show_boxed', 'PDF_show_xy', 'PDF_skew', 'PDF_stringwidth', 'PDF_stroke', 'PDF_suspend_page', 'PDF_translate', 'PDF_utf16_to_utf8', 'PDF_utf32_to_utf16', 'PDF_utf8_to_utf16', 'PDO::pgsqlLOBOpen', 'RarEntry::getStream', 'SQLite3::openBlob', 'SWFMovie::saveToFile', 'SplFileInfo::openFile', 'SplFileObject::openFile', 'SplTempFileObject::openFile', 'V8Js::compileString', 'V8Js::executeScript', 'Vtiful\\Kernel\\Excel::setColumn', 'Vtiful\\Kernel\\Excel::setRow', 'Vtiful\\Kernel\\Format::align', 'Vtiful\\Kernel\\Format::bold', 'Vtiful\\Kernel\\Format::italic', 'Vtiful\\Kernel\\Format::underline', 'XMLWriter::openMemory', 'XMLWriter::openURI', 'ZipArchive::getStream', 'Zookeeper::setLogStream', 'apc_bin_dumpfile', 'apc_bin_loadfile', 'bbcode_add_element', 'bbcode_add_smiley', 'bbcode_create', 'bbcode_destroy', 'bbcode_parse', 'bbcode_set_arg_parser', 'bbcode_set_flags', 'bcompiler_read', 'bcompiler_write_class', 'bcompiler_write_constant', 'bcompiler_write_exe_footer', 'bcompiler_write_file', 'bcompiler_write_footer', 'bcompiler_write_function', 'bcompiler_write_functions_from_file', 'bcompiler_write_header', 'bcompiler_write_included_filename', 'bzclose', 'bzerrno', 'bzerror', 'bzerrstr', 'bzflush', 'bzopen', 'bzread', 'bzwrite', 'cairo_surface_write_to_png', 'closedir', 'copy', 'crack_closedict', 'crack_opendict', 'cubrid_bind', 'cubrid_close_prepare', 'cubrid_close_request', 'cubrid_col_get', 'cubrid_col_size', 'cubrid_column_names', 'cubrid_column_types', 'cubrid_commit', 'cubrid_connect', 'cubrid_connect_with_url', 'cubrid_current_oid', 'cubrid_db_parameter', 'cubrid_disconnect', 'cubrid_drop', 'cubrid_fetch', 'cubrid_free_result', 'cubrid_get', 'cubrid_get_autocommit', 'cubrid_get_charset', 'cubrid_get_class_name', 'cubrid_get_db_parameter', 'cubrid_get_query_timeout', 'cubrid_get_server_info', 'cubrid_insert_id', 'cubrid_is_instance', 'cubrid_lob2_bind', 'cubrid_lob2_close', 'cubrid_lob2_export', 'cubrid_lob2_import', 'cubrid_lob2_new', 'cubrid_lob2_read', 'cubrid_lob2_seek', 'cubrid_lob2_seek64', 'cubrid_lob2_size', 'cubrid_lob2_size64', 'cubrid_lob2_tell', 'cubrid_lob2_tell64', 'cubrid_lob2_write', 'cubrid_lob_export', 'cubrid_lob_get', 'cubrid_lob_send', 'cubrid_lob_size', 'cubrid_lock_read', 'cubrid_lock_write', 'cubrid_move_cursor', 'cubrid_next_result', 'cubrid_num_cols', 'cubrid_num_rows', 'cubrid_pconnect', 'cubrid_pconnect_with_url', 'cubrid_prepare', 'cubrid_put', 'cubrid_query', 'cubrid_rollback', 'cubrid_schema', 'cubrid_seq_add', 'cubrid_seq_drop', 'cubrid_seq_insert', 'cubrid_seq_put', 'cubrid_set_add', 'cubrid_set_autocommit', 'cubrid_set_db_parameter', 'cubrid_set_drop', 'cubrid_set_query_timeout', 'cubrid_unbuffered_query', 'curl_close', 'curl_copy_handle', 'curl_errno', 'curl_error', 'curl_escape', 'curl_exec', 'curl_getinfo', 'curl_multi_add_handle', 'curl_multi_close', 'curl_multi_errno', 'curl_multi_exec', 'curl_multi_getcontent', 'curl_multi_info_read', 'curl_multi_remove_handle', 'curl_multi_select', 'curl_multi_setopt', 'curl_pause', 'curl_reset', 'curl_setopt', 'curl_setopt_array', 'curl_share_close', 'curl_share_errno', 'curl_share_init', 'curl_share_setopt', 'curl_unescape', 'cyrus_authenticate', 'cyrus_bind', 'cyrus_close', 'cyrus_connect', 'cyrus_query', 'cyrus_unbind', 'db2_autocommit', 'db2_bind_param', 'db2_client_info', 'db2_close', 'db2_column_privileges', 'db2_columns', 'db2_commit', 'db2_conn_error', 'db2_conn_errormsg', 'db2_connect', 'db2_cursor_type', 'db2_exec', 'db2_execute', 'db2_fetch_array', 'db2_fetch_assoc', 'db2_fetch_both', 'db2_fetch_object', 'db2_fetch_row', 'db2_field_display_size', 'db2_field_name', 'db2_field_num', 'db2_field_precision', 'db2_field_scale', 'db2_field_type', 'db2_field_width', 'db2_foreign_keys', 'db2_free_result', 'db2_free_stmt', 'db2_get_option', 'db2_last_insert_id', 'db2_lob_read', 'db2_next_result', 'db2_num_fields', 'db2_num_rows', 'db2_pclose', 'db2_pconnect', 'db2_prepare', 'db2_primary_keys', 'db2_procedure_columns', 'db2_procedures', 'db2_result', 'db2_rollback', 'db2_server_info', 'db2_set_option', 'db2_special_columns', 'db2_statistics', 'db2_stmt_error', 'db2_stmt_errormsg', 'db2_table_privileges', 'db2_tables', 'dba_close', 'dba_delete', 'dba_exists', 'dba_fetch', 'dba_firstkey', 'dba_insert', 'dba_nextkey', 'dba_open', 'dba_optimize', 'dba_popen', 'dba_replace', 'dba_sync', 'dbplus_add', 'dbplus_aql', 'dbplus_close', 'dbplus_curr', 'dbplus_find', 'dbplus_first', 'dbplus_flush', 'dbplus_freelock', 'dbplus_freerlocks', 'dbplus_getlock', 'dbplus_getunique', 'dbplus_info', 'dbplus_last', 'dbplus_lockrel', 'dbplus_next', 'dbplus_open', 'dbplus_prev', 'dbplus_rchperm', 'dbplus_rcreate', 'dbplus_rcrtexact', 'dbplus_rcrtlike', 'dbplus_restorepos', 'dbplus_rkeys', 'dbplus_ropen', 'dbplus_rquery', 'dbplus_rrename', 'dbplus_rsecindex', 'dbplus_runlink', 'dbplus_rzap', 'dbplus_savepos', 'dbplus_setindex', 'dbplus_setindexbynumber', 'dbplus_sql', 'dbplus_tremove', 'dbplus_undo', 'dbplus_undoprepare', 'dbplus_unlockrel', 'dbplus_unselect', 'dbplus_update', 'dbplus_xlockrel', 'dbplus_xunlockrel', 'deflate_add', 'dio_close', 'dio_fcntl', 'dio_open', 'dio_read', 'dio_seek', 'dio_stat', 'dio_tcsetattr', 'dio_truncate', 'dio_write', 'dir', 'eio_busy', 'eio_cancel', 'eio_chmod', 'eio_chown', 'eio_close', 'eio_custom', 'eio_dup2', 'eio_fallocate', 'eio_fchmod', 'eio_fchown', 'eio_fdatasync', 'eio_fstat', 'eio_fstatvfs', 'eio_fsync', 'eio_ftruncate', 'eio_futime', 'eio_get_last_error', 'eio_grp', 'eio_grp_add', 'eio_grp_cancel', 'eio_grp_limit', 'eio_link', 'eio_lstat', 'eio_mkdir', 'eio_mknod', 'eio_nop', 'eio_open', 'eio_read', 'eio_readahead', 'eio_readdir', 'eio_readlink', 'eio_realpath', 'eio_rename', 'eio_rmdir', 'eio_seek', 'eio_sendfile', 'eio_stat', 'eio_statvfs', 'eio_symlink', 'eio_sync', 'eio_sync_file_range', 'eio_syncfs', 'eio_truncate', 'eio_unlink', 'eio_utime', 'eio_write', 'enchant_broker_describe', 'enchant_broker_dict_exists', 'enchant_broker_free', 'enchant_broker_free_dict', 'enchant_broker_get_dict_path', 'enchant_broker_get_error', 'enchant_broker_init', 'enchant_broker_list_dicts', 'enchant_broker_request_dict', 'enchant_broker_request_pwl_dict', 'enchant_broker_set_dict_path', 'enchant_broker_set_ordering', 'enchant_dict_add_to_personal', 'enchant_dict_add_to_session', 'enchant_dict_check', 'enchant_dict_describe', 'enchant_dict_get_error', 'enchant_dict_is_in_session', 'enchant_dict_quick_check', 'enchant_dict_store_replacement', 'enchant_dict_suggest', 'event_add', 'event_base_free', 'event_base_loop', 'event_base_loopbreak', 'event_base_loopexit', 'event_base_new', 'event_base_priority_init', 'event_base_reinit', 'event_base_set', 'event_buffer_base_set', 'event_buffer_disable', 'event_buffer_enable', 'event_buffer_fd_set', 'event_buffer_free', 'event_buffer_new', 'event_buffer_priority_set', 'event_buffer_read', 'event_buffer_set_callback', 'event_buffer_timeout_set', 'event_buffer_watermark_set', 'event_buffer_write', 'event_del', 'event_free', 'event_new', 'event_priority_set', 'event_set', 'event_timer_add', 'event_timer_del', 'event_timer_pending', 'event_timer_set', 'expect_expectl', 'expect_popen', 'fam_cancel_monitor', 'fam_close', 'fam_monitor_collection', 'fam_monitor_directory', 'fam_monitor_file', 'fam_next_event', 'fam_open', 'fam_pending', 'fam_resume_monitor', 'fam_suspend_monitor', 'fann_cascadetrain_on_data', 'fann_cascadetrain_on_file', 'fann_clear_scaling_params', 'fann_copy', 'fann_create_from_file', 'fann_create_shortcut_array', 'fann_create_standard', 'fann_create_standard_array', 'fann_create_train', 'fann_create_train_from_callback', 'fann_descale_input', 'fann_descale_output', 'fann_descale_train', 'fann_destroy', 'fann_destroy_train', 'fann_duplicate_train_data', 'fann_get_MSE', 'fann_get_activation_function', 'fann_get_activation_steepness', 'fann_get_bias_array', 'fann_get_bit_fail', 'fann_get_bit_fail_limit', 'fann_get_cascade_activation_functions', 'fann_get_cascade_activation_functions_count', 'fann_get_cascade_activation_steepnesses', 'fann_get_cascade_activation_steepnesses_count', 'fann_get_cascade_candidate_change_fraction', 'fann_get_cascade_candidate_limit', 'fann_get_cascade_candidate_stagnation_epochs', 'fann_get_cascade_max_cand_epochs', 'fann_get_cascade_max_out_epochs', 'fann_get_cascade_min_cand_epochs', 'fann_get_cascade_min_out_epochs', 'fann_get_cascade_num_candidate_groups', 'fann_get_cascade_num_candidates', 'fann_get_cascade_output_change_fraction', 'fann_get_cascade_output_stagnation_epochs', 'fann_get_cascade_weight_multiplier', 'fann_get_connection_array', 'fann_get_connection_rate', 'fann_get_errno', 'fann_get_errstr', 'fann_get_layer_array', 'fann_get_learning_momentum', 'fann_get_learning_rate', 'fann_get_network_type', 'fann_get_num_input', 'fann_get_num_layers', 'fann_get_num_output', 'fann_get_quickprop_decay', 'fann_get_quickprop_mu', 'fann_get_rprop_decrease_factor', 'fann_get_rprop_delta_max', 'fann_get_rprop_delta_min', 'fann_get_rprop_delta_zero', 'fann_get_rprop_increase_factor', 'fann_get_sarprop_step_error_shift', 'fann_get_sarprop_step_error_threshold_factor', 'fann_get_sarprop_temperature', 'fann_get_sarprop_weight_decay_shift', 'fann_get_total_connections', 'fann_get_total_neurons', 'fann_get_train_error_function', 'fann_get_train_stop_function', 'fann_get_training_algorithm', 'fann_init_weights', 'fann_length_train_data', 'fann_merge_train_data', 'fann_num_input_train_data', 'fann_num_output_train_data', 'fann_randomize_weights', 'fann_read_train_from_file', 'fann_reset_errno', 'fann_reset_errstr', 'fann_run', 'fann_save', 'fann_save_train', 'fann_scale_input', 'fann_scale_input_train_data', 'fann_scale_output', 'fann_scale_output_train_data', 'fann_scale_train', 'fann_scale_train_data', 'fann_set_activation_function', 'fann_set_activation_function_hidden', 'fann_set_activation_function_layer', 'fann_set_activation_function_output', 'fann_set_activation_steepness', 'fann_set_activation_steepness_hidden', 'fann_set_activation_steepness_layer', 'fann_set_activation_steepness_output', 'fann_set_bit_fail_limit', 'fann_set_callback', 'fann_set_cascade_activation_functions', 'fann_set_cascade_activation_steepnesses', 'fann_set_cascade_candidate_change_fraction', 'fann_set_cascade_candidate_limit', 'fann_set_cascade_candidate_stagnation_epochs', 'fann_set_cascade_max_cand_epochs', 'fann_set_cascade_max_out_epochs', 'fann_set_cascade_min_cand_epochs', 'fann_set_cascade_min_out_epochs', 'fann_set_cascade_num_candidate_groups', 'fann_set_cascade_output_change_fraction', 'fann_set_cascade_output_stagnation_epochs', 'fann_set_cascade_weight_multiplier', 'fann_set_error_log', 'fann_set_input_scaling_params', 'fann_set_learning_momentum', 'fann_set_learning_rate', 'fann_set_output_scaling_params', 'fann_set_quickprop_decay', 'fann_set_quickprop_mu', 'fann_set_rprop_decrease_factor', 'fann_set_rprop_delta_max', 'fann_set_rprop_delta_min', 'fann_set_rprop_delta_zero', 'fann_set_rprop_increase_factor', 'fann_set_sarprop_step_error_shift', 'fann_set_sarprop_step_error_threshold_factor', 'fann_set_sarprop_temperature', 'fann_set_sarprop_weight_decay_shift', 'fann_set_scaling_params', 'fann_set_train_error_function', 'fann_set_train_stop_function', 'fann_set_training_algorithm', 'fann_set_weight', 'fann_set_weight_array', 'fann_shuffle_train_data', 'fann_subset_train_data', 'fann_test', 'fann_test_data', 'fann_train', 'fann_train_epoch', 'fann_train_on_data', 'fann_train_on_file', 'fbsql_affected_rows', 'fbsql_autocommit', 'fbsql_blob_size', 'fbsql_change_user', 'fbsql_clob_size', 'fbsql_close', 'fbsql_commit', 'fbsql_connect', 'fbsql_create_blob', 'fbsql_create_clob', 'fbsql_create_db', 'fbsql_data_seek', 'fbsql_database', 'fbsql_database_password', 'fbsql_db_query', 'fbsql_db_status', 'fbsql_drop_db', 'fbsql_errno', 'fbsql_error', 'fbsql_fetch_array', 'fbsql_fetch_assoc', 'fbsql_fetch_field', 'fbsql_fetch_lengths', 'fbsql_fetch_object', 'fbsql_fetch_row', 'fbsql_field_flags', 'fbsql_field_len', 'fbsql_field_name', 'fbsql_field_seek', 'fbsql_field_table', 'fbsql_field_type', 'fbsql_free_result', 'fbsql_get_autostart_info', 'fbsql_hostname', 'fbsql_insert_id', 'fbsql_list_dbs', 'fbsql_list_fields', 'fbsql_list_tables', 'fbsql_next_result', 'fbsql_num_fields', 'fbsql_num_rows', 'fbsql_password', 'fbsql_pconnect', 'fbsql_query', 'fbsql_read_blob', 'fbsql_read_clob', 'fbsql_result', 'fbsql_rollback', 'fbsql_rows_fetched', 'fbsql_select_db', 'fbsql_set_characterset', 'fbsql_set_lob_mode', 'fbsql_set_password', 'fbsql_set_transaction', 'fbsql_start_db', 'fbsql_stop_db', 'fbsql_table_name', 'fbsql_username', 'fclose', 'fdf_add_doc_javascript', 'fdf_add_template', 'fdf_close', 'fdf_create', 'fdf_enum_values', 'fdf_get_ap', 'fdf_get_attachment', 'fdf_get_encoding', 'fdf_get_file', 'fdf_get_flags', 'fdf_get_opt', 'fdf_get_status', 'fdf_get_value', 'fdf_get_version', 'fdf_next_field_name', 'fdf_open', 'fdf_open_string', 'fdf_remove_item', 'fdf_save', 'fdf_save_string', 'fdf_set_ap', 'fdf_set_encoding', 'fdf_set_file', 'fdf_set_flags', 'fdf_set_javascript_action', 'fdf_set_on_import_javascript', 'fdf_set_opt', 'fdf_set_status', 'fdf_set_submit_form_action', 'fdf_set_target_frame', 'fdf_set_value', 'fdf_set_version', 'feof', 'fflush', 'ffmpeg_frame::__construct', 'ffmpeg_frame::toGDImage', 'fgetc', 'fgetcsv', 'fgets', 'fgetss', 'file', 'file_get_contents', 'file_put_contents', 'finfo::buffer', 'finfo::file', 'finfo_buffer', 'finfo_close', 'finfo_file', 'finfo_open', 'finfo_set_flags', 'flock', 'fopen', 'fpassthru', 'fprintf', 'fputcsv', 'fputs', 'fread', 'fscanf', 'fseek', 'fstat', 'ftell', 'ftp_alloc', 'ftp_append', 'ftp_cdup', 'ftp_chdir', 'ftp_chmod', 'ftp_close', 'ftp_delete', 'ftp_exec', 'ftp_fget', 'ftp_fput', 'ftp_get', 'ftp_get_option', 'ftp_login', 'ftp_mdtm', 'ftp_mkdir', 'ftp_mlsd', 'ftp_nb_continue', 'ftp_nb_fget', 'ftp_nb_fput', 'ftp_nb_get', 'ftp_nb_put', 'ftp_nlist', 'ftp_pasv', 'ftp_put', 'ftp_pwd', 'ftp_quit', 'ftp_raw', 'ftp_rawlist', 'ftp_rename', 'ftp_rmdir', 'ftp_set_option', 'ftp_site', 'ftp_size', 'ftp_systype', 'ftruncate', 'fwrite', 'get_resource_type', 'gmp_div', 'gnupg::init', 'gnupg_adddecryptkey', 'gnupg_addencryptkey', 'gnupg_addsignkey', 'gnupg_cleardecryptkeys', 'gnupg_clearencryptkeys', 'gnupg_clearsignkeys', 'gnupg_decrypt', 'gnupg_decryptverify', 'gnupg_encrypt', 'gnupg_encryptsign', 'gnupg_export', 'gnupg_geterror', 'gnupg_getprotocol', 'gnupg_import', 'gnupg_init', 'gnupg_keyinfo', 'gnupg_setarmor', 'gnupg_seterrormode', 'gnupg_setsignmode', 'gnupg_sign', 'gnupg_verify', 'gupnp_context_get_host_ip', 'gupnp_context_get_port', 'gupnp_context_get_subscription_timeout', 'gupnp_context_host_path', 'gupnp_context_new', 'gupnp_context_set_subscription_timeout', 'gupnp_context_timeout_add', 'gupnp_context_unhost_path', 'gupnp_control_point_browse_start', 'gupnp_control_point_browse_stop', 'gupnp_control_point_callback_set', 'gupnp_control_point_new', 'gupnp_device_action_callback_set', 'gupnp_device_info_get', 'gupnp_device_info_get_service', 'gupnp_root_device_get_available', 'gupnp_root_device_get_relative_location', 'gupnp_root_device_new', 'gupnp_root_device_set_available', 'gupnp_root_device_start', 'gupnp_root_device_stop', 'gupnp_service_action_get', 'gupnp_service_action_return', 'gupnp_service_action_return_error', 'gupnp_service_action_set', 'gupnp_service_freeze_notify', 'gupnp_service_info_get', 'gupnp_service_info_get_introspection', 'gupnp_service_introspection_get_state_variable', 'gupnp_service_notify', 'gupnp_service_proxy_action_get', 'gupnp_service_proxy_action_set', 'gupnp_service_proxy_add_notify', 'gupnp_service_proxy_callback_set', 'gupnp_service_proxy_get_subscribed', 'gupnp_service_proxy_remove_notify', 'gupnp_service_proxy_send_action', 'gupnp_service_proxy_set_subscribed', 'gupnp_service_thaw_notify', 'gzclose', 'gzeof', 'gzgetc', 'gzgets', 'gzgetss', 'gzpassthru', 'gzputs', 'gzread', 'gzrewind', 'gzseek', 'gztell', 'gzwrite', 'hash_update_stream', 'http\\Env\\Response::send', 'http_get_request_body_stream', 'ibase_add_user', 'ibase_affected_rows', 'ibase_backup', 'ibase_blob_add', 'ibase_blob_cancel', 'ibase_blob_close', 'ibase_blob_create', 'ibase_blob_get', 'ibase_blob_open', 'ibase_close', 'ibase_commit', 'ibase_commit_ret', 'ibase_connect', 'ibase_db_info', 'ibase_delete_user', 'ibase_drop_db', 'ibase_execute', 'ibase_fetch_assoc', 'ibase_fetch_object', 'ibase_fetch_row', 'ibase_field_info', 'ibase_free_event_handler', 'ibase_free_query', 'ibase_free_result', 'ibase_gen_id', 'ibase_maintain_db', 'ibase_modify_user', 'ibase_name_result', 'ibase_num_fields', 'ibase_num_params', 'ibase_param_info', 'ibase_pconnect', 'ibase_prepare', 'ibase_query', 'ibase_restore', 'ibase_rollback', 'ibase_rollback_ret', 'ibase_server_info', 'ibase_service_attach', 'ibase_service_detach', 'ibase_set_event_handler', 'ibase_trans', 'ifx_affected_rows', 'ifx_close', 'ifx_connect', 'ifx_do', 'ifx_error', 'ifx_fetch_row', 'ifx_fieldproperties', 'ifx_fieldtypes', 'ifx_free_result', 'ifx_getsqlca', 'ifx_htmltbl_result', 'ifx_num_fields', 'ifx_num_rows', 'ifx_pconnect', 'ifx_prepare', 'ifx_query', 'image2wbmp', 'imageaffine', 'imagealphablending', 'imageantialias', 'imagearc', 'imagebmp', 'imagechar', 'imagecharup', 'imagecolorallocate', 'imagecolorallocatealpha', 'imagecolorat', 'imagecolorclosest', 'imagecolorclosestalpha', 'imagecolorclosesthwb', 'imagecolordeallocate', 'imagecolorexact', 'imagecolorexactalpha', 'imagecolormatch', 'imagecolorresolve', 'imagecolorresolvealpha', 'imagecolorset', 'imagecolorsforindex', 'imagecolorstotal', 'imagecolortransparent', 'imageconvolution', 'imagecopy', 'imagecopymerge', 'imagecopymergegray', 'imagecopyresampled', 'imagecopyresized', 'imagecrop', 'imagecropauto', 'imagedashedline', 'imagedestroy', 'imageellipse', 'imagefill', 'imagefilledarc', 'imagefilledellipse', 'imagefilledpolygon', 'imagefilledrectangle', 'imagefilltoborder', 'imagefilter', 'imageflip', 'imagefttext', 'imagegammacorrect', 'imagegd', 'imagegd2', 'imagegetclip', 'imagegif', 'imagegrabscreen', 'imagegrabwindow', 'imageinterlace', 'imageistruecolor', 'imagejpeg', 'imagelayereffect', 'imageline', 'imageopenpolygon', 'imagepalettecopy', 'imagepalettetotruecolor', 'imagepng', 'imagepolygon', 'imagepsencodefont', 'imagepsextendfont', 'imagepsfreefont', 'imagepsloadfont', 'imagepsslantfont', 'imagepstext', 'imagerectangle', 'imageresolution', 'imagerotate', 'imagesavealpha', 'imagescale', 'imagesetbrush', 'imagesetclip', 'imagesetinterpolation', 'imagesetpixel', 'imagesetstyle', 'imagesetthickness', 'imagesettile', 'imagestring', 'imagestringup', 'imagesx', 'imagesy', 'imagetruecolortopalette', 'imagettftext', 'imagewbmp', 'imagewebp', 'imagexbm', 'imap_append', 'imap_body', 'imap_bodystruct', 'imap_check', 'imap_clearflag_full', 'imap_close', 'imap_create', 'imap_createmailbox', 'imap_delete', 'imap_deletemailbox', 'imap_expunge', 'imap_fetch_overview', 'imap_fetchbody', 'imap_fetchheader', 'imap_fetchmime', 'imap_fetchstructure', 'imap_fetchtext', 'imap_gc', 'imap_get_quota', 'imap_get_quotaroot', 'imap_getacl', 'imap_getmailboxes', 'imap_getsubscribed', 'imap_header', 'imap_headerinfo', 'imap_headers', 'imap_list', 'imap_listmailbox', 'imap_listscan', 'imap_listsubscribed', 'imap_lsub', 'imap_mail_copy', 'imap_mail_move', 'imap_mailboxmsginfo', 'imap_msgno', 'imap_num_msg', 'imap_num_recent', 'imap_ping', 'imap_rename', 'imap_renamemailbox', 'imap_reopen', 'imap_savebody', 'imap_scan', 'imap_scanmailbox', 'imap_search', 'imap_set_quota', 'imap_setacl', 'imap_setflag_full', 'imap_sort', 'imap_status', 'imap_subscribe', 'imap_thread', 'imap_uid', 'imap_undelete', 'imap_unsubscribe', 'inflate_add', 'inflate_get_read_len', 'inflate_get_status', 'ingres_autocommit', 'ingres_autocommit_state', 'ingres_charset', 'ingres_close', 'ingres_commit', 'ingres_connect', 'ingres_cursor', 'ingres_errno', 'ingres_error', 'ingres_errsqlstate', 'ingres_escape_string', 'ingres_execute', 'ingres_fetch_array', 'ingres_fetch_assoc', 'ingres_fetch_object', 'ingres_fetch_proc_return', 'ingres_fetch_row', 'ingres_field_length', 'ingres_field_name', 'ingres_field_nullable', 'ingres_field_precision', 'ingres_field_scale', 'ingres_field_type', 'ingres_free_result', 'ingres_next_error', 'ingres_num_fields', 'ingres_num_rows', 'ingres_pconnect', 'ingres_prepare', 'ingres_query', 'ingres_result_seek', 'ingres_rollback', 'ingres_set_environment', 'ingres_unbuffered_query', 'inotify_add_watch', 'inotify_init', 'inotify_queue_len', 'inotify_read', 'inotify_rm_watch', 'kadm5_chpass_principal', 'kadm5_create_principal', 'kadm5_delete_principal', 'kadm5_destroy', 'kadm5_flush', 'kadm5_get_policies', 'kadm5_get_principal', 'kadm5_get_principals', 'kadm5_init_with_password', 'kadm5_modify_principal', 'ldap_add', 'ldap_bind', 'ldap_close', 'ldap_compare', 'ldap_control_paged_result', 'ldap_control_paged_result_response', 'ldap_count_entries', 'ldap_delete', 'ldap_errno', 'ldap_error', 'ldap_exop', 'ldap_exop_passwd', 'ldap_exop_refresh', 'ldap_exop_whoami', 'ldap_first_attribute', 'ldap_first_entry', 'ldap_first_reference', 'ldap_free_result', 'ldap_get_attributes', 'ldap_get_dn', 'ldap_get_entries', 'ldap_get_option', 'ldap_get_values', 'ldap_get_values_len', 'ldap_mod_add', 'ldap_mod_del', 'ldap_mod_replace', 'ldap_modify', 'ldap_modify_batch', 'ldap_next_attribute', 'ldap_next_entry', 'ldap_next_reference', 'ldap_parse_exop', 'ldap_parse_reference', 'ldap_parse_result', 'ldap_rename', 'ldap_sasl_bind', 'ldap_set_option', 'ldap_set_rebind_proc', 'ldap_sort', 'ldap_start_tls', 'ldap_unbind', 'libxml_set_streams_context', 'm_checkstatus', 'm_completeauthorizations', 'm_connect', 'm_connectionerror', 'm_deletetrans', 'm_destroyconn', 'm_getcell', 'm_getcellbynum', 'm_getcommadelimited', 'm_getheader', 'm_initconn', 'm_iscommadelimited', 'm_maxconntimeout', 'm_monitor', 'm_numcolumns', 'm_numrows', 'm_parsecommadelimited', 'm_responsekeys', 'm_responseparam', 'm_returnstatus', 'm_setblocking', 'm_setdropfile', 'm_setip', 'm_setssl', 'm_setssl_cafile', 'm_setssl_files', 'm_settimeout', 'm_transactionssent', 'm_transinqueue', 'm_transkeyval', 'm_transnew', 'm_transsend', 'm_validateidentifier', 'm_verifyconnection', 'm_verifysslcert', 'mailparse_determine_best_xfer_encoding', 'mailparse_msg_create', 'mailparse_msg_extract_part', 'mailparse_msg_extract_part_file', 'mailparse_msg_extract_whole_part_file', 'mailparse_msg_free', 'mailparse_msg_get_part', 'mailparse_msg_get_part_data', 'mailparse_msg_get_structure', 'mailparse_msg_parse', 'mailparse_msg_parse_file', 'mailparse_stream_encode', 'mailparse_uudecode_all', 'maxdb::use_result', 'maxdb_affected_rows', 'maxdb_connect', 'maxdb_disable_rpl_parse', 'maxdb_dump_debug_info', 'maxdb_embedded_connect', 'maxdb_enable_reads_from_master', 'maxdb_enable_rpl_parse', 'maxdb_errno', 'maxdb_error', 'maxdb_fetch_lengths', 'maxdb_field_tell', 'maxdb_get_host_info', 'maxdb_get_proto_info', 'maxdb_get_server_info', 'maxdb_get_server_version', 'maxdb_info', 'maxdb_init', 'maxdb_insert_id', 'maxdb_master_query', 'maxdb_more_results', 'maxdb_next_result', 'maxdb_num_fields', 'maxdb_num_rows', 'maxdb_rpl_parse_enabled', 'maxdb_rpl_probe', 'maxdb_select_db', 'maxdb_sqlstate', 'maxdb_stmt::result_metadata', 'maxdb_stmt_affected_rows', 'maxdb_stmt_errno', 'maxdb_stmt_error', 'maxdb_stmt_num_rows', 'maxdb_stmt_param_count', 'maxdb_stmt_result_metadata', 'maxdb_stmt_sqlstate', 'maxdb_thread_id', 'maxdb_use_result', 'maxdb_warning_count', 'mcrypt_enc_get_algorithms_name', 'mcrypt_enc_get_block_size', 'mcrypt_enc_get_iv_size', 'mcrypt_enc_get_key_size', 'mcrypt_enc_get_modes_name', 'mcrypt_enc_get_supported_key_sizes', 'mcrypt_enc_is_block_algorithm', 'mcrypt_enc_is_block_algorithm_mode', 'mcrypt_enc_is_block_mode', 'mcrypt_enc_self_test', 'mcrypt_generic', 'mcrypt_generic_deinit', 'mcrypt_generic_end', 'mcrypt_generic_init', 'mcrypt_module_close', 'mcrypt_module_open', 'mdecrypt_generic', 'mkdir', 'mqseries_back', 'mqseries_begin', 'mqseries_close', 'mqseries_cmit', 'mqseries_conn', 'mqseries_connx', 'mqseries_disc', 'mqseries_get', 'mqseries_inq', 'mqseries_open', 'mqseries_put', 'mqseries_put1', 'mqseries_set', 'msg_get_queue', 'msg_receive', 'msg_remove_queue', 'msg_send', 'msg_set_queue', 'msg_stat_queue', 'msql_affected_rows', 'msql_close', 'msql_connect', 'msql_create_db', 'msql_data_seek', 'msql_db_query', 'msql_drop_db', 'msql_fetch_array', 'msql_fetch_field', 'msql_fetch_object', 'msql_fetch_row', 'msql_field_flags', 'msql_field_len', 'msql_field_name', 'msql_field_seek', 'msql_field_table', 'msql_field_type', 'msql_free_result', 'msql_list_dbs', 'msql_list_fields', 'msql_list_tables', 'msql_num_fields', 'msql_num_rows', 'msql_pconnect', 'msql_query', 'msql_result', 'msql_select_db', 'mssql_bind', 'mssql_close', 'mssql_connect', 'mssql_data_seek', 'mssql_execute', 'mssql_fetch_array', 'mssql_fetch_assoc', 'mssql_fetch_batch', 'mssql_fetch_field', 'mssql_fetch_object', 'mssql_fetch_row', 'mssql_field_length', 'mssql_field_name', 'mssql_field_seek', 'mssql_field_type', 'mssql_free_result', 'mssql_free_statement', 'mssql_init', 'mssql_next_result', 'mssql_num_fields', 'mssql_num_rows', 'mssql_pconnect', 'mssql_query', 'mssql_result', 'mssql_rows_affected', 'mssql_select_db', 'mysql_affected_rows', 'mysql_client_encoding', 'mysql_close', 'mysql_connect', 'mysql_create_db', 'mysql_data_seek', 'mysql_db_name', 'mysql_db_query', 'mysql_drop_db', 'mysql_errno', 'mysql_error', 'mysql_fetch_array', 'mysql_fetch_assoc', 'mysql_fetch_field', 'mysql_fetch_lengths', 'mysql_fetch_object', 'mysql_fetch_row', 'mysql_field_flags', 'mysql_field_len', 'mysql_field_name', 'mysql_field_seek', 'mysql_field_table', 'mysql_field_type', 'mysql_free_result', 'mysql_get_host_info', 'mysql_get_proto_info', 'mysql_get_server_info', 'mysql_info', 'mysql_insert_id', 'mysql_list_dbs', 'mysql_list_fields', 'mysql_list_processes', 'mysql_list_tables', 'mysql_num_fields', 'mysql_num_rows', 'mysql_pconnect', 'mysql_ping', 'mysql_query', 'mysql_real_escape_string', 'mysql_result', 'mysql_select_db', 'mysql_set_charset', 'mysql_stat', 'mysql_tablename', 'mysql_thread_id', 'mysql_unbuffered_query', 'mysqlnd_uh_convert_to_mysqlnd', 'ncurses_bottom_panel', 'ncurses_del_panel', 'ncurses_delwin', 'ncurses_getmaxyx', 'ncurses_getyx', 'ncurses_hide_panel', 'ncurses_keypad', 'ncurses_meta', 'ncurses_move_panel', 'ncurses_mvwaddstr', 'ncurses_new_panel', 'ncurses_newpad', 'ncurses_newwin', 'ncurses_panel_above', 'ncurses_panel_below', 'ncurses_panel_window', 'ncurses_pnoutrefresh', 'ncurses_prefresh', 'ncurses_replace_panel', 'ncurses_show_panel', 'ncurses_top_panel', 'ncurses_waddch', 'ncurses_waddstr', 'ncurses_wattroff', 'ncurses_wattron', 'ncurses_wattrset', 'ncurses_wborder', 'ncurses_wclear', 'ncurses_wcolor_set', 'ncurses_werase', 'ncurses_wgetch', 'ncurses_whline', 'ncurses_wmouse_trafo', 'ncurses_wmove', 'ncurses_wnoutrefresh', 'ncurses_wrefresh', 'ncurses_wstandend', 'ncurses_wstandout', 'ncurses_wvline', 'newt_button', 'newt_button_bar', 'newt_checkbox', 'newt_checkbox_get_value', 'newt_checkbox_set_flags', 'newt_checkbox_set_value', 'newt_checkbox_tree', 'newt_checkbox_tree_add_item', 'newt_checkbox_tree_find_item', 'newt_checkbox_tree_get_current', 'newt_checkbox_tree_get_entry_value', 'newt_checkbox_tree_get_multi_selection', 'newt_checkbox_tree_get_selection', 'newt_checkbox_tree_multi', 'newt_checkbox_tree_set_current', 'newt_checkbox_tree_set_entry', 'newt_checkbox_tree_set_entry_value', 'newt_checkbox_tree_set_width', 'newt_compact_button', 'newt_component_add_callback', 'newt_component_takes_focus', 'newt_create_grid', 'newt_draw_form', 'newt_entry', 'newt_entry_get_value', 'newt_entry_set', 'newt_entry_set_filter', 'newt_entry_set_flags', 'newt_form', 'newt_form_add_component', 'newt_form_add_components', 'newt_form_add_hot_key', 'newt_form_destroy', 'newt_form_get_current', 'newt_form_run', 'newt_form_set_background', 'newt_form_set_height', 'newt_form_set_size', 'newt_form_set_timer', 'newt_form_set_width', 'newt_form_watch_fd', 'newt_grid_add_components_to_form', 'newt_grid_basic_window', 'newt_grid_free', 'newt_grid_get_size', 'newt_grid_h_close_stacked', 'newt_grid_h_stacked', 'newt_grid_place', 'newt_grid_set_field', 'newt_grid_simple_window', 'newt_grid_v_close_stacked', 'newt_grid_v_stacked', 'newt_grid_wrapped_window', 'newt_grid_wrapped_window_at', 'newt_label', 'newt_label_set_text', 'newt_listbox', 'newt_listbox_append_entry', 'newt_listbox_clear', 'newt_listbox_clear_selection', 'newt_listbox_delete_entry', 'newt_listbox_get_current', 'newt_listbox_get_selection', 'newt_listbox_insert_entry', 'newt_listbox_item_count', 'newt_listbox_select_item', 'newt_listbox_set_current', 'newt_listbox_set_current_by_key', 'newt_listbox_set_data', 'newt_listbox_set_entry', 'newt_listbox_set_width', 'newt_listitem', 'newt_listitem_get_data', 'newt_listitem_set', 'newt_radio_get_current', 'newt_radiobutton', 'newt_run_form', 'newt_scale', 'newt_scale_set', 'newt_scrollbar_set', 'newt_textbox', 'newt_textbox_get_num_lines', 'newt_textbox_reflowed', 'newt_textbox_set_height', 'newt_textbox_set_text', 'newt_vertical_scrollbar', 'oci_bind_array_by_name', 'oci_bind_by_name', 'oci_cancel', 'oci_close', 'oci_commit', 'oci_connect', 'oci_define_by_name', 'oci_error', 'oci_execute', 'oci_fetch', 'oci_fetch_all', 'oci_fetch_array', 'oci_fetch_assoc', 'oci_fetch_object', 'oci_fetch_row', 'oci_field_is_null', 'oci_field_name', 'oci_field_precision', 'oci_field_scale', 'oci_field_size', 'oci_field_type', 'oci_field_type_raw', 'oci_free_cursor', 'oci_free_statement', 'oci_get_implicit_resultset', 'oci_new_collection', 'oci_new_connect', 'oci_new_cursor', 'oci_new_descriptor', 'oci_num_fields', 'oci_num_rows', 'oci_parse', 'oci_pconnect', 'oci_register_taf_callback', 'oci_result', 'oci_rollback', 'oci_server_version', 'oci_set_action', 'oci_set_client_identifier', 'oci_set_client_info', 'oci_set_module_name', 'oci_set_prefetch', 'oci_statement_type', 'oci_unregister_taf_callback', 'odbc_autocommit', 'odbc_close', 'odbc_columnprivileges', 'odbc_columns', 'odbc_commit', 'odbc_connect', 'odbc_cursor', 'odbc_data_source', 'odbc_do', 'odbc_error', 'odbc_errormsg', 'odbc_exec', 'odbc_execute', 'odbc_fetch_array', 'odbc_fetch_into', 'odbc_fetch_row', 'odbc_field_len', 'odbc_field_name', 'odbc_field_num', 'odbc_field_precision', 'odbc_field_scale', 'odbc_field_type', 'odbc_foreignkeys', 'odbc_free_result', 'odbc_gettypeinfo', 'odbc_next_result', 'odbc_num_fields', 'odbc_num_rows', 'odbc_pconnect', 'odbc_prepare', 'odbc_primarykeys', 'odbc_procedurecolumns', 'odbc_procedures', 'odbc_result', 'odbc_result_all', 'odbc_rollback', 'odbc_setoption', 'odbc_specialcolumns', 'odbc_statistics', 'odbc_tableprivileges', 'odbc_tables', 'openal_buffer_create', 'openal_buffer_data', 'openal_buffer_destroy', 'openal_buffer_get', 'openal_buffer_loadwav', 'openal_context_create', 'openal_context_current', 'openal_context_destroy', 'openal_context_process', 'openal_context_suspend', 'openal_device_close', 'openal_device_open', 'openal_source_create', 'openal_source_destroy', 'openal_source_get', 'openal_source_pause', 'openal_source_play', 'openal_source_rewind', 'openal_source_set', 'openal_source_stop', 'openal_stream', 'opendir', 'openssl_csr_new', 'openssl_dh_compute_key', 'openssl_free_key', 'openssl_pkey_export', 'openssl_pkey_free', 'openssl_pkey_get_details', 'openssl_spki_new', 'openssl_x509_free', 'pclose', 'pfsockopen', 'pg_affected_rows', 'pg_cancel_query', 'pg_client_encoding', 'pg_close', 'pg_connect_poll', 'pg_connection_busy', 'pg_connection_reset', 'pg_connection_status', 'pg_consume_input', 'pg_convert', 'pg_copy_from', 'pg_copy_to', 'pg_dbname', 'pg_delete', 'pg_end_copy', 'pg_escape_bytea', 'pg_escape_identifier', 'pg_escape_literal', 'pg_escape_string', 'pg_execute', 'pg_fetch_all', 'pg_fetch_all_columns', 'pg_fetch_array', 'pg_fetch_assoc', 'pg_fetch_row', 'pg_field_name', 'pg_field_num', 'pg_field_size', 'pg_field_table', 'pg_field_type', 'pg_field_type_oid', 'pg_flush', 'pg_free_result', 'pg_get_notify', 'pg_get_pid', 'pg_get_result', 'pg_host', 'pg_insert', 'pg_last_error', 'pg_last_notice', 'pg_last_oid', 'pg_lo_close', 'pg_lo_create', 'pg_lo_export', 'pg_lo_import', 'pg_lo_open', 'pg_lo_read', 'pg_lo_read_all', 'pg_lo_seek', 'pg_lo_tell', 'pg_lo_truncate', 'pg_lo_unlink', 'pg_lo_write', 'pg_meta_data', 'pg_num_fields', 'pg_num_rows', 'pg_options', 'pg_parameter_status', 'pg_ping', 'pg_port', 'pg_prepare', 'pg_put_line', 'pg_query', 'pg_query_params', 'pg_result_error', 'pg_result_error_field', 'pg_result_seek', 'pg_result_status', 'pg_select', 'pg_send_execute', 'pg_send_prepare', 'pg_send_query', 'pg_send_query_params', 'pg_set_client_encoding', 'pg_set_error_verbosity', 'pg_socket', 'pg_trace', 'pg_transaction_status', 'pg_tty', 'pg_untrace', 'pg_update', 'pg_version', 'php_user_filter::filter', 'proc_close', 'proc_get_status', 'proc_terminate', 'ps_add_bookmark', 'ps_add_launchlink', 'ps_add_locallink', 'ps_add_note', 'ps_add_pdflink', 'ps_add_weblink', 'ps_arc', 'ps_arcn', 'ps_begin_page', 'ps_begin_pattern', 'ps_begin_template', 'ps_circle', 'ps_clip', 'ps_close', 'ps_close_image', 'ps_closepath', 'ps_closepath_stroke', 'ps_continue_text', 'ps_curveto', 'ps_delete', 'ps_end_page', 'ps_end_pattern', 'ps_end_template', 'ps_fill', 'ps_fill_stroke', 'ps_findfont', 'ps_get_buffer', 'ps_get_parameter', 'ps_get_value', 'ps_hyphenate', 'ps_include_file', 'ps_lineto', 'ps_makespotcolor', 'ps_moveto', 'ps_new', 'ps_open_file', 'ps_open_image', 'ps_open_image_file', 'ps_open_memory_image', 'ps_place_image', 'ps_rect', 'ps_restore', 'ps_rotate', 'ps_save', 'ps_scale', 'ps_set_border_color', 'ps_set_border_dash', 'ps_set_border_style', 'ps_set_info', 'ps_set_parameter', 'ps_set_text_pos', 'ps_set_value', 'ps_setcolor', 'ps_setdash', 'ps_setflat', 'ps_setfont', 'ps_setgray', 'ps_setlinecap', 'ps_setlinejoin', 'ps_setlinewidth', 'ps_setmiterlimit', 'ps_setoverprintmode', 'ps_setpolydash', 'ps_shading', 'ps_shading_pattern', 'ps_shfill', 'ps_show', 'ps_show2', 'ps_show_boxed', 'ps_show_xy', 'ps_show_xy2', 'ps_string_geometry', 'ps_stringwidth', 'ps_stroke', 'ps_symbol', 'ps_symbol_name', 'ps_symbol_width', 'ps_translate', 'px_close', 'px_create_fp', 'px_date2string', 'px_delete', 'px_delete_record', 'px_get_field', 'px_get_info', 'px_get_parameter', 'px_get_record', 'px_get_schema', 'px_get_value', 'px_insert_record', 'px_new', 'px_numfields', 'px_numrecords', 'px_open_fp', 'px_put_record', 'px_retrieve_record', 'px_set_blob_file', 'px_set_parameter', 'px_set_tablename', 'px_set_targetencoding', 'px_set_value', 'px_timestamp2string', 'px_update_record', 'radius_acct_open', 'radius_add_server', 'radius_auth_open', 'radius_close', 'radius_config', 'radius_create_request', 'radius_demangle', 'radius_demangle_mppe_key', 'radius_get_attr', 'radius_put_addr', 'radius_put_attr', 'radius_put_int', 'radius_put_string', 'radius_put_vendor_addr', 'radius_put_vendor_attr', 'radius_put_vendor_int', 'radius_put_vendor_string', 'radius_request_authenticator', 'radius_salt_encrypt_attr', 'radius_send_request', 'radius_server_secret', 'radius_strerror', 'readdir', 'readfile', 'recode_file', 'rename', 'rewind', 'rewinddir', 'rmdir', 'rpm_close', 'rpm_get_tag', 'rpm_open', 'sapi_windows_vt100_support', 'scandir', 'sem_acquire', 'sem_get', 'sem_release', 'sem_remove', 'set_file_buffer', 'shm_attach', 'shm_detach', 'shm_get_var', 'shm_has_var', 'shm_put_var', 'shm_remove', 'shm_remove_var', 'shmop_close', 'shmop_delete', 'shmop_open', 'shmop_read', 'shmop_size', 'shmop_write', 'socket_accept', 'socket_addrinfo_bind', 'socket_addrinfo_connect', 'socket_addrinfo_explain', 'socket_bind', 'socket_clear_error', 'socket_close', 'socket_connect', 'socket_export_stream', 'socket_get_option', 'socket_get_status', 'socket_getopt', 'socket_getpeername', 'socket_getsockname', 'socket_import_stream', 'socket_last_error', 'socket_listen', 'socket_read', 'socket_recv', 'socket_recvfrom', 'socket_recvmsg', 'socket_send', 'socket_sendmsg', 'socket_sendto', 'socket_set_block', 'socket_set_blocking', 'socket_set_nonblock', 'socket_set_option', 'socket_set_timeout', 'socket_shutdown', 'socket_write', 'sqlite_close', 'sqlite_fetch_string', 'sqlite_has_more', 'sqlite_open', 'sqlite_popen', 'sqlsrv_begin_transaction', 'sqlsrv_cancel', 'sqlsrv_client_info', 'sqlsrv_close', 'sqlsrv_commit', 'sqlsrv_connect', 'sqlsrv_execute', 'sqlsrv_fetch', 'sqlsrv_fetch_array', 'sqlsrv_fetch_object', 'sqlsrv_field_metadata', 'sqlsrv_free_stmt', 'sqlsrv_get_field', 'sqlsrv_has_rows', 'sqlsrv_next_result', 'sqlsrv_num_fields', 'sqlsrv_num_rows', 'sqlsrv_prepare', 'sqlsrv_query', 'sqlsrv_rollback', 'sqlsrv_rows_affected', 'sqlsrv_send_stream_data', 'sqlsrv_server_info', 'ssh2_auth_agent', 'ssh2_auth_hostbased_file', 'ssh2_auth_none', 'ssh2_auth_password', 'ssh2_auth_pubkey_file', 'ssh2_disconnect', 'ssh2_exec', 'ssh2_fetch_stream', 'ssh2_fingerprint', 'ssh2_methods_negotiated', 'ssh2_publickey_add', 'ssh2_publickey_init', 'ssh2_publickey_list', 'ssh2_publickey_remove', 'ssh2_scp_recv', 'ssh2_scp_send', 'ssh2_sftp', 'ssh2_sftp_chmod', 'ssh2_sftp_lstat', 'ssh2_sftp_mkdir', 'ssh2_sftp_readlink', 'ssh2_sftp_realpath', 'ssh2_sftp_rename', 'ssh2_sftp_rmdir', 'ssh2_sftp_stat', 'ssh2_sftp_symlink', 'ssh2_sftp_unlink', 'ssh2_shell', 'ssh2_tunnel', 'stomp_connect', 'streamWrapper::stream_cast', 'stream_bucket_append', 'stream_bucket_make_writeable', 'stream_bucket_new', 'stream_bucket_prepend', 'stream_context_create', 'stream_context_get_default', 'stream_context_get_options', 'stream_context_get_params', 'stream_context_set_default', 'stream_context_set_params', 'stream_copy_to_stream', 'stream_encoding', 'stream_filter_append', 'stream_filter_prepend', 'stream_filter_remove', 'stream_get_contents', 'stream_get_line', 'stream_get_meta_data', 'stream_isatty', 'stream_set_blocking', 'stream_set_chunk_size', 'stream_set_read_buffer', 'stream_set_timeout', 'stream_set_write_buffer', 'stream_socket_accept', 'stream_socket_client', 'stream_socket_enable_crypto', 'stream_socket_get_name', 'stream_socket_recvfrom', 'stream_socket_sendto', 'stream_socket_server', 'stream_socket_shutdown', 'stream_supports_lock', 'svn_fs_abort_txn', 'svn_fs_apply_text', 'svn_fs_begin_txn2', 'svn_fs_change_node_prop', 'svn_fs_check_path', 'svn_fs_contents_changed', 'svn_fs_copy', 'svn_fs_delete', 'svn_fs_dir_entries', 'svn_fs_file_contents', 'svn_fs_file_length', 'svn_fs_is_dir', 'svn_fs_is_file', 'svn_fs_make_dir', 'svn_fs_make_file', 'svn_fs_node_created_rev', 'svn_fs_node_prop', 'svn_fs_props_changed', 'svn_fs_revision_prop', 'svn_fs_revision_root', 'svn_fs_txn_root', 'svn_fs_youngest_rev', 'svn_repos_create', 'svn_repos_fs', 'svn_repos_fs_begin_txn_for_commit', 'svn_repos_fs_commit_txn', 'svn_repos_open', 'sybase_affected_rows', 'sybase_close', 'sybase_connect', 'sybase_data_seek', 'sybase_fetch_array', 'sybase_fetch_assoc', 'sybase_fetch_field', 'sybase_fetch_object', 'sybase_fetch_row', 'sybase_field_seek', 'sybase_free_result', 'sybase_num_fields', 'sybase_num_rows', 'sybase_pconnect', 'sybase_query', 'sybase_result', 'sybase_select_db', 'sybase_set_message_handler', 'sybase_unbuffered_query', 'tmpfile', 'udm_add_search_limit', 'udm_alloc_agent', 'udm_alloc_agent_array', 'udm_cat_list', 'udm_cat_path', 'udm_check_charset', 'udm_clear_search_limits', 'udm_crc32', 'udm_errno', 'udm_error', 'udm_find', 'udm_free_agent', 'udm_free_res', 'udm_get_doc_count', 'udm_get_res_field', 'udm_get_res_param', 'udm_hash32', 'udm_load_ispell_data', 'udm_set_agent_param', 'unlink', 'vfprintf', 'w32api_init_dtype', 'wddx_add_vars', 'wddx_packet_end', 'wddx_packet_start', 'xml_get_current_byte_index', 'xml_get_current_column_number', 'xml_get_current_line_number', 'xml_get_error_code', 'xml_parse', 'xml_parse_into_struct', 'xml_parser_create', 'xml_parser_create_ns', 'xml_parser_free', 'xml_parser_get_option', 'xml_parser_set_option', 'xml_set_character_data_handler', 'xml_set_default_handler', 'xml_set_element_handler', 'xml_set_end_namespace_decl_handler', 'xml_set_external_entity_ref_handler', 'xml_set_notation_decl_handler', 'xml_set_object', 'xml_set_processing_instruction_handler', 'xml_set_start_namespace_decl_handler', 'xml_set_unparsed_entity_decl_handler', 'xmlrpc_server_add_introspection_data', 'xmlrpc_server_call_method', 'xmlrpc_server_create', 'xmlrpc_server_destroy', 'xmlrpc_server_register_introspection_callback', 'xmlrpc_server_register_method', 'xmlwriter_end_attribute', 'xmlwriter_end_cdata', 'xmlwriter_end_comment', 'xmlwriter_end_document', 'xmlwriter_end_dtd', 'xmlwriter_end_dtd_attlist', 'xmlwriter_end_dtd_element', 'xmlwriter_end_dtd_entity', 'xmlwriter_end_element', 'xmlwriter_end_pi', 'xmlwriter_flush', 'xmlwriter_full_end_element', 'xmlwriter_open_memory', 'xmlwriter_open_uri', 'xmlwriter_output_memory', 'xmlwriter_set_indent', 'xmlwriter_set_indent_string', 'xmlwriter_start_attribute', 'xmlwriter_start_attribute_ns', 'xmlwriter_start_cdata', 'xmlwriter_start_comment', 'xmlwriter_start_document', 'xmlwriter_start_dtd', 'xmlwriter_start_dtd_attlist', 'xmlwriter_start_dtd_element', 'xmlwriter_start_dtd_entity', 'xmlwriter_start_element', 'xmlwriter_start_element_ns', 'xmlwriter_start_pi', 'xmlwriter_text', 'xmlwriter_write_attribute', 'xmlwriter_write_attribute_ns', 'xmlwriter_write_cdata', 'xmlwriter_write_comment', 'xmlwriter_write_dtd', 'xmlwriter_write_dtd_attlist', 'xmlwriter_write_dtd_element', 'xmlwriter_write_dtd_entity', 'xmlwriter_write_element', 'xmlwriter_write_element_ns', 'xmlwriter_write_pi', 'xmlwriter_write_raw', 'xslt_create', 'yaz_addinfo', 'yaz_ccl_conf', 'yaz_ccl_parse', 'yaz_close', 'yaz_database', 'yaz_element', 'yaz_errno', 'yaz_error', 'yaz_es', 'yaz_es_result', 'yaz_get_option', 'yaz_hits', 'yaz_itemorder', 'yaz_present', 'yaz_range', 'yaz_record', 'yaz_scan', 'yaz_scan_result', 'yaz_schema', 'yaz_search', 'yaz_sort', 'yaz_syntax', 'zip_close', 'zip_entry_close', 'zip_entry_compressedsize', 'zip_entry_compressionmethod', 'zip_entry_filesize', 'zip_entry_name', 'zip_entry_open', 'zip_entry_read', 'zip_open', 'zip_read'];
41246    }
41247}
41248Resource Operations
41249
41250Copyright (c) 2015-2020, Sebastian Bergmann <sebastian@phpunit.de>.
41251All rights reserved.
41252
41253Redistribution and use in source and binary forms, with or without
41254modification, are permitted provided that the following conditions
41255are met:
41256
41257 * Redistributions of source code must retain the above copyright
41258   notice, this list of conditions and the following disclaimer.
41259
41260 * Redistributions in binary form must reproduce the above copyright
41261   notice, this list of conditions and the following disclaimer in
41262   the documentation and/or other materials provided with the
41263   distribution.
41264
41265 * Neither the name of Sebastian Bergmann nor the names of his
41266   contributors may be used to endorse or promote products derived
41267   from this software without specific prior written permission.
41268
41269THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
41270"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
41271LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
41272FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
41273COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
41274INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
41275BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
41276LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
41277CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
41278LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
41279ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41280POSSIBILITY OF SUCH DAMAGE.
41281<?php
41282
41283declare (strict_types=1);
41284/*
41285 * This file is part of sebastian/code-unit.
41286 *
41287 * (c) Sebastian Bergmann <sebastian@phpunit.de>
41288 *
41289 * For the full copyright and license information, please view the LICENSE
41290 * file that was distributed with this source code.
41291 */
41292namespace PHPUnit\SebastianBergmann\CodeUnit;
41293
41294/**
41295 * @psalm-immutable
41296 */
41297final class FunctionUnit extends CodeUnit
41298{
41299    /**
41300     * @psalm-assert-if-true FunctionUnit $this
41301     */
41302    public function isFunction() : bool
41303    {
41304        return \true;
41305    }
41306}
41307<?php
41308
41309declare (strict_types=1);
41310/*
41311 * This file is part of sebastian/code-unit.
41312 *
41313 * (c) Sebastian Bergmann <sebastian@phpunit.de>
41314 *
41315 * For the full copyright and license information, please view the LICENSE
41316 * file that was distributed with this source code.
41317 */
41318namespace PHPUnit\SebastianBergmann\CodeUnit;
41319
41320use Iterator;
41321final class CodeUnitCollectionIterator implements Iterator
41322{
41323    /**
41324     * @psalm-var list<CodeUnit>
41325     */
41326    private $codeUnits;
41327    /**
41328     * @var int
41329     */
41330    private $position = 0;
41331    public function __construct(CodeUnitCollection $collection)
41332    {
41333        $this->codeUnits = $collection->asArray();
41334    }
41335    public function rewind() : void
41336    {
41337        $this->position = 0;
41338    }
41339    public function valid() : bool
41340    {
41341        return isset($this->codeUnits[$this->position]);
41342    }
41343    public function key() : int
41344    {
41345        return $this->position;
41346    }
41347    public function current() : CodeUnit
41348    {
41349        return $this->codeUnits[$this->position];
41350    }
41351    public function next() : void
41352    {
41353        $this->position++;
41354    }
41355}
41356<?php
41357
41358declare (strict_types=1);
41359/*
41360 * This file is part of sebastian/code-unit.
41361 *
41362 * (c) Sebastian Bergmann <sebastian@phpunit.de>
41363 *
41364 * For the full copyright and license information, please view the LICENSE
41365 * file that was distributed with this source code.
41366 */
41367namespace PHPUnit\SebastianBergmann\CodeUnit;
41368
41369use function array_keys;
41370use function array_merge;
41371use function array_unique;
41372use function array_values;
41373use function class_exists;
41374use function explode;
41375use function function_exists;
41376use function interface_exists;
41377use function ksort;
41378use function method_exists;
41379use function sort;
41380use function sprintf;
41381use function str_replace;
41382use function strpos;
41383use function trait_exists;
41384use ReflectionClass;
41385use ReflectionFunction;
41386use ReflectionMethod;
41387final class Mapper
41388{
41389    /**
41390     * @psalm-return array<string,list<int>>
41391     */
41392    public function codeUnitsToSourceLines(CodeUnitCollection $codeUnits) : array
41393    {
41394        $result = [];
41395        foreach ($codeUnits as $codeUnit) {
41396            $sourceFileName = $codeUnit->sourceFileName();
41397            if (!isset($result[$sourceFileName])) {
41398                $result[$sourceFileName] = [];
41399            }
41400            $result[$sourceFileName] = array_merge($result[$sourceFileName], $codeUnit->sourceLines());
41401        }
41402        foreach (array_keys($result) as $sourceFileName) {
41403            $result[$sourceFileName] = array_values(array_unique($result[$sourceFileName]));
41404            sort($result[$sourceFileName]);
41405        }
41406        ksort($result);
41407        return $result;
41408    }
41409    /**
41410     * @throws InvalidCodeUnitException
41411     * @throws ReflectionException
41412     */
41413    public function stringToCodeUnits(string $unit) : CodeUnitCollection
41414    {
41415        if (strpos($unit, '::') !== \false) {
41416            [$firstPart, $secondPart] = explode('::', $unit);
41417            if (empty($firstPart) && $this->isUserDefinedFunction($secondPart)) {
41418                return CodeUnitCollection::fromList(CodeUnit::forFunction($secondPart));
41419            }
41420            if ($this->isUserDefinedClass($firstPart)) {
41421                if ($secondPart === '<public>') {
41422                    return $this->publicMethodsOfClass($firstPart);
41423                }
41424                if ($secondPart === '<!public>') {
41425                    return $this->protectedAndPrivateMethodsOfClass($firstPart);
41426                }
41427                if ($secondPart === '<protected>') {
41428                    return $this->protectedMethodsOfClass($firstPart);
41429                }
41430                if ($secondPart === '<!protected>') {
41431                    return $this->publicAndPrivateMethodsOfClass($firstPart);
41432                }
41433                if ($secondPart === '<private>') {
41434                    return $this->privateMethodsOfClass($firstPart);
41435                }
41436                if ($secondPart === '<!private>') {
41437                    return $this->publicAndProtectedMethodsOfClass($firstPart);
41438                }
41439                if ($this->isUserDefinedMethod($firstPart, $secondPart)) {
41440                    return CodeUnitCollection::fromList(CodeUnit::forClassMethod($firstPart, $secondPart));
41441                }
41442            }
41443            if ($this->isUserDefinedInterface($firstPart)) {
41444                return CodeUnitCollection::fromList(CodeUnit::forInterfaceMethod($firstPart, $secondPart));
41445            }
41446            if ($this->isUserDefinedTrait($firstPart)) {
41447                return CodeUnitCollection::fromList(CodeUnit::forTraitMethod($firstPart, $secondPart));
41448            }
41449        } else {
41450            if ($this->isUserDefinedClass($unit)) {
41451                $units = [CodeUnit::forClass($unit)];
41452                foreach ($this->reflectorForClass($unit)->getTraits() as $trait) {
41453                    if (!$trait->isUserDefined()) {
41454                        // @codeCoverageIgnoreStart
41455                        continue;
41456                        // @codeCoverageIgnoreEnd
41457                    }
41458                    $units[] = CodeUnit::forTrait($trait->getName());
41459                }
41460                return CodeUnitCollection::fromArray($units);
41461            }
41462            if ($this->isUserDefinedInterface($unit)) {
41463                return CodeUnitCollection::fromList(CodeUnit::forInterface($unit));
41464            }
41465            if ($this->isUserDefinedTrait($unit)) {
41466                return CodeUnitCollection::fromList(CodeUnit::forTrait($unit));
41467            }
41468            if ($this->isUserDefinedFunction($unit)) {
41469                return CodeUnitCollection::fromList(CodeUnit::forFunction($unit));
41470            }
41471            $unit = str_replace('<extended>', '', $unit);
41472            if ($this->isUserDefinedClass($unit)) {
41473                return $this->classAndParentClassesAndTraits($unit);
41474            }
41475        }
41476        throw new InvalidCodeUnitException(sprintf('"%s" is not a valid code unit', $unit));
41477    }
41478    /**
41479     * @psalm-param class-string $className
41480     *
41481     * @throws ReflectionException
41482     */
41483    private function publicMethodsOfClass(string $className) : CodeUnitCollection
41484    {
41485        return $this->methodsOfClass($className, ReflectionMethod::IS_PUBLIC);
41486    }
41487    /**
41488     * @psalm-param class-string $className
41489     *
41490     * @throws ReflectionException
41491     */
41492    private function publicAndProtectedMethodsOfClass(string $className) : CodeUnitCollection
41493    {
41494        return $this->methodsOfClass($className, ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED);
41495    }
41496    /**
41497     * @psalm-param class-string $className
41498     *
41499     * @throws ReflectionException
41500     */
41501    private function publicAndPrivateMethodsOfClass(string $className) : CodeUnitCollection
41502    {
41503        return $this->methodsOfClass($className, ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PRIVATE);
41504    }
41505    /**
41506     * @psalm-param class-string $className
41507     *
41508     * @throws ReflectionException
41509     */
41510    private function protectedMethodsOfClass(string $className) : CodeUnitCollection
41511    {
41512        return $this->methodsOfClass($className, ReflectionMethod::IS_PROTECTED);
41513    }
41514    /**
41515     * @psalm-param class-string $className
41516     *
41517     * @throws ReflectionException
41518     */
41519    private function protectedAndPrivateMethodsOfClass(string $className) : CodeUnitCollection
41520    {
41521        return $this->methodsOfClass($className, ReflectionMethod::IS_PROTECTED | ReflectionMethod::IS_PRIVATE);
41522    }
41523    /**
41524     * @psalm-param class-string $className
41525     *
41526     * @throws ReflectionException
41527     */
41528    private function privateMethodsOfClass(string $className) : CodeUnitCollection
41529    {
41530        return $this->methodsOfClass($className, ReflectionMethod::IS_PRIVATE);
41531    }
41532    /**
41533     * @psalm-param class-string $className
41534     *
41535     * @throws ReflectionException
41536     */
41537    private function methodsOfClass(string $className, int $filter) : CodeUnitCollection
41538    {
41539        $units = [];
41540        foreach ($this->reflectorForClass($className)->getMethods($filter) as $method) {
41541            if (!$method->isUserDefined()) {
41542                continue;
41543            }
41544            $units[] = CodeUnit::forClassMethod($className, $method->getName());
41545        }
41546        return CodeUnitCollection::fromArray($units);
41547    }
41548    /**
41549     * @psalm-param class-string $className
41550     *
41551     * @throws ReflectionException
41552     */
41553    private function classAndParentClassesAndTraits(string $className) : CodeUnitCollection
41554    {
41555        $units = [CodeUnit::forClass($className)];
41556        $reflector = $this->reflectorForClass($className);
41557        foreach ($this->reflectorForClass($className)->getTraits() as $trait) {
41558            if (!$trait->isUserDefined()) {
41559                // @codeCoverageIgnoreStart
41560                continue;
41561                // @codeCoverageIgnoreEnd
41562            }
41563            $units[] = CodeUnit::forTrait($trait->getName());
41564        }
41565        while ($reflector = $reflector->getParentClass()) {
41566            if (!$reflector->isUserDefined()) {
41567                break;
41568            }
41569            $units[] = CodeUnit::forClass($reflector->getName());
41570            foreach ($reflector->getTraits() as $trait) {
41571                if (!$trait->isUserDefined()) {
41572                    // @codeCoverageIgnoreStart
41573                    continue;
41574                    // @codeCoverageIgnoreEnd
41575                }
41576                $units[] = CodeUnit::forTrait($trait->getName());
41577            }
41578        }
41579        return CodeUnitCollection::fromArray($units);
41580    }
41581    /**
41582     * @psalm-param class-string $className
41583     *
41584     * @throws ReflectionException
41585     */
41586    private function reflectorForClass(string $className) : ReflectionClass
41587    {
41588        try {
41589            return new ReflectionClass($className);
41590            // @codeCoverageIgnoreStart
41591        } catch (\ReflectionException $e) {
41592            throw new ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
41593        }
41594        // @codeCoverageIgnoreEnd
41595    }
41596    /**
41597     * @throws ReflectionException
41598     */
41599    private function isUserDefinedFunction(string $functionName) : bool
41600    {
41601        if (!function_exists($functionName)) {
41602            return \false;
41603        }
41604        try {
41605            return (new ReflectionFunction($functionName))->isUserDefined();
41606            // @codeCoverageIgnoreStart
41607        } catch (\ReflectionException $e) {
41608            throw new ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
41609        }
41610        // @codeCoverageIgnoreEnd
41611    }
41612    /**
41613     * @throws ReflectionException
41614     */
41615    private function isUserDefinedClass(string $className) : bool
41616    {
41617        if (!class_exists($className)) {
41618            return \false;
41619        }
41620        try {
41621            return (new ReflectionClass($className))->isUserDefined();
41622            // @codeCoverageIgnoreStart
41623        } catch (\ReflectionException $e) {
41624            throw new ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
41625        }
41626        // @codeCoverageIgnoreEnd
41627    }
41628    /**
41629     * @throws ReflectionException
41630     */
41631    private function isUserDefinedInterface(string $interfaceName) : bool
41632    {
41633        if (!interface_exists($interfaceName)) {
41634            return \false;
41635        }
41636        try {
41637            return (new ReflectionClass($interfaceName))->isUserDefined();
41638            // @codeCoverageIgnoreStart
41639        } catch (\ReflectionException $e) {
41640            throw new ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
41641        }
41642        // @codeCoverageIgnoreEnd
41643    }
41644    /**
41645     * @throws ReflectionException
41646     */
41647    private function isUserDefinedTrait(string $traitName) : bool
41648    {
41649        if (!trait_exists($traitName)) {
41650            return \false;
41651        }
41652        try {
41653            return (new ReflectionClass($traitName))->isUserDefined();
41654            // @codeCoverageIgnoreStart
41655        } catch (\ReflectionException $e) {
41656            throw new ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
41657        }
41658        // @codeCoverageIgnoreEnd
41659    }
41660    /**
41661     * @throws ReflectionException
41662     */
41663    private function isUserDefinedMethod(string $className, string $methodName) : bool
41664    {
41665        if (!class_exists($className)) {
41666            // @codeCoverageIgnoreStart
41667            return \false;
41668            // @codeCoverageIgnoreEnd
41669        }
41670        if (!method_exists($className, $methodName)) {
41671            // @codeCoverageIgnoreStart
41672            return \false;
41673            // @codeCoverageIgnoreEnd
41674        }
41675        try {
41676            return (new ReflectionMethod($className, $methodName))->isUserDefined();
41677            // @codeCoverageIgnoreStart
41678        } catch (\ReflectionException $e) {
41679            throw new ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
41680        }
41681        // @codeCoverageIgnoreEnd
41682    }
41683}
41684<?php
41685
41686declare (strict_types=1);
41687/*
41688 * This file is part of sebastian/code-unit.
41689 *
41690 * (c) Sebastian Bergmann <sebastian@phpunit.de>
41691 *
41692 * For the full copyright and license information, please view the LICENSE
41693 * file that was distributed with this source code.
41694 */
41695namespace PHPUnit\SebastianBergmann\CodeUnit;
41696
41697/**
41698 * @psalm-immutable
41699 */
41700final class InterfaceUnit extends CodeUnit
41701{
41702    /**
41703     * @psalm-assert-if-true InterfaceUnit $this
41704     */
41705    public function isInterface() : bool
41706    {
41707        return \true;
41708    }
41709}
41710<?php
41711
41712declare (strict_types=1);
41713/*
41714 * This file is part of sebastian/code-unit.
41715 *
41716 * (c) Sebastian Bergmann <sebastian@phpunit.de>
41717 *
41718 * For the full copyright and license information, please view the LICENSE
41719 * file that was distributed with this source code.
41720 */
41721namespace PHPUnit\SebastianBergmann\CodeUnit;
41722
41723use function range;
41724use function sprintf;
41725use ReflectionClass;
41726use ReflectionFunction;
41727use ReflectionMethod;
41728/**
41729 * @psalm-immutable
41730 */
41731abstract class CodeUnit
41732{
41733    /**
41734     * @var string
41735     */
41736    private $name;
41737    /**
41738     * @var string
41739     */
41740    private $sourceFileName;
41741    /**
41742     * @var array
41743     * @psalm-var list<int>
41744     */
41745    private $sourceLines;
41746    /**
41747     * @psalm-param class-string $className
41748     *
41749     * @throws InvalidCodeUnitException
41750     * @throws ReflectionException
41751     */
41752    public static function forClass(string $className) : ClassUnit
41753    {
41754        self::ensureUserDefinedClass($className);
41755        $reflector = self::reflectorForClass($className);
41756        return new ClassUnit($className, $reflector->getFileName(), range($reflector->getStartLine(), $reflector->getEndLine()));
41757    }
41758    /**
41759     * @psalm-param class-string $className
41760     *
41761     * @throws InvalidCodeUnitException
41762     * @throws ReflectionException
41763     */
41764    public static function forClassMethod(string $className, string $methodName) : ClassMethodUnit
41765    {
41766        self::ensureUserDefinedClass($className);
41767        $reflector = self::reflectorForClassMethod($className, $methodName);
41768        return new ClassMethodUnit($className . '::' . $methodName, $reflector->getFileName(), range($reflector->getStartLine(), $reflector->getEndLine()));
41769    }
41770    /**
41771     * @psalm-param class-string $interfaceName
41772     *
41773     * @throws InvalidCodeUnitException
41774     * @throws ReflectionException
41775     */
41776    public static function forInterface(string $interfaceName) : InterfaceUnit
41777    {
41778        self::ensureUserDefinedInterface($interfaceName);
41779        $reflector = self::reflectorForClass($interfaceName);
41780        return new InterfaceUnit($interfaceName, $reflector->getFileName(), range($reflector->getStartLine(), $reflector->getEndLine()));
41781    }
41782    /**
41783     * @psalm-param class-string $interfaceName
41784     *
41785     * @throws InvalidCodeUnitException
41786     * @throws ReflectionException
41787     */
41788    public static function forInterfaceMethod(string $interfaceName, string $methodName) : InterfaceMethodUnit
41789    {
41790        self::ensureUserDefinedInterface($interfaceName);
41791        $reflector = self::reflectorForClassMethod($interfaceName, $methodName);
41792        return new InterfaceMethodUnit($interfaceName . '::' . $methodName, $reflector->getFileName(), range($reflector->getStartLine(), $reflector->getEndLine()));
41793    }
41794    /**
41795     * @psalm-param class-string $traitName
41796     *
41797     * @throws InvalidCodeUnitException
41798     * @throws ReflectionException
41799     */
41800    public static function forTrait(string $traitName) : TraitUnit
41801    {
41802        self::ensureUserDefinedTrait($traitName);
41803        $reflector = self::reflectorForClass($traitName);
41804        return new TraitUnit($traitName, $reflector->getFileName(), range($reflector->getStartLine(), $reflector->getEndLine()));
41805    }
41806    /**
41807     * @psalm-param class-string $traitName
41808     *
41809     * @throws InvalidCodeUnitException
41810     * @throws ReflectionException
41811     */
41812    public static function forTraitMethod(string $traitName, string $methodName) : TraitMethodUnit
41813    {
41814        self::ensureUserDefinedTrait($traitName);
41815        $reflector = self::reflectorForClassMethod($traitName, $methodName);
41816        return new TraitMethodUnit($traitName . '::' . $methodName, $reflector->getFileName(), range($reflector->getStartLine(), $reflector->getEndLine()));
41817    }
41818    /**
41819     * @psalm-param callable-string $functionName
41820     *
41821     * @throws InvalidCodeUnitException
41822     * @throws ReflectionException
41823     */
41824    public static function forFunction(string $functionName) : FunctionUnit
41825    {
41826        $reflector = self::reflectorForFunction($functionName);
41827        if (!$reflector->isUserDefined()) {
41828            throw new InvalidCodeUnitException(sprintf('"%s" is not a user-defined function', $functionName));
41829        }
41830        return new FunctionUnit($functionName, $reflector->getFileName(), range($reflector->getStartLine(), $reflector->getEndLine()));
41831    }
41832    /**
41833     * @psalm-param list<int> $sourceLines
41834     */
41835    private function __construct(string $name, string $sourceFileName, array $sourceLines)
41836    {
41837        $this->name = $name;
41838        $this->sourceFileName = $sourceFileName;
41839        $this->sourceLines = $sourceLines;
41840    }
41841    public function name() : string
41842    {
41843        return $this->name;
41844    }
41845    public function sourceFileName() : string
41846    {
41847        return $this->sourceFileName;
41848    }
41849    /**
41850     * @psalm-return list<int>
41851     */
41852    public function sourceLines() : array
41853    {
41854        return $this->sourceLines;
41855    }
41856    public function isClass() : bool
41857    {
41858        return \false;
41859    }
41860    public function isClassMethod() : bool
41861    {
41862        return \false;
41863    }
41864    public function isInterface() : bool
41865    {
41866        return \false;
41867    }
41868    public function isInterfaceMethod() : bool
41869    {
41870        return \false;
41871    }
41872    public function isTrait() : bool
41873    {
41874        return \false;
41875    }
41876    public function isTraitMethod() : bool
41877    {
41878        return \false;
41879    }
41880    public function isFunction() : bool
41881    {
41882        return \false;
41883    }
41884    /**
41885     * @psalm-param class-string $className
41886     *
41887     * @throws InvalidCodeUnitException
41888     */
41889    private static function ensureUserDefinedClass(string $className) : void
41890    {
41891        try {
41892            $reflector = new ReflectionClass($className);
41893            if ($reflector->isInterface()) {
41894                throw new InvalidCodeUnitException(sprintf('"%s" is an interface and not a class', $className));
41895            }
41896            if ($reflector->isTrait()) {
41897                throw new InvalidCodeUnitException(sprintf('"%s" is a trait and not a class', $className));
41898            }
41899            if (!$reflector->isUserDefined()) {
41900                throw new InvalidCodeUnitException(sprintf('"%s" is not a user-defined class', $className));
41901            }
41902            // @codeCoverageIgnoreStart
41903        } catch (\ReflectionException $e) {
41904            throw new ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
41905        }
41906        // @codeCoverageIgnoreEnd
41907    }
41908    /**
41909     * @psalm-param class-string $interfaceName
41910     *
41911     * @throws InvalidCodeUnitException
41912     */
41913    private static function ensureUserDefinedInterface(string $interfaceName) : void
41914    {
41915        try {
41916            $reflector = new ReflectionClass($interfaceName);
41917            if (!$reflector->isInterface()) {
41918                throw new InvalidCodeUnitException(sprintf('"%s" is not an interface', $interfaceName));
41919            }
41920            if (!$reflector->isUserDefined()) {
41921                throw new InvalidCodeUnitException(sprintf('"%s" is not a user-defined interface', $interfaceName));
41922            }
41923            // @codeCoverageIgnoreStart
41924        } catch (\ReflectionException $e) {
41925            throw new ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
41926        }
41927        // @codeCoverageIgnoreEnd
41928    }
41929    /**
41930     * @psalm-param class-string $traitName
41931     *
41932     * @throws InvalidCodeUnitException
41933     */
41934    private static function ensureUserDefinedTrait(string $traitName) : void
41935    {
41936        try {
41937            $reflector = new ReflectionClass($traitName);
41938            if (!$reflector->isTrait()) {
41939                throw new InvalidCodeUnitException(sprintf('"%s" is not a trait', $traitName));
41940            }
41941            // @codeCoverageIgnoreStart
41942            if (!$reflector->isUserDefined()) {
41943                throw new InvalidCodeUnitException(sprintf('"%s" is not a user-defined trait', $traitName));
41944            }
41945        } catch (\ReflectionException $e) {
41946            throw new ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
41947        }
41948        // @codeCoverageIgnoreEnd
41949    }
41950    /**
41951     * @psalm-param class-string $className
41952     *
41953     * @throws ReflectionException
41954     */
41955    private static function reflectorForClass(string $className) : ReflectionClass
41956    {
41957        try {
41958            return new ReflectionClass($className);
41959            // @codeCoverageIgnoreStart
41960        } catch (\ReflectionException $e) {
41961            throw new ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
41962        }
41963        // @codeCoverageIgnoreEnd
41964    }
41965    /**
41966     * @psalm-param class-string $className
41967     *
41968     * @throws ReflectionException
41969     */
41970    private static function reflectorForClassMethod(string $className, string $methodName) : ReflectionMethod
41971    {
41972        try {
41973            return new ReflectionMethod($className, $methodName);
41974            // @codeCoverageIgnoreStart
41975        } catch (\ReflectionException $e) {
41976            throw new ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
41977        }
41978        // @codeCoverageIgnoreEnd
41979    }
41980    /**
41981     * @psalm-param callable-string $functionName
41982     *
41983     * @throws ReflectionException
41984     */
41985    private static function reflectorForFunction(string $functionName) : ReflectionFunction
41986    {
41987        try {
41988            return new ReflectionFunction($functionName);
41989            // @codeCoverageIgnoreStart
41990        } catch (\ReflectionException $e) {
41991            throw new ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
41992        }
41993        // @codeCoverageIgnoreEnd
41994    }
41995}
41996<?php
41997
41998declare (strict_types=1);
41999/*
42000 * This file is part of sebastian/code-unit.
42001 *
42002 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42003 *
42004 * For the full copyright and license information, please view the LICENSE
42005 * file that was distributed with this source code.
42006 */
42007namespace PHPUnit\SebastianBergmann\CodeUnit;
42008
42009/**
42010 * @psalm-immutable
42011 */
42012final class TraitUnit extends CodeUnit
42013{
42014    /**
42015     * @psalm-assert-if-true TraitUnit $this
42016     */
42017    public function isTrait() : bool
42018    {
42019        return \true;
42020    }
42021}
42022<?php
42023
42024declare (strict_types=1);
42025/*
42026 * This file is part of sebastian/code-unit.
42027 *
42028 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42029 *
42030 * For the full copyright and license information, please view the LICENSE
42031 * file that was distributed with this source code.
42032 */
42033namespace PHPUnit\SebastianBergmann\CodeUnit;
42034
42035/**
42036 * @psalm-immutable
42037 */
42038final class InterfaceMethodUnit extends CodeUnit
42039{
42040    /**
42041     * @psalm-assert-if-true InterfaceMethod $this
42042     */
42043    public function isInterfaceMethod() : bool
42044    {
42045        return \true;
42046    }
42047}
42048<?php
42049
42050declare (strict_types=1);
42051/*
42052 * This file is part of sebastian/code-unit.
42053 *
42054 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42055 *
42056 * For the full copyright and license information, please view the LICENSE
42057 * file that was distributed with this source code.
42058 */
42059namespace PHPUnit\SebastianBergmann\CodeUnit;
42060
42061/**
42062 * @psalm-immutable
42063 */
42064final class ClassMethodUnit extends CodeUnit
42065{
42066    /**
42067     * @psalm-assert-if-true ClassMethodUnit $this
42068     */
42069    public function isClassMethod() : bool
42070    {
42071        return \true;
42072    }
42073}
42074<?php
42075
42076declare (strict_types=1);
42077/*
42078 * This file is part of sebastian/code-unit.
42079 *
42080 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42081 *
42082 * For the full copyright and license information, please view the LICENSE
42083 * file that was distributed with this source code.
42084 */
42085namespace PHPUnit\SebastianBergmann\CodeUnit;
42086
42087use RuntimeException;
42088final class NoTraitException extends RuntimeException implements Exception
42089{
42090}
42091<?php
42092
42093declare (strict_types=1);
42094/*
42095 * This file is part of sebastian/code-unit.
42096 *
42097 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42098 *
42099 * For the full copyright and license information, please view the LICENSE
42100 * file that was distributed with this source code.
42101 */
42102namespace PHPUnit\SebastianBergmann\CodeUnit;
42103
42104use RuntimeException;
42105final class ReflectionException extends RuntimeException implements Exception
42106{
42107}
42108<?php
42109
42110declare (strict_types=1);
42111/*
42112 * This file is part of sebastian/code-unit.
42113 *
42114 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42115 *
42116 * For the full copyright and license information, please view the LICENSE
42117 * file that was distributed with this source code.
42118 */
42119namespace PHPUnit\SebastianBergmann\CodeUnit;
42120
42121use Throwable;
42122interface Exception extends Throwable
42123{
42124}
42125<?php
42126
42127declare (strict_types=1);
42128/*
42129 * This file is part of sebastian/code-unit.
42130 *
42131 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42132 *
42133 * For the full copyright and license information, please view the LICENSE
42134 * file that was distributed with this source code.
42135 */
42136namespace PHPUnit\SebastianBergmann\CodeUnit;
42137
42138use RuntimeException;
42139final class InvalidCodeUnitException extends RuntimeException implements Exception
42140{
42141}
42142<?php
42143
42144declare (strict_types=1);
42145/*
42146 * This file is part of sebastian/code-unit.
42147 *
42148 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42149 *
42150 * For the full copyright and license information, please view the LICENSE
42151 * file that was distributed with this source code.
42152 */
42153namespace PHPUnit\SebastianBergmann\CodeUnit;
42154
42155/**
42156 * @psalm-immutable
42157 */
42158final class ClassUnit extends CodeUnit
42159{
42160    /**
42161     * @psalm-assert-if-true ClassUnit $this
42162     */
42163    public function isClass() : bool
42164    {
42165        return \true;
42166    }
42167}
42168<?php
42169
42170declare (strict_types=1);
42171/*
42172 * This file is part of sebastian/code-unit.
42173 *
42174 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42175 *
42176 * For the full copyright and license information, please view the LICENSE
42177 * file that was distributed with this source code.
42178 */
42179namespace PHPUnit\SebastianBergmann\CodeUnit;
42180
42181/**
42182 * @psalm-immutable
42183 */
42184final class TraitMethodUnit extends CodeUnit
42185{
42186    /**
42187     * @psalm-assert-if-true TraitMethodUnit $this
42188     */
42189    public function isTraitMethod() : bool
42190    {
42191        return \true;
42192    }
42193}
42194sebastian/code-unit
42195
42196Copyright (c) 2020, Sebastian Bergmann <sebastian@phpunit.de>.
42197All rights reserved.
42198
42199Redistribution and use in source and binary forms, with or without
42200modification, are permitted provided that the following conditions
42201are met:
42202
42203 * Redistributions of source code must retain the above copyright
42204   notice, this list of conditions and the following disclaimer.
42205
42206 * Redistributions in binary form must reproduce the above copyright
42207   notice, this list of conditions and the following disclaimer in
42208   the documentation and/or other materials provided with the
42209   distribution.
42210
42211 * Neither the name of Sebastian Bergmann nor the names of his
42212   contributors may be used to endorse or promote products derived
42213   from this software without specific prior written permission.
42214
42215THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
42216"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
42217LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
42218FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
42219COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
42220INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
42221BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
42222LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
42223CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
42224LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
42225ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
42226POSSIBILITY OF SUCH DAMAGE.
42227<?php
42228
42229declare (strict_types=1);
42230/*
42231 * This file is part of sebastian/code-unit.
42232 *
42233 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42234 *
42235 * For the full copyright and license information, please view the LICENSE
42236 * file that was distributed with this source code.
42237 */
42238namespace PHPUnit\SebastianBergmann\CodeUnit;
42239
42240use function array_merge;
42241use function count;
42242use Countable;
42243use IteratorAggregate;
42244final class CodeUnitCollection implements Countable, IteratorAggregate
42245{
42246    /**
42247     * @psalm-var list<CodeUnit>
42248     */
42249    private $codeUnits = [];
42250    /**
42251     * @psalm-param list<CodeUnit> $items
42252     */
42253    public static function fromArray(array $items) : self
42254    {
42255        $collection = new self();
42256        foreach ($items as $item) {
42257            $collection->add($item);
42258        }
42259        return $collection;
42260    }
42261    public static function fromList(CodeUnit ...$items) : self
42262    {
42263        return self::fromArray($items);
42264    }
42265    private function __construct()
42266    {
42267    }
42268    /**
42269     * @psalm-return list<CodeUnit>
42270     */
42271    public function asArray() : array
42272    {
42273        return $this->codeUnits;
42274    }
42275    public function getIterator() : CodeUnitCollectionIterator
42276    {
42277        return new CodeUnitCollectionIterator($this);
42278    }
42279    public function count() : int
42280    {
42281        return count($this->codeUnits);
42282    }
42283    public function isEmpty() : bool
42284    {
42285        return empty($this->codeUnits);
42286    }
42287    public function mergeWith(self $other) : self
42288    {
42289        return self::fromArray(array_merge($this->asArray(), $other->asArray()));
42290    }
42291    private function add(CodeUnit $item) : void
42292    {
42293        $this->codeUnits[] = $item;
42294    }
42295}
42296<?php
42297namespace PHPSTORM_META {
42298
42299    override(
42300        \PHPUnit\Framework\TestCase::createMock(0),
42301        map([""=>"$0"])
42302    );
42303
42304    override(
42305        \PHPUnit\Framework\TestCase::createStub(0),
42306        map([""=>"$0"])
42307    );
42308
42309    override(
42310        \PHPUnit\Framework\TestCase::createConfiguredMock(0),
42311        map([""=>"$0"])
42312    );
42313
42314    override(
42315        \PHPUnit\Framework\TestCase::createPartialMock(0),
42316        map([""=>"$0"])
42317    );
42318
42319    override(
42320        \PHPUnit\Framework\TestCase::createTestProxy(0),
42321        map([""=>"$0"])
42322    );
42323
42324    override(
42325        \PHPUnit\Framework\TestCase::getMockForAbstractClass(0),
42326        map([""=>"$0"])
42327    );
42328}
42329<?php
42330
42331declare (strict_types=1);
42332/*
42333 * This file is part of phpunit/php-code-coverage.
42334 *
42335 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42336 *
42337 * For the full copyright and license information, please view the LICENSE
42338 * file that was distributed with this source code.
42339 */
42340namespace PHPUnit\SebastianBergmann\CodeCoverage\Driver;
42341
42342use RuntimeException;
42343use PHPUnit\SebastianBergmann\CodeCoverage\Exception;
42344final class WrongXdebugVersionException extends RuntimeException implements Exception
42345{
42346}
42347<?php
42348
42349declare (strict_types=1);
42350/*
42351 * This file is part of phpunit/php-code-coverage.
42352 *
42353 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42354 *
42355 * For the full copyright and license information, please view the LICENSE
42356 * file that was distributed with this source code.
42357 */
42358namespace PHPUnit\SebastianBergmann\CodeCoverage\Driver;
42359
42360use RuntimeException;
42361use PHPUnit\SebastianBergmann\CodeCoverage\Exception;
42362final class PhpdbgNotAvailableException extends RuntimeException implements Exception
42363{
42364    public function __construct()
42365    {
42366        parent::__construct('The PHPDBG SAPI is not available');
42367    }
42368}
42369<?php
42370
42371declare (strict_types=1);
42372/*
42373 * This file is part of phpunit/php-code-coverage.
42374 *
42375 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42376 *
42377 * For the full copyright and license information, please view the LICENSE
42378 * file that was distributed with this source code.
42379 */
42380namespace PHPUnit\SebastianBergmann\CodeCoverage;
42381
42382use RuntimeException;
42383final class NoCodeCoverageDriverAvailableException extends RuntimeException implements Exception
42384{
42385    public function __construct()
42386    {
42387        parent::__construct('No code coverage driver available');
42388    }
42389}
42390<?php
42391
42392declare (strict_types=1);
42393/*
42394 * This file is part of phpunit/php-code-coverage.
42395 *
42396 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42397 *
42398 * For the full copyright and license information, please view the LICENSE
42399 * file that was distributed with this source code.
42400 */
42401namespace PHPUnit\SebastianBergmann\CodeCoverage;
42402
42403use RuntimeException;
42404final class XmlException extends RuntimeException implements Exception
42405{
42406}
42407<?php
42408
42409declare (strict_types=1);
42410/*
42411 * This file is part of phpunit/php-code-coverage.
42412 *
42413 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42414 *
42415 * For the full copyright and license information, please view the LICENSE
42416 * file that was distributed with this source code.
42417 */
42418namespace PHPUnit\SebastianBergmann\CodeCoverage;
42419
42420use RuntimeException;
42421final class ReportAlreadyFinalizedException extends RuntimeException implements Exception
42422{
42423    public function __construct()
42424    {
42425        parent::__construct('The code coverage report has already been finalized');
42426    }
42427}
42428<?php
42429
42430declare (strict_types=1);
42431/*
42432 * This file is part of phpunit/php-code-coverage.
42433 *
42434 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42435 *
42436 * For the full copyright and license information, please view the LICENSE
42437 * file that was distributed with this source code.
42438 */
42439namespace PHPUnit\SebastianBergmann\CodeCoverage\Driver;
42440
42441use RuntimeException;
42442use PHPUnit\SebastianBergmann\CodeCoverage\Exception;
42443final class XdebugNotAvailableException extends RuntimeException implements Exception
42444{
42445    public function __construct()
42446    {
42447        parent::__construct('The Xdebug extension is not available');
42448    }
42449}
42450<?php
42451
42452declare (strict_types=1);
42453/*
42454 * This file is part of phpunit/php-code-coverage.
42455 *
42456 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42457 *
42458 * For the full copyright and license information, please view the LICENSE
42459 * file that was distributed with this source code.
42460 */
42461namespace PHPUnit\SebastianBergmann\CodeCoverage\Driver;
42462
42463use function sprintf;
42464use RuntimeException;
42465use PHPUnit\SebastianBergmann\CodeCoverage\Exception;
42466final class WriteOperationFailedException extends RuntimeException implements Exception
42467{
42468    public function __construct(string $path)
42469    {
42470        parent::__construct(sprintf('Cannot write to "%s"', $path));
42471    }
42472}
42473<?php
42474
42475declare (strict_types=1);
42476/*
42477 * This file is part of phpunit/php-code-coverage.
42478 *
42479 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42480 *
42481 * For the full copyright and license information, please view the LICENSE
42482 * file that was distributed with this source code.
42483 */
42484namespace PHPUnit\SebastianBergmann\CodeCoverage;
42485
42486use RuntimeException;
42487final class DirectoryCouldNotBeCreatedException extends RuntimeException implements Exception
42488{
42489}
42490<?php
42491
42492declare (strict_types=1);
42493/*
42494 * This file is part of phpunit/php-code-coverage.
42495 *
42496 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42497 *
42498 * For the full copyright and license information, please view the LICENSE
42499 * file that was distributed with this source code.
42500 */
42501namespace PHPUnit\SebastianBergmann\CodeCoverage;
42502
42503use RuntimeException;
42504final class DeadCodeDetectionNotSupportedException extends RuntimeException implements Exception
42505{
42506}
42507<?php
42508
42509declare (strict_types=1);
42510/*
42511 * This file is part of phpunit/php-code-coverage.
42512 *
42513 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42514 *
42515 * For the full copyright and license information, please view the LICENSE
42516 * file that was distributed with this source code.
42517 */
42518namespace PHPUnit\SebastianBergmann\CodeCoverage\Driver;
42519
42520use RuntimeException;
42521use PHPUnit\SebastianBergmann\CodeCoverage\Exception;
42522final class Xdebug2NotEnabledException extends RuntimeException implements Exception
42523{
42524    public function __construct()
42525    {
42526        parent::__construct('xdebug.coverage_enable=On has to be set');
42527    }
42528}
42529<?php
42530
42531declare (strict_types=1);
42532/*
42533 * This file is part of phpunit/php-code-coverage.
42534 *
42535 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42536 *
42537 * For the full copyright and license information, please view the LICENSE
42538 * file that was distributed with this source code.
42539 */
42540namespace PHPUnit\SebastianBergmann\CodeCoverage;
42541
42542use RuntimeException;
42543final class TestIdMissingException extends RuntimeException implements Exception
42544{
42545    public function __construct()
42546    {
42547        parent::__construct('Test ID is missing');
42548    }
42549}
42550<?php
42551
42552declare (strict_types=1);
42553/*
42554 * This file is part of phpunit/php-code-coverage.
42555 *
42556 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42557 *
42558 * For the full copyright and license information, please view the LICENSE
42559 * file that was distributed with this source code.
42560 */
42561namespace PHPUnit\SebastianBergmann\CodeCoverage;
42562
42563use RuntimeException;
42564final class ReflectionException extends RuntimeException implements Exception
42565{
42566}
42567<?php
42568
42569declare (strict_types=1);
42570/*
42571 * This file is part of phpunit/php-code-coverage.
42572 *
42573 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42574 *
42575 * For the full copyright and license information, please view the LICENSE
42576 * file that was distributed with this source code.
42577 */
42578namespace PHPUnit\SebastianBergmann\CodeCoverage\Driver;
42579
42580use RuntimeException;
42581use PHPUnit\SebastianBergmann\CodeCoverage\Exception;
42582final class Xdebug3NotEnabledException extends RuntimeException implements Exception
42583{
42584    public function __construct()
42585    {
42586        parent::__construct('XDEBUG_MODE=coverage or xdebug.mode=coverage has to be set');
42587    }
42588}
42589<?php
42590
42591declare (strict_types=1);
42592/*
42593 * This file is part of phpunit/php-code-coverage.
42594 *
42595 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42596 *
42597 * For the full copyright and license information, please view the LICENSE
42598 * file that was distributed with this source code.
42599 */
42600namespace PHPUnit\SebastianBergmann\CodeCoverage;
42601
42602use RuntimeException;
42603final class NoCodeCoverageDriverWithPathCoverageSupportAvailableException extends RuntimeException implements Exception
42604{
42605    public function __construct()
42606    {
42607        parent::__construct('No code coverage driver with path coverage support available');
42608    }
42609}
42610<?php
42611
42612declare (strict_types=1);
42613/*
42614 * This file is part of phpunit/php-code-coverage.
42615 *
42616 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42617 *
42618 * For the full copyright and license information, please view the LICENSE
42619 * file that was distributed with this source code.
42620 */
42621namespace PHPUnit\SebastianBergmann\CodeCoverage;
42622
42623use Throwable;
42624interface Exception extends Throwable
42625{
42626}
42627<?php
42628
42629declare (strict_types=1);
42630/*
42631 * This file is part of phpunit/php-code-coverage.
42632 *
42633 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42634 *
42635 * For the full copyright and license information, please view the LICENSE
42636 * file that was distributed with this source code.
42637 */
42638namespace PHPUnit\SebastianBergmann\CodeCoverage\Driver;
42639
42640use RuntimeException;
42641use PHPUnit\SebastianBergmann\CodeCoverage\Exception;
42642final class PcovNotAvailableException extends RuntimeException implements Exception
42643{
42644    public function __construct()
42645    {
42646        parent::__construct('The PCOV extension is not available');
42647    }
42648}
42649<?php
42650
42651declare (strict_types=1);
42652/*
42653 * This file is part of phpunit/php-code-coverage.
42654 *
42655 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42656 *
42657 * For the full copyright and license information, please view the LICENSE
42658 * file that was distributed with this source code.
42659 */
42660namespace PHPUnit\SebastianBergmann\CodeCoverage\Driver;
42661
42662use function sprintf;
42663use RuntimeException;
42664use PHPUnit\SebastianBergmann\CodeCoverage\Exception;
42665final class PathExistsButIsNotDirectoryException extends RuntimeException implements Exception
42666{
42667    public function __construct(string $path)
42668    {
42669        parent::__construct(sprintf('"%s" exists but is not a directory', $path));
42670    }
42671}
42672<?php
42673
42674declare (strict_types=1);
42675/*
42676 * This file is part of phpunit/php-code-coverage.
42677 *
42678 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42679 *
42680 * For the full copyright and license information, please view the LICENSE
42681 * file that was distributed with this source code.
42682 */
42683namespace PHPUnit\SebastianBergmann\CodeCoverage;
42684
42685use RuntimeException;
42686final class StaticAnalysisCacheNotConfiguredException extends RuntimeException implements Exception
42687{
42688}
42689<?php
42690
42691declare (strict_types=1);
42692/*
42693 * This file is part of phpunit/php-code-coverage.
42694 *
42695 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42696 *
42697 * For the full copyright and license information, please view the LICENSE
42698 * file that was distributed with this source code.
42699 */
42700namespace PHPUnit\SebastianBergmann\CodeCoverage;
42701
42702use RuntimeException;
42703final class UnintentionallyCoveredCodeException extends RuntimeException implements Exception
42704{
42705    /**
42706     * @var array
42707     */
42708    private $unintentionallyCoveredUnits;
42709    public function __construct(array $unintentionallyCoveredUnits)
42710    {
42711        $this->unintentionallyCoveredUnits = $unintentionallyCoveredUnits;
42712        parent::__construct($this->toString());
42713    }
42714    public function getUnintentionallyCoveredUnits() : array
42715    {
42716        return $this->unintentionallyCoveredUnits;
42717    }
42718    private function toString() : string
42719    {
42720        $message = '';
42721        foreach ($this->unintentionallyCoveredUnits as $unit) {
42722            $message .= '- ' . $unit . "\n";
42723        }
42724        return $message;
42725    }
42726}
42727<?php
42728
42729declare (strict_types=1);
42730/*
42731 * This file is part of phpunit/php-code-coverage.
42732 *
42733 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42734 *
42735 * For the full copyright and license information, please view the LICENSE
42736 * file that was distributed with this source code.
42737 */
42738namespace PHPUnit\SebastianBergmann\CodeCoverage;
42739
42740use RuntimeException;
42741final class BranchAndPathCoverageNotSupportedException extends RuntimeException implements Exception
42742{
42743}
42744<?php
42745
42746declare (strict_types=1);
42747/*
42748 * This file is part of phpunit/php-code-coverage.
42749 *
42750 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42751 *
42752 * For the full copyright and license information, please view the LICENSE
42753 * file that was distributed with this source code.
42754 */
42755namespace PHPUnit\SebastianBergmann\CodeCoverage;
42756
42757final class InvalidArgumentException extends \InvalidArgumentException implements Exception
42758{
42759}
42760<?php
42761
42762declare (strict_types=1);
42763/*
42764 * This file is part of phpunit/php-code-coverage.
42765 *
42766 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42767 *
42768 * For the full copyright and license information, please view the LICENSE
42769 * file that was distributed with this source code.
42770 */
42771namespace PHPUnit\SebastianBergmann\CodeCoverage;
42772
42773use RuntimeException;
42774final class ParserException extends RuntimeException implements Exception
42775{
42776}
42777<?php
42778
42779declare (strict_types=1);
42780/*
42781 * This file is part of phpunit/php-code-coverage.
42782 *
42783 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42784 *
42785 * For the full copyright and license information, please view the LICENSE
42786 * file that was distributed with this source code.
42787 */
42788namespace PHPUnit\SebastianBergmann\CodeCoverage;
42789
42790use function sprintf;
42791/**
42792 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
42793 */
42794final class Percentage
42795{
42796    /**
42797     * @var float
42798     */
42799    private $fraction;
42800    /**
42801     * @var float
42802     */
42803    private $total;
42804    public static function fromFractionAndTotal(float $fraction, float $total) : self
42805    {
42806        return new self($fraction, $total);
42807    }
42808    private function __construct(float $fraction, float $total)
42809    {
42810        $this->fraction = $fraction;
42811        $this->total = $total;
42812    }
42813    public function asFloat() : float
42814    {
42815        if ($this->total > 0) {
42816            return $this->fraction / $this->total * 100;
42817        }
42818        return 100.0;
42819    }
42820    public function asString() : string
42821    {
42822        if ($this->total > 0) {
42823            return sprintf('%01.2F%%', $this->asFloat());
42824        }
42825        return '';
42826    }
42827    public function asFixedWidthString() : string
42828    {
42829        if ($this->total > 0) {
42830            return sprintf('%6.2F%%', $this->asFloat());
42831        }
42832        return '';
42833    }
42834}
42835<?php
42836
42837declare (strict_types=1);
42838/*
42839 * This file is part of phpunit/php-code-coverage.
42840 *
42841 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42842 *
42843 * For the full copyright and license information, please view the LICENSE
42844 * file that was distributed with this source code.
42845 */
42846namespace PHPUnit\SebastianBergmann\CodeCoverage;
42847
42848use function array_keys;
42849use function is_file;
42850use function realpath;
42851use function strpos;
42852use PHPUnit\SebastianBergmann\FileIterator\Facade as FileIteratorFacade;
42853final class Filter
42854{
42855    /**
42856     * @psalm-var array<string,true>
42857     */
42858    private $files = [];
42859    /**
42860     * @psalm-var array<string,bool>
42861     */
42862    private $isFileCache = [];
42863    public function includeDirectory(string $directory, string $suffix = '.php', string $prefix = '') : void
42864    {
42865        foreach ((new FileIteratorFacade())->getFilesAsArray($directory, $suffix, $prefix) as $file) {
42866            $this->includeFile($file);
42867        }
42868    }
42869    /**
42870     * @psalm-param list<string> $files
42871     */
42872    public function includeFiles(array $filenames) : void
42873    {
42874        foreach ($filenames as $filename) {
42875            $this->includeFile($filename);
42876        }
42877    }
42878    public function includeFile(string $filename) : void
42879    {
42880        $filename = realpath($filename);
42881        if (!$filename) {
42882            return;
42883        }
42884        $this->files[$filename] = \true;
42885    }
42886    public function excludeDirectory(string $directory, string $suffix = '.php', string $prefix = '') : void
42887    {
42888        foreach ((new FileIteratorFacade())->getFilesAsArray($directory, $suffix, $prefix) as $file) {
42889            $this->excludeFile($file);
42890        }
42891    }
42892    public function excludeFile(string $filename) : void
42893    {
42894        $filename = realpath($filename);
42895        if (!$filename || !isset($this->files[$filename])) {
42896            return;
42897        }
42898        unset($this->files[$filename]);
42899    }
42900    public function isFile(string $filename) : bool
42901    {
42902        if (isset($this->isFileCache[$filename])) {
42903            return $this->isFileCache[$filename];
42904        }
42905        if ($filename === '-' || strpos($filename, 'vfs://') === 0 || strpos($filename, 'xdebug://debug-eval') !== \false || strpos($filename, 'eval()\'d code') !== \false || strpos($filename, 'runtime-created function') !== \false || strpos($filename, 'runkit created function') !== \false || strpos($filename, 'assert code') !== \false || strpos($filename, 'regexp code') !== \false || strpos($filename, 'Standard input code') !== \false) {
42906            $isFile = \false;
42907        } else {
42908            $isFile = is_file($filename);
42909        }
42910        $this->isFileCache[$filename] = $isFile;
42911        return $isFile;
42912    }
42913    public function isExcluded(string $filename) : bool
42914    {
42915        if (!$this->isFile($filename)) {
42916            return \true;
42917        }
42918        return !isset($this->files[$filename]);
42919    }
42920    /**
42921     * @psalm-return list<string>
42922     */
42923    public function files() : array
42924    {
42925        return array_keys($this->files);
42926    }
42927    public function isEmpty() : bool
42928    {
42929        return empty($this->files);
42930    }
42931}
42932<?php
42933
42934declare (strict_types=1);
42935/*
42936 * This file is part of phpunit/php-code-coverage.
42937 *
42938 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42939 *
42940 * For the full copyright and license information, please view the LICENSE
42941 * file that was distributed with this source code.
42942 */
42943namespace PHPUnit\SebastianBergmann\CodeCoverage\Driver;
42944
42945use function extension_loaded;
42946use function phpversion;
42947use PHPUnit\SebastianBergmann\CodeCoverage\Filter;
42948use PHPUnit\SebastianBergmann\CodeCoverage\RawCodeCoverageData;
42949/**
42950 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
42951 */
42952final class PcovDriver extends Driver
42953{
42954    /**
42955     * @var Filter
42956     */
42957    private $filter;
42958    /**
42959     * @throws PcovNotAvailableException
42960     */
42961    public function __construct(Filter $filter)
42962    {
42963        if (!extension_loaded('pcov')) {
42964            throw new PcovNotAvailableException();
42965        }
42966        $this->filter = $filter;
42967    }
42968    public function start() : void
42969    {
42970        \pcov\start();
42971    }
42972    public function stop() : RawCodeCoverageData
42973    {
42974        \pcov\stop();
42975        $collect = \pcov\collect(\pcov\inclusive, !$this->filter->isEmpty() ? $this->filter->files() : \pcov\waiting());
42976        \pcov\clear();
42977        return RawCodeCoverageData::fromXdebugWithoutPathCoverage($collect);
42978    }
42979    public function nameAndVersion() : string
42980    {
42981        return 'PCOV ' . phpversion('pcov');
42982    }
42983}
42984<?php
42985
42986declare (strict_types=1);
42987/*
42988 * This file is part of phpunit/php-code-coverage.
42989 *
42990 * (c) Sebastian Bergmann <sebastian@phpunit.de>
42991 *
42992 * For the full copyright and license information, please view the LICENSE
42993 * file that was distributed with this source code.
42994 */
42995namespace PHPUnit\SebastianBergmann\CodeCoverage\Driver;
42996
42997use function sprintf;
42998use PHPUnit\SebastianBergmann\CodeCoverage\BranchAndPathCoverageNotSupportedException;
42999use PHPUnit\SebastianBergmann\CodeCoverage\DeadCodeDetectionNotSupportedException;
43000use PHPUnit\SebastianBergmann\CodeCoverage\Filter;
43001use PHPUnit\SebastianBergmann\CodeCoverage\NoCodeCoverageDriverAvailableException;
43002use PHPUnit\SebastianBergmann\CodeCoverage\NoCodeCoverageDriverWithPathCoverageSupportAvailableException;
43003use PHPUnit\SebastianBergmann\CodeCoverage\RawCodeCoverageData;
43004/**
43005 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
43006 */
43007abstract class Driver
43008{
43009    /**
43010     * @var int
43011     *
43012     * @see http://xdebug.org/docs/code_coverage
43013     */
43014    public const LINE_NOT_EXECUTABLE = -2;
43015    /**
43016     * @var int
43017     *
43018     * @see http://xdebug.org/docs/code_coverage
43019     */
43020    public const LINE_NOT_EXECUTED = -1;
43021    /**
43022     * @var int
43023     *
43024     * @see http://xdebug.org/docs/code_coverage
43025     */
43026    public const LINE_EXECUTED = 1;
43027    /**
43028     * @var int
43029     *
43030     * @see http://xdebug.org/docs/code_coverage
43031     */
43032    public const BRANCH_NOT_HIT = 0;
43033    /**
43034     * @var int
43035     *
43036     * @see http://xdebug.org/docs/code_coverage
43037     */
43038    public const BRANCH_HIT = 1;
43039    /**
43040     * @var bool
43041     */
43042    private $collectBranchAndPathCoverage = \false;
43043    /**
43044     * @var bool
43045     */
43046    private $detectDeadCode = \false;
43047    /**
43048     * @throws NoCodeCoverageDriverAvailableException
43049     * @throws PcovNotAvailableException
43050     * @throws PhpdbgNotAvailableException
43051     * @throws Xdebug2NotEnabledException
43052     * @throws Xdebug3NotEnabledException
43053     * @throws XdebugNotAvailableException
43054     *
43055     * @deprecated Use DriverSelector::forLineCoverage() instead
43056     */
43057    public static function forLineCoverage(Filter $filter) : self
43058    {
43059        return (new Selector())->forLineCoverage($filter);
43060    }
43061    /**
43062     * @throws NoCodeCoverageDriverWithPathCoverageSupportAvailableException
43063     * @throws Xdebug2NotEnabledException
43064     * @throws Xdebug3NotEnabledException
43065     * @throws XdebugNotAvailableException
43066     *
43067     * @deprecated Use DriverSelector::forLineAndPathCoverage() instead
43068     */
43069    public static function forLineAndPathCoverage(Filter $filter) : self
43070    {
43071        return (new Selector())->forLineAndPathCoverage($filter);
43072    }
43073    public function canCollectBranchAndPathCoverage() : bool
43074    {
43075        return \false;
43076    }
43077    public function collectsBranchAndPathCoverage() : bool
43078    {
43079        return $this->collectBranchAndPathCoverage;
43080    }
43081    /**
43082     * @throws BranchAndPathCoverageNotSupportedException
43083     */
43084    public function enableBranchAndPathCoverage() : void
43085    {
43086        if (!$this->canCollectBranchAndPathCoverage()) {
43087            throw new BranchAndPathCoverageNotSupportedException(sprintf('%s does not support branch and path coverage', $this->nameAndVersion()));
43088        }
43089        $this->collectBranchAndPathCoverage = \true;
43090    }
43091    public function disableBranchAndPathCoverage() : void
43092    {
43093        $this->collectBranchAndPathCoverage = \false;
43094    }
43095    public function canDetectDeadCode() : bool
43096    {
43097        return \false;
43098    }
43099    public function detectsDeadCode() : bool
43100    {
43101        return $this->detectDeadCode;
43102    }
43103    /**
43104     * @throws DeadCodeDetectionNotSupportedException
43105     */
43106    public function enableDeadCodeDetection() : void
43107    {
43108        if (!$this->canDetectDeadCode()) {
43109            throw new DeadCodeDetectionNotSupportedException(sprintf('%s does not support dead code detection', $this->nameAndVersion()));
43110        }
43111        $this->detectDeadCode = \true;
43112    }
43113    public function disableDeadCodeDetection() : void
43114    {
43115        $this->detectDeadCode = \false;
43116    }
43117    public abstract function nameAndVersion() : string;
43118    public abstract function start() : void;
43119    public abstract function stop() : RawCodeCoverageData;
43120}
43121<?php
43122
43123declare (strict_types=1);
43124/*
43125 * This file is part of phpunit/php-code-coverage.
43126 *
43127 * (c) Sebastian Bergmann <sebastian@phpunit.de>
43128 *
43129 * For the full copyright and license information, please view the LICENSE
43130 * file that was distributed with this source code.
43131 */
43132namespace PHPUnit\SebastianBergmann\CodeCoverage\Driver;
43133
43134use const XDEBUG_CC_BRANCH_CHECK;
43135use const XDEBUG_CC_DEAD_CODE;
43136use const XDEBUG_CC_UNUSED;
43137use const XDEBUG_FILTER_CODE_COVERAGE;
43138use const PHPUnit\XDEBUG_PATH_INCLUDE;
43139use function explode;
43140use function extension_loaded;
43141use function getenv;
43142use function in_array;
43143use function ini_get;
43144use function phpversion;
43145use function sprintf;
43146use function version_compare;
43147use function xdebug_get_code_coverage;
43148use function xdebug_set_filter;
43149use function xdebug_start_code_coverage;
43150use function xdebug_stop_code_coverage;
43151use PHPUnit\SebastianBergmann\CodeCoverage\Filter;
43152use PHPUnit\SebastianBergmann\CodeCoverage\RawCodeCoverageData;
43153/**
43154 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
43155 */
43156final class Xdebug3Driver extends Driver
43157{
43158    /**
43159     * @throws WrongXdebugVersionException
43160     * @throws Xdebug3NotEnabledException
43161     * @throws XdebugNotAvailableException
43162     */
43163    public function __construct(Filter $filter)
43164    {
43165        if (!extension_loaded('xdebug')) {
43166            throw new XdebugNotAvailableException();
43167        }
43168        if (version_compare(phpversion('xdebug'), '3', '<')) {
43169            throw new WrongXdebugVersionException(sprintf('This driver requires Xdebug 3 but version %s is loaded', phpversion('xdebug')));
43170        }
43171        $mode = getenv('XDEBUG_MODE');
43172        if ($mode === \false || $mode === '') {
43173            $mode = ini_get('xdebug.mode');
43174        }
43175        if ($mode === \false || !in_array('coverage', explode(',', $mode), \true)) {
43176            throw new Xdebug3NotEnabledException();
43177        }
43178        if (!$filter->isEmpty()) {
43179            xdebug_set_filter(\XDEBUG_FILTER_CODE_COVERAGE, \XDEBUG_PATH_INCLUDE, $filter->files());
43180        }
43181    }
43182    public function canCollectBranchAndPathCoverage() : bool
43183    {
43184        return \true;
43185    }
43186    public function canDetectDeadCode() : bool
43187    {
43188        return \true;
43189    }
43190    public function start() : void
43191    {
43192        $flags = \XDEBUG_CC_UNUSED;
43193        if ($this->detectsDeadCode() || $this->collectsBranchAndPathCoverage()) {
43194            $flags |= \XDEBUG_CC_DEAD_CODE;
43195        }
43196        if ($this->collectsBranchAndPathCoverage()) {
43197            $flags |= \XDEBUG_CC_BRANCH_CHECK;
43198        }
43199        xdebug_start_code_coverage($flags);
43200    }
43201    public function stop() : RawCodeCoverageData
43202    {
43203        $data = xdebug_get_code_coverage();
43204        xdebug_stop_code_coverage();
43205        if ($this->collectsBranchAndPathCoverage()) {
43206            return RawCodeCoverageData::fromXdebugWithPathCoverage($data);
43207        }
43208        return RawCodeCoverageData::fromXdebugWithoutPathCoverage($data);
43209    }
43210    public function nameAndVersion() : string
43211    {
43212        return 'Xdebug ' . phpversion('xdebug');
43213    }
43214}
43215<?php
43216
43217declare (strict_types=1);
43218/*
43219 * This file is part of phpunit/php-code-coverage.
43220 *
43221 * (c) Sebastian Bergmann <sebastian@phpunit.de>
43222 *
43223 * For the full copyright and license information, please view the LICENSE
43224 * file that was distributed with this source code.
43225 */
43226namespace PHPUnit\SebastianBergmann\CodeCoverage\Driver;
43227
43228use const XDEBUG_CC_BRANCH_CHECK;
43229use const XDEBUG_CC_DEAD_CODE;
43230use const XDEBUG_CC_UNUSED;
43231use const XDEBUG_FILTER_CODE_COVERAGE;
43232use const PHPUnit\XDEBUG_PATH_INCLUDE;
43233use const XDEBUG_PATH_WHITELIST;
43234use function defined;
43235use function extension_loaded;
43236use function ini_get;
43237use function phpversion;
43238use function sprintf;
43239use function version_compare;
43240use function xdebug_get_code_coverage;
43241use function xdebug_set_filter;
43242use function xdebug_start_code_coverage;
43243use function xdebug_stop_code_coverage;
43244use PHPUnit\SebastianBergmann\CodeCoverage\Filter;
43245use PHPUnit\SebastianBergmann\CodeCoverage\RawCodeCoverageData;
43246/**
43247 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
43248 */
43249final class Xdebug2Driver extends Driver
43250{
43251    /**
43252     * @var bool
43253     */
43254    private $pathCoverageIsMixedCoverage;
43255    /**
43256     * @throws WrongXdebugVersionException
43257     * @throws Xdebug2NotEnabledException
43258     * @throws XdebugNotAvailableException
43259     */
43260    public function __construct(Filter $filter)
43261    {
43262        if (!extension_loaded('xdebug')) {
43263            throw new XdebugNotAvailableException();
43264        }
43265        if (version_compare(phpversion('xdebug'), '3', '>=')) {
43266            throw new WrongXdebugVersionException(sprintf('This driver requires Xdebug 2 but version %s is loaded', phpversion('xdebug')));
43267        }
43268        if (!ini_get('xdebug.coverage_enable')) {
43269            throw new Xdebug2NotEnabledException();
43270        }
43271        if (!$filter->isEmpty()) {
43272            if (defined('XDEBUG_PATH_WHITELIST')) {
43273                $listType = \XDEBUG_PATH_WHITELIST;
43274            } else {
43275                $listType = \XDEBUG_PATH_INCLUDE;
43276            }
43277            xdebug_set_filter(\XDEBUG_FILTER_CODE_COVERAGE, $listType, $filter->files());
43278        }
43279        $this->pathCoverageIsMixedCoverage = version_compare(phpversion('xdebug'), '2.9.6', '<');
43280    }
43281    public function canCollectBranchAndPathCoverage() : bool
43282    {
43283        return \true;
43284    }
43285    public function canDetectDeadCode() : bool
43286    {
43287        return \true;
43288    }
43289    public function start() : void
43290    {
43291        $flags = \XDEBUG_CC_UNUSED;
43292        if ($this->detectsDeadCode() || $this->collectsBranchAndPathCoverage()) {
43293            $flags |= \XDEBUG_CC_DEAD_CODE;
43294        }
43295        if ($this->collectsBranchAndPathCoverage()) {
43296            $flags |= \XDEBUG_CC_BRANCH_CHECK;
43297        }
43298        xdebug_start_code_coverage($flags);
43299    }
43300    public function stop() : RawCodeCoverageData
43301    {
43302        $data = xdebug_get_code_coverage();
43303        xdebug_stop_code_coverage();
43304        if ($this->collectsBranchAndPathCoverage()) {
43305            if ($this->pathCoverageIsMixedCoverage) {
43306                return RawCodeCoverageData::fromXdebugWithMixedCoverage($data);
43307            }
43308            return RawCodeCoverageData::fromXdebugWithPathCoverage($data);
43309        }
43310        return RawCodeCoverageData::fromXdebugWithoutPathCoverage($data);
43311    }
43312    public function nameAndVersion() : string
43313    {
43314        return 'Xdebug ' . phpversion('xdebug');
43315    }
43316}
43317<?php
43318
43319declare (strict_types=1);
43320/*
43321 * This file is part of phpunit/php-code-coverage.
43322 *
43323 * (c) Sebastian Bergmann <sebastian@phpunit.de>
43324 *
43325 * For the full copyright and license information, please view the LICENSE
43326 * file that was distributed with this source code.
43327 */
43328namespace PHPUnit\SebastianBergmann\CodeCoverage\Driver;
43329
43330use const PHP_SAPI;
43331use const PHP_VERSION;
43332use function array_diff;
43333use function array_keys;
43334use function array_merge;
43335use function get_included_files;
43336use function phpdbg_end_oplog;
43337use function phpdbg_get_executable;
43338use function phpdbg_start_oplog;
43339use PHPUnit\SebastianBergmann\CodeCoverage\RawCodeCoverageData;
43340/**
43341 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
43342 */
43343final class PhpdbgDriver extends Driver
43344{
43345    /**
43346     * @throws PhpdbgNotAvailableException
43347     */
43348    public function __construct()
43349    {
43350        if (\PHP_SAPI !== 'phpdbg') {
43351            throw new PhpdbgNotAvailableException();
43352        }
43353    }
43354    public function start() : void
43355    {
43356        phpdbg_start_oplog();
43357    }
43358    public function stop() : RawCodeCoverageData
43359    {
43360        static $fetchedLines = [];
43361        $dbgData = phpdbg_end_oplog();
43362        if ($fetchedLines === []) {
43363            $sourceLines = phpdbg_get_executable();
43364        } else {
43365            $newFiles = array_diff(get_included_files(), array_keys($fetchedLines));
43366            $sourceLines = [];
43367            if ($newFiles) {
43368                $sourceLines = phpdbg_get_executable(['files' => $newFiles]);
43369            }
43370        }
43371        foreach ($sourceLines as $file => $lines) {
43372            foreach ($lines as $lineNo => $numExecuted) {
43373                $sourceLines[$file][$lineNo] = self::LINE_NOT_EXECUTED;
43374            }
43375        }
43376        $fetchedLines = array_merge($fetchedLines, $sourceLines);
43377        return RawCodeCoverageData::fromXdebugWithoutPathCoverage($this->detectExecutedLines($fetchedLines, $dbgData));
43378    }
43379    public function nameAndVersion() : string
43380    {
43381        return 'PHPDBG ' . \PHP_VERSION;
43382    }
43383    private function detectExecutedLines(array $sourceLines, array $dbgData) : array
43384    {
43385        foreach ($dbgData as $file => $coveredLines) {
43386            foreach ($coveredLines as $lineNo => $numExecuted) {
43387                // phpdbg also reports $lineNo=0 when e.g. exceptions get thrown.
43388                // make sure we only mark lines executed which are actually executable.
43389                if (isset($sourceLines[$file][$lineNo])) {
43390                    $sourceLines[$file][$lineNo] = self::LINE_EXECUTED;
43391                }
43392            }
43393        }
43394        return $sourceLines;
43395    }
43396}
43397<?php
43398
43399declare (strict_types=1);
43400/*
43401 * This file is part of phpunit/php-code-coverage.
43402 *
43403 * (c) Sebastian Bergmann <sebastian@phpunit.de>
43404 *
43405 * For the full copyright and license information, please view the LICENSE
43406 * file that was distributed with this source code.
43407 */
43408namespace PHPUnit\SebastianBergmann\CodeCoverage\Driver;
43409
43410use function phpversion;
43411use function version_compare;
43412use PHPUnit\SebastianBergmann\CodeCoverage\Filter;
43413use PHPUnit\SebastianBergmann\CodeCoverage\NoCodeCoverageDriverAvailableException;
43414use PHPUnit\SebastianBergmann\CodeCoverage\NoCodeCoverageDriverWithPathCoverageSupportAvailableException;
43415use PHPUnit\SebastianBergmann\Environment\Runtime;
43416final class Selector
43417{
43418    /**
43419     * @throws NoCodeCoverageDriverAvailableException
43420     * @throws PcovNotAvailableException
43421     * @throws PhpdbgNotAvailableException
43422     * @throws Xdebug2NotEnabledException
43423     * @throws Xdebug3NotEnabledException
43424     * @throws XdebugNotAvailableException
43425     */
43426    public function forLineCoverage(Filter $filter) : Driver
43427    {
43428        $runtime = new Runtime();
43429        if ($runtime->hasPHPDBGCodeCoverage()) {
43430            return new PhpdbgDriver();
43431        }
43432        if ($runtime->hasPCOV()) {
43433            return new PcovDriver($filter);
43434        }
43435        if ($runtime->hasXdebug()) {
43436            if (version_compare(phpversion('xdebug'), '3', '>=')) {
43437                $driver = new Xdebug3Driver($filter);
43438            } else {
43439                $driver = new Xdebug2Driver($filter);
43440            }
43441            $driver->enableDeadCodeDetection();
43442            return $driver;
43443        }
43444        throw new NoCodeCoverageDriverAvailableException();
43445    }
43446    /**
43447     * @throws NoCodeCoverageDriverWithPathCoverageSupportAvailableException
43448     * @throws Xdebug2NotEnabledException
43449     * @throws Xdebug3NotEnabledException
43450     * @throws XdebugNotAvailableException
43451     */
43452    public function forLineAndPathCoverage(Filter $filter) : Driver
43453    {
43454        if ((new Runtime())->hasXdebug()) {
43455            if (version_compare(phpversion('xdebug'), '3', '>=')) {
43456                $driver = new Xdebug3Driver($filter);
43457            } else {
43458                $driver = new Xdebug2Driver($filter);
43459            }
43460            $driver->enableDeadCodeDetection();
43461            $driver->enableBranchAndPathCoverage();
43462            return $driver;
43463        }
43464        throw new NoCodeCoverageDriverWithPathCoverageSupportAvailableException();
43465    }
43466}
43467<?php
43468
43469declare (strict_types=1);
43470/*
43471 * This file is part of phpunit/php-code-coverage.
43472 *
43473 * (c) Sebastian Bergmann <sebastian@phpunit.de>
43474 *
43475 * For the full copyright and license information, please view the LICENSE
43476 * file that was distributed with this source code.
43477 */
43478namespace PHPUnit\SebastianBergmann\CodeCoverage\StaticAnalysis;
43479
43480use PHPUnit\SebastianBergmann\LinesOfCode\LinesOfCode;
43481/**
43482 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
43483 */
43484final class CachingCoveredFileAnalyser extends Cache implements CoveredFileAnalyser
43485{
43486    /**
43487     * @var CoveredFileAnalyser
43488     */
43489    private $coveredFileAnalyser;
43490    /**
43491     * @var array
43492     */
43493    private $cache = [];
43494    public function __construct(string $directory, CoveredFileAnalyser $coveredFileAnalyser)
43495    {
43496        parent::__construct($directory);
43497        $this->coveredFileAnalyser = $coveredFileAnalyser;
43498    }
43499    public function classesIn(string $filename) : array
43500    {
43501        if (!isset($this->cache[$filename])) {
43502            $this->process($filename);
43503        }
43504        return $this->cache[$filename]['classesIn'];
43505    }
43506    public function traitsIn(string $filename) : array
43507    {
43508        if (!isset($this->cache[$filename])) {
43509            $this->process($filename);
43510        }
43511        return $this->cache[$filename]['traitsIn'];
43512    }
43513    public function functionsIn(string $filename) : array
43514    {
43515        if (!isset($this->cache[$filename])) {
43516            $this->process($filename);
43517        }
43518        return $this->cache[$filename]['functionsIn'];
43519    }
43520    public function linesOfCodeFor(string $filename) : LinesOfCode
43521    {
43522        if (!isset($this->cache[$filename])) {
43523            $this->process($filename);
43524        }
43525        return $this->cache[$filename]['linesOfCodeFor'];
43526    }
43527    public function ignoredLinesFor(string $filename) : array
43528    {
43529        if (!isset($this->cache[$filename])) {
43530            $this->process($filename);
43531        }
43532        return $this->cache[$filename]['ignoredLinesFor'];
43533    }
43534    public function process(string $filename) : void
43535    {
43536        if ($this->has($filename, __CLASS__)) {
43537            $this->cache[$filename] = $this->read($filename, __CLASS__, [LinesOfCode::class]);
43538            return;
43539        }
43540        $this->cache[$filename] = ['classesIn' => $this->coveredFileAnalyser->classesIn($filename), 'traitsIn' => $this->coveredFileAnalyser->traitsIn($filename), 'functionsIn' => $this->coveredFileAnalyser->functionsIn($filename), 'linesOfCodeFor' => $this->coveredFileAnalyser->linesOfCodeFor($filename), 'ignoredLinesFor' => $this->coveredFileAnalyser->ignoredLinesFor($filename)];
43541        $this->write($filename, __CLASS__, $this->cache[$filename]);
43542    }
43543}
43544<?php
43545
43546declare (strict_types=1);
43547/*
43548 * This file is part of phpunit/php-code-coverage.
43549 *
43550 * (c) Sebastian Bergmann <sebastian@phpunit.de>
43551 *
43552 * For the full copyright and license information, please view the LICENSE
43553 * file that was distributed with this source code.
43554 */
43555namespace PHPUnit\SebastianBergmann\CodeCoverage\StaticAnalysis;
43556
43557/**
43558 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
43559 */
43560interface UncoveredFileAnalyser
43561{
43562    public function executableLinesIn(string $filename) : array;
43563}
43564<?php
43565
43566declare (strict_types=1);
43567/*
43568 * This file is part of phpunit/php-code-coverage.
43569 *
43570 * (c) Sebastian Bergmann <sebastian@phpunit.de>
43571 *
43572 * For the full copyright and license information, please view the LICENSE
43573 * file that was distributed with this source code.
43574 */
43575namespace PHPUnit\SebastianBergmann\CodeCoverage\StaticAnalysis;
43576
43577use function array_unique;
43578use function assert;
43579use function file_get_contents;
43580use function is_array;
43581use function sprintf;
43582use function substr_count;
43583use function token_get_all;
43584use function trim;
43585use PHPUnit\PhpParser\Error;
43586use PHPUnit\PhpParser\Lexer;
43587use PHPUnit\PhpParser\NodeTraverser;
43588use PHPUnit\PhpParser\NodeVisitor\NameResolver;
43589use PHPUnit\PhpParser\NodeVisitor\ParentConnectingVisitor;
43590use PHPUnit\PhpParser\ParserFactory;
43591use PHPUnit\SebastianBergmann\CodeCoverage\ParserException;
43592use PHPUnit\SebastianBergmann\LinesOfCode\LineCountingVisitor;
43593use PHPUnit\SebastianBergmann\LinesOfCode\LinesOfCode;
43594/**
43595 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
43596 */
43597final class ParsingCoveredFileAnalyser implements CoveredFileAnalyser
43598{
43599    /**
43600     * @var array
43601     */
43602    private $classes = [];
43603    /**
43604     * @var array
43605     */
43606    private $traits = [];
43607    /**
43608     * @var array
43609     */
43610    private $functions = [];
43611    /**
43612     * @var LinesOfCode[]
43613     */
43614    private $linesOfCode = [];
43615    /**
43616     * @var array
43617     */
43618    private $ignoredLines = [];
43619    /**
43620     * @var bool
43621     */
43622    private $useAnnotationsForIgnoringCode;
43623    /**
43624     * @var bool
43625     */
43626    private $ignoreDeprecatedCode;
43627    public function __construct(bool $useAnnotationsForIgnoringCode, bool $ignoreDeprecatedCode)
43628    {
43629        $this->useAnnotationsForIgnoringCode = $useAnnotationsForIgnoringCode;
43630        $this->ignoreDeprecatedCode = $ignoreDeprecatedCode;
43631    }
43632    public function classesIn(string $filename) : array
43633    {
43634        $this->analyse($filename);
43635        return $this->classes[$filename];
43636    }
43637    public function traitsIn(string $filename) : array
43638    {
43639        $this->analyse($filename);
43640        return $this->traits[$filename];
43641    }
43642    public function functionsIn(string $filename) : array
43643    {
43644        $this->analyse($filename);
43645        return $this->functions[$filename];
43646    }
43647    public function linesOfCodeFor(string $filename) : LinesOfCode
43648    {
43649        $this->analyse($filename);
43650        return $this->linesOfCode[$filename];
43651    }
43652    public function ignoredLinesFor(string $filename) : array
43653    {
43654        $this->analyse($filename);
43655        return $this->ignoredLines[$filename];
43656    }
43657    /**
43658     * @throws ParserException
43659     */
43660    private function analyse(string $filename) : void
43661    {
43662        if (isset($this->classes[$filename])) {
43663            return;
43664        }
43665        $source = file_get_contents($filename);
43666        $linesOfCode = substr_count($source, "\n");
43667        if ($linesOfCode === 0 && !empty($source)) {
43668            $linesOfCode = 1;
43669        }
43670        $parser = (new ParserFactory())->create(ParserFactory::PREFER_PHP7, new Lexer());
43671        try {
43672            $nodes = $parser->parse($source);
43673            assert($nodes !== null);
43674            $traverser = new NodeTraverser();
43675            $codeUnitFindingVisitor = new CodeUnitFindingVisitor();
43676            $lineCountingVisitor = new LineCountingVisitor($linesOfCode);
43677            $ignoredLinesFindingVisitor = new IgnoredLinesFindingVisitor($this->useAnnotationsForIgnoringCode, $this->ignoreDeprecatedCode);
43678            $traverser->addVisitor(new NameResolver());
43679            $traverser->addVisitor(new ParentConnectingVisitor());
43680            $traverser->addVisitor($codeUnitFindingVisitor);
43681            $traverser->addVisitor($lineCountingVisitor);
43682            $traverser->addVisitor($ignoredLinesFindingVisitor);
43683            /* @noinspection UnusedFunctionResultInspection */
43684            $traverser->traverse($nodes);
43685            // @codeCoverageIgnoreStart
43686        } catch (Error $error) {
43687            throw new ParserException(sprintf('Cannot parse %s: %s', $filename, $error->getMessage()), (int) $error->getCode(), $error);
43688        }
43689        // @codeCoverageIgnoreEnd
43690        $this->classes[$filename] = $codeUnitFindingVisitor->classes();
43691        $this->traits[$filename] = $codeUnitFindingVisitor->traits();
43692        $this->functions[$filename] = $codeUnitFindingVisitor->functions();
43693        $this->linesOfCode[$filename] = $lineCountingVisitor->result();
43694        $this->ignoredLines[$filename] = [];
43695        $this->findLinesIgnoredByLineBasedAnnotations($filename, $source, $this->useAnnotationsForIgnoringCode);
43696        $this->ignoredLines[$filename] = array_unique(\array_merge($this->ignoredLines[$filename], $ignoredLinesFindingVisitor->ignoredLines()));
43697        \sort($this->ignoredLines[$filename]);
43698    }
43699    private function findLinesIgnoredByLineBasedAnnotations(string $filename, string $source, bool $useAnnotationsForIgnoringCode) : void
43700    {
43701        $ignore = \false;
43702        $stop = \false;
43703        foreach (token_get_all($source) as $token) {
43704            if (!is_array($token)) {
43705                continue;
43706            }
43707            switch ($token[0]) {
43708                case \T_COMMENT:
43709                case \T_DOC_COMMENT:
43710                    if (!$useAnnotationsForIgnoringCode) {
43711                        break;
43712                    }
43713                    $comment = trim($token[1]);
43714                    if ($comment === '// @codeCoverageIgnore' || $comment === '//@codeCoverageIgnore') {
43715                        $ignore = \true;
43716                        $stop = \true;
43717                    } elseif ($comment === '// @codeCoverageIgnoreStart' || $comment === '//@codeCoverageIgnoreStart') {
43718                        $ignore = \true;
43719                    } elseif ($comment === '// @codeCoverageIgnoreEnd' || $comment === '//@codeCoverageIgnoreEnd') {
43720                        $stop = \true;
43721                    }
43722                    break;
43723            }
43724            if ($ignore) {
43725                $this->ignoredLines[$filename][] = $token[2];
43726                if ($stop) {
43727                    $ignore = \false;
43728                    $stop = \false;
43729                }
43730            }
43731        }
43732    }
43733}
43734<?php
43735
43736declare (strict_types=1);
43737/*
43738 * This file is part of phpunit/php-code-coverage.
43739 *
43740 * (c) Sebastian Bergmann <sebastian@phpunit.de>
43741 *
43742 * For the full copyright and license information, please view the LICENSE
43743 * file that was distributed with this source code.
43744 */
43745namespace PHPUnit\SebastianBergmann\CodeCoverage\StaticAnalysis;
43746
43747use function array_unique;
43748use function sort;
43749use PHPUnit\PhpParser\Node;
43750use PHPUnit\PhpParser\Node\Stmt\Break_;
43751use PHPUnit\PhpParser\Node\Stmt\Case_;
43752use PHPUnit\PhpParser\Node\Stmt\Catch_;
43753use PHPUnit\PhpParser\Node\Stmt\Continue_;
43754use PHPUnit\PhpParser\Node\Stmt\Do_;
43755use PHPUnit\PhpParser\Node\Stmt\Echo_;
43756use PHPUnit\PhpParser\Node\Stmt\Else_;
43757use PHPUnit\PhpParser\Node\Stmt\ElseIf_;
43758use PHPUnit\PhpParser\Node\Stmt\Expression;
43759use PHPUnit\PhpParser\Node\Stmt\Finally_;
43760use PHPUnit\PhpParser\Node\Stmt\For_;
43761use PHPUnit\PhpParser\Node\Stmt\Foreach_;
43762use PHPUnit\PhpParser\Node\Stmt\Goto_;
43763use PHPUnit\PhpParser\Node\Stmt\If_;
43764use PHPUnit\PhpParser\Node\Stmt\Return_;
43765use PHPUnit\PhpParser\Node\Stmt\Switch_;
43766use PHPUnit\PhpParser\Node\Stmt\Throw_;
43767use PHPUnit\PhpParser\Node\Stmt\TryCatch;
43768use PHPUnit\PhpParser\Node\Stmt\Unset_;
43769use PHPUnit\PhpParser\Node\Stmt\While_;
43770use PHPUnit\PhpParser\NodeVisitorAbstract;
43771/**
43772 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
43773 */
43774final class ExecutableLinesFindingVisitor extends NodeVisitorAbstract
43775{
43776    /**
43777     * @psalm-var list<int>
43778     */
43779    private $executableLines = [];
43780    public function enterNode(Node $node) : void
43781    {
43782        if (!$this->isExecutable($node)) {
43783            return;
43784        }
43785        $this->executableLines[] = $node->getStartLine();
43786    }
43787    /**
43788     * @psalm-return list<int>
43789     */
43790    public function executableLines() : array
43791    {
43792        $executableLines = array_unique($this->executableLines);
43793        sort($executableLines);
43794        return $executableLines;
43795    }
43796    private function isExecutable(Node $node) : bool
43797    {
43798        return $node instanceof Break_ || $node instanceof Case_ || $node instanceof Catch_ || $node instanceof Continue_ || $node instanceof Do_ || $node instanceof Echo_ || $node instanceof ElseIf_ || $node instanceof Else_ || $node instanceof Expression || $node instanceof Finally_ || $node instanceof Foreach_ || $node instanceof For_ || $node instanceof Goto_ || $node instanceof If_ || $node instanceof Return_ || $node instanceof Switch_ || $node instanceof Throw_ || $node instanceof TryCatch || $node instanceof Unset_ || $node instanceof While_;
43799    }
43800}
43801<?php
43802
43803declare (strict_types=1);
43804/*
43805 * This file is part of phpunit/php-code-coverage.
43806 *
43807 * (c) Sebastian Bergmann <sebastian@phpunit.de>
43808 *
43809 * For the full copyright and license information, please view the LICENSE
43810 * file that was distributed with this source code.
43811 */
43812namespace PHPUnit\SebastianBergmann\CodeCoverage\StaticAnalysis;
43813
43814use const DIRECTORY_SEPARATOR;
43815use function file_get_contents;
43816use function file_put_contents;
43817use function filemtime;
43818use function hash;
43819use function is_file;
43820use function serialize;
43821use function unserialize;
43822use PHPUnit\SebastianBergmann\CodeCoverage\Directory;
43823/**
43824 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
43825 */
43826abstract class Cache
43827{
43828    /**
43829     * @var string
43830     */
43831    private $directory;
43832    public function __construct(string $directory)
43833    {
43834        Directory::create($directory);
43835        $this->directory = $directory;
43836    }
43837    protected function has(string $filename, string $key) : bool
43838    {
43839        $cacheFile = $this->cacheFile($filename, $key);
43840        if (!is_file($cacheFile)) {
43841            return \false;
43842        }
43843        if (filemtime($cacheFile) < filemtime($filename)) {
43844            return \false;
43845        }
43846        return \true;
43847    }
43848    /**
43849     * @psalm-param list<class-string> $allowedClasses
43850     *
43851     * @return mixed
43852     */
43853    protected function read(string $filename, string $key, array $allowedClasses = [])
43854    {
43855        $options = ['allowed_classes' => \false];
43856        if (!empty($allowedClasses)) {
43857            $options = ['allowed_classes' => $allowedClasses];
43858        }
43859        return unserialize(file_get_contents($this->cacheFile($filename, $key)), $options);
43860    }
43861    /**
43862     * @param mixed $data
43863     */
43864    protected function write(string $filename, string $key, $data) : void
43865    {
43866        file_put_contents($this->cacheFile($filename, $key), serialize($data));
43867    }
43868    private function cacheFile(string $filename, string $key) : string
43869    {
43870        return $this->directory . \DIRECTORY_SEPARATOR . hash('sha256', $filename . $key);
43871    }
43872}
43873<?php
43874
43875declare (strict_types=1);
43876/*
43877 * This file is part of phpunit/php-code-coverage.
43878 *
43879 * (c) Sebastian Bergmann <sebastian@phpunit.de>
43880 *
43881 * For the full copyright and license information, please view the LICENSE
43882 * file that was distributed with this source code.
43883 */
43884namespace PHPUnit\SebastianBergmann\CodeCoverage\StaticAnalysis;
43885
43886use function implode;
43887use function rtrim;
43888use function trim;
43889use PHPUnit\PhpParser\Node;
43890use PHPUnit\PhpParser\Node\Identifier;
43891use PHPUnit\PhpParser\Node\Name;
43892use PHPUnit\PhpParser\Node\NullableType;
43893use PHPUnit\PhpParser\Node\Stmt\Class_;
43894use PHPUnit\PhpParser\Node\Stmt\ClassMethod;
43895use PHPUnit\PhpParser\Node\Stmt\Function_;
43896use PHPUnit\PhpParser\Node\Stmt\Interface_;
43897use PHPUnit\PhpParser\Node\Stmt\Trait_;
43898use PHPUnit\PhpParser\Node\UnionType;
43899use PHPUnit\PhpParser\NodeTraverser;
43900use PHPUnit\PhpParser\NodeVisitorAbstract;
43901use PHPUnit\SebastianBergmann\Complexity\CyclomaticComplexityCalculatingVisitor;
43902/**
43903 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
43904 */
43905final class CodeUnitFindingVisitor extends NodeVisitorAbstract
43906{
43907    /**
43908     * @var array
43909     */
43910    private $classes = [];
43911    /**
43912     * @var array
43913     */
43914    private $traits = [];
43915    /**
43916     * @var array
43917     */
43918    private $functions = [];
43919    public function enterNode(Node $node)
43920    {
43921        if ($node instanceof Class_) {
43922            if ($node->isAnonymous()) {
43923                return;
43924            }
43925            $this->processClass($node);
43926        }
43927        if ($node instanceof Trait_) {
43928            $this->processTrait($node);
43929        }
43930        if (!$node instanceof ClassMethod && !$node instanceof Function_) {
43931            return null;
43932        }
43933        if ($node instanceof ClassMethod) {
43934            $parentNode = $node->getAttribute('parent');
43935            if ($parentNode instanceof Class_ && $parentNode->isAnonymous()) {
43936                return;
43937            }
43938            $this->processMethod($node);
43939            return;
43940        }
43941        $this->processFunction($node);
43942    }
43943    public function classes() : array
43944    {
43945        return $this->classes;
43946    }
43947    public function traits() : array
43948    {
43949        return $this->traits;
43950    }
43951    public function functions() : array
43952    {
43953        return $this->functions;
43954    }
43955    /**
43956     * @psalm-param ClassMethod|Function_ $node
43957     */
43958    private function cyclomaticComplexity(Node $node) : int
43959    {
43960        \assert($node instanceof ClassMethod || $node instanceof Function_);
43961        $nodes = $node->getStmts();
43962        if ($nodes === null) {
43963            return 0;
43964        }
43965        $traverser = new NodeTraverser();
43966        $cyclomaticComplexityCalculatingVisitor = new CyclomaticComplexityCalculatingVisitor();
43967        $traverser->addVisitor($cyclomaticComplexityCalculatingVisitor);
43968        /* @noinspection UnusedFunctionResultInspection */
43969        $traverser->traverse($nodes);
43970        return $cyclomaticComplexityCalculatingVisitor->cyclomaticComplexity();
43971    }
43972    /**
43973     * @psalm-param ClassMethod|Function_ $node
43974     */
43975    private function signature(Node $node) : string
43976    {
43977        \assert($node instanceof ClassMethod || $node instanceof Function_);
43978        $signature = ($node->returnsByRef() ? '&' : '') . $node->name->toString() . '(';
43979        $parameters = [];
43980        foreach ($node->getParams() as $parameter) {
43981            \assert(isset($parameter->var->name));
43982            $parameterAsString = '';
43983            if ($parameter->type !== null) {
43984                $parameterAsString = $this->type($parameter->type) . ' ';
43985            }
43986            $parameterAsString .= '$' . $parameter->var->name;
43987            /* @todo Handle default values */
43988            $parameters[] = $parameterAsString;
43989        }
43990        $signature .= implode(', ', $parameters) . ')';
43991        $returnType = $node->getReturnType();
43992        if ($returnType !== null) {
43993            $signature .= ': ' . $this->type($returnType);
43994        }
43995        return $signature;
43996    }
43997    /**
43998     * @psalm-param Identifier|Name|NullableType|UnionType $type
43999     */
44000    private function type(Node $type) : string
44001    {
44002        \assert($type instanceof Identifier || $type instanceof Name || $type instanceof NullableType || $type instanceof UnionType);
44003        if ($type instanceof NullableType) {
44004            return '?' . $type->type;
44005        }
44006        if ($type instanceof UnionType) {
44007            $types = [];
44008            foreach ($type->types as $_type) {
44009                $types[] = $_type->toString();
44010            }
44011            return implode('|', $types);
44012        }
44013        return $type->toString();
44014    }
44015    private function visibility(ClassMethod $node) : string
44016    {
44017        if ($node->isPrivate()) {
44018            return 'private';
44019        }
44020        if ($node->isProtected()) {
44021            return 'protected';
44022        }
44023        return 'public';
44024    }
44025    private function processClass(Class_ $node) : void
44026    {
44027        $name = $node->name->toString();
44028        $namespacedName = $node->namespacedName->toString();
44029        $this->classes[$namespacedName] = ['name' => $name, 'namespacedName' => $namespacedName, 'namespace' => $this->namespace($namespacedName, $name), 'startLine' => $node->getStartLine(), 'endLine' => $node->getEndLine(), 'methods' => []];
44030    }
44031    private function processTrait(Trait_ $node) : void
44032    {
44033        $name = $node->name->toString();
44034        $namespacedName = $node->namespacedName->toString();
44035        $this->traits[$namespacedName] = ['name' => $name, 'namespacedName' => $namespacedName, 'namespace' => $this->namespace($namespacedName, $name), 'startLine' => $node->getStartLine(), 'endLine' => $node->getEndLine(), 'methods' => []];
44036    }
44037    private function processMethod(ClassMethod $node) : void
44038    {
44039        $parentNode = $node->getAttribute('parent');
44040        if ($parentNode instanceof Interface_) {
44041            return;
44042        }
44043        \assert($parentNode instanceof Class_ || $parentNode instanceof Trait_);
44044        \assert(isset($parentNode->name));
44045        \assert(isset($parentNode->namespacedName));
44046        \assert($parentNode->namespacedName instanceof Name);
44047        $parentName = $parentNode->name->toString();
44048        $parentNamespacedName = $parentNode->namespacedName->toString();
44049        if ($parentNode instanceof Class_) {
44050            $storage =& $this->classes;
44051        } else {
44052            $storage =& $this->traits;
44053        }
44054        if (!isset($storage[$parentNamespacedName])) {
44055            $storage[$parentNamespacedName] = ['name' => $parentName, 'namespacedName' => $parentNamespacedName, 'namespace' => $this->namespace($parentNamespacedName, $parentName), 'startLine' => $parentNode->getStartLine(), 'endLine' => $parentNode->getEndLine(), 'methods' => []];
44056        }
44057        $storage[$parentNamespacedName]['methods'][$node->name->toString()] = ['methodName' => $node->name->toString(), 'signature' => $this->signature($node), 'visibility' => $this->visibility($node), 'startLine' => $node->getStartLine(), 'endLine' => $node->getEndLine(), 'ccn' => $this->cyclomaticComplexity($node)];
44058    }
44059    private function processFunction(Function_ $node) : void
44060    {
44061        \assert(isset($node->name));
44062        \assert(isset($node->namespacedName));
44063        \assert($node->namespacedName instanceof Name);
44064        $name = $node->name->toString();
44065        $namespacedName = $node->namespacedName->toString();
44066        $this->functions[$namespacedName] = ['name' => $name, 'namespacedName' => $namespacedName, 'namespace' => $this->namespace($namespacedName, $name), 'signature' => $this->signature($node), 'startLine' => $node->getStartLine(), 'endLine' => $node->getEndLine(), 'ccn' => $this->cyclomaticComplexity($node)];
44067    }
44068    private function namespace(string $namespacedName, string $name) : string
44069    {
44070        return trim(rtrim($namespacedName, $name), '\\');
44071    }
44072}
44073<?php
44074
44075declare (strict_types=1);
44076/*
44077 * This file is part of phpunit/php-code-coverage.
44078 *
44079 * (c) Sebastian Bergmann <sebastian@phpunit.de>
44080 *
44081 * For the full copyright and license information, please view the LICENSE
44082 * file that was distributed with this source code.
44083 */
44084namespace PHPUnit\SebastianBergmann\CodeCoverage\StaticAnalysis;
44085
44086use PHPUnit\PhpParser\Error;
44087use PHPUnit\PhpParser\Lexer;
44088use PHPUnit\PhpParser\NodeTraverser;
44089use PHPUnit\PhpParser\ParserFactory;
44090/**
44091 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
44092 */
44093final class ParsingUncoveredFileAnalyser implements UncoveredFileAnalyser
44094{
44095    public function executableLinesIn(string $filename) : array
44096    {
44097        $parser = (new ParserFactory())->create(ParserFactory::PREFER_PHP7, new Lexer());
44098        try {
44099            $nodes = $parser->parse(\file_get_contents($filename));
44100            \assert($nodes !== null);
44101            $traverser = new NodeTraverser();
44102            $visitor = new ExecutableLinesFindingVisitor();
44103            $traverser->addVisitor($visitor);
44104            /* @noinspection UnusedFunctionResultInspection */
44105            $traverser->traverse($nodes);
44106            return $visitor->executableLines();
44107            // @codeCoverageIgnoreStart
44108        } catch (Error $error) {
44109        }
44110        // @codeCoverageIgnoreEnd
44111        return [];
44112    }
44113}
44114<?php
44115
44116declare (strict_types=1);
44117/*
44118 * This file is part of phpunit/php-code-coverage.
44119 *
44120 * (c) Sebastian Bergmann <sebastian@phpunit.de>
44121 *
44122 * For the full copyright and license information, please view the LICENSE
44123 * file that was distributed with this source code.
44124 */
44125namespace PHPUnit\SebastianBergmann\CodeCoverage\StaticAnalysis;
44126
44127/**
44128 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
44129 */
44130final class CachingUncoveredFileAnalyser extends Cache implements UncoveredFileAnalyser
44131{
44132    /**
44133     * @var UncoveredFileAnalyser
44134     */
44135    private $uncoveredFileAnalyser;
44136    public function __construct(string $directory, UncoveredFileAnalyser $uncoveredFileAnalyser)
44137    {
44138        parent::__construct($directory);
44139        $this->uncoveredFileAnalyser = $uncoveredFileAnalyser;
44140    }
44141    public function executableLinesIn(string $filename) : array
44142    {
44143        if ($this->has($filename, __METHOD__)) {
44144            return $this->read($filename, __METHOD__);
44145        }
44146        $data = $this->uncoveredFileAnalyser->executableLinesIn($filename);
44147        $this->write($filename, __METHOD__, $data);
44148        return $data;
44149    }
44150}
44151<?php
44152
44153declare (strict_types=1);
44154/*
44155 * This file is part of phpunit/php-code-coverage.
44156 *
44157 * (c) Sebastian Bergmann <sebastian@phpunit.de>
44158 *
44159 * For the full copyright and license information, please view the LICENSE
44160 * file that was distributed with this source code.
44161 */
44162namespace PHPUnit\SebastianBergmann\CodeCoverage\StaticAnalysis;
44163
44164use PHPUnit\SebastianBergmann\LinesOfCode\LinesOfCode;
44165/**
44166 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
44167 */
44168interface CoveredFileAnalyser
44169{
44170    public function classesIn(string $filename) : array;
44171    public function traitsIn(string $filename) : array;
44172    public function functionsIn(string $filename) : array;
44173    public function linesOfCodeFor(string $filename) : LinesOfCode;
44174    public function ignoredLinesFor(string $filename) : array;
44175}
44176<?php
44177
44178declare (strict_types=1);
44179/*
44180 * This file is part of phpunit/php-code-coverage.
44181 *
44182 * (c) Sebastian Bergmann <sebastian@phpunit.de>
44183 *
44184 * For the full copyright and license information, please view the LICENSE
44185 * file that was distributed with this source code.
44186 */
44187namespace PHPUnit\SebastianBergmann\CodeCoverage\StaticAnalysis;
44188
44189use function array_merge;
44190use function range;
44191use function strpos;
44192use PHPUnit\PhpParser\Node;
44193use PHPUnit\PhpParser\Node\Stmt\Class_;
44194use PHPUnit\PhpParser\Node\Stmt\ClassMethod;
44195use PHPUnit\PhpParser\Node\Stmt\Function_;
44196use PHPUnit\PhpParser\Node\Stmt\Interface_;
44197use PHPUnit\PhpParser\Node\Stmt\Trait_;
44198use PHPUnit\PhpParser\NodeTraverser;
44199use PHPUnit\PhpParser\NodeVisitorAbstract;
44200/**
44201 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
44202 */
44203final class IgnoredLinesFindingVisitor extends NodeVisitorAbstract
44204{
44205    /**
44206     * @psalm-var list<int>
44207     */
44208    private $ignoredLines = [];
44209    /**
44210     * @var bool
44211     */
44212    private $useAnnotationsForIgnoringCode;
44213    /**
44214     * @var bool
44215     */
44216    private $ignoreDeprecated;
44217    public function __construct(bool $useAnnotationsForIgnoringCode, bool $ignoreDeprecated)
44218    {
44219        $this->useAnnotationsForIgnoringCode = $useAnnotationsForIgnoringCode;
44220        $this->ignoreDeprecated = $ignoreDeprecated;
44221    }
44222    public function enterNode(Node $node) : ?int
44223    {
44224        if (!$node instanceof Class_ && !$node instanceof Trait_ && !$node instanceof Interface_ && !$node instanceof ClassMethod && !$node instanceof Function_) {
44225            return null;
44226        }
44227        if ($node instanceof Class_ && $node->isAnonymous()) {
44228            return null;
44229        }
44230        // Workaround for https://bugs.xdebug.org/view.php?id=1798
44231        if ($node instanceof Class_ || $node instanceof Trait_ || $node instanceof Interface_) {
44232            $this->ignoredLines[] = $node->getStartLine();
44233        }
44234        if (!$this->useAnnotationsForIgnoringCode) {
44235            return null;
44236        }
44237        if ($node instanceof Interface_) {
44238            return null;
44239        }
44240        $docComment = $node->getDocComment();
44241        if ($docComment === null) {
44242            return null;
44243        }
44244        if (strpos($docComment->getText(), '@codeCoverageIgnore') !== \false) {
44245            $this->ignoredLines = array_merge($this->ignoredLines, range($node->getStartLine(), $node->getEndLine()));
44246        }
44247        if ($this->ignoreDeprecated && strpos($docComment->getText(), '@deprecated') !== \false) {
44248            $this->ignoredLines = array_merge($this->ignoredLines, range($node->getStartLine(), $node->getEndLine()));
44249        }
44250        if ($node instanceof ClassMethod || $node instanceof Function_) {
44251            return NodeTraverser::DONT_TRAVERSE_CHILDREN;
44252        }
44253        return null;
44254    }
44255    /**
44256     * @psalm-return list<int>
44257     */
44258    public function ignoredLines() : array
44259    {
44260        return $this->ignoredLines;
44261    }
44262}
44263<?php
44264
44265declare (strict_types=1);
44266/*
44267 * This file is part of phpunit/php-code-coverage.
44268 *
44269 * (c) Sebastian Bergmann <sebastian@phpunit.de>
44270 *
44271 * For the full copyright and license information, please view the LICENSE
44272 * file that was distributed with this source code.
44273 */
44274namespace PHPUnit\SebastianBergmann\CodeCoverage\StaticAnalysis;
44275
44276use PHPUnit\SebastianBergmann\CodeCoverage\Filter;
44277final class CacheWarmer
44278{
44279    public function warmCache(string $cacheDirectory, bool $useAnnotationsForIgnoringCode, bool $ignoreDeprecatedCode, Filter $filter) : void
44280    {
44281        $coveredFileAnalyser = new CachingCoveredFileAnalyser($cacheDirectory, new ParsingCoveredFileAnalyser($useAnnotationsForIgnoringCode, $ignoreDeprecatedCode));
44282        $uncoveredFileAnalyser = new CachingUncoveredFileAnalyser($cacheDirectory, new ParsingUncoveredFileAnalyser());
44283        foreach ($filter->files() as $file) {
44284            $coveredFileAnalyser->process($file);
44285            /* @noinspection UnusedFunctionResultInspection */
44286            $uncoveredFileAnalyser->executableLinesIn($file);
44287        }
44288    }
44289}
44290<?php
44291
44292declare (strict_types=1);
44293/*
44294 * This file is part of phpunit/php-code-coverage.
44295 *
44296 * (c) Sebastian Bergmann <sebastian@phpunit.de>
44297 *
44298 * For the full copyright and license information, please view the LICENSE
44299 * file that was distributed with this source code.
44300 */
44301namespace PHPUnit\SebastianBergmann\CodeCoverage;
44302
44303use function dirname;
44304use PHPUnit\SebastianBergmann\Version as VersionId;
44305final class Version
44306{
44307    /**
44308     * @var string
44309     */
44310    private static $version;
44311    public static function id() : string
44312    {
44313        if (self::$version === null) {
44314            self::$version = (new VersionId('9.2.7', dirname(__DIR__)))->getVersion();
44315        }
44316        return self::$version;
44317    }
44318}
44319<?php
44320
44321declare (strict_types=1);
44322/*
44323 * This file is part of phpunit/php-code-coverage.
44324 *
44325 * (c) Sebastian Bergmann <sebastian@phpunit.de>
44326 *
44327 * For the full copyright and license information, please view the LICENSE
44328 * file that was distributed with this source code.
44329 */
44330namespace PHPUnit\SebastianBergmann\CodeCoverage;
44331
44332use function array_diff;
44333use function array_diff_key;
44334use function array_flip;
44335use function array_keys;
44336use function array_merge;
44337use function array_unique;
44338use function array_values;
44339use function count;
44340use function explode;
44341use function get_class;
44342use function is_array;
44343use function is_file;
44344use function sort;
44345use PHPUnit\Framework\TestCase;
44346use PHPUnit\Runner\PhptTestCase;
44347use PHPUnit\Util\Test;
44348use ReflectionClass;
44349use PHPUnit\SebastianBergmann\CodeCoverage\Driver\Driver;
44350use PHPUnit\SebastianBergmann\CodeCoverage\Node\Builder;
44351use PHPUnit\SebastianBergmann\CodeCoverage\Node\Directory;
44352use PHPUnit\SebastianBergmann\CodeCoverage\StaticAnalysis\CachingCoveredFileAnalyser;
44353use PHPUnit\SebastianBergmann\CodeCoverage\StaticAnalysis\CachingUncoveredFileAnalyser;
44354use PHPUnit\SebastianBergmann\CodeCoverage\StaticAnalysis\CoveredFileAnalyser;
44355use PHPUnit\SebastianBergmann\CodeCoverage\StaticAnalysis\ParsingCoveredFileAnalyser;
44356use PHPUnit\SebastianBergmann\CodeCoverage\StaticAnalysis\ParsingUncoveredFileAnalyser;
44357use PHPUnit\SebastianBergmann\CodeCoverage\StaticAnalysis\UncoveredFileAnalyser;
44358use PHPUnit\SebastianBergmann\CodeUnitReverseLookup\Wizard;
44359/**
44360 * Provides collection functionality for PHP code coverage information.
44361 */
44362final class CodeCoverage
44363{
44364    private const UNCOVERED_FILES = 'UNCOVERED_FILES';
44365    /**
44366     * @var Driver
44367     */
44368    private $driver;
44369    /**
44370     * @var Filter
44371     */
44372    private $filter;
44373    /**
44374     * @var Wizard
44375     */
44376    private $wizard;
44377    /**
44378     * @var bool
44379     */
44380    private $checkForUnintentionallyCoveredCode = \false;
44381    /**
44382     * @var bool
44383     */
44384    private $includeUncoveredFiles = \true;
44385    /**
44386     * @var bool
44387     */
44388    private $processUncoveredFiles = \false;
44389    /**
44390     * @var bool
44391     */
44392    private $ignoreDeprecatedCode = \false;
44393    /**
44394     * @var PhptTestCase|string|TestCase
44395     */
44396    private $currentId;
44397    /**
44398     * Code coverage data.
44399     *
44400     * @var ProcessedCodeCoverageData
44401     */
44402    private $data;
44403    /**
44404     * @var bool
44405     */
44406    private $useAnnotationsForIgnoringCode = \true;
44407    /**
44408     * Test data.
44409     *
44410     * @var array
44411     */
44412    private $tests = [];
44413    /**
44414     * @psalm-var list<class-string>
44415     */
44416    private $parentClassesExcludedFromUnintentionallyCoveredCodeCheck = [];
44417    /**
44418     * @var ?CoveredFileAnalyser
44419     */
44420    private $coveredFileAnalyser;
44421    /**
44422     * @var ?UncoveredFileAnalyser
44423     */
44424    private $uncoveredFileAnalyser;
44425    /**
44426     * @var ?string
44427     */
44428    private $cacheDirectory;
44429    public function __construct(Driver $driver, Filter $filter)
44430    {
44431        $this->driver = $driver;
44432        $this->filter = $filter;
44433        $this->data = new ProcessedCodeCoverageData();
44434        $this->wizard = new Wizard();
44435    }
44436    /**
44437     * Returns the code coverage information as a graph of node objects.
44438     */
44439    public function getReport() : Directory
44440    {
44441        return (new Builder($this->coveredFileAnalyser()))->build($this);
44442    }
44443    /**
44444     * Clears collected code coverage data.
44445     */
44446    public function clear() : void
44447    {
44448        $this->currentId = null;
44449        $this->data = new ProcessedCodeCoverageData();
44450        $this->tests = [];
44451    }
44452    /**
44453     * Returns the filter object used.
44454     */
44455    public function filter() : Filter
44456    {
44457        return $this->filter;
44458    }
44459    /**
44460     * Returns the collected code coverage data.
44461     */
44462    public function getData(bool $raw = \false) : ProcessedCodeCoverageData
44463    {
44464        if (!$raw) {
44465            if ($this->processUncoveredFiles) {
44466                $this->processUncoveredFilesFromFilter();
44467            } elseif ($this->includeUncoveredFiles) {
44468                $this->addUncoveredFilesFromFilter();
44469            }
44470        }
44471        return $this->data;
44472    }
44473    /**
44474     * Sets the coverage data.
44475     */
44476    public function setData(ProcessedCodeCoverageData $data) : void
44477    {
44478        $this->data = $data;
44479    }
44480    /**
44481     * Returns the test data.
44482     */
44483    public function getTests() : array
44484    {
44485        return $this->tests;
44486    }
44487    /**
44488     * Sets the test data.
44489     */
44490    public function setTests(array $tests) : void
44491    {
44492        $this->tests = $tests;
44493    }
44494    /**
44495     * Start collection of code coverage information.
44496     *
44497     * @param PhptTestCase|string|TestCase $id
44498     */
44499    public function start($id, bool $clear = \false) : void
44500    {
44501        if ($clear) {
44502            $this->clear();
44503        }
44504        $this->currentId = $id;
44505        $this->driver->start();
44506    }
44507    /**
44508     * Stop collection of code coverage information.
44509     *
44510     * @param array|false $linesToBeCovered
44511     */
44512    public function stop(bool $append = \true, $linesToBeCovered = [], array $linesToBeUsed = []) : RawCodeCoverageData
44513    {
44514        if (!is_array($linesToBeCovered) && $linesToBeCovered !== \false) {
44515            throw new InvalidArgumentException('$linesToBeCovered must be an array or false');
44516        }
44517        $data = $this->driver->stop();
44518        $this->append($data, null, $append, $linesToBeCovered, $linesToBeUsed);
44519        $this->currentId = null;
44520        return $data;
44521    }
44522    /**
44523     * Appends code coverage data.
44524     *
44525     * @param PhptTestCase|string|TestCase $id
44526     * @param array|false                  $linesToBeCovered
44527     *
44528     * @throws ReflectionException
44529     * @throws TestIdMissingException
44530     * @throws UnintentionallyCoveredCodeException
44531     */
44532    public function append(RawCodeCoverageData $rawData, $id = null, bool $append = \true, $linesToBeCovered = [], array $linesToBeUsed = []) : void
44533    {
44534        if ($id === null) {
44535            $id = $this->currentId;
44536        }
44537        if ($id === null) {
44538            throw new TestIdMissingException();
44539        }
44540        $this->applyFilter($rawData);
44541        if ($this->useAnnotationsForIgnoringCode) {
44542            $this->applyIgnoredLinesFilter($rawData);
44543        }
44544        $this->data->initializeUnseenData($rawData);
44545        if (!$append) {
44546            return;
44547        }
44548        if ($id !== self::UNCOVERED_FILES) {
44549            $this->applyCoversAnnotationFilter($rawData, $linesToBeCovered, $linesToBeUsed);
44550            if (empty($rawData->lineCoverage())) {
44551                return;
44552            }
44553            $size = 'unknown';
44554            $status = -1;
44555            $fromTestcase = \false;
44556            if ($id instanceof TestCase) {
44557                $fromTestcase = \true;
44558                $_size = $id->getSize();
44559                if ($_size === Test::SMALL) {
44560                    $size = 'small';
44561                } elseif ($_size === Test::MEDIUM) {
44562                    $size = 'medium';
44563                } elseif ($_size === Test::LARGE) {
44564                    $size = 'large';
44565                }
44566                $status = $id->getStatus();
44567                $id = get_class($id) . '::' . $id->getName();
44568            } elseif ($id instanceof PhptTestCase) {
44569                $fromTestcase = \true;
44570                $size = 'large';
44571                $id = $id->getName();
44572            }
44573            $this->tests[$id] = ['size' => $size, 'status' => $status, 'fromTestcase' => $fromTestcase];
44574            $this->data->markCodeAsExecutedByTestCase($id, $rawData);
44575        }
44576    }
44577    /**
44578     * Merges the data from another instance.
44579     */
44580    public function merge(self $that) : void
44581    {
44582        $this->filter->includeFiles($that->filter()->files());
44583        $this->data->merge($that->data);
44584        $this->tests = array_merge($this->tests, $that->getTests());
44585    }
44586    public function enableCheckForUnintentionallyCoveredCode() : void
44587    {
44588        $this->checkForUnintentionallyCoveredCode = \true;
44589    }
44590    public function disableCheckForUnintentionallyCoveredCode() : void
44591    {
44592        $this->checkForUnintentionallyCoveredCode = \false;
44593    }
44594    public function includeUncoveredFiles() : void
44595    {
44596        $this->includeUncoveredFiles = \true;
44597    }
44598    public function excludeUncoveredFiles() : void
44599    {
44600        $this->includeUncoveredFiles = \false;
44601    }
44602    public function processUncoveredFiles() : void
44603    {
44604        $this->processUncoveredFiles = \true;
44605    }
44606    public function doNotProcessUncoveredFiles() : void
44607    {
44608        $this->processUncoveredFiles = \false;
44609    }
44610    public function enableAnnotationsForIgnoringCode() : void
44611    {
44612        $this->useAnnotationsForIgnoringCode = \true;
44613    }
44614    public function disableAnnotationsForIgnoringCode() : void
44615    {
44616        $this->useAnnotationsForIgnoringCode = \false;
44617    }
44618    public function ignoreDeprecatedCode() : void
44619    {
44620        $this->ignoreDeprecatedCode = \true;
44621    }
44622    public function doNotIgnoreDeprecatedCode() : void
44623    {
44624        $this->ignoreDeprecatedCode = \false;
44625    }
44626    /**
44627     * @psalm-assert-if-true !null $this->cacheDirectory
44628     */
44629    public function cachesStaticAnalysis() : bool
44630    {
44631        return $this->cacheDirectory !== null;
44632    }
44633    public function cacheStaticAnalysis(string $directory) : void
44634    {
44635        $this->cacheDirectory = $directory;
44636    }
44637    public function doNotCacheStaticAnalysis() : void
44638    {
44639        $this->cacheDirectory = null;
44640    }
44641    /**
44642     * @throws StaticAnalysisCacheNotConfiguredException
44643     */
44644    public function cacheDirectory() : string
44645    {
44646        if (!$this->cachesStaticAnalysis()) {
44647            throw new StaticAnalysisCacheNotConfiguredException('The static analysis cache is not configured');
44648        }
44649        return $this->cacheDirectory;
44650    }
44651    /**
44652     * @psalm-param class-string $className
44653     */
44654    public function excludeSubclassesOfThisClassFromUnintentionallyCoveredCodeCheck(string $className) : void
44655    {
44656        $this->parentClassesExcludedFromUnintentionallyCoveredCodeCheck[] = $className;
44657    }
44658    public function enableBranchAndPathCoverage() : void
44659    {
44660        $this->driver->enableBranchAndPathCoverage();
44661    }
44662    public function disableBranchAndPathCoverage() : void
44663    {
44664        $this->driver->disableBranchAndPathCoverage();
44665    }
44666    public function collectsBranchAndPathCoverage() : bool
44667    {
44668        return $this->driver->collectsBranchAndPathCoverage();
44669    }
44670    public function detectsDeadCode() : bool
44671    {
44672        return $this->driver->detectsDeadCode();
44673    }
44674    /**
44675     * Applies the @covers annotation filtering.
44676     *
44677     * @param array|false $linesToBeCovered
44678     *
44679     * @throws ReflectionException
44680     * @throws UnintentionallyCoveredCodeException
44681     */
44682    private function applyCoversAnnotationFilter(RawCodeCoverageData $rawData, $linesToBeCovered, array $linesToBeUsed) : void
44683    {
44684        if ($linesToBeCovered === \false) {
44685            $rawData->clear();
44686            return;
44687        }
44688        if (empty($linesToBeCovered)) {
44689            return;
44690        }
44691        if ($this->checkForUnintentionallyCoveredCode && (!$this->currentId instanceof TestCase || !$this->currentId->isMedium() && !$this->currentId->isLarge())) {
44692            $this->performUnintentionallyCoveredCodeCheck($rawData, $linesToBeCovered, $linesToBeUsed);
44693        }
44694        $rawLineData = $rawData->lineCoverage();
44695        $filesWithNoCoverage = array_diff_key($rawLineData, $linesToBeCovered);
44696        foreach (array_keys($filesWithNoCoverage) as $fileWithNoCoverage) {
44697            $rawData->removeCoverageDataForFile($fileWithNoCoverage);
44698        }
44699        if (is_array($linesToBeCovered)) {
44700            foreach ($linesToBeCovered as $fileToBeCovered => $includedLines) {
44701                $rawData->keepCoverageDataOnlyForLines($fileToBeCovered, $includedLines);
44702            }
44703        }
44704    }
44705    private function applyFilter(RawCodeCoverageData $data) : void
44706    {
44707        if ($this->filter->isEmpty()) {
44708            return;
44709        }
44710        foreach (array_keys($data->lineCoverage()) as $filename) {
44711            if ($this->filter->isExcluded($filename)) {
44712                $data->removeCoverageDataForFile($filename);
44713            }
44714        }
44715    }
44716    private function applyIgnoredLinesFilter(RawCodeCoverageData $data) : void
44717    {
44718        foreach (array_keys($data->lineCoverage()) as $filename) {
44719            if (!$this->filter->isFile($filename)) {
44720                continue;
44721            }
44722            $data->removeCoverageDataForLines($filename, $this->coveredFileAnalyser()->ignoredLinesFor($filename));
44723        }
44724    }
44725    /**
44726     * @throws UnintentionallyCoveredCodeException
44727     */
44728    private function addUncoveredFilesFromFilter() : void
44729    {
44730        $uncoveredFiles = array_diff($this->filter->files(), $this->data->coveredFiles());
44731        foreach ($uncoveredFiles as $uncoveredFile) {
44732            if (is_file($uncoveredFile)) {
44733                $this->append(RawCodeCoverageData::fromUncoveredFile($uncoveredFile, $this->uncoveredFileAnalyser()), self::UNCOVERED_FILES);
44734            }
44735        }
44736    }
44737    /**
44738     * @throws UnintentionallyCoveredCodeException
44739     */
44740    private function processUncoveredFilesFromFilter() : void
44741    {
44742        $uncoveredFiles = array_diff($this->filter->files(), $this->data->coveredFiles());
44743        $this->driver->start();
44744        foreach ($uncoveredFiles as $uncoveredFile) {
44745            if (is_file($uncoveredFile)) {
44746                include_once $uncoveredFile;
44747            }
44748        }
44749        $this->append($this->driver->stop(), self::UNCOVERED_FILES);
44750    }
44751    /**
44752     * @throws ReflectionException
44753     * @throws UnintentionallyCoveredCodeException
44754     */
44755    private function performUnintentionallyCoveredCodeCheck(RawCodeCoverageData $data, array $linesToBeCovered, array $linesToBeUsed) : void
44756    {
44757        $allowedLines = $this->getAllowedLines($linesToBeCovered, $linesToBeUsed);
44758        $unintentionallyCoveredUnits = [];
44759        foreach ($data->lineCoverage() as $file => $_data) {
44760            foreach ($_data as $line => $flag) {
44761                if ($flag === 1 && !isset($allowedLines[$file][$line])) {
44762                    $unintentionallyCoveredUnits[] = $this->wizard->lookup($file, $line);
44763                }
44764            }
44765        }
44766        $unintentionallyCoveredUnits = $this->processUnintentionallyCoveredUnits($unintentionallyCoveredUnits);
44767        if (!empty($unintentionallyCoveredUnits)) {
44768            throw new UnintentionallyCoveredCodeException($unintentionallyCoveredUnits);
44769        }
44770    }
44771    private function getAllowedLines(array $linesToBeCovered, array $linesToBeUsed) : array
44772    {
44773        $allowedLines = [];
44774        foreach (array_keys($linesToBeCovered) as $file) {
44775            if (!isset($allowedLines[$file])) {
44776                $allowedLines[$file] = [];
44777            }
44778            $allowedLines[$file] = array_merge($allowedLines[$file], $linesToBeCovered[$file]);
44779        }
44780        foreach (array_keys($linesToBeUsed) as $file) {
44781            if (!isset($allowedLines[$file])) {
44782                $allowedLines[$file] = [];
44783            }
44784            $allowedLines[$file] = array_merge($allowedLines[$file], $linesToBeUsed[$file]);
44785        }
44786        foreach (array_keys($allowedLines) as $file) {
44787            $allowedLines[$file] = array_flip(array_unique($allowedLines[$file]));
44788        }
44789        return $allowedLines;
44790    }
44791    /**
44792     * @throws ReflectionException
44793     */
44794    private function processUnintentionallyCoveredUnits(array $unintentionallyCoveredUnits) : array
44795    {
44796        $unintentionallyCoveredUnits = array_unique($unintentionallyCoveredUnits);
44797        sort($unintentionallyCoveredUnits);
44798        foreach (array_keys($unintentionallyCoveredUnits) as $k => $v) {
44799            $unit = explode('::', $unintentionallyCoveredUnits[$k]);
44800            if (count($unit) !== 2) {
44801                continue;
44802            }
44803            try {
44804                $class = new ReflectionClass($unit[0]);
44805                foreach ($this->parentClassesExcludedFromUnintentionallyCoveredCodeCheck as $parentClass) {
44806                    if ($class->isSubclassOf($parentClass)) {
44807                        unset($unintentionallyCoveredUnits[$k]);
44808                        break;
44809                    }
44810                }
44811            } catch (\ReflectionException $e) {
44812                throw new ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
44813            }
44814        }
44815        return array_values($unintentionallyCoveredUnits);
44816    }
44817    private function coveredFileAnalyser() : CoveredFileAnalyser
44818    {
44819        if ($this->coveredFileAnalyser !== null) {
44820            return $this->coveredFileAnalyser;
44821        }
44822        $this->coveredFileAnalyser = new ParsingCoveredFileAnalyser($this->useAnnotationsForIgnoringCode, $this->ignoreDeprecatedCode);
44823        if ($this->cachesStaticAnalysis()) {
44824            $this->coveredFileAnalyser = new CachingCoveredFileAnalyser($this->cacheDirectory, $this->coveredFileAnalyser);
44825        }
44826        return $this->coveredFileAnalyser;
44827    }
44828    private function uncoveredFileAnalyser() : UncoveredFileAnalyser
44829    {
44830        if ($this->uncoveredFileAnalyser !== null) {
44831            return $this->uncoveredFileAnalyser;
44832        }
44833        $this->uncoveredFileAnalyser = new ParsingUncoveredFileAnalyser();
44834        if ($this->cachesStaticAnalysis()) {
44835            $this->uncoveredFileAnalyser = new CachingUncoveredFileAnalyser($this->cacheDirectory, $this->uncoveredFileAnalyser);
44836        }
44837        return $this->uncoveredFileAnalyser;
44838    }
44839}
44840<?php
44841
44842declare (strict_types=1);
44843/*
44844 * This file is part of phpunit/php-code-coverage.
44845 *
44846 * (c) Sebastian Bergmann <sebastian@phpunit.de>
44847 *
44848 * For the full copyright and license information, please view the LICENSE
44849 * file that was distributed with this source code.
44850 */
44851namespace PHPUnit\SebastianBergmann\CodeCoverage;
44852
44853use function array_key_exists;
44854use function array_keys;
44855use function array_merge;
44856use function array_unique;
44857use function count;
44858use function is_array;
44859use function ksort;
44860use PHPUnit\SebastianBergmann\CodeCoverage\Driver\Driver;
44861/**
44862 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
44863 */
44864final class ProcessedCodeCoverageData
44865{
44866    /**
44867     * Line coverage data.
44868     * An array of filenames, each having an array of linenumbers, each executable line having an array of testcase ids.
44869     *
44870     * @var array
44871     */
44872    private $lineCoverage = [];
44873    /**
44874     * Function coverage data.
44875     * Maintains base format of raw data (@see https://xdebug.org/docs/code_coverage), but each 'hit' entry is an array
44876     * of testcase ids.
44877     *
44878     * @var array
44879     */
44880    private $functionCoverage = [];
44881    public function initializeUnseenData(RawCodeCoverageData $rawData) : void
44882    {
44883        foreach ($rawData->lineCoverage() as $file => $lines) {
44884            if (!isset($this->lineCoverage[$file])) {
44885                $this->lineCoverage[$file] = [];
44886                foreach ($lines as $k => $v) {
44887                    $this->lineCoverage[$file][$k] = $v === Driver::LINE_NOT_EXECUTABLE ? null : [];
44888                }
44889            }
44890        }
44891        foreach ($rawData->functionCoverage() as $file => $functions) {
44892            foreach ($functions as $functionName => $functionData) {
44893                if (isset($this->functionCoverage[$file][$functionName])) {
44894                    $this->initPreviouslySeenFunction($file, $functionName, $functionData);
44895                } else {
44896                    $this->initPreviouslyUnseenFunction($file, $functionName, $functionData);
44897                }
44898            }
44899        }
44900    }
44901    public function markCodeAsExecutedByTestCase(string $testCaseId, RawCodeCoverageData $executedCode) : void
44902    {
44903        foreach ($executedCode->lineCoverage() as $file => $lines) {
44904            foreach ($lines as $k => $v) {
44905                if ($v === Driver::LINE_EXECUTED) {
44906                    $this->lineCoverage[$file][$k][] = $testCaseId;
44907                }
44908            }
44909        }
44910        foreach ($executedCode->functionCoverage() as $file => $functions) {
44911            foreach ($functions as $functionName => $functionData) {
44912                foreach ($functionData['branches'] as $branchId => $branchData) {
44913                    if ($branchData['hit'] === Driver::BRANCH_HIT) {
44914                        $this->functionCoverage[$file][$functionName]['branches'][$branchId]['hit'][] = $testCaseId;
44915                    }
44916                }
44917                foreach ($functionData['paths'] as $pathId => $pathData) {
44918                    if ($pathData['hit'] === Driver::BRANCH_HIT) {
44919                        $this->functionCoverage[$file][$functionName]['paths'][$pathId]['hit'][] = $testCaseId;
44920                    }
44921                }
44922            }
44923        }
44924    }
44925    public function setLineCoverage(array $lineCoverage) : void
44926    {
44927        $this->lineCoverage = $lineCoverage;
44928    }
44929    public function lineCoverage() : array
44930    {
44931        ksort($this->lineCoverage);
44932        return $this->lineCoverage;
44933    }
44934    public function setFunctionCoverage(array $functionCoverage) : void
44935    {
44936        $this->functionCoverage = $functionCoverage;
44937    }
44938    public function functionCoverage() : array
44939    {
44940        ksort($this->functionCoverage);
44941        return $this->functionCoverage;
44942    }
44943    public function coveredFiles() : array
44944    {
44945        ksort($this->lineCoverage);
44946        return array_keys($this->lineCoverage);
44947    }
44948    public function renameFile(string $oldFile, string $newFile) : void
44949    {
44950        $this->lineCoverage[$newFile] = $this->lineCoverage[$oldFile];
44951        if (isset($this->functionCoverage[$oldFile])) {
44952            $this->functionCoverage[$newFile] = $this->functionCoverage[$oldFile];
44953        }
44954        unset($this->lineCoverage[$oldFile], $this->functionCoverage[$oldFile]);
44955    }
44956    public function merge(self $newData) : void
44957    {
44958        foreach ($newData->lineCoverage as $file => $lines) {
44959            if (!isset($this->lineCoverage[$file])) {
44960                $this->lineCoverage[$file] = $lines;
44961                continue;
44962            }
44963            // we should compare the lines if any of two contains data
44964            $compareLineNumbers = array_unique(array_merge(array_keys($this->lineCoverage[$file]), array_keys($newData->lineCoverage[$file])));
44965            foreach ($compareLineNumbers as $line) {
44966                $thatPriority = $this->priorityForLine($newData->lineCoverage[$file], $line);
44967                $thisPriority = $this->priorityForLine($this->lineCoverage[$file], $line);
44968                if ($thatPriority > $thisPriority) {
44969                    $this->lineCoverage[$file][$line] = $newData->lineCoverage[$file][$line];
44970                } elseif ($thatPriority === $thisPriority && is_array($this->lineCoverage[$file][$line])) {
44971                    $this->lineCoverage[$file][$line] = array_unique(array_merge($this->lineCoverage[$file][$line], $newData->lineCoverage[$file][$line]));
44972                }
44973            }
44974        }
44975        foreach ($newData->functionCoverage as $file => $functions) {
44976            if (!isset($this->functionCoverage[$file])) {
44977                $this->functionCoverage[$file] = $functions;
44978                continue;
44979            }
44980            foreach ($functions as $functionName => $functionData) {
44981                if (isset($this->functionCoverage[$file][$functionName])) {
44982                    $this->initPreviouslySeenFunction($file, $functionName, $functionData);
44983                } else {
44984                    $this->initPreviouslyUnseenFunction($file, $functionName, $functionData);
44985                }
44986                foreach ($functionData['branches'] as $branchId => $branchData) {
44987                    $this->functionCoverage[$file][$functionName]['branches'][$branchId]['hit'] = array_unique(array_merge($this->functionCoverage[$file][$functionName]['branches'][$branchId]['hit'], $branchData['hit']));
44988                }
44989                foreach ($functionData['paths'] as $pathId => $pathData) {
44990                    $this->functionCoverage[$file][$functionName]['paths'][$pathId]['hit'] = array_unique(array_merge($this->functionCoverage[$file][$functionName]['paths'][$pathId]['hit'], $pathData['hit']));
44991                }
44992            }
44993        }
44994    }
44995    /**
44996     * Determine the priority for a line.
44997     *
44998     * 1 = the line is not set
44999     * 2 = the line has not been tested
45000     * 3 = the line is dead code
45001     * 4 = the line has been tested
45002     *
45003     * During a merge, a higher number is better.
45004     */
45005    private function priorityForLine(array $data, int $line) : int
45006    {
45007        if (!array_key_exists($line, $data)) {
45008            return 1;
45009        }
45010        if (is_array($data[$line]) && count($data[$line]) === 0) {
45011            return 2;
45012        }
45013        if ($data[$line] === null) {
45014            return 3;
45015        }
45016        return 4;
45017    }
45018    /**
45019     * For a function we have never seen before, copy all data over and simply init the 'hit' array.
45020     */
45021    private function initPreviouslyUnseenFunction(string $file, string $functionName, array $functionData) : void
45022    {
45023        $this->functionCoverage[$file][$functionName] = $functionData;
45024        foreach (array_keys($functionData['branches']) as $branchId) {
45025            $this->functionCoverage[$file][$functionName]['branches'][$branchId]['hit'] = [];
45026        }
45027        foreach (array_keys($functionData['paths']) as $pathId) {
45028            $this->functionCoverage[$file][$functionName]['paths'][$pathId]['hit'] = [];
45029        }
45030    }
45031    /**
45032     * For a function we have seen before, only copy over and init the 'hit' array for any unseen branches and paths.
45033     * Techniques such as mocking and where the contents of a file are different vary during tests (e.g. compiling
45034     * containers) mean that the functions inside a file cannot be relied upon to be static.
45035     */
45036    private function initPreviouslySeenFunction(string $file, string $functionName, array $functionData) : void
45037    {
45038        foreach ($functionData['branches'] as $branchId => $branchData) {
45039            if (!isset($this->functionCoverage[$file][$functionName]['branches'][$branchId])) {
45040                $this->functionCoverage[$file][$functionName]['branches'][$branchId] = $branchData;
45041                $this->functionCoverage[$file][$functionName]['branches'][$branchId]['hit'] = [];
45042            }
45043        }
45044        foreach ($functionData['paths'] as $pathId => $pathData) {
45045            if (!isset($this->functionCoverage[$file][$functionName]['paths'][$pathId])) {
45046                $this->functionCoverage[$file][$functionName]['paths'][$pathId] = $pathData;
45047                $this->functionCoverage[$file][$functionName]['paths'][$pathId]['hit'] = [];
45048            }
45049        }
45050    }
45051}
45052<?php
45053
45054declare (strict_types=1);
45055/*
45056 * This file is part of phpunit/php-code-coverage.
45057 *
45058 * (c) Sebastian Bergmann <sebastian@phpunit.de>
45059 *
45060 * For the full copyright and license information, please view the LICENSE
45061 * file that was distributed with this source code.
45062 */
45063namespace PHPUnit\SebastianBergmann\CodeCoverage\Report;
45064
45065use function date;
45066use function dirname;
45067use function file_put_contents;
45068use function htmlspecialchars;
45069use function is_string;
45070use function round;
45071use DOMDocument;
45072use PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage;
45073use PHPUnit\SebastianBergmann\CodeCoverage\Directory;
45074use PHPUnit\SebastianBergmann\CodeCoverage\Driver\WriteOperationFailedException;
45075use PHPUnit\SebastianBergmann\CodeCoverage\Node\File;
45076final class Crap4j
45077{
45078    /**
45079     * @var int
45080     */
45081    private $threshold;
45082    public function __construct(int $threshold = 30)
45083    {
45084        $this->threshold = $threshold;
45085    }
45086    /**
45087     * @throws WriteOperationFailedException
45088     */
45089    public function process(CodeCoverage $coverage, ?string $target = null, ?string $name = null) : string
45090    {
45091        $document = new DOMDocument('1.0', 'UTF-8');
45092        $document->formatOutput = \true;
45093        $root = $document->createElement('crap_result');
45094        $document->appendChild($root);
45095        $project = $document->createElement('project', is_string($name) ? $name : '');
45096        $root->appendChild($project);
45097        $root->appendChild($document->createElement('timestamp', date('Y-m-d H:i:s')));
45098        $stats = $document->createElement('stats');
45099        $methodsNode = $document->createElement('methods');
45100        $report = $coverage->getReport();
45101        unset($coverage);
45102        $fullMethodCount = 0;
45103        $fullCrapMethodCount = 0;
45104        $fullCrapLoad = 0;
45105        $fullCrap = 0;
45106        foreach ($report as $item) {
45107            $namespace = 'global';
45108            if (!$item instanceof File) {
45109                continue;
45110            }
45111            $file = $document->createElement('file');
45112            $file->setAttribute('name', $item->pathAsString());
45113            $classes = $item->classesAndTraits();
45114            foreach ($classes as $className => $class) {
45115                foreach ($class['methods'] as $methodName => $method) {
45116                    $crapLoad = $this->crapLoad((float) $method['crap'], $method['ccn'], $method['coverage']);
45117                    $fullCrap += $method['crap'];
45118                    $fullCrapLoad += $crapLoad;
45119                    $fullMethodCount++;
45120                    if ($method['crap'] >= $this->threshold) {
45121                        $fullCrapMethodCount++;
45122                    }
45123                    $methodNode = $document->createElement('method');
45124                    if (!empty($class['namespace'])) {
45125                        $namespace = $class['namespace'];
45126                    }
45127                    $methodNode->appendChild($document->createElement('package', $namespace));
45128                    $methodNode->appendChild($document->createElement('className', $className));
45129                    $methodNode->appendChild($document->createElement('methodName', $methodName));
45130                    $methodNode->appendChild($document->createElement('methodSignature', htmlspecialchars($method['signature'])));
45131                    $methodNode->appendChild($document->createElement('fullMethod', htmlspecialchars($method['signature'])));
45132                    $methodNode->appendChild($document->createElement('crap', (string) $this->roundValue((float) $method['crap'])));
45133                    $methodNode->appendChild($document->createElement('complexity', (string) $method['ccn']));
45134                    $methodNode->appendChild($document->createElement('coverage', (string) $this->roundValue($method['coverage'])));
45135                    $methodNode->appendChild($document->createElement('crapLoad', (string) round($crapLoad)));
45136                    $methodsNode->appendChild($methodNode);
45137                }
45138            }
45139        }
45140        $stats->appendChild($document->createElement('name', 'Method Crap Stats'));
45141        $stats->appendChild($document->createElement('methodCount', (string) $fullMethodCount));
45142        $stats->appendChild($document->createElement('crapMethodCount', (string) $fullCrapMethodCount));
45143        $stats->appendChild($document->createElement('crapLoad', (string) round($fullCrapLoad)));
45144        $stats->appendChild($document->createElement('totalCrap', (string) $fullCrap));
45145        $crapMethodPercent = 0;
45146        if ($fullMethodCount > 0) {
45147            $crapMethodPercent = $this->roundValue(100 * $fullCrapMethodCount / $fullMethodCount);
45148        }
45149        $stats->appendChild($document->createElement('crapMethodPercent', (string) $crapMethodPercent));
45150        $root->appendChild($stats);
45151        $root->appendChild($methodsNode);
45152        $buffer = $document->saveXML();
45153        if ($target !== null) {
45154            Directory::create(dirname($target));
45155            if (@file_put_contents($target, $buffer) === \false) {
45156                throw new WriteOperationFailedException($target);
45157            }
45158        }
45159        return $buffer;
45160    }
45161    private function crapLoad(float $crapValue, int $cyclomaticComplexity, float $coveragePercent) : float
45162    {
45163        $crapLoad = 0;
45164        if ($crapValue >= $this->threshold) {
45165            $crapLoad += $cyclomaticComplexity * (1.0 - $coveragePercent / 100);
45166            $crapLoad += $cyclomaticComplexity / $this->threshold;
45167        }
45168        return $crapLoad;
45169    }
45170    private function roundValue(float $value) : float
45171    {
45172        return round($value, 2);
45173    }
45174}
45175<?php
45176
45177declare (strict_types=1);
45178/*
45179 * This file is part of phpunit/php-code-coverage.
45180 *
45181 * (c) Sebastian Bergmann <sebastian@phpunit.de>
45182 *
45183 * For the full copyright and license information, please view the LICENSE
45184 * file that was distributed with this source code.
45185 */
45186namespace PHPUnit\SebastianBergmann\CodeCoverage\Report;
45187
45188use const PHP_EOL;
45189use function array_map;
45190use function date;
45191use function ksort;
45192use function max;
45193use function sprintf;
45194use function str_pad;
45195use function strlen;
45196use PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage;
45197use PHPUnit\SebastianBergmann\CodeCoverage\Node\File;
45198use PHPUnit\SebastianBergmann\CodeCoverage\Percentage;
45199final class Text
45200{
45201    /**
45202     * @var string
45203     */
45204    private const COLOR_GREEN = "\33[30;42m";
45205    /**
45206     * @var string
45207     */
45208    private const COLOR_YELLOW = "\33[30;43m";
45209    /**
45210     * @var string
45211     */
45212    private const COLOR_RED = "\33[37;41m";
45213    /**
45214     * @var string
45215     */
45216    private const COLOR_HEADER = "\33[1;37;40m";
45217    /**
45218     * @var string
45219     */
45220    private const COLOR_RESET = "\33[0m";
45221    /**
45222     * @var string
45223     */
45224    private const COLOR_EOL = "\33[2K";
45225    /**
45226     * @var int
45227     */
45228    private $lowUpperBound;
45229    /**
45230     * @var int
45231     */
45232    private $highLowerBound;
45233    /**
45234     * @var bool
45235     */
45236    private $showUncoveredFiles;
45237    /**
45238     * @var bool
45239     */
45240    private $showOnlySummary;
45241    public function __construct(int $lowUpperBound = 50, int $highLowerBound = 90, bool $showUncoveredFiles = \false, bool $showOnlySummary = \false)
45242    {
45243        $this->lowUpperBound = $lowUpperBound;
45244        $this->highLowerBound = $highLowerBound;
45245        $this->showUncoveredFiles = $showUncoveredFiles;
45246        $this->showOnlySummary = $showOnlySummary;
45247    }
45248    public function process(CodeCoverage $coverage, bool $showColors = \false) : string
45249    {
45250        $hasBranchCoverage = !empty($coverage->getData(\true)->functionCoverage());
45251        $output = \PHP_EOL . \PHP_EOL;
45252        $report = $coverage->getReport();
45253        $colors = ['header' => '', 'classes' => '', 'methods' => '', 'lines' => '', 'branches' => '', 'paths' => '', 'reset' => '', 'eol' => ''];
45254        if ($showColors) {
45255            $colors['classes'] = $this->coverageColor($report->numberOfTestedClassesAndTraits(), $report->numberOfClassesAndTraits());
45256            $colors['methods'] = $this->coverageColor($report->numberOfTestedMethods(), $report->numberOfMethods());
45257            $colors['lines'] = $this->coverageColor($report->numberOfExecutedLines(), $report->numberOfExecutableLines());
45258            $colors['branches'] = $this->coverageColor($report->numberOfExecutedBranches(), $report->numberOfExecutableBranches());
45259            $colors['paths'] = $this->coverageColor($report->numberOfExecutedPaths(), $report->numberOfExecutablePaths());
45260            $colors['reset'] = self::COLOR_RESET;
45261            $colors['header'] = self::COLOR_HEADER;
45262            $colors['eol'] = self::COLOR_EOL;
45263        }
45264        $classes = sprintf('  Classes: %6s (%d/%d)', Percentage::fromFractionAndTotal($report->numberOfTestedClassesAndTraits(), $report->numberOfClassesAndTraits())->asString(), $report->numberOfTestedClassesAndTraits(), $report->numberOfClassesAndTraits());
45265        $methods = sprintf('  Methods: %6s (%d/%d)', Percentage::fromFractionAndTotal($report->numberOfTestedMethods(), $report->numberOfMethods())->asString(), $report->numberOfTestedMethods(), $report->numberOfMethods());
45266        $paths = '';
45267        $branches = '';
45268        if ($hasBranchCoverage) {
45269            $paths = sprintf('  Paths:   %6s (%d/%d)', Percentage::fromFractionAndTotal($report->numberOfExecutedPaths(), $report->numberOfExecutablePaths())->asString(), $report->numberOfExecutedPaths(), $report->numberOfExecutablePaths());
45270            $branches = sprintf('  Branches:   %6s (%d/%d)', Percentage::fromFractionAndTotal($report->numberOfExecutedBranches(), $report->numberOfExecutableBranches())->asString(), $report->numberOfExecutedBranches(), $report->numberOfExecutableBranches());
45271        }
45272        $lines = sprintf('  Lines:   %6s (%d/%d)', Percentage::fromFractionAndTotal($report->numberOfExecutedLines(), $report->numberOfExecutableLines())->asString(), $report->numberOfExecutedLines(), $report->numberOfExecutableLines());
45273        $padding = max(array_map('strlen', [$classes, $methods, $lines]));
45274        if ($this->showOnlySummary) {
45275            $title = 'Code Coverage Report Summary:';
45276            $padding = max($padding, strlen($title));
45277            $output .= $this->format($colors['header'], $padding, $title);
45278        } else {
45279            $date = date('  Y-m-d H:i:s');
45280            $title = 'Code Coverage Report:';
45281            $output .= $this->format($colors['header'], $padding, $title);
45282            $output .= $this->format($colors['header'], $padding, $date);
45283            $output .= $this->format($colors['header'], $padding, '');
45284            $output .= $this->format($colors['header'], $padding, ' Summary:');
45285        }
45286        $output .= $this->format($colors['classes'], $padding, $classes);
45287        $output .= $this->format($colors['methods'], $padding, $methods);
45288        if ($hasBranchCoverage) {
45289            $output .= $this->format($colors['paths'], $padding, $paths);
45290            $output .= $this->format($colors['branches'], $padding, $branches);
45291        }
45292        $output .= $this->format($colors['lines'], $padding, $lines);
45293        if ($this->showOnlySummary) {
45294            return $output . \PHP_EOL;
45295        }
45296        $classCoverage = [];
45297        foreach ($report as $item) {
45298            if (!$item instanceof File) {
45299                continue;
45300            }
45301            $classes = $item->classesAndTraits();
45302            foreach ($classes as $className => $class) {
45303                $classExecutableLines = 0;
45304                $classExecutedLines = 0;
45305                $classExecutableBranches = 0;
45306                $classExecutedBranches = 0;
45307                $classExecutablePaths = 0;
45308                $classExecutedPaths = 0;
45309                $coveredMethods = 0;
45310                $classMethods = 0;
45311                foreach ($class['methods'] as $method) {
45312                    if ($method['executableLines'] == 0) {
45313                        continue;
45314                    }
45315                    $classMethods++;
45316                    $classExecutableLines += $method['executableLines'];
45317                    $classExecutedLines += $method['executedLines'];
45318                    $classExecutableBranches += $method['executableBranches'];
45319                    $classExecutedBranches += $method['executedBranches'];
45320                    $classExecutablePaths += $method['executablePaths'];
45321                    $classExecutedPaths += $method['executedPaths'];
45322                    if ($method['coverage'] == 100) {
45323                        $coveredMethods++;
45324                    }
45325                }
45326                $classCoverage[$className] = ['namespace' => $class['namespace'], 'className' => $className, 'methodsCovered' => $coveredMethods, 'methodCount' => $classMethods, 'statementsCovered' => $classExecutedLines, 'statementCount' => $classExecutableLines, 'branchesCovered' => $classExecutedBranches, 'branchesCount' => $classExecutableBranches, 'pathsCovered' => $classExecutedPaths, 'pathsCount' => $classExecutablePaths];
45327            }
45328        }
45329        ksort($classCoverage);
45330        $methodColor = '';
45331        $pathsColor = '';
45332        $branchesColor = '';
45333        $linesColor = '';
45334        $resetColor = '';
45335        foreach ($classCoverage as $fullQualifiedPath => $classInfo) {
45336            if ($this->showUncoveredFiles || $classInfo['statementsCovered'] != 0) {
45337                if ($showColors) {
45338                    $methodColor = $this->coverageColor($classInfo['methodsCovered'], $classInfo['methodCount']);
45339                    $pathsColor = $this->coverageColor($classInfo['pathsCovered'], $classInfo['pathsCount']);
45340                    $branchesColor = $this->coverageColor($classInfo['branchesCovered'], $classInfo['branchesCount']);
45341                    $linesColor = $this->coverageColor($classInfo['statementsCovered'], $classInfo['statementCount']);
45342                    $resetColor = $colors['reset'];
45343                }
45344                $output .= \PHP_EOL . $fullQualifiedPath . \PHP_EOL . '  ' . $methodColor . 'Methods: ' . $this->printCoverageCounts($classInfo['methodsCovered'], $classInfo['methodCount'], 2) . $resetColor . ' ';
45345                if ($hasBranchCoverage) {
45346                    $output .= '  ' . $pathsColor . 'Paths: ' . $this->printCoverageCounts($classInfo['pathsCovered'], $classInfo['pathsCount'], 3) . $resetColor . ' ' . '  ' . $branchesColor . 'Branches: ' . $this->printCoverageCounts($classInfo['branchesCovered'], $classInfo['branchesCount'], 3) . $resetColor . ' ';
45347                }
45348                $output .= '  ' . $linesColor . 'Lines: ' . $this->printCoverageCounts($classInfo['statementsCovered'], $classInfo['statementCount'], 3) . $resetColor;
45349            }
45350        }
45351        return $output . \PHP_EOL;
45352    }
45353    private function coverageColor(int $numberOfCoveredElements, int $totalNumberOfElements) : string
45354    {
45355        $coverage = Percentage::fromFractionAndTotal($numberOfCoveredElements, $totalNumberOfElements);
45356        if ($coverage->asFloat() >= $this->highLowerBound) {
45357            return self::COLOR_GREEN;
45358        }
45359        if ($coverage->asFloat() > $this->lowUpperBound) {
45360            return self::COLOR_YELLOW;
45361        }
45362        return self::COLOR_RED;
45363    }
45364    private function printCoverageCounts(int $numberOfCoveredElements, int $totalNumberOfElements, int $precision) : string
45365    {
45366        $format = '%' . $precision . 's';
45367        return Percentage::fromFractionAndTotal($numberOfCoveredElements, $totalNumberOfElements)->asFixedWidthString() . ' (' . sprintf($format, $numberOfCoveredElements) . '/' . sprintf($format, $totalNumberOfElements) . ')';
45368    }
45369    /**
45370     * @param false|string $string
45371     */
45372    private function format(string $color, int $padding, $string) : string
45373    {
45374        $reset = $color ? self::COLOR_RESET : '';
45375        return $color . str_pad((string) $string, $padding) . $reset . \PHP_EOL;
45376    }
45377}
45378<?php
45379
45380declare (strict_types=1);
45381/*
45382 * This file is part of phpunit/php-code-coverage.
45383 *
45384 * (c) Sebastian Bergmann <sebastian@phpunit.de>
45385 *
45386 * For the full copyright and license information, please view the LICENSE
45387 * file that was distributed with this source code.
45388 */
45389namespace PHPUnit\SebastianBergmann\CodeCoverage\Report\Html;
45390
45391use const DIRECTORY_SEPARATOR;
45392use function copy;
45393use function date;
45394use function dirname;
45395use function substr;
45396use PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage;
45397use PHPUnit\SebastianBergmann\CodeCoverage\Directory as DirectoryUtil;
45398use PHPUnit\SebastianBergmann\CodeCoverage\Node\Directory as DirectoryNode;
45399final class Facade
45400{
45401    /**
45402     * @var string
45403     */
45404    private $templatePath;
45405    /**
45406     * @var string
45407     */
45408    private $generator;
45409    /**
45410     * @var int
45411     */
45412    private $lowUpperBound;
45413    /**
45414     * @var int
45415     */
45416    private $highLowerBound;
45417    public function __construct(int $lowUpperBound = 50, int $highLowerBound = 90, string $generator = '')
45418    {
45419        $this->generator = $generator;
45420        $this->highLowerBound = $highLowerBound;
45421        $this->lowUpperBound = $lowUpperBound;
45422        $this->templatePath = __DIR__ . '/Renderer/Template/';
45423    }
45424    public function process(CodeCoverage $coverage, string $target) : void
45425    {
45426        $target = $this->directory($target);
45427        $report = $coverage->getReport();
45428        $date = date('D M j G:i:s T Y');
45429        $dashboard = new Dashboard($this->templatePath, $this->generator, $date, $this->lowUpperBound, $this->highLowerBound, $coverage->collectsBranchAndPathCoverage());
45430        $directory = new Directory($this->templatePath, $this->generator, $date, $this->lowUpperBound, $this->highLowerBound, $coverage->collectsBranchAndPathCoverage());
45431        $file = new File($this->templatePath, $this->generator, $date, $this->lowUpperBound, $this->highLowerBound, $coverage->collectsBranchAndPathCoverage());
45432        $directory->render($report, $target . 'index.html');
45433        $dashboard->render($report, $target . 'dashboard.html');
45434        foreach ($report as $node) {
45435            $id = $node->id();
45436            if ($node instanceof DirectoryNode) {
45437                DirectoryUtil::create($target . $id);
45438                $directory->render($node, $target . $id . '/index.html');
45439                $dashboard->render($node, $target . $id . '/dashboard.html');
45440            } else {
45441                $dir = dirname($target . $id);
45442                DirectoryUtil::create($dir);
45443                $file->render($node, $target . $id);
45444            }
45445        }
45446        $this->copyFiles($target);
45447    }
45448    private function copyFiles(string $target) : void
45449    {
45450        $dir = $this->directory($target . '_css');
45451        copy($this->templatePath . 'css/bootstrap.min.css', $dir . 'bootstrap.min.css');
45452        copy($this->templatePath . 'css/nv.d3.min.css', $dir . 'nv.d3.min.css');
45453        copy($this->templatePath . 'css/style.css', $dir . 'style.css');
45454        copy($this->templatePath . 'css/custom.css', $dir . 'custom.css');
45455        copy($this->templatePath . 'css/octicons.css', $dir . 'octicons.css');
45456        $dir = $this->directory($target . '_icons');
45457        copy($this->templatePath . 'icons/file-code.svg', $dir . 'file-code.svg');
45458        copy($this->templatePath . 'icons/file-directory.svg', $dir . 'file-directory.svg');
45459        $dir = $this->directory($target . '_js');
45460        copy($this->templatePath . 'js/bootstrap.min.js', $dir . 'bootstrap.min.js');
45461        copy($this->templatePath . 'js/popper.min.js', $dir . 'popper.min.js');
45462        copy($this->templatePath . 'js/d3.min.js', $dir . 'd3.min.js');
45463        copy($this->templatePath . 'js/jquery.min.js', $dir . 'jquery.min.js');
45464        copy($this->templatePath . 'js/nv.d3.min.js', $dir . 'nv.d3.min.js');
45465        copy($this->templatePath . 'js/file.js', $dir . 'file.js');
45466    }
45467    private function directory(string $directory) : string
45468    {
45469        if (substr($directory, -1, 1) != \DIRECTORY_SEPARATOR) {
45470            $directory .= \DIRECTORY_SEPARATOR;
45471        }
45472        DirectoryUtil::create($directory);
45473        return $directory;
45474    }
45475}
45476<?php
45477
45478declare (strict_types=1);
45479/*
45480 * This file is part of phpunit/php-code-coverage.
45481 *
45482 * (c) Sebastian Bergmann <sebastian@phpunit.de>
45483 *
45484 * For the full copyright and license information, please view the LICENSE
45485 * file that was distributed with this source code.
45486 */
45487namespace PHPUnit\SebastianBergmann\CodeCoverage\Report\Html;
45488
45489use function array_pop;
45490use function count;
45491use function sprintf;
45492use function str_repeat;
45493use function substr_count;
45494use PHPUnit\SebastianBergmann\CodeCoverage\Node\AbstractNode;
45495use PHPUnit\SebastianBergmann\CodeCoverage\Node\Directory as DirectoryNode;
45496use PHPUnit\SebastianBergmann\CodeCoverage\Node\File as FileNode;
45497use PHPUnit\SebastianBergmann\CodeCoverage\Version;
45498use PHPUnit\SebastianBergmann\Environment\Runtime;
45499use PHPUnit\SebastianBergmann\Template\Template;
45500/**
45501 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
45502 */
45503abstract class Renderer
45504{
45505    /**
45506     * @var string
45507     */
45508    protected $templatePath;
45509    /**
45510     * @var string
45511     */
45512    protected $generator;
45513    /**
45514     * @var string
45515     */
45516    protected $date;
45517    /**
45518     * @var int
45519     */
45520    protected $lowUpperBound;
45521    /**
45522     * @var int
45523     */
45524    protected $highLowerBound;
45525    /**
45526     * @var bool
45527     */
45528    protected $hasBranchCoverage;
45529    /**
45530     * @var string
45531     */
45532    protected $version;
45533    public function __construct(string $templatePath, string $generator, string $date, int $lowUpperBound, int $highLowerBound, bool $hasBranchCoverage)
45534    {
45535        $this->templatePath = $templatePath;
45536        $this->generator = $generator;
45537        $this->date = $date;
45538        $this->lowUpperBound = $lowUpperBound;
45539        $this->highLowerBound = $highLowerBound;
45540        $this->version = Version::id();
45541        $this->hasBranchCoverage = $hasBranchCoverage;
45542    }
45543    protected function renderItemTemplate(Template $template, array $data) : string
45544    {
45545        $numSeparator = '&nbsp;/&nbsp;';
45546        if (isset($data['numClasses']) && $data['numClasses'] > 0) {
45547            $classesLevel = $this->colorLevel($data['testedClassesPercent']);
45548            $classesNumber = $data['numTestedClasses'] . $numSeparator . $data['numClasses'];
45549            $classesBar = $this->coverageBar($data['testedClassesPercent']);
45550        } else {
45551            $classesLevel = '';
45552            $classesNumber = '0' . $numSeparator . '0';
45553            $classesBar = '';
45554            $data['testedClassesPercentAsString'] = 'n/a';
45555        }
45556        if ($data['numMethods'] > 0) {
45557            $methodsLevel = $this->colorLevel($data['testedMethodsPercent']);
45558            $methodsNumber = $data['numTestedMethods'] . $numSeparator . $data['numMethods'];
45559            $methodsBar = $this->coverageBar($data['testedMethodsPercent']);
45560        } else {
45561            $methodsLevel = '';
45562            $methodsNumber = '0' . $numSeparator . '0';
45563            $methodsBar = '';
45564            $data['testedMethodsPercentAsString'] = 'n/a';
45565        }
45566        if ($data['numExecutableLines'] > 0) {
45567            $linesLevel = $this->colorLevel($data['linesExecutedPercent']);
45568            $linesNumber = $data['numExecutedLines'] . $numSeparator . $data['numExecutableLines'];
45569            $linesBar = $this->coverageBar($data['linesExecutedPercent']);
45570        } else {
45571            $linesLevel = '';
45572            $linesNumber = '0' . $numSeparator . '0';
45573            $linesBar = '';
45574            $data['linesExecutedPercentAsString'] = 'n/a';
45575        }
45576        if ($data['numExecutablePaths'] > 0) {
45577            $pathsLevel = $this->colorLevel($data['pathsExecutedPercent']);
45578            $pathsNumber = $data['numExecutedPaths'] . $numSeparator . $data['numExecutablePaths'];
45579            $pathsBar = $this->coverageBar($data['pathsExecutedPercent']);
45580        } else {
45581            $pathsLevel = '';
45582            $pathsNumber = '0' . $numSeparator . '0';
45583            $pathsBar = '';
45584            $data['pathsExecutedPercentAsString'] = 'n/a';
45585        }
45586        if ($data['numExecutableBranches'] > 0) {
45587            $branchesLevel = $this->colorLevel($data['branchesExecutedPercent']);
45588            $branchesNumber = $data['numExecutedBranches'] . $numSeparator . $data['numExecutableBranches'];
45589            $branchesBar = $this->coverageBar($data['branchesExecutedPercent']);
45590        } else {
45591            $branchesLevel = '';
45592            $branchesNumber = '0' . $numSeparator . '0';
45593            $branchesBar = '';
45594            $data['branchesExecutedPercentAsString'] = 'n/a';
45595        }
45596        $template->setVar(['icon' => $data['icon'] ?? '', 'crap' => $data['crap'] ?? '', 'name' => $data['name'], 'lines_bar' => $linesBar, 'lines_executed_percent' => $data['linesExecutedPercentAsString'], 'lines_level' => $linesLevel, 'lines_number' => $linesNumber, 'paths_bar' => $pathsBar, 'paths_executed_percent' => $data['pathsExecutedPercentAsString'], 'paths_level' => $pathsLevel, 'paths_number' => $pathsNumber, 'branches_bar' => $branchesBar, 'branches_executed_percent' => $data['branchesExecutedPercentAsString'], 'branches_level' => $branchesLevel, 'branches_number' => $branchesNumber, 'methods_bar' => $methodsBar, 'methods_tested_percent' => $data['testedMethodsPercentAsString'], 'methods_level' => $methodsLevel, 'methods_number' => $methodsNumber, 'classes_bar' => $classesBar, 'classes_tested_percent' => $data['testedClassesPercentAsString'] ?? '', 'classes_level' => $classesLevel, 'classes_number' => $classesNumber]);
45597        return $template->render();
45598    }
45599    protected function setCommonTemplateVariables(Template $template, AbstractNode $node) : void
45600    {
45601        $template->setVar(['id' => $node->id(), 'full_path' => $node->pathAsString(), 'path_to_root' => $this->pathToRoot($node), 'breadcrumbs' => $this->breadcrumbs($node), 'date' => $this->date, 'version' => $this->version, 'runtime' => $this->runtimeString(), 'generator' => $this->generator, 'low_upper_bound' => $this->lowUpperBound, 'high_lower_bound' => $this->highLowerBound]);
45602    }
45603    protected function breadcrumbs(AbstractNode $node) : string
45604    {
45605        $breadcrumbs = '';
45606        $path = $node->pathAsArray();
45607        $pathToRoot = [];
45608        $max = count($path);
45609        if ($node instanceof FileNode) {
45610            $max--;
45611        }
45612        for ($i = 0; $i < $max; $i++) {
45613            $pathToRoot[] = str_repeat('../', $i);
45614        }
45615        foreach ($path as $step) {
45616            if ($step !== $node) {
45617                $breadcrumbs .= $this->inactiveBreadcrumb($step, array_pop($pathToRoot));
45618            } else {
45619                $breadcrumbs .= $this->activeBreadcrumb($step);
45620            }
45621        }
45622        return $breadcrumbs;
45623    }
45624    protected function activeBreadcrumb(AbstractNode $node) : string
45625    {
45626        $buffer = sprintf('         <li class="breadcrumb-item active">%s</li>' . "\n", $node->name());
45627        if ($node instanceof DirectoryNode) {
45628            $buffer .= '         <li class="breadcrumb-item">(<a href="dashboard.html">Dashboard</a>)</li>' . "\n";
45629        }
45630        return $buffer;
45631    }
45632    protected function inactiveBreadcrumb(AbstractNode $node, string $pathToRoot) : string
45633    {
45634        return sprintf('         <li class="breadcrumb-item"><a href="%sindex.html">%s</a></li>' . "\n", $pathToRoot, $node->name());
45635    }
45636    protected function pathToRoot(AbstractNode $node) : string
45637    {
45638        $id = $node->id();
45639        $depth = substr_count($id, '/');
45640        if ($id !== 'index' && $node instanceof DirectoryNode) {
45641            $depth++;
45642        }
45643        return str_repeat('../', $depth);
45644    }
45645    protected function coverageBar(float $percent) : string
45646    {
45647        $level = $this->colorLevel($percent);
45648        $templateName = $this->templatePath . ($this->hasBranchCoverage ? 'coverage_bar_branch.html' : 'coverage_bar.html');
45649        $template = new Template($templateName, '{{', '}}');
45650        $template->setVar(['level' => $level, 'percent' => sprintf('%.2F', $percent)]);
45651        return $template->render();
45652    }
45653    protected function colorLevel(float $percent) : string
45654    {
45655        if ($percent <= $this->lowUpperBound) {
45656            return 'danger';
45657        }
45658        if ($percent > $this->lowUpperBound && $percent < $this->highLowerBound) {
45659            return 'warning';
45660        }
45661        return 'success';
45662    }
45663    private function runtimeString() : string
45664    {
45665        $runtime = new Runtime();
45666        return sprintf('<a href="%s" target="_top">%s %s</a>', $runtime->getVendorUrl(), $runtime->getName(), $runtime->getVersion());
45667    }
45668}
45669<!DOCTYPE html>
45670<html lang="en">
45671 <head>
45672  <meta charset="UTF-8">
45673  <title>Code Coverage for {{full_path}}</title>
45674  <meta name="viewport" content="width=device-width, initial-scale=1.0">
45675  <link href="{{path_to_root}}_css/bootstrap.min.css" rel="stylesheet" type="text/css">
45676  <link href="{{path_to_root}}_css/octicons.css" rel="stylesheet" type="text/css">
45677  <link href="{{path_to_root}}_css/style.css" rel="stylesheet" type="text/css">
45678  <link href="{{path_to_root}}_css/custom.css" rel="stylesheet" type="text/css">
45679 </head>
45680 <body>
45681  <header>
45682   <div class="container-fluid">
45683    <div class="row">
45684     <div class="col-md-12">
45685      <nav aria-label="breadcrumb">
45686       <ol class="breadcrumb">
45687{{breadcrumbs}}
45688       </ol>
45689      </nav>
45690     </div>
45691    </div>
45692   </div>
45693  </header>
45694  <div class="container-fluid">
45695   <div class="table-responsive">
45696    <table class="table table-bordered">
45697     <thead>
45698      <tr>
45699       <td>&nbsp;</td>
45700       <td colspan="10"><div align="center"><strong>Code Coverage</strong></div></td>
45701      </tr>
45702      <tr>
45703       <td>&nbsp;</td>
45704       <td colspan="3"><div align="center"><strong>Classes and Traits</strong></div></td>
45705       <td colspan="4"><div align="center"><strong>Functions and Methods</strong></div></td>
45706       <td colspan="3"><div align="center"><strong>Lines</strong></div></td>
45707      </tr>
45708     </thead>
45709     <tbody>
45710{{items}}
45711     </tbody>
45712    </table>
45713   </div>
45714{{lines}}
45715{{structure}}
45716   <footer>
45717    <hr/>
45718    <h4>Legend</h4>
45719    {{legend}}
45720    <p>
45721     <small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage {{version}}</a> using {{runtime}}{{generator}} at {{date}}.</small>
45722    </p>
45723    <a title="Back to the top" id="toplink" href="#">
45724        <svg xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewBox="0 0 12 16"><path fill-rule="evenodd" d="M12 11L6 5l-6 6h12z"/></svg>
45725    </a>
45726   </footer>
45727  </div>
45728  <script src="{{path_to_root}}_js/jquery.min.js" type="text/javascript"></script>
45729  <script src="{{path_to_root}}_js/popper.min.js" type="text/javascript"></script>
45730  <script src="{{path_to_root}}_js/bootstrap.min.js" type="text/javascript"></script>
45731  <script src="{{path_to_root}}_js/file.js" type="text/javascript"></script>
45732 </body>
45733</html>
45734       <div class="progress">
45735         <div class="progress-bar bg-{{level}}" role="progressbar" aria-valuenow="{{percent}}" aria-valuemin="0" aria-valuemax="100" style="width: {{percent}}%">
45736           <span class="sr-only">{{percent}}% covered ({{level}})</span>
45737         </div>
45738       </div>
45739<!DOCTYPE html>
45740<html lang="en">
45741 <head>
45742  <meta charset="UTF-8">
45743  <title>Dashboard for {{full_path}}</title>
45744  <meta name="viewport" content="width=device-width, initial-scale=1.0">
45745  <link href="{{path_to_root}}_css/bootstrap.min.css" rel="stylesheet" type="text/css">
45746  <link href="{{path_to_root}}_css/nv.d3.min.css" rel="stylesheet" type="text/css">
45747  <link href="{{path_to_root}}_css/style.css" rel="stylesheet" type="text/css">
45748  <link href="{{path_to_root}}_css/custom.css" rel="stylesheet" type="text/css">
45749 </head>
45750 <body>
45751  <header>
45752   <div class="container-fluid">
45753    <div class="row">
45754     <div class="col-md-12">
45755      <nav aria-label="breadcrumb">
45756       <ol class="breadcrumb">
45757{{breadcrumbs}}
45758       </ol>
45759      </nav>
45760     </div>
45761    </div>
45762   </div>
45763  </header>
45764  <div class="container-fluid">
45765   <div class="row">
45766    <div class="col-md-12">
45767     <h2>Classes</h2>
45768    </div>
45769   </div>
45770   <div class="row">
45771    <div class="col-md-6">
45772     <h3>Coverage Distribution</h3>
45773     <div id="classCoverageDistribution" style="height: 300px;">
45774       <svg></svg>
45775     </div>
45776    </div>
45777    <div class="col-md-6">
45778     <h3>Complexity</h3>
45779     <div id="classComplexity" style="height: 300px;">
45780       <svg></svg>
45781     </div>
45782    </div>
45783   </div>
45784   <div class="row">
45785    <div class="col-md-6">
45786     <h3>Insufficient Coverage</h3>
45787     <div class="scrollbox">
45788      <table class="table">
45789       <thead>
45790        <tr>
45791         <th>Class</th>
45792         <th class="text-right">Coverage</th>
45793        </tr>
45794       </thead>
45795       <tbody>
45796{{insufficient_coverage_classes}}
45797       </tbody>
45798      </table>
45799     </div>
45800    </div>
45801    <div class="col-md-6">
45802     <h3>Project Risks</h3>
45803     <div class="scrollbox">
45804      <table class="table">
45805       <thead>
45806        <tr>
45807         <th>Class</th>
45808         <th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
45809        </tr>
45810       </thead>
45811       <tbody>
45812{{project_risks_classes}}
45813       </tbody>
45814      </table>
45815     </div>
45816    </div>
45817   </div>
45818   <div class="row">
45819    <div class="col-md-12">
45820     <h2>Methods</h2>
45821    </div>
45822   </div>
45823   <div class="row">
45824    <div class="col-md-6">
45825     <h3>Coverage Distribution</h3>
45826     <div id="methodCoverageDistribution" style="height: 300px;">
45827       <svg></svg>
45828     </div>
45829    </div>
45830    <div class="col-md-6">
45831     <h3>Complexity</h3>
45832     <div id="methodComplexity" style="height: 300px;">
45833       <svg></svg>
45834     </div>
45835    </div>
45836   </div>
45837   <div class="row">
45838    <div class="col-md-6">
45839     <h3>Insufficient Coverage</h3>
45840     <div class="scrollbox">
45841      <table class="table">
45842       <thead>
45843        <tr>
45844         <th>Method</th>
45845         <th class="text-right">Coverage</th>
45846        </tr>
45847       </thead>
45848       <tbody>
45849{{insufficient_coverage_methods}}
45850       </tbody>
45851      </table>
45852     </div>
45853    </div>
45854    <div class="col-md-6">
45855     <h3>Project Risks</h3>
45856     <div class="scrollbox">
45857      <table class="table">
45858       <thead>
45859        <tr>
45860         <th>Method</th>
45861         <th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
45862        </tr>
45863       </thead>
45864       <tbody>
45865{{project_risks_methods}}
45866       </tbody>
45867      </table>
45868     </div>
45869    </div>
45870   </div>
45871   <footer>
45872    <hr/>
45873    <p>
45874     <small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage {{version}}</a> using {{runtime}}{{generator}} at {{date}}.</small>
45875    </p>
45876   </footer>
45877  </div>
45878  <script src="{{path_to_root}}_js/jquery.min.js" type="text/javascript"></script>
45879  <script src="{{path_to_root}}_js/d3.min.js" type="text/javascript"></script>
45880  <script src="{{path_to_root}}_js/nv.d3.min.js" type="text/javascript"></script>
45881  <script type="text/javascript">
45882$(document).ready(function() {
45883  nv.addGraph(function() {
45884    var chart = nv.models.multiBarChart();
45885    chart.tooltips(false)
45886      .showControls(false)
45887      .showLegend(false)
45888      .reduceXTicks(false)
45889      .staggerLabels(true)
45890      .yAxis.tickFormat(d3.format('d'));
45891
45892    d3.select('#classCoverageDistribution svg')
45893      .datum(getCoverageDistributionData({{class_coverage_distribution}}, "Class Coverage"))
45894      .transition().duration(500).call(chart);
45895
45896    nv.utils.windowResize(chart.update);
45897
45898    return chart;
45899  });
45900
45901  nv.addGraph(function() {
45902    var chart = nv.models.multiBarChart();
45903    chart.tooltips(false)
45904      .showControls(false)
45905      .showLegend(false)
45906      .reduceXTicks(false)
45907      .staggerLabels(true)
45908      .yAxis.tickFormat(d3.format('d'));
45909
45910    d3.select('#methodCoverageDistribution svg')
45911      .datum(getCoverageDistributionData({{method_coverage_distribution}}, "Method Coverage"))
45912      .transition().duration(500).call(chart);
45913
45914    nv.utils.windowResize(chart.update);
45915
45916    return chart;
45917  });
45918
45919  function getCoverageDistributionData(data, label) {
45920    var labels = [
45921      '0%',
45922      '0-10%',
45923      '10-20%',
45924      '20-30%',
45925      '30-40%',
45926      '40-50%',
45927      '50-60%',
45928      '60-70%',
45929      '70-80%',
45930      '80-90%',
45931      '90-100%',
45932      '100%'
45933    ];
45934    var values = [];
45935    $.each(labels, function(key) {
45936      values.push({x: labels[key], y: data[key]});
45937    });
45938
45939    return [
45940      {
45941        key: label,
45942        values: values,
45943        color: "#4572A7"
45944      }
45945    ];
45946  }
45947  nv.addGraph(function() {
45948    var chart = nv.models.scatterChart()
45949      .showDistX(true)
45950      .showDistY(true)
45951      .showLegend(false)
45952      .forceX([0, 100]);
45953    chart.tooltipContent(function(graph) {
45954      return '<p>' + graph.point.class + '</p>';
45955    });
45956
45957    chart.xAxis.axisLabel('Code Coverage (in percent)');
45958    chart.yAxis.axisLabel('Cyclomatic Complexity');
45959
45960    d3.select('#classComplexity svg')
45961      .datum(getComplexityData({{complexity_class}}, 'Class Complexity'))
45962      .transition()
45963      .duration(500)
45964      .call(chart);
45965
45966    nv.utils.windowResize(chart.update);
45967
45968    return chart;
45969  });
45970
45971  nv.addGraph(function() {
45972    var chart = nv.models.scatterChart()
45973      .showDistX(true)
45974      .showDistY(true)
45975      .showLegend(false)
45976      .forceX([0, 100]);
45977    chart.tooltipContent(function(graph) {
45978      return '<p>' + graph.point.class + '</p>';
45979    });
45980
45981    chart.xAxis.axisLabel('Code Coverage (in percent)');
45982    chart.yAxis.axisLabel('Method Complexity');
45983
45984    d3.select('#methodComplexity svg')
45985      .datum(getComplexityData({{complexity_method}}, 'Method Complexity'))
45986      .transition()
45987      .duration(500)
45988      .call(chart);
45989
45990    nv.utils.windowResize(chart.update);
45991
45992    return chart;
45993  });
45994
45995  function getComplexityData(data, label) {
45996    var values = [];
45997    $.each(data, function(key) {
45998      var value = Math.round(data[key][0]*100) / 100;
45999      values.push({
46000        x: value,
46001        y: data[key][1],
46002        class: data[key][2],
46003        size: 0.05,
46004        shape: 'diamond'
46005      });
46006    });
46007
46008    return [
46009      {
46010        key: label,
46011        values: values,
46012        color: "#4572A7"
46013      }
46014    ];
46015  }
46016});
46017  </script>
46018 </body>
46019</html>
46020<hr/>
46021<h4>Paths</h4>
46022<p>
46023    Below are the source code lines that represent each code path as identified by Xdebug. Please note a path is not
46024    necessarily coterminous with a line, a line may contain multiple paths and therefore show up more than once.
46025    Please also be aware that some paths may include implicit rather than explicit branches, e.g. an <code>if</code> statement
46026    <i>always</i> has an <code>else</code> as part of its logical flow even if you didn't write one.
46027</p>
46028{{paths}}
46029<!DOCTYPE html>
46030<html lang="en">
46031 <head>
46032  <meta charset="UTF-8">
46033  <title>Code Coverage for {{full_path}}</title>
46034  <meta name="viewport" content="width=device-width, initial-scale=1.0">
46035  <link href="{{path_to_root}}_css/bootstrap.min.css" rel="stylesheet" type="text/css">
46036  <link href="{{path_to_root}}_css/octicons.css" rel="stylesheet" type="text/css">
46037  <link href="{{path_to_root}}_css/style.css" rel="stylesheet" type="text/css">
46038  <link href="{{path_to_root}}_css/custom.css" rel="stylesheet" type="text/css">
46039 </head>
46040 <body>
46041  <header>
46042   <div class="container-fluid">
46043    <div class="row">
46044     <div class="col-md-12">
46045      <nav aria-label="breadcrumb">
46046       <ol class="breadcrumb">
46047{{breadcrumbs}}
46048       </ol>
46049      </nav>
46050     </div>
46051    </div>
46052   </div>
46053  </header>
46054  <div class="container-fluid">
46055   <div class="table-responsive">
46056    <table class="table table-bordered">
46057     <thead>
46058      <tr>
46059       <td>&nbsp;</td>
46060       <td colspan="9"><div align="center"><strong>Code Coverage</strong></div></td>
46061      </tr>
46062      <tr>
46063       <td>&nbsp;</td>
46064       <td colspan="3"><div align="center"><strong>Lines</strong></div></td>
46065       <td colspan="3"><div align="center"><strong>Functions and Methods</strong></div></td>
46066       <td colspan="3"><div align="center"><strong>Classes and Traits</strong></div></td>
46067      </tr>
46068     </thead>
46069     <tbody>
46070{{items}}
46071     </tbody>
46072    </table>
46073   </div>
46074   <footer>
46075    <hr/>
46076    <h4>Legend</h4>
46077    <p>
46078     <span class="danger"><strong>Low</strong>: 0% to {{low_upper_bound}}%</span>
46079     <span class="warning"><strong>Medium</strong>: {{low_upper_bound}}% to {{high_lower_bound}}%</span>
46080     <span class="success"><strong>High</strong>: {{high_lower_bound}}% to 100%</span>
46081    </p>
46082    <p>
46083     <small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage {{version}}</a> using {{runtime}}{{generator}} at {{date}}.</small>
46084    </p>
46085   </footer>
46086  </div>
46087 </body>
46088</html>
46089/* nvd3 version 1.8.1 (https://github.com/novus/nvd3) 2015-06-15 */
46090!function(){var a={};a.dev=!1,a.tooltip=a.tooltip||{},a.utils=a.utils||{},a.models=a.models||{},a.charts={},a.logs={},a.dom={},a.dispatch=d3.dispatch("render_start","render_end"),Function.prototype.bind||(Function.prototype.bind=function(a){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),c=this,d=function(){},e=function(){return c.apply(this instanceof d&&a?this:a,b.concat(Array.prototype.slice.call(arguments)))};return d.prototype=this.prototype,e.prototype=new d,e}),a.dev&&(a.dispatch.on("render_start",function(){a.logs.startTime=+new Date}),a.dispatch.on("render_end",function(){a.logs.endTime=+new Date,a.logs.totalTime=a.logs.endTime-a.logs.startTime,a.log("total",a.logs.totalTime)})),a.log=function(){if(a.dev&&window.console&&console.log&&console.log.apply)console.log.apply(console,arguments);else if(a.dev&&window.console&&"function"==typeof console.log&&Function.prototype.bind){var b=Function.prototype.bind.call(console.log,console);b.apply(console,arguments)}return arguments[arguments.length-1]},a.deprecated=function(a,b){console&&console.warn&&console.warn("nvd3 warning: `"+a+"` has been deprecated. ",b||"")},a.render=function(b){b=b||1,a.render.active=!0,a.dispatch.render_start();var c=function(){for(var d,e,f=0;b>f&&(e=a.render.queue[f]);f++)d=e.generate(),typeof e.callback==typeof Function&&e.callback(d);a.render.queue.splice(0,f),a.render.queue.length?setTimeout(c):(a.dispatch.render_end(),a.render.active=!1)};setTimeout(c)},a.render.active=!1,a.render.queue=[],a.addGraph=function(b){typeof arguments[0]==typeof Function&&(b={generate:arguments[0],callback:arguments[1]}),a.render.queue.push(b),a.render.active||a.render()},"undefined"!=typeof module&&"undefined"!=typeof exports&&(module.exports=a),"undefined"!=typeof window&&(window.nv=a),a.dom.write=function(a){return void 0!==window.fastdom?fastdom.write(a):a()},a.dom.read=function(a){return void 0!==window.fastdom?fastdom.read(a):a()},a.interactiveGuideline=function(){"use strict";function b(l){l.each(function(l){function m(){var a=d3.mouse(this),d=a[0],e=a[1],i=!0,j=!1;if(k&&(d=d3.event.offsetX,e=d3.event.offsetY,"svg"!==d3.event.target.tagName&&(i=!1),d3.event.target.className.baseVal.match("nv-legend")&&(j=!0)),i&&(d-=f.left,e-=f.top),0>d||0>e||d>o||e>p||d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement||j){if(k&&d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement&&(void 0===d3.event.relatedTarget.className||d3.event.relatedTarget.className.match(c.nvPointerEventsClass)))return;return h.elementMouseout({mouseX:d,mouseY:e}),b.renderGuideLine(null),void c.hidden(!0)}c.hidden(!1);var l=g.invert(d);h.elementMousemove({mouseX:d,mouseY:e,pointXValue:l}),"dblclick"===d3.event.type&&h.elementDblclick({mouseX:d,mouseY:e,pointXValue:l}),"click"===d3.event.type&&h.elementClick({mouseX:d,mouseY:e,pointXValue:l})}var n=d3.select(this),o=d||960,p=e||400,q=n.selectAll("g.nv-wrap.nv-interactiveLineLayer").data([l]),r=q.enter().append("g").attr("class"," nv-wrap nv-interactiveLineLayer");r.append("g").attr("class","nv-interactiveGuideLine"),j&&(j.on("touchmove",m).on("mousemove",m,!0).on("mouseout",m,!0).on("dblclick",m).on("click",m),b.guideLine=null,b.renderGuideLine=function(c){i&&(b.guideLine&&b.guideLine.attr("x1")===c||a.dom.write(function(){var b=q.select(".nv-interactiveGuideLine").selectAll("line").data(null!=c?[a.utils.NaNtoZero(c)]:[],String);b.enter().append("line").attr("class","nv-guideline").attr("x1",function(a){return a}).attr("x2",function(a){return a}).attr("y1",p).attr("y2",0),b.exit().remove()}))})})}var c=a.models.tooltip();c.duration(0).hideDelay(0)._isInteractiveLayer(!0).hidden(!1);var d=null,e=null,f={left:0,top:0},g=d3.scale.linear(),h=d3.dispatch("elementMousemove","elementMouseout","elementClick","elementDblclick"),i=!0,j=null,k="ActiveXObject"in window;return b.dispatch=h,b.tooltip=c,b.margin=function(a){return arguments.length?(f.top="undefined"!=typeof a.top?a.top:f.top,f.left="undefined"!=typeof a.left?a.left:f.left,b):f},b.width=function(a){return arguments.length?(d=a,b):d},b.height=function(a){return arguments.length?(e=a,b):e},b.xScale=function(a){return arguments.length?(g=a,b):g},b.showGuideLine=function(a){return arguments.length?(i=a,b):i},b.svgContainer=function(a){return arguments.length?(j=a,b):j},b},a.interactiveBisect=function(a,b,c){"use strict";if(!(a instanceof Array))return null;var d;d="function"!=typeof c?function(a){return a.x}:c;var e=function(a,b){return d(a)-b},f=d3.bisector(e).left,g=d3.max([0,f(a,b)-1]),h=d(a[g]);if("undefined"==typeof h&&(h=g),h===b)return g;var i=d3.min([g+1,a.length-1]),j=d(a[i]);return"undefined"==typeof j&&(j=i),Math.abs(j-b)>=Math.abs(h-b)?g:i},a.nearestValueIndex=function(a,b,c){"use strict";var d=1/0,e=null;return a.forEach(function(a,f){var g=Math.abs(b-a);null!=a&&d>=g&&c>g&&(d=g,e=f)}),e},function(){"use strict";a.models.tooltip=function(){function b(){if(k){var a=d3.select(k);"svg"!==a.node().tagName&&(a=a.select("svg"));var b=a.node()?a.attr("viewBox"):null;if(b){b=b.split(" ");var c=parseInt(a.style("width"),10)/b[2];p.left=p.left*c,p.top=p.top*c}}}function c(){if(!n){var a;a=k?k:document.body,n=d3.select(a).append("div").attr("class","nvtooltip "+(j?j:"xy-tooltip")).attr("id",v),n.style("top",0).style("left",0),n.style("opacity",0),n.selectAll("div, table, td, tr").classed(w,!0),n.classed(w,!0),o=n.node()}}function d(){if(r&&B(e)){b();var f=p.left,g=null!==i?i:p.top;return a.dom.write(function(){c();var b=A(e);b&&(o.innerHTML=b),k&&u?a.dom.read(function(){var a=k.getElementsByTagName("svg")[0],b={left:0,top:0};if(a){var c=a.getBoundingClientRect(),d=k.getBoundingClientRect(),e=c.top;if(0>e){var i=k.getBoundingClientRect();e=Math.abs(e)>i.height?0:e}b.top=Math.abs(e-d.top),b.left=Math.abs(c.left-d.left)}f+=k.offsetLeft+b.left-2*k.scrollLeft,g+=k.offsetTop+b.top-2*k.scrollTop,h&&h>0&&(g=Math.floor(g/h)*h),C([f,g])}):C([f,g])}),d}}var e=null,f="w",g=25,h=0,i=null,j=null,k=null,l=!0,m=400,n=null,o=null,p={left:null,top:null},q={left:0,top:0},r=!0,s=100,t=!0,u=!1,v="nvtooltip-"+Math.floor(1e5*Math.random()),w="nv-pointer-events-none",x=function(a){return a},y=function(a){return a},z=function(a){return a},A=function(a){if(null===a)return"";var b=d3.select(document.createElement("table"));if(t){var c=b.selectAll("thead").data([a]).enter().append("thead");c.append("tr").append("td").attr("colspan",3).append("strong").classed("x-value",!0).html(y(a.value))}var d=b.selectAll("tbody").data([a]).enter().append("tbody"),e=d.selectAll("tr").data(function(a){return a.series}).enter().append("tr").classed("highlight",function(a){return a.highlight});e.append("td").classed("legend-color-guide",!0).append("div").style("background-color",function(a){return a.color}),e.append("td").classed("key",!0).html(function(a,b){return z(a.key,b)}),e.append("td").classed("value",!0).html(function(a,b){return x(a.value,b)}),e.selectAll("td").each(function(a){if(a.highlight){var b=d3.scale.linear().domain([0,1]).range(["#fff",a.color]),c=.6;d3.select(this).style("border-bottom-color",b(c)).style("border-top-color",b(c))}});var f=b.node().outerHTML;return void 0!==a.footer&&(f+="<div class='footer'>"+a.footer+"</div>"),f},B=function(a){if(a&&a.series){if(a.series instanceof Array)return!!a.series.length;if(a.series instanceof Object)return a.series=[a.series],!0}return!1},C=function(b){o&&a.dom.read(function(){var c,d,e=parseInt(o.offsetHeight,10),h=parseInt(o.offsetWidth,10),i=a.utils.windowSize().width,j=a.utils.windowSize().height,k=window.pageYOffset,p=window.pageXOffset;j=window.innerWidth>=document.body.scrollWidth?j:j-16,i=window.innerHeight>=document.body.scrollHeight?i:i-16;var r,t,u=function(a){var b=d;do isNaN(a.offsetTop)||(b+=a.offsetTop),a=a.offsetParent;while(a);return b},v=function(a){var b=c;do isNaN(a.offsetLeft)||(b+=a.offsetLeft),a=a.offsetParent;while(a);return b};switch(f){case"e":c=b[0]-h-g,d=b[1]-e/2,r=v(o),t=u(o),p>r&&(c=b[0]+g>p?b[0]+g:p-r+c),k>t&&(d=k-t+d),t+e>k+j&&(d=k+j-t+d-e);break;case"w":c=b[0]+g,d=b[1]-e/2,r=v(o),t=u(o),r+h>i&&(c=b[0]-h-g),k>t&&(d=k+5),t+e>k+j&&(d=k+j-t+d-e);break;case"n":c=b[0]-h/2-5,d=b[1]+g,r=v(o),t=u(o),p>r&&(c=p+5),r+h>i&&(c=c-h/2+5),t+e>k+j&&(d=k+j-t+d-e);break;case"s":c=b[0]-h/2,d=b[1]-e-g,r=v(o),t=u(o),p>r&&(c=p+5),r+h>i&&(c=c-h/2+5),k>t&&(d=k);break;case"none":c=b[0],d=b[1]-g,r=v(o),t=u(o)}c-=q.left,d-=q.top;var w=o.getBoundingClientRect(),k=window.pageYOffset||document.documentElement.scrollTop,p=window.pageXOffset||document.documentElement.scrollLeft,x="translate("+(w.left+p)+"px, "+(w.top+k)+"px)",y="translate("+c+"px, "+d+"px)",z=d3.interpolateString(x,y),A=n.style("opacity")<.1;l?n.transition().delay(m).duration(0).style("opacity",0):n.interrupt().transition().duration(A?0:s).styleTween("transform",function(){return z},"important").style("-webkit-transform",y).style("opacity",1)})};return d.nvPointerEventsClass=w,d.options=a.utils.optionsFunc.bind(d),d._options=Object.create({},{duration:{get:function(){return s},set:function(a){s=a}},gravity:{get:function(){return f},set:function(a){f=a}},distance:{get:function(){return g},set:function(a){g=a}},snapDistance:{get:function(){return h},set:function(a){h=a}},classes:{get:function(){return j},set:function(a){j=a}},chartContainer:{get:function(){return k},set:function(a){k=a}},fixedTop:{get:function(){return i},set:function(a){i=a}},enabled:{get:function(){return r},set:function(a){r=a}},hideDelay:{get:function(){return m},set:function(a){m=a}},contentGenerator:{get:function(){return A},set:function(a){A=a}},valueFormatter:{get:function(){return x},set:function(a){x=a}},headerFormatter:{get:function(){return y},set:function(a){y=a}},keyFormatter:{get:function(){return z},set:function(a){z=a}},headerEnabled:{get:function(){return t},set:function(a){t=a}},_isInteractiveLayer:{get:function(){return u},set:function(a){u=!!a}},position:{get:function(){return p},set:function(a){p.left=void 0!==a.left?a.left:p.left,p.top=void 0!==a.top?a.top:p.top}},offset:{get:function(){return q},set:function(a){q.left=void 0!==a.left?a.left:q.left,q.top=void 0!==a.top?a.top:q.top}},hidden:{get:function(){return l},set:function(a){l!=a&&(l=!!a,d())}},data:{get:function(){return e},set:function(a){a.point&&(a.value=a.point.x,a.series=a.series||{},a.series.value=a.point.y,a.series.color=a.point.color||a.series.color),e=a}},tooltipElem:{get:function(){return o},set:function(){}},id:{get:function(){return v},set:function(){}}}),a.utils.initOptions(d),d}}(),a.utils.windowSize=function(){var a={width:640,height:480};return window.innerWidth&&window.innerHeight?(a.width=window.innerWidth,a.height=window.innerHeight,a):"CSS1Compat"==document.compatMode&&document.documentElement&&document.documentElement.offsetWidth?(a.width=document.documentElement.offsetWidth,a.height=document.documentElement.offsetHeight,a):document.body&&document.body.offsetWidth?(a.width=document.body.offsetWidth,a.height=document.body.offsetHeight,a):a},a.utils.windowResize=function(b){return window.addEventListener?window.addEventListener("resize",b):a.log("ERROR: Failed to bind to window.resize with: ",b),{callback:b,clear:function(){window.removeEventListener("resize",b)}}},a.utils.getColor=function(b){if(void 0===b)return a.utils.defaultColor();if(Array.isArray(b)){var c=d3.scale.ordinal().range(b);return function(a,b){var d=void 0===b?a:b;return a.color||c(d)}}return b},a.utils.defaultColor=function(){return a.utils.getColor(d3.scale.category20().range())},a.utils.customTheme=function(a,b,c){b=b||function(a){return a.key},c=c||d3.scale.category20().range();var d=c.length;return function(e){var f=b(e);return"function"==typeof a[f]?a[f]():void 0!==a[f]?a[f]:(d||(d=c.length),d-=1,c[d])}},a.utils.pjax=function(b,c){var d=function(d){d3.html(d,function(d){var e=d3.select(c).node();e.parentNode.replaceChild(d3.select(d).select(c).node(),e),a.utils.pjax(b,c)})};d3.selectAll(b).on("click",function(){history.pushState(this.href,this.textContent,this.href),d(this.href),d3.event.preventDefault()}),d3.select(window).on("popstate",function(){d3.event.state&&d(d3.event.state)})},a.utils.calcApproxTextWidth=function(a){if("function"==typeof a.style&&"function"==typeof a.text){var b=parseInt(a.style("font-size").replace("px",""),10),c=a.text().length;return c*b*.5}return 0},a.utils.NaNtoZero=function(a){return"number"!=typeof a||isNaN(a)||null===a||1/0===a||a===-1/0?0:a},d3.selection.prototype.watchTransition=function(a){var b=[this].concat([].slice.call(arguments,1));return a.transition.apply(a,b)},a.utils.renderWatch=function(b,c){if(!(this instanceof a.utils.renderWatch))return new a.utils.renderWatch(b,c);var d=void 0!==c?c:250,e=[],f=this;this.models=function(a){return a=[].slice.call(arguments,0),a.forEach(function(a){a.__rendered=!1,function(a){a.dispatch.on("renderEnd",function(){a.__rendered=!0,f.renderEnd("model")})}(a),e.indexOf(a)<0&&e.push(a)}),this},this.reset=function(a){void 0!==a&&(d=a),e=[]},this.transition=function(a,b,c){if(b=arguments.length>1?[].slice.call(arguments,1):[],c=b.length>1?b.pop():void 0!==d?d:250,a.__rendered=!1,e.indexOf(a)<0&&e.push(a),0===c)return a.__rendered=!0,a.delay=function(){return this},a.duration=function(){return this},a;a.__rendered=0===a.length?!0:a.every(function(a){return!a.length})?!0:!1;var g=0;return a.transition().duration(c).each(function(){++g}).each("end",function(){0===--g&&(a.__rendered=!0,f.renderEnd.apply(this,b))})},this.renderEnd=function(){e.every(function(a){return a.__rendered})&&(e.forEach(function(a){a.__rendered=!1}),b.renderEnd.apply(this,arguments))}},a.utils.deepExtend=function(b){var c=arguments.length>1?[].slice.call(arguments,1):[];c.forEach(function(c){for(var d in c){var e=b[d]instanceof Array,f="object"==typeof b[d],g="object"==typeof c[d];f&&!e&&g?a.utils.deepExtend(b[d],c[d]):b[d]=c[d]}})},a.utils.state=function(){if(!(this instanceof a.utils.state))return new a.utils.state;var b={},c=function(){},d=function(){return{}},e=null,f=null;this.dispatch=d3.dispatch("change","set"),this.dispatch.on("set",function(a){c(a,!0)}),this.getter=function(a){return d=a,this},this.setter=function(a,b){return b||(b=function(){}),c=function(c,d){a(c),d&&b()},this},this.init=function(b){e=e||{},a.utils.deepExtend(e,b)};var g=function(){var a=d();if(JSON.stringify(a)===JSON.stringify(b))return!1;for(var c in a)void 0===b[c]&&(b[c]={}),b[c]=a[c],f=!0;return!0};this.update=function(){e&&(c(e,!1),e=null),g.call(this)&&this.dispatch.change(b)}},a.utils.optionsFunc=function(a){return a&&d3.map(a).forEach(function(a,b){"function"==typeof this[a]&&this[a](b)}.bind(this)),this},a.utils.calcTicksX=function(b,c){var d=1,e=0;for(e;e<c.length;e+=1){var f=c[e]&&c[e].values?c[e].values.length:0;d=f>d?f:d}return a.log("Requested number of ticks: ",b),a.log("Calculated max values to be: ",d),b=b>d?b=d-1:b,b=1>b?1:b,b=Math.floor(b),a.log("Calculating tick count as: ",b),b},a.utils.calcTicksY=function(b,c){return a.utils.calcTicksX(b,c)},a.utils.initOption=function(a,b){a._calls&&a._calls[b]?a[b]=a._calls[b]:(a[b]=function(c){return arguments.length?(a._overrides[b]=!0,a._options[b]=c,a):a._options[b]},a["_"+b]=function(c){return arguments.length?(a._overrides[b]||(a._options[b]=c),a):a._options[b]})},a.utils.initOptions=function(b){b._overrides=b._overrides||{};var c=Object.getOwnPropertyNames(b._options||{}),d=Object.getOwnPropertyNames(b._calls||{});c=c.concat(d);for(var e in c)a.utils.initOption(b,c[e])},a.utils.inheritOptionsD3=function(a,b,c){a._d3options=c.concat(a._d3options||[]),c.unshift(b),c.unshift(a),d3.rebind.apply(this,c)},a.utils.arrayUnique=function(a){return a.sort().filter(function(b,c){return!c||b!=a[c-1]})},a.utils.symbolMap=d3.map(),a.utils.symbol=function(){function b(b,e){var f=c.call(this,b,e),g=d.call(this,b,e);return-1!==d3.svg.symbolTypes.indexOf(f)?d3.svg.symbol().type(f).size(g)():a.utils.symbolMap.get(f)(g)}var c,d=64;return b.type=function(a){return arguments.length?(c=d3.functor(a),b):c},b.size=function(a){return arguments.length?(d=d3.functor(a),b):d},b},a.utils.inheritOptions=function(b,c){var d=Object.getOwnPropertyNames(c._options||{}),e=Object.getOwnPropertyNames(c._calls||{}),f=c._inherited||[],g=c._d3options||[],h=d.concat(e).concat(f).concat(g);h.unshift(c),h.unshift(b),d3.rebind.apply(this,h),b._inherited=a.utils.arrayUnique(d.concat(e).concat(f).concat(d).concat(b._inherited||[])),b._d3options=a.utils.arrayUnique(g.concat(b._d3options||[]))},a.utils.initSVG=function(a){a.classed({"nvd3-svg":!0})},a.utils.sanitizeHeight=function(a,b){return a||parseInt(b.style("height"),10)||400},a.utils.sanitizeWidth=function(a,b){return a||parseInt(b.style("width"),10)||960},a.utils.availableHeight=function(b,c,d){return a.utils.sanitizeHeight(b,c)-d.top-d.bottom},a.utils.availableWidth=function(b,c,d){return a.utils.sanitizeWidth(b,c)-d.left-d.right},a.utils.noData=function(b,c){var d=b.options(),e=d.margin(),f=d.noData(),g=null==f?["No Data Available."]:[f],h=a.utils.availableHeight(d.height(),c,e),i=a.utils.availableWidth(d.width(),c,e),j=e.left+i/2,k=e.top+h/2;c.selectAll("g").remove();var l=c.selectAll(".nv-noData").data(g);l.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),l.attr("x",j).attr("y",k).text(function(a){return a})},a.models.axis=function(){"use strict";function b(g){return s.reset(),g.each(function(b){var g=d3.select(this);a.utils.initSVG(g);var p=g.selectAll("g.nv-wrap.nv-axis").data([b]),q=p.enter().append("g").attr("class","nvd3 nv-wrap nv-axis"),t=(q.append("g"),p.select("g"));null!==n?c.ticks(n):("top"==c.orient()||"bottom"==c.orient())&&c.ticks(Math.abs(d.range()[1]-d.range()[0])/100),t.watchTransition(s,"axis").call(c),r=r||c.scale();var u=c.tickFormat();null==u&&(u=r.tickFormat());var v=t.selectAll("text.nv-axislabel").data([h||null]);v.exit().remove();var w,x,y;switch(c.orient()){case"top":v.enter().append("text").attr("class","nv-axislabel"),y=d.range().length<2?0:2===d.range().length?d.range()[1]:d.range()[d.range().length-1]+(d.range()[1]-d.range()[0]),v.attr("text-anchor","middle").attr("y",0).attr("x",y/2),i&&(x=p.selectAll("g.nv-axisMaxMin").data(d.domain()),x.enter().append("g").attr("class",function(a,b){return["nv-axisMaxMin","nv-axisMaxMin-x",0==b?"nv-axisMin-x":"nv-axisMax-x"].join(" ")}).append("text"),x.exit().remove(),x.attr("transform",function(b){return"translate("+a.utils.NaNtoZero(d(b))+",0)"}).select("text").attr("dy","-0.5em").attr("y",-c.tickPadding()).attr("text-anchor","middle").text(function(a){var b=u(a);return(""+b).match("NaN")?"":b}),x.watchTransition(s,"min-max top").attr("transform",function(b,c){return"translate("+a.utils.NaNtoZero(d.range()[c])+",0)"}));break;case"bottom":w=o+36;var z=30,A=0,B=t.selectAll("g").select("text"),C="";if(j%360){B.each(function(){var a=this.getBoundingClientRect(),b=a.width;A=a.height,b>z&&(z=b)}),C="rotate("+j+" 0,"+(A/2+c.tickPadding())+")";var D=Math.abs(Math.sin(j*Math.PI/180));w=(D?D*z:z)+30,B.attr("transform",C).style("text-anchor",j%360>0?"start":"end")}v.enter().append("text").attr("class","nv-axislabel"),y=d.range().length<2?0:2===d.range().length?d.range()[1]:d.range()[d.range().length-1]+(d.range()[1]-d.range()[0]),v.attr("text-anchor","middle").attr("y",w).attr("x",y/2),i&&(x=p.selectAll("g.nv-axisMaxMin").data([d.domain()[0],d.domain()[d.domain().length-1]]),x.enter().append("g").attr("class",function(a,b){return["nv-axisMaxMin","nv-axisMaxMin-x",0==b?"nv-axisMin-x":"nv-axisMax-x"].join(" ")}).append("text"),x.exit().remove(),x.attr("transform",function(b){return"translate("+a.utils.NaNtoZero(d(b)+(m?d.rangeBand()/2:0))+",0)"}).select("text").attr("dy",".71em").attr("y",c.tickPadding()).attr("transform",C).style("text-anchor",j?j%360>0?"start":"end":"middle").text(function(a){var b=u(a);return(""+b).match("NaN")?"":b}),x.watchTransition(s,"min-max bottom").attr("transform",function(b){return"translate("+a.utils.NaNtoZero(d(b)+(m?d.rangeBand()/2:0))+",0)"})),l&&B.attr("transform",function(a,b){return"translate(0,"+(b%2==0?"0":"12")+")"});break;case"right":v.enter().append("text").attr("class","nv-axislabel"),v.style("text-anchor",k?"middle":"begin").attr("transform",k?"rotate(90)":"").attr("y",k?-Math.max(e.right,f)+12:-10).attr("x",k?d3.max(d.range())/2:c.tickPadding()),i&&(x=p.selectAll("g.nv-axisMaxMin").data(d.domain()),x.enter().append("g").attr("class",function(a,b){return["nv-axisMaxMin","nv-axisMaxMin-y",0==b?"nv-axisMin-y":"nv-axisMax-y"].join(" ")}).append("text").style("opacity",0),x.exit().remove(),x.attr("transform",function(b){return"translate(0,"+a.utils.NaNtoZero(d(b))+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",c.tickPadding()).style("text-anchor","start").text(function(a){var b=u(a);return(""+b).match("NaN")?"":b}),x.watchTransition(s,"min-max right").attr("transform",function(b,c){return"translate(0,"+a.utils.NaNtoZero(d.range()[c])+")"}).select("text").style("opacity",1));break;case"left":v.enter().append("text").attr("class","nv-axislabel"),v.style("text-anchor",k?"middle":"end").attr("transform",k?"rotate(-90)":"").attr("y",k?-Math.max(e.left,f)+25-(o||0):-10).attr("x",k?-d3.max(d.range())/2:-c.tickPadding()),i&&(x=p.selectAll("g.nv-axisMaxMin").data(d.domain()),x.enter().append("g").attr("class",function(a,b){return["nv-axisMaxMin","nv-axisMaxMin-y",0==b?"nv-axisMin-y":"nv-axisMax-y"].join(" ")}).append("text").style("opacity",0),x.exit().remove(),x.attr("transform",function(b){return"translate(0,"+a.utils.NaNtoZero(r(b))+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",-c.tickPadding()).attr("text-anchor","end").text(function(a){var b=u(a);return(""+b).match("NaN")?"":b}),x.watchTransition(s,"min-max right").attr("transform",function(b,c){return"translate(0,"+a.utils.NaNtoZero(d.range()[c])+")"}).select("text").style("opacity",1))}if(v.text(function(a){return a}),!i||"left"!==c.orient()&&"right"!==c.orient()||(t.selectAll("g").each(function(a){d3.select(this).select("text").attr("opacity",1),(d(a)<d.range()[1]+10||d(a)>d.range()[0]-10)&&((a>1e-10||-1e-10>a)&&d3.select(this).attr("opacity",0),d3.select(this).select("text").attr("opacity",0))}),d.domain()[0]==d.domain()[1]&&0==d.domain()[0]&&p.selectAll("g.nv-axisMaxMin").style("opacity",function(a,b){return b?0:1})),i&&("top"===c.orient()||"bottom"===c.orient())){var E=[];p.selectAll("g.nv-axisMaxMin").each(function(a,b){try{E.push(b?d(a)-this.getBoundingClientRect().width-4:d(a)+this.getBoundingClientRect().width+4)}catch(c){E.push(b?d(a)-4:d(a)+4)}}),t.selectAll("g").each(function(a){(d(a)<E[0]||d(a)>E[1])&&(a>1e-10||-1e-10>a?d3.select(this).remove():d3.select(this).select("text").remove())})}t.selectAll(".tick").filter(function(a){return!parseFloat(Math.round(1e5*a)/1e6)&&void 0!==a}).classed("zero",!0),r=d.copy()}),s.renderEnd("axis immediate"),b}var c=d3.svg.axis(),d=d3.scale.linear(),e={top:0,right:0,bottom:0,left:0},f=75,g=60,h=null,i=!0,j=0,k=!0,l=!1,m=!1,n=null,o=0,p=250,q=d3.dispatch("renderEnd");c.scale(d).orient("bottom").tickFormat(function(a){return a});var r,s=a.utils.renderWatch(q,p);return b.axis=c,b.dispatch=q,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{axisLabelDistance:{get:function(){return o},set:function(a){o=a}},staggerLabels:{get:function(){return l},set:function(a){l=a}},rotateLabels:{get:function(){return j},set:function(a){j=a}},rotateYLabel:{get:function(){return k},set:function(a){k=a}},showMaxMin:{get:function(){return i},set:function(a){i=a}},axisLabel:{get:function(){return h},set:function(a){h=a}},height:{get:function(){return g},set:function(a){g=a}},ticks:{get:function(){return n},set:function(a){n=a}},width:{get:function(){return f},set:function(a){f=a}},margin:{get:function(){return e},set:function(a){e.top=void 0!==a.top?a.top:e.top,e.right=void 0!==a.right?a.right:e.right,e.bottom=void 0!==a.bottom?a.bottom:e.bottom,e.left=void 0!==a.left?a.left:e.left}},duration:{get:function(){return p},set:function(a){p=a,s.reset(p)}},scale:{get:function(){return d},set:function(e){d=e,c.scale(d),m="function"==typeof d.rangeBands,a.utils.inheritOptionsD3(b,d,["domain","range","rangeBand","rangeBands"])}}}),a.utils.initOptions(b),a.utils.inheritOptionsD3(b,c,["orient","tickValues","tickSubdivide","tickSize","tickPadding","tickFormat"]),a.utils.inheritOptionsD3(b,d,["domain","range","rangeBand","rangeBands"]),b},a.models.boxPlot=function(){"use strict";function b(l){return v.reset(),l.each(function(b){var l=j-i.left-i.right,p=k-i.top-i.bottom;r=d3.select(this),a.utils.initSVG(r),m.domain(c||b.map(function(a,b){return o(a,b)})).rangeBands(e||[0,l],.1);var w=[];if(!d){var x=d3.min(b.map(function(a){var b=[];return b.push(a.values.Q1),a.values.hasOwnProperty("whisker_low")&&null!==a.values.whisker_low&&b.push(a.values.whisker_low),a.values.hasOwnProperty("outliers")&&null!==a.values.outliers&&(b=b.concat(a.values.outliers)),d3.min(b)})),y=d3.max(b.map(function(a){var b=[];return b.push(a.values.Q3),a.values.hasOwnProperty("whisker_high")&&null!==a.values.whisker_high&&b.push(a.values.whisker_high),a.values.hasOwnProperty("outliers")&&null!==a.values.outliers&&(b=b.concat(a.values.outliers)),d3.max(b)}));w=[x,y]}n.domain(d||w),n.range(f||[p,0]),g=g||m,h=h||n.copy().range([n(0),n(0)]);{var z=r.selectAll("g.nv-wrap").data([b]);z.enter().append("g").attr("class","nvd3 nv-wrap")}z.attr("transform","translate("+i.left+","+i.top+")");var A=z.selectAll(".nv-boxplot").data(function(a){return a}),B=A.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);A.attr("class","nv-boxplot").attr("transform",function(a,b){return"translate("+(m(o(a,b))+.05*m.rangeBand())+", 0)"}).classed("hover",function(a){return a.hover}),A.watchTransition(v,"nv-boxplot: boxplots").style("stroke-opacity",1).style("fill-opacity",.75).delay(function(a,c){return c*t/b.length}).attr("transform",function(a,b){return"translate("+(m(o(a,b))+.05*m.rangeBand())+", 0)"}),A.exit().remove(),B.each(function(a,b){var c=d3.select(this);["low","high"].forEach(function(d){a.values.hasOwnProperty("whisker_"+d)&&null!==a.values["whisker_"+d]&&(c.append("line").style("stroke",a.color?a.color:q(a,b)).attr("class","nv-boxplot-whisker nv-boxplot-"+d),c.append("line").style("stroke",a.color?a.color:q(a,b)).attr("class","nv-boxplot-tick nv-boxplot-"+d))})});var C=A.selectAll(".nv-boxplot-outlier").data(function(a){return a.values.hasOwnProperty("outliers")&&null!==a.values.outliers?a.values.outliers:[]});C.enter().append("circle").style("fill",function(a,b,c){return q(a,c)}).style("stroke",function(a,b,c){return q(a,c)}).on("mouseover",function(a,b,c){d3.select(this).classed("hover",!0),s.elementMouseover({series:{key:a,color:q(a,c)},e:d3.event})}).on("mouseout",function(a,b,c){d3.select(this).classed("hover",!1),s.elementMouseout({series:{key:a,color:q(a,c)},e:d3.event})}).on("mousemove",function(){s.elementMousemove({e:d3.event})}),C.attr("class","nv-boxplot-outlier"),C.watchTransition(v,"nv-boxplot: nv-boxplot-outlier").attr("cx",.45*m.rangeBand()).attr("cy",function(a){return n(a)}).attr("r","3"),C.exit().remove();var D=function(){return null===u?.9*m.rangeBand():Math.min(75,.9*m.rangeBand())},E=function(){return.45*m.rangeBand()-D()/2},F=function(){return.45*m.rangeBand()+D()/2};["low","high"].forEach(function(a){var b="low"===a?"Q1":"Q3";A.select("line.nv-boxplot-whisker.nv-boxplot-"+a).watchTransition(v,"nv-boxplot: boxplots").attr("x1",.45*m.rangeBand()).attr("y1",function(b){return n(b.values["whisker_"+a])}).attr("x2",.45*m.rangeBand()).attr("y2",function(a){return n(a.values[b])}),A.select("line.nv-boxplot-tick.nv-boxplot-"+a).watchTransition(v,"nv-boxplot: boxplots").attr("x1",E).attr("y1",function(b){return n(b.values["whisker_"+a])}).attr("x2",F).attr("y2",function(b){return n(b.values["whisker_"+a])})}),["low","high"].forEach(function(a){B.selectAll(".nv-boxplot-"+a).on("mouseover",function(b,c,d){d3.select(this).classed("hover",!0),s.elementMouseover({series:{key:b.values["whisker_"+a],color:q(b,d)},e:d3.event})}).on("mouseout",function(b,c,d){d3.select(this).classed("hover",!1),s.elementMouseout({series:{key:b.values["whisker_"+a],color:q(b,d)},e:d3.event})}).on("mousemove",function(){s.elementMousemove({e:d3.event})})}),B.append("rect").attr("class","nv-boxplot-box").on("mouseover",function(a,b){d3.select(this).classed("hover",!0),s.elementMouseover({key:a.label,value:a.label,series:[{key:"Q3",value:a.values.Q3,color:a.color||q(a,b)},{key:"Q2",value:a.values.Q2,color:a.color||q(a,b)},{key:"Q1",value:a.values.Q1,color:a.color||q(a,b)}],data:a,index:b,e:d3.event})}).on("mouseout",function(a,b){d3.select(this).classed("hover",!1),s.elementMouseout({key:a.label,value:a.label,series:[{key:"Q3",value:a.values.Q3,color:a.color||q(a,b)},{key:"Q2",value:a.values.Q2,color:a.color||q(a,b)},{key:"Q1",value:a.values.Q1,color:a.color||q(a,b)}],data:a,index:b,e:d3.event})}).on("mousemove",function(){s.elementMousemove({e:d3.event})}),A.select("rect.nv-boxplot-box").watchTransition(v,"nv-boxplot: boxes").attr("y",function(a){return n(a.values.Q3)}).attr("width",D).attr("x",E).attr("height",function(a){return Math.abs(n(a.values.Q3)-n(a.values.Q1))||1}).style("fill",function(a,b){return a.color||q(a,b)}).style("stroke",function(a,b){return a.color||q(a,b)}),B.append("line").attr("class","nv-boxplot-median"),A.select("line.nv-boxplot-median").watchTransition(v,"nv-boxplot: boxplots line").attr("x1",E).attr("y1",function(a){return n(a.values.Q2)}).attr("x2",F).attr("y2",function(a){return n(a.values.Q2)}),g=m.copy(),h=n.copy()}),v.renderEnd("nv-boxplot immediate"),b}var c,d,e,f,g,h,i={top:0,right:0,bottom:0,left:0},j=960,k=500,l=Math.floor(1e4*Math.random()),m=d3.scale.ordinal(),n=d3.scale.linear(),o=function(a){return a.x},p=function(a){return a.y},q=a.utils.defaultColor(),r=null,s=d3.dispatch("elementMouseover","elementMouseout","elementMousemove","renderEnd"),t=250,u=null,v=a.utils.renderWatch(s,t);return b.dispatch=s,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return j},set:function(a){j=a}},height:{get:function(){return k},set:function(a){k=a}},maxBoxWidth:{get:function(){return u},set:function(a){u=a}},x:{get:function(){return o},set:function(a){o=a}},y:{get:function(){return p},set:function(a){p=a}},xScale:{get:function(){return m},set:function(a){m=a}},yScale:{get:function(){return n},set:function(a){n=a}},xDomain:{get:function(){return c},set:function(a){c=a}},yDomain:{get:function(){return d},set:function(a){d=a}},xRange:{get:function(){return e},set:function(a){e=a}},yRange:{get:function(){return f},set:function(a){f=a}},id:{get:function(){return l},set:function(a){l=a}},margin:{get:function(){return i},set:function(a){i.top=void 0!==a.top?a.top:i.top,i.right=void 0!==a.right?a.right:i.right,i.bottom=void 0!==a.bottom?a.bottom:i.bottom,i.left=void 0!==a.left?a.left:i.left}},color:{get:function(){return q},set:function(b){q=a.utils.getColor(b)}},duration:{get:function(){return t},set:function(a){t=a,v.reset(t)}}}),a.utils.initOptions(b),b},a.models.boxPlotChart=function(){"use strict";function b(k){return t.reset(),t.models(e),l&&t.models(f),m&&t.models(g),k.each(function(k){var p=d3.select(this);a.utils.initSVG(p);var t=(i||parseInt(p.style("width"))||960)-h.left-h.right,u=(j||parseInt(p.style("height"))||400)-h.top-h.bottom;if(b.update=function(){r.beforeUpdate(),p.transition().duration(s).call(b)},b.container=this,!(k&&k.length&&k.filter(function(a){return a.values.hasOwnProperty("Q1")&&a.values.hasOwnProperty("Q2")&&a.values.hasOwnProperty("Q3")}).length)){var v=p.selectAll(".nv-noData").data([q]);return v.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),v.attr("x",h.left+t/2).attr("y",h.top+u/2).text(function(a){return a}),b}p.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale().clamp(!0);var w=p.selectAll("g.nv-wrap.nv-boxPlotWithAxes").data([k]),x=w.enter().append("g").attr("class","nvd3 nv-wrap nv-boxPlotWithAxes").append("g"),y=x.append("defs"),z=w.select("g");
46091x.append("g").attr("class","nv-x nv-axis"),x.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),x.append("g").attr("class","nv-barsWrap"),z.attr("transform","translate("+h.left+","+h.top+")"),n&&z.select(".nv-y.nv-axis").attr("transform","translate("+t+",0)"),e.width(t).height(u);var A=z.select(".nv-barsWrap").datum(k.filter(function(a){return!a.disabled}));if(A.transition().call(e),y.append("clipPath").attr("id","nv-x-label-clip-"+e.id()).append("rect"),z.select("#nv-x-label-clip-"+e.id()+" rect").attr("width",c.rangeBand()*(o?2:1)).attr("height",16).attr("x",-c.rangeBand()/(o?1:2)),l){f.scale(c).ticks(a.utils.calcTicksX(t/100,k)).tickSize(-u,0),z.select(".nv-x.nv-axis").attr("transform","translate(0,"+d.range()[0]+")"),z.select(".nv-x.nv-axis").call(f);var B=z.select(".nv-x.nv-axis").selectAll("g");o&&B.selectAll("text").attr("transform",function(a,b,c){return"translate(0,"+(c%2==0?"5":"17")+")"})}m&&(g.scale(d).ticks(Math.floor(u/36)).tickSize(-t,0),z.select(".nv-y.nv-axis").call(g)),z.select(".nv-zeroLine line").attr("x1",0).attr("x2",t).attr("y1",d(0)).attr("y2",d(0))}),t.renderEnd("nv-boxplot chart immediate"),b}var c,d,e=a.models.boxPlot(),f=a.models.axis(),g=a.models.axis(),h={top:15,right:10,bottom:50,left:60},i=null,j=null,k=a.utils.getColor(),l=!0,m=!0,n=!1,o=!1,p=a.models.tooltip(),q="No Data Available.",r=d3.dispatch("tooltipShow","tooltipHide","beforeUpdate","renderEnd"),s=250;f.orient("bottom").showMaxMin(!1).tickFormat(function(a){return a}),g.orient(n?"right":"left").tickFormat(d3.format(",.1f")),p.duration(0);var t=a.utils.renderWatch(r,s);return e.dispatch.on("elementMouseover.tooltip",function(a){p.data(a).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(a){p.data(a).hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(){p.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=r,b.boxplot=e,b.xAxis=f,b.yAxis=g,b.tooltip=p,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return i},set:function(a){i=a}},height:{get:function(){return j},set:function(a){j=a}},staggerLabels:{get:function(){return o},set:function(a){o=a}},showXAxis:{get:function(){return l},set:function(a){l=a}},showYAxis:{get:function(){return m},set:function(a){m=a}},tooltips:{get:function(){return tooltips},set:function(a){tooltips=a}},tooltipContent:{get:function(){return p},set:function(a){p=a}},noData:{get:function(){return q},set:function(a){q=a}},margin:{get:function(){return h},set:function(a){h.top=void 0!==a.top?a.top:h.top,h.right=void 0!==a.right?a.right:h.right,h.bottom=void 0!==a.bottom?a.bottom:h.bottom,h.left=void 0!==a.left?a.left:h.left}},duration:{get:function(){return s},set:function(a){s=a,t.reset(s),e.duration(s),f.duration(s),g.duration(s)}},color:{get:function(){return k},set:function(b){k=a.utils.getColor(b),e.color(k)}},rightAlignYAxis:{get:function(){return n},set:function(a){n=a,g.orient(a?"right":"left")}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.bullet=function(){"use strict";function b(d){return d.each(function(b,d){var p=m-c.left-c.right,s=n-c.top-c.bottom;o=d3.select(this),a.utils.initSVG(o);{var t=f.call(this,b,d).slice().sort(d3.descending),u=g.call(this,b,d).slice().sort(d3.descending),v=h.call(this,b,d).slice().sort(d3.descending),w=i.call(this,b,d).slice(),x=j.call(this,b,d).slice(),y=k.call(this,b,d).slice(),z=d3.scale.linear().domain(d3.extent(d3.merge([l,t]))).range(e?[p,0]:[0,p]);this.__chart__||d3.scale.linear().domain([0,1/0]).range(z.range())}this.__chart__=z;var A=d3.min(t),B=d3.max(t),C=t[1],D=o.selectAll("g.nv-wrap.nv-bullet").data([b]),E=D.enter().append("g").attr("class","nvd3 nv-wrap nv-bullet"),F=E.append("g"),G=D.select("g");F.append("rect").attr("class","nv-range nv-rangeMax"),F.append("rect").attr("class","nv-range nv-rangeAvg"),F.append("rect").attr("class","nv-range nv-rangeMin"),F.append("rect").attr("class","nv-measure"),D.attr("transform","translate("+c.left+","+c.top+")");var H=function(a){return Math.abs(z(a)-z(0))},I=function(a){return z(0>a?a:0)};G.select("rect.nv-rangeMax").attr("height",s).attr("width",H(B>0?B:A)).attr("x",I(B>0?B:A)).datum(B>0?B:A),G.select("rect.nv-rangeAvg").attr("height",s).attr("width",H(C)).attr("x",I(C)).datum(C),G.select("rect.nv-rangeMin").attr("height",s).attr("width",H(B)).attr("x",I(B)).attr("width",H(B>0?A:B)).attr("x",I(B>0?A:B)).datum(B>0?A:B),G.select("rect.nv-measure").style("fill",q).attr("height",s/3).attr("y",s/3).attr("width",0>v?z(0)-z(v[0]):z(v[0])-z(0)).attr("x",I(v)).on("mouseover",function(){r.elementMouseover({value:v[0],label:y[0]||"Current",color:d3.select(this).style("fill")})}).on("mousemove",function(){r.elementMousemove({value:v[0],label:y[0]||"Current",color:d3.select(this).style("fill")})}).on("mouseout",function(){r.elementMouseout({value:v[0],label:y[0]||"Current",color:d3.select(this).style("fill")})});var J=s/6,K=u.map(function(a,b){return{value:a,label:x[b]}});F.selectAll("path.nv-markerTriangle").data(K).enter().append("path").attr("class","nv-markerTriangle").attr("transform",function(a){return"translate("+z(a.value)+","+s/2+")"}).attr("d","M0,"+J+"L"+J+","+-J+" "+-J+","+-J+"Z").on("mouseover",function(a){r.elementMouseover({value:a.value,label:a.label||"Previous",color:d3.select(this).style("fill"),pos:[z(a.value),s/2]})}).on("mousemove",function(a){r.elementMousemove({value:a.value,label:a.label||"Previous",color:d3.select(this).style("fill")})}).on("mouseout",function(a){r.elementMouseout({value:a.value,label:a.label||"Previous",color:d3.select(this).style("fill")})}),D.selectAll(".nv-range").on("mouseover",function(a,b){var c=w[b]||(b?1==b?"Mean":"Minimum":"Maximum");r.elementMouseover({value:a,label:c,color:d3.select(this).style("fill")})}).on("mousemove",function(){r.elementMousemove({value:v[0],label:y[0]||"Previous",color:d3.select(this).style("fill")})}).on("mouseout",function(a,b){var c=w[b]||(b?1==b?"Mean":"Minimum":"Maximum");r.elementMouseout({value:a,label:c,color:d3.select(this).style("fill")})})}),b}var c={top:0,right:0,bottom:0,left:0},d="left",e=!1,f=function(a){return a.ranges},g=function(a){return a.markers?a.markers:[0]},h=function(a){return a.measures},i=function(a){return a.rangeLabels?a.rangeLabels:[]},j=function(a){return a.markerLabels?a.markerLabels:[]},k=function(a){return a.measureLabels?a.measureLabels:[]},l=[0],m=380,n=30,o=null,p=null,q=a.utils.getColor(["#1f77b4"]),r=d3.dispatch("elementMouseover","elementMouseout","elementMousemove");return b.dispatch=r,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{ranges:{get:function(){return f},set:function(a){f=a}},markers:{get:function(){return g},set:function(a){g=a}},measures:{get:function(){return h},set:function(a){h=a}},forceX:{get:function(){return l},set:function(a){l=a}},width:{get:function(){return m},set:function(a){m=a}},height:{get:function(){return n},set:function(a){n=a}},tickFormat:{get:function(){return p},set:function(a){p=a}},margin:{get:function(){return c},set:function(a){c.top=void 0!==a.top?a.top:c.top,c.right=void 0!==a.right?a.right:c.right,c.bottom=void 0!==a.bottom?a.bottom:c.bottom,c.left=void 0!==a.left?a.left:c.left}},orient:{get:function(){return d},set:function(a){d=a,e="right"==d||"bottom"==d}},color:{get:function(){return q},set:function(b){q=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.bulletChart=function(){"use strict";function b(d){return d.each(function(e,o){var p=d3.select(this);a.utils.initSVG(p);var q=a.utils.availableWidth(k,p,g),r=l-g.top-g.bottom;if(b.update=function(){b(d)},b.container=this,!e||!h.call(this,e,o))return a.utils.noData(b,p),b;p.selectAll(".nv-noData").remove();var s=h.call(this,e,o).slice().sort(d3.descending),t=i.call(this,e,o).slice().sort(d3.descending),u=j.call(this,e,o).slice().sort(d3.descending),v=p.selectAll("g.nv-wrap.nv-bulletChart").data([e]),w=v.enter().append("g").attr("class","nvd3 nv-wrap nv-bulletChart"),x=w.append("g"),y=v.select("g");x.append("g").attr("class","nv-bulletWrap"),x.append("g").attr("class","nv-titles"),v.attr("transform","translate("+g.left+","+g.top+")");var z=d3.scale.linear().domain([0,Math.max(s[0],t[0],u[0])]).range(f?[q,0]:[0,q]),A=this.__chart__||d3.scale.linear().domain([0,1/0]).range(z.range());this.__chart__=z;var B=x.select(".nv-titles").append("g").attr("text-anchor","end").attr("transform","translate(-6,"+(l-g.top-g.bottom)/2+")");B.append("text").attr("class","nv-title").text(function(a){return a.title}),B.append("text").attr("class","nv-subtitle").attr("dy","1em").text(function(a){return a.subtitle}),c.width(q).height(r);var C=y.select(".nv-bulletWrap");d3.transition(C).call(c);var D=m||z.tickFormat(q/100),E=y.selectAll("g.nv-tick").data(z.ticks(n?n:q/50),function(a){return this.textContent||D(a)}),F=E.enter().append("g").attr("class","nv-tick").attr("transform",function(a){return"translate("+A(a)+",0)"}).style("opacity",1e-6);F.append("line").attr("y1",r).attr("y2",7*r/6),F.append("text").attr("text-anchor","middle").attr("dy","1em").attr("y",7*r/6).text(D);var G=d3.transition(E).attr("transform",function(a){return"translate("+z(a)+",0)"}).style("opacity",1);G.select("line").attr("y1",r).attr("y2",7*r/6),G.select("text").attr("y",7*r/6),d3.transition(E.exit()).attr("transform",function(a){return"translate("+z(a)+",0)"}).style("opacity",1e-6).remove()}),d3.timer.flush(),b}var c=a.models.bullet(),d=a.models.tooltip(),e="left",f=!1,g={top:5,right:40,bottom:20,left:120},h=function(a){return a.ranges},i=function(a){return a.markers?a.markers:[0]},j=function(a){return a.measures},k=null,l=55,m=null,n=null,o=null,p=d3.dispatch("tooltipShow","tooltipHide");return d.duration(0).headerEnabled(!1),c.dispatch.on("elementMouseover.tooltip",function(a){a.series={key:a.label,value:a.value,color:a.color},d.data(a).hidden(!1)}),c.dispatch.on("elementMouseout.tooltip",function(){d.hidden(!0)}),c.dispatch.on("elementMousemove.tooltip",function(){d.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.bullet=c,b.dispatch=p,b.tooltip=d,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{ranges:{get:function(){return h},set:function(a){h=a}},markers:{get:function(){return i},set:function(a){i=a}},measures:{get:function(){return j},set:function(a){j=a}},width:{get:function(){return k},set:function(a){k=a}},height:{get:function(){return l},set:function(a){l=a}},tickFormat:{get:function(){return m},set:function(a){m=a}},ticks:{get:function(){return n},set:function(a){n=a}},noData:{get:function(){return o},set:function(a){o=a}},tooltips:{get:function(){return d.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),d.enabled(!!b)}},tooltipContent:{get:function(){return d.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),d.contentGenerator(b)}},margin:{get:function(){return g},set:function(a){g.top=void 0!==a.top?a.top:g.top,g.right=void 0!==a.right?a.right:g.right,g.bottom=void 0!==a.bottom?a.bottom:g.bottom,g.left=void 0!==a.left?a.left:g.left}},orient:{get:function(){return e},set:function(a){e=a,f="right"==e||"bottom"==e}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.models.candlestickBar=function(){"use strict";function b(x){return x.each(function(b){c=d3.select(this);var x=a.utils.availableWidth(i,c,h),y=a.utils.availableHeight(j,c,h);a.utils.initSVG(c);var A=x/b[0].values.length*.45;l.domain(d||d3.extent(b[0].values.map(n).concat(t))),l.range(v?f||[.5*x/b[0].values.length,x*(b[0].values.length-.5)/b[0].values.length]:f||[5+A/2,x-A/2-5]),m.domain(e||[d3.min(b[0].values.map(s).concat(u)),d3.max(b[0].values.map(r).concat(u))]).range(g||[y,0]),l.domain()[0]===l.domain()[1]&&l.domain(l.domain()[0]?[l.domain()[0]-.01*l.domain()[0],l.domain()[1]+.01*l.domain()[1]]:[-1,1]),m.domain()[0]===m.domain()[1]&&m.domain(m.domain()[0]?[m.domain()[0]+.01*m.domain()[0],m.domain()[1]-.01*m.domain()[1]]:[-1,1]);var B=d3.select(this).selectAll("g.nv-wrap.nv-candlestickBar").data([b[0].values]),C=B.enter().append("g").attr("class","nvd3 nv-wrap nv-candlestickBar"),D=C.append("defs"),E=C.append("g"),F=B.select("g");E.append("g").attr("class","nv-ticks"),B.attr("transform","translate("+h.left+","+h.top+")"),c.on("click",function(a,b){z.chartClick({data:a,index:b,pos:d3.event,id:k})}),D.append("clipPath").attr("id","nv-chart-clip-path-"+k).append("rect"),B.select("#nv-chart-clip-path-"+k+" rect").attr("width",x).attr("height",y),F.attr("clip-path",w?"url(#nv-chart-clip-path-"+k+")":"");var G=B.select(".nv-ticks").selectAll(".nv-tick").data(function(a){return a});G.exit().remove();{var H=G.enter().append("g").attr("class",function(a,b,c){return(p(a,b)>q(a,b)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+c+"-"+b});H.append("line").attr("class","nv-candlestick-lines").attr("transform",function(a,b){return"translate("+l(n(a,b))+",0)"}).attr("x1",0).attr("y1",function(a,b){return m(r(a,b))}).attr("x2",0).attr("y2",function(a,b){return m(s(a,b))}),H.append("rect").attr("class","nv-candlestick-rects nv-bars").attr("transform",function(a,b){return"translate("+(l(n(a,b))-A/2)+","+(m(o(a,b))-(p(a,b)>q(a,b)?m(q(a,b))-m(p(a,b)):0))+")"}).attr("x",0).attr("y",0).attr("width",A).attr("height",function(a,b){var c=p(a,b),d=q(a,b);return c>d?m(d)-m(c):m(c)-m(d)})}c.selectAll(".nv-candlestick-lines").transition().attr("transform",function(a,b){return"translate("+l(n(a,b))+",0)"}).attr("x1",0).attr("y1",function(a,b){return m(r(a,b))}).attr("x2",0).attr("y2",function(a,b){return m(s(a,b))}),c.selectAll(".nv-candlestick-rects").transition().attr("transform",function(a,b){return"translate("+(l(n(a,b))-A/2)+","+(m(o(a,b))-(p(a,b)>q(a,b)?m(q(a,b))-m(p(a,b)):0))+")"}).attr("x",0).attr("y",0).attr("width",A).attr("height",function(a,b){var c=p(a,b),d=q(a,b);return c>d?m(d)-m(c):m(c)-m(d)})}),b}var c,d,e,f,g,h={top:0,right:0,bottom:0,left:0},i=null,j=null,k=Math.floor(1e4*Math.random()),l=d3.scale.linear(),m=d3.scale.linear(),n=function(a){return a.x},o=function(a){return a.y},p=function(a){return a.open},q=function(a){return a.close},r=function(a){return a.high},s=function(a){return a.low},t=[],u=[],v=!1,w=!0,x=a.utils.defaultColor(),y=!1,z=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd","chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove");return b.highlightPoint=function(a,d){b.clearHighlights(),c.select(".nv-candlestickBar .nv-tick-0-"+a).classed("hover",d)},b.clearHighlights=function(){c.select(".nv-candlestickBar .nv-tick.hover").classed("hover",!1)},b.dispatch=z,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return i},set:function(a){i=a}},height:{get:function(){return j},set:function(a){j=a}},xScale:{get:function(){return l},set:function(a){l=a}},yScale:{get:function(){return m},set:function(a){m=a}},xDomain:{get:function(){return d},set:function(a){d=a}},yDomain:{get:function(){return e},set:function(a){e=a}},xRange:{get:function(){return f},set:function(a){f=a}},yRange:{get:function(){return g},set:function(a){g=a}},forceX:{get:function(){return t},set:function(a){t=a}},forceY:{get:function(){return u},set:function(a){u=a}},padData:{get:function(){return v},set:function(a){v=a}},clipEdge:{get:function(){return w},set:function(a){w=a}},id:{get:function(){return k},set:function(a){k=a}},interactive:{get:function(){return y},set:function(a){y=a}},x:{get:function(){return n},set:function(a){n=a}},y:{get:function(){return o},set:function(a){o=a}},open:{get:function(){return p()},set:function(a){p=a}},close:{get:function(){return q()},set:function(a){q=a}},high:{get:function(){return r},set:function(a){r=a}},low:{get:function(){return s},set:function(a){s=a}},margin:{get:function(){return h},set:function(a){h.top=void 0!=a.top?a.top:h.top,h.right=void 0!=a.right?a.right:h.right,h.bottom=void 0!=a.bottom?a.bottom:h.bottom,h.left=void 0!=a.left?a.left:h.left}},color:{get:function(){return x},set:function(b){x=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.cumulativeLineChart=function(){"use strict";function b(l){return H.reset(),H.models(f),r&&H.models(g),s&&H.models(h),l.each(function(l){function A(){d3.select(b.container).style("cursor","ew-resize")}function E(){G.x=d3.event.x,G.i=Math.round(F.invert(G.x)),K()}function H(){d3.select(b.container).style("cursor","auto"),y.index=G.i,C.stateChange(y)}function K(){bb.data([G]);var a=b.duration();b.duration(0),b.update(),b.duration(a)}var L=d3.select(this);a.utils.initSVG(L),L.classed("nv-chart-"+x,!0);var M=this,N=a.utils.availableWidth(o,L,m),O=a.utils.availableHeight(p,L,m);if(b.update=function(){0===D?L.call(b):L.transition().duration(D).call(b)},b.container=this,y.setter(J(l),b.update).getter(I(l)).update(),y.disabled=l.map(function(a){return!!a.disabled}),!z){var P;z={};for(P in y)z[P]=y[P]instanceof Array?y[P].slice(0):y[P]}var Q=d3.behavior.drag().on("dragstart",A).on("drag",E).on("dragend",H);if(!(l&&l.length&&l.filter(function(a){return a.values.length}).length))return a.utils.noData(b,L),b;if(L.selectAll(".nv-noData").remove(),d=f.xScale(),e=f.yScale(),w)f.yDomain(null);else{var R=l.filter(function(a){return!a.disabled}).map(function(a){var b=d3.extent(a.values,f.y());return b[0]<-.95&&(b[0]=-.95),[(b[0]-b[1])/(1+b[1]),(b[1]-b[0])/(1+b[0])]}),S=[d3.min(R,function(a){return a[0]}),d3.max(R,function(a){return a[1]})];f.yDomain(S)}F.domain([0,l[0].values.length-1]).range([0,N]).clamp(!0);var l=c(G.i,l),T=v?"none":"all",U=L.selectAll("g.nv-wrap.nv-cumulativeLine").data([l]),V=U.enter().append("g").attr("class","nvd3 nv-wrap nv-cumulativeLine").append("g"),W=U.select("g");if(V.append("g").attr("class","nv-interactive"),V.append("g").attr("class","nv-x nv-axis").style("pointer-events","none"),V.append("g").attr("class","nv-y nv-axis"),V.append("g").attr("class","nv-background"),V.append("g").attr("class","nv-linesWrap").style("pointer-events",T),V.append("g").attr("class","nv-avgLinesWrap").style("pointer-events","none"),V.append("g").attr("class","nv-legendWrap"),V.append("g").attr("class","nv-controlsWrap"),q&&(i.width(N),W.select(".nv-legendWrap").datum(l).call(i),m.top!=i.height()&&(m.top=i.height(),O=a.utils.availableHeight(p,L,m)),W.select(".nv-legendWrap").attr("transform","translate(0,"+-m.top+")")),u){var X=[{key:"Re-scale y-axis",disabled:!w}];j.width(140).color(["#444","#444","#444"]).rightAlign(!1).margin({top:5,right:0,bottom:5,left:20}),W.select(".nv-controlsWrap").datum(X).attr("transform","translate(0,"+-m.top+")").call(j)}U.attr("transform","translate("+m.left+","+m.top+")"),t&&W.select(".nv-y.nv-axis").attr("transform","translate("+N+",0)");var Y=l.filter(function(a){return a.tempDisabled});U.select(".tempDisabled").remove(),Y.length&&U.append("text").attr("class","tempDisabled").attr("x",N/2).attr("y","-.71em").style("text-anchor","end").text(Y.map(function(a){return a.key}).join(", ")+" values cannot be calculated for this time period."),v&&(k.width(N).height(O).margin({left:m.left,top:m.top}).svgContainer(L).xScale(d),U.select(".nv-interactive").call(k)),V.select(".nv-background").append("rect"),W.select(".nv-background rect").attr("width",N).attr("height",O),f.y(function(a){return a.display.y}).width(N).height(O).color(l.map(function(a,b){return a.color||n(a,b)}).filter(function(a,b){return!l[b].disabled&&!l[b].tempDisabled}));var Z=W.select(".nv-linesWrap").datum(l.filter(function(a){return!a.disabled&&!a.tempDisabled}));Z.call(f),l.forEach(function(a,b){a.seriesIndex=b});var $=l.filter(function(a){return!a.disabled&&!!B(a)}),_=W.select(".nv-avgLinesWrap").selectAll("line").data($,function(a){return a.key}),ab=function(a){var b=e(B(a));return 0>b?0:b>O?O:b};_.enter().append("line").style("stroke-width",2).style("stroke-dasharray","10,10").style("stroke",function(a){return f.color()(a,a.seriesIndex)}).attr("x1",0).attr("x2",N).attr("y1",ab).attr("y2",ab),_.style("stroke-opacity",function(a){var b=e(B(a));return 0>b||b>O?0:1}).attr("x1",0).attr("x2",N).attr("y1",ab).attr("y2",ab),_.exit().remove();var bb=Z.selectAll(".nv-indexLine").data([G]);bb.enter().append("rect").attr("class","nv-indexLine").attr("width",3).attr("x",-2).attr("fill","red").attr("fill-opacity",.5).style("pointer-events","all").call(Q),bb.attr("transform",function(a){return"translate("+F(a.i)+",0)"}).attr("height",O),r&&(g.scale(d)._ticks(a.utils.calcTicksX(N/70,l)).tickSize(-O,0),W.select(".nv-x.nv-axis").attr("transform","translate(0,"+e.range()[0]+")"),W.select(".nv-x.nv-axis").call(g)),s&&(h.scale(e)._ticks(a.utils.calcTicksY(O/36,l)).tickSize(-N,0),W.select(".nv-y.nv-axis").call(h)),W.select(".nv-background rect").on("click",function(){G.x=d3.mouse(this)[0],G.i=Math.round(F.invert(G.x)),y.index=G.i,C.stateChange(y),K()}),f.dispatch.on("elementClick",function(a){G.i=a.pointIndex,G.x=F(G.i),y.index=G.i,C.stateChange(y),K()}),j.dispatch.on("legendClick",function(a){a.disabled=!a.disabled,w=!a.disabled,y.rescaleY=w,C.stateChange(y),b.update()}),i.dispatch.on("stateChange",function(a){for(var c in a)y[c]=a[c];C.stateChange(y),b.update()}),k.dispatch.on("elementMousemove",function(c){f.clearHighlights();var d,e,i,j=[];if(l.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(g,h){e=a.interactiveBisect(g.values,c.pointXValue,b.x()),f.highlightPoint(h,e,!0);var k=g.values[e];"undefined"!=typeof k&&("undefined"==typeof d&&(d=k),"undefined"==typeof i&&(i=b.xScale()(b.x()(k,e))),j.push({key:g.key,value:b.y()(k,e),color:n(g,g.seriesIndex)}))}),j.length>2){var o=b.yScale().invert(c.mouseY),p=Math.abs(b.yScale().domain()[0]-b.yScale().domain()[1]),q=.03*p,r=a.nearestValueIndex(j.map(function(a){return a.value}),o,q);null!==r&&(j[r].highlight=!0)}var s=g.tickFormat()(b.x()(d,e),e);k.tooltip.position({left:i+m.left,top:c.mouseY+m.top}).chartContainer(M.parentNode).valueFormatter(function(a){return h.tickFormat()(a)}).data({value:s,series:j})(),k.renderGuideLine(i)}),k.dispatch.on("elementMouseout",function(){f.clearHighlights()}),C.on("changeState",function(a){"undefined"!=typeof a.disabled&&(l.forEach(function(b,c){b.disabled=a.disabled[c]}),y.disabled=a.disabled),"undefined"!=typeof a.index&&(G.i=a.index,G.x=F(G.i),y.index=a.index,bb.data([G])),"undefined"!=typeof a.rescaleY&&(w=a.rescaleY),b.update()})}),H.renderEnd("cumulativeLineChart immediate"),b}function c(a,b){return K||(K=f.y()),b.map(function(b){if(!b.values)return b;var c=b.values[a];if(null==c)return b;var d=K(c,a);return-.95>d&&!E?(b.tempDisabled=!0,b):(b.tempDisabled=!1,b.values=b.values.map(function(a,b){return a.display={y:(K(a,b)-d)/(1+d)},a}),b)})}var d,e,f=a.models.line(),g=a.models.axis(),h=a.models.axis(),i=a.models.legend(),j=a.models.legend(),k=a.interactiveGuideline(),l=a.models.tooltip(),m={top:30,right:30,bottom:50,left:60},n=a.utils.defaultColor(),o=null,p=null,q=!0,r=!0,s=!0,t=!1,u=!0,v=!1,w=!0,x=f.id(),y=a.utils.state(),z=null,A=null,B=function(a){return a.average},C=d3.dispatch("stateChange","changeState","renderEnd"),D=250,E=!1;y.index=0,y.rescaleY=w,g.orient("bottom").tickPadding(7),h.orient(t?"right":"left"),l.valueFormatter(function(a,b){return h.tickFormat()(a,b)}).headerFormatter(function(a,b){return g.tickFormat()(a,b)}),j.updateState(!1);var F=d3.scale.linear(),G={i:0,x:0},H=a.utils.renderWatch(C,D),I=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),index:G.i,rescaleY:w}}},J=function(a){return function(b){void 0!==b.index&&(G.i=b.index),void 0!==b.rescaleY&&(w=b.rescaleY),void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};f.dispatch.on("elementMouseover.tooltip",function(a){var c={x:b.x()(a.point),y:b.y()(a.point),color:a.point.color};a.point=c,l.data(a).position(a.pos).hidden(!1)}),f.dispatch.on("elementMouseout.tooltip",function(){l.hidden(!0)});var K=null;return b.dispatch=C,b.lines=f,b.legend=i,b.controls=j,b.xAxis=g,b.yAxis=h,b.interactiveLayer=k,b.state=y,b.tooltip=l,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return o},set:function(a){o=a}},height:{get:function(){return p},set:function(a){p=a}},rescaleY:{get:function(){return w},set:function(a){w=a}},showControls:{get:function(){return u},set:function(a){u=a}},showLegend:{get:function(){return q},set:function(a){q=a}},average:{get:function(){return B},set:function(a){B=a}},defaultState:{get:function(){return z},set:function(a){z=a}},noData:{get:function(){return A},set:function(a){A=a}},showXAxis:{get:function(){return r},set:function(a){r=a}},showYAxis:{get:function(){return s},set:function(a){s=a}},noErrorCheck:{get:function(){return E},set:function(a){E=a}},tooltips:{get:function(){return l.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),l.enabled(!!b)}},tooltipContent:{get:function(){return l.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),l.contentGenerator(b)}},margin:{get:function(){return m},set:function(a){m.top=void 0!==a.top?a.top:m.top,m.right=void 0!==a.right?a.right:m.right,m.bottom=void 0!==a.bottom?a.bottom:m.bottom,m.left=void 0!==a.left?a.left:m.left}},color:{get:function(){return n},set:function(b){n=a.utils.getColor(b),i.color(n)}},useInteractiveGuideline:{get:function(){return v},set:function(a){v=a,a===!0&&(b.interactive(!1),b.useVoronoi(!1))}},rightAlignYAxis:{get:function(){return t},set:function(a){t=a,h.orient(a?"right":"left")}},duration:{get:function(){return D},set:function(a){D=a,f.duration(D),g.duration(D),h.duration(D),H.reset(D)}}}),a.utils.inheritOptions(b,f),a.utils.initOptions(b),b},a.models.discreteBar=function(){"use strict";function b(m){return y.reset(),m.each(function(b){var m=k-j.left-j.right,x=l-j.top-j.bottom;c=d3.select(this),a.utils.initSVG(c),b.forEach(function(a,b){a.values.forEach(function(a){a.series=b})});var z=d&&e?[]:b.map(function(a){return a.values.map(function(a,b){return{x:p(a,b),y:q(a,b),y0:a.y0}})});n.domain(d||d3.merge(z).map(function(a){return a.x})).rangeBands(f||[0,m],.1),o.domain(e||d3.extent(d3.merge(z).map(function(a){return a.y}).concat(r))),o.range(t?g||[x-(o.domain()[0]<0?12:0),o.domain()[1]>0?12:0]:g||[x,0]),h=h||n,i=i||o.copy().range([o(0),o(0)]);{var A=c.selectAll("g.nv-wrap.nv-discretebar").data([b]),B=A.enter().append("g").attr("class","nvd3 nv-wrap nv-discretebar"),C=B.append("g");A.select("g")}C.append("g").attr("class","nv-groups"),A.attr("transform","translate("+j.left+","+j.top+")");var D=A.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});D.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),D.exit().watchTransition(y,"discreteBar: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),D.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}),D.watchTransition(y,"discreteBar: groups").style("stroke-opacity",1).style("fill-opacity",.75);var E=D.selectAll("g.nv-bar").data(function(a){return a.values});E.exit().remove();var F=E.enter().append("g").attr("transform",function(a,b){return"translate("+(n(p(a,b))+.05*n.rangeBand())+", "+o(0)+")"}).on("mouseover",function(a,b){d3.select(this).classed("hover",!0),v.elementMouseover({data:a,index:b,color:d3.select(this).style("fill")})}).on("mouseout",function(a,b){d3.select(this).classed("hover",!1),v.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")})}).on("mousemove",function(a,b){v.elementMousemove({data:a,index:b,color:d3.select(this).style("fill")})}).on("click",function(a,b){v.elementClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}).on("dblclick",function(a,b){v.elementDblClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()});F.append("rect").attr("height",0).attr("width",.9*n.rangeBand()/b.length),t?(F.append("text").attr("text-anchor","middle"),E.select("text").text(function(a,b){return u(q(a,b))}).watchTransition(y,"discreteBar: bars text").attr("x",.9*n.rangeBand()/2).attr("y",function(a,b){return q(a,b)<0?o(q(a,b))-o(0)+12:-4})):E.selectAll("text").remove(),E.attr("class",function(a,b){return q(a,b)<0?"nv-bar negative":"nv-bar positive"}).style("fill",function(a,b){return a.color||s(a,b)}).style("stroke",function(a,b){return a.color||s(a,b)}).select("rect").attr("class",w).watchTransition(y,"discreteBar: bars rect").attr("width",.9*n.rangeBand()/b.length),E.watchTransition(y,"discreteBar: bars").attr("transform",function(a,b){var c=n(p(a,b))+.05*n.rangeBand(),d=q(a,b)<0?o(0):o(0)-o(q(a,b))<1?o(0)-1:o(q(a,b));return"translate("+c+", "+d+")"}).select("rect").attr("height",function(a,b){return Math.max(Math.abs(o(q(a,b))-o(e&&e[0]||0))||1)}),h=n.copy(),i=o.copy()}),y.renderEnd("discreteBar immediate"),b}var c,d,e,f,g,h,i,j={top:0,right:0,bottom:0,left:0},k=960,l=500,m=Math.floor(1e4*Math.random()),n=d3.scale.ordinal(),o=d3.scale.linear(),p=function(a){return a.x},q=function(a){return a.y},r=[0],s=a.utils.defaultColor(),t=!1,u=d3.format(",.2f"),v=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),w="discreteBar",x=250,y=a.utils.renderWatch(v,x);return b.dispatch=v,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return k},set:function(a){k=a}},height:{get:function(){return l},set:function(a){l=a}},forceY:{get:function(){return r},set:function(a){r=a}},showValues:{get:function(){return t},set:function(a){t=a}},x:{get:function(){return p},set:function(a){p=a}},y:{get:function(){return q},set:function(a){q=a}},xScale:{get:function(){return n},set:function(a){n=a}},yScale:{get:function(){return o},set:function(a){o=a}},xDomain:{get:function(){return d},set:function(a){d=a}},yDomain:{get:function(){return e},set:function(a){e=a}},xRange:{get:function(){return f},set:function(a){f=a}},yRange:{get:function(){return g},set:function(a){g=a}},valueFormat:{get:function(){return u},set:function(a){u=a}},id:{get:function(){return m},set:function(a){m=a}},rectClass:{get:function(){return w},set:function(a){w=a}},margin:{get:function(){return j},set:function(a){j.top=void 0!==a.top?a.top:j.top,j.right=void 0!==a.right?a.right:j.right,j.bottom=void 0!==a.bottom?a.bottom:j.bottom,j.left=void 0!==a.left?a.left:j.left}},color:{get:function(){return s},set:function(b){s=a.utils.getColor(b)}},duration:{get:function(){return x},set:function(a){x=a,y.reset(x)}}}),a.utils.initOptions(b),b},a.models.discreteBarChart=function(){"use strict";function b(h){return t.reset(),t.models(e),m&&t.models(f),n&&t.models(g),h.each(function(h){var l=d3.select(this);a.utils.initSVG(l);var q=a.utils.availableWidth(j,l,i),t=a.utils.availableHeight(k,l,i);if(b.update=function(){r.beforeUpdate(),l.transition().duration(s).call(b)},b.container=this,!(h&&h.length&&h.filter(function(a){return a.values.length}).length))return a.utils.noData(b,l),b;l.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale().clamp(!0);var u=l.selectAll("g.nv-wrap.nv-discreteBarWithAxes").data([h]),v=u.enter().append("g").attr("class","nvd3 nv-wrap nv-discreteBarWithAxes").append("g"),w=v.append("defs"),x=u.select("g");v.append("g").attr("class","nv-x nv-axis"),v.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),v.append("g").attr("class","nv-barsWrap"),x.attr("transform","translate("+i.left+","+i.top+")"),o&&x.select(".nv-y.nv-axis").attr("transform","translate("+q+",0)"),e.width(q).height(t);var y=x.select(".nv-barsWrap").datum(h.filter(function(a){return!a.disabled}));if(y.transition().call(e),w.append("clipPath").attr("id","nv-x-label-clip-"+e.id()).append("rect"),x.select("#nv-x-label-clip-"+e.id()+" rect").attr("width",c.rangeBand()*(p?2:1)).attr("height",16).attr("x",-c.rangeBand()/(p?1:2)),m){f.scale(c)._ticks(a.utils.calcTicksX(q/100,h)).tickSize(-t,0),x.select(".nv-x.nv-axis").attr("transform","translate(0,"+(d.range()[0]+(e.showValues()&&d.domain()[0]<0?16:0))+")"),x.select(".nv-x.nv-axis").call(f);
46092var z=x.select(".nv-x.nv-axis").selectAll("g");p&&z.selectAll("text").attr("transform",function(a,b,c){return"translate(0,"+(c%2==0?"5":"17")+")"})}n&&(g.scale(d)._ticks(a.utils.calcTicksY(t/36,h)).tickSize(-q,0),x.select(".nv-y.nv-axis").call(g)),x.select(".nv-zeroLine line").attr("x1",0).attr("x2",q).attr("y1",d(0)).attr("y2",d(0))}),t.renderEnd("discreteBar chart immediate"),b}var c,d,e=a.models.discreteBar(),f=a.models.axis(),g=a.models.axis(),h=a.models.tooltip(),i={top:15,right:10,bottom:50,left:60},j=null,k=null,l=a.utils.getColor(),m=!0,n=!0,o=!1,p=!1,q=null,r=d3.dispatch("beforeUpdate","renderEnd"),s=250;f.orient("bottom").showMaxMin(!1).tickFormat(function(a){return a}),g.orient(o?"right":"left").tickFormat(d3.format(",.1f")),h.duration(0).headerEnabled(!1).valueFormatter(function(a,b){return g.tickFormat()(a,b)}).keyFormatter(function(a,b){return f.tickFormat()(a,b)});var t=a.utils.renderWatch(r,s);return e.dispatch.on("elementMouseover.tooltip",function(a){a.series={key:b.x()(a.data),value:b.y()(a.data),color:a.color},h.data(a).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(){h.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(){h.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=r,b.discretebar=e,b.xAxis=f,b.yAxis=g,b.tooltip=h,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return j},set:function(a){j=a}},height:{get:function(){return k},set:function(a){k=a}},staggerLabels:{get:function(){return p},set:function(a){p=a}},showXAxis:{get:function(){return m},set:function(a){m=a}},showYAxis:{get:function(){return n},set:function(a){n=a}},noData:{get:function(){return q},set:function(a){q=a}},tooltips:{get:function(){return h.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),h.enabled(!!b)}},tooltipContent:{get:function(){return h.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),h.contentGenerator(b)}},margin:{get:function(){return i},set:function(a){i.top=void 0!==a.top?a.top:i.top,i.right=void 0!==a.right?a.right:i.right,i.bottom=void 0!==a.bottom?a.bottom:i.bottom,i.left=void 0!==a.left?a.left:i.left}},duration:{get:function(){return s},set:function(a){s=a,t.reset(s),e.duration(s),f.duration(s),g.duration(s)}},color:{get:function(){return l},set:function(b){l=a.utils.getColor(b),e.color(l)}},rightAlignYAxis:{get:function(){return o},set:function(a){o=a,g.orient(a?"right":"left")}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.distribution=function(){"use strict";function b(k){return m.reset(),k.each(function(b){var k=(e-("x"===g?d.left+d.right:d.top+d.bottom),"x"==g?"y":"x"),l=d3.select(this);a.utils.initSVG(l),c=c||j;var n=l.selectAll("g.nv-distribution").data([b]),o=n.enter().append("g").attr("class","nvd3 nv-distribution"),p=(o.append("g"),n.select("g"));n.attr("transform","translate("+d.left+","+d.top+")");var q=p.selectAll("g.nv-dist").data(function(a){return a},function(a){return a.key});q.enter().append("g"),q.attr("class",function(a,b){return"nv-dist nv-series-"+b}).style("stroke",function(a,b){return i(a,b)});var r=q.selectAll("line.nv-dist"+g).data(function(a){return a.values});r.enter().append("line").attr(g+"1",function(a,b){return c(h(a,b))}).attr(g+"2",function(a,b){return c(h(a,b))}),m.transition(q.exit().selectAll("line.nv-dist"+g),"dist exit").attr(g+"1",function(a,b){return j(h(a,b))}).attr(g+"2",function(a,b){return j(h(a,b))}).style("stroke-opacity",0).remove(),r.attr("class",function(a,b){return"nv-dist"+g+" nv-dist"+g+"-"+b}).attr(k+"1",0).attr(k+"2",f),m.transition(r,"dist").attr(g+"1",function(a,b){return j(h(a,b))}).attr(g+"2",function(a,b){return j(h(a,b))}),c=j.copy()}),m.renderEnd("distribution immediate"),b}var c,d={top:0,right:0,bottom:0,left:0},e=400,f=8,g="x",h=function(a){return a[g]},i=a.utils.defaultColor(),j=d3.scale.linear(),k=250,l=d3.dispatch("renderEnd"),m=a.utils.renderWatch(l,k);return b.options=a.utils.optionsFunc.bind(b),b.dispatch=l,b.margin=function(a){return arguments.length?(d.top="undefined"!=typeof a.top?a.top:d.top,d.right="undefined"!=typeof a.right?a.right:d.right,d.bottom="undefined"!=typeof a.bottom?a.bottom:d.bottom,d.left="undefined"!=typeof a.left?a.left:d.left,b):d},b.width=function(a){return arguments.length?(e=a,b):e},b.axis=function(a){return arguments.length?(g=a,b):g},b.size=function(a){return arguments.length?(f=a,b):f},b.getData=function(a){return arguments.length?(h=d3.functor(a),b):h},b.scale=function(a){return arguments.length?(j=a,b):j},b.color=function(c){return arguments.length?(i=a.utils.getColor(c),b):i},b.duration=function(a){return arguments.length?(k=a,m.reset(k),b):k},b},a.models.furiousLegend=function(){"use strict";function b(p){function q(a,b){return"furious"!=o?"#000":m?a.disengaged?g(a,b):"#fff":m?void 0:a.disabled?g(a,b):"#fff"}function r(a,b){return m&&"furious"==o?a.disengaged?"#fff":g(a,b):a.disabled?"#fff":g(a,b)}return p.each(function(b){var p=d-c.left-c.right,s=d3.select(this);a.utils.initSVG(s);var t=s.selectAll("g.nv-legend").data([b]),u=(t.enter().append("g").attr("class","nvd3 nv-legend").append("g"),t.select("g"));t.attr("transform","translate("+c.left+","+c.top+")");var v,w=u.selectAll(".nv-series").data(function(a){return"furious"!=o?a:a.filter(function(a){return m?!0:!a.disengaged})}),x=w.enter().append("g").attr("class","nv-series");if("classic"==o)x.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),v=w.select("circle");else if("furious"==o){x.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3),v=w.select("rect"),x.append("g").attr("class","nv-check-box").property("innerHTML",'<path d="M0.5,5 L22.5,5 L22.5,26.5 L0.5,26.5 L0.5,5 Z" class="nv-box"></path><path d="M5.5,12.8618467 L11.9185089,19.2803556 L31,0.198864511" class="nv-check"></path>').attr("transform","translate(-10,-8)scale(0.5)");var y=w.select(".nv-check-box");y.each(function(a,b){d3.select(this).selectAll("path").attr("stroke",q(a,b))})}x.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");var z=w.select("text.nv-legend-text");w.on("mouseover",function(a,b){n.legendMouseover(a,b)}).on("mouseout",function(a,b){n.legendMouseout(a,b)}).on("click",function(a,b){n.legendClick(a,b);var c=w.data();if(k){if("classic"==o)l?(c.forEach(function(a){a.disabled=!0}),a.disabled=!1):(a.disabled=!a.disabled,c.every(function(a){return a.disabled})&&c.forEach(function(a){a.disabled=!1}));else if("furious"==o)if(m)a.disengaged=!a.disengaged,a.userDisabled=void 0==a.userDisabled?!!a.disabled:a.userDisabled,a.disabled=a.disengaged||a.userDisabled;else if(!m){a.disabled=!a.disabled,a.userDisabled=a.disabled;var d=c.filter(function(a){return!a.disengaged});d.every(function(a){return a.userDisabled})&&c.forEach(function(a){a.disabled=a.userDisabled=!1})}n.stateChange({disabled:c.map(function(a){return!!a.disabled}),disengaged:c.map(function(a){return!!a.disengaged})})}}).on("dblclick",function(a,b){if(("furious"!=o||!m)&&(n.legendDblclick(a,b),k)){var c=w.data();c.forEach(function(a){a.disabled=!0,"furious"==o&&(a.userDisabled=a.disabled)}),a.disabled=!1,"furious"==o&&(a.userDisabled=a.disabled),n.stateChange({disabled:c.map(function(a){return!!a.disabled})})}}),w.classed("nv-disabled",function(a){return a.userDisabled}),w.exit().remove(),z.attr("fill",q).text(f);var A;switch(o){case"furious":A=23;break;case"classic":A=20}if(h){var B=[];w.each(function(){var b,c=d3.select(this).select("text");try{if(b=c.node().getComputedTextLength(),0>=b)throw Error()}catch(d){b=a.utils.calcApproxTextWidth(c)}B.push(b+i)});for(var C=0,D=0,E=[];p>D&&C<B.length;)E[C]=B[C],D+=B[C++];for(0===C&&(C=1);D>p&&C>1;){E=[],C--;for(var F=0;F<B.length;F++)B[F]>(E[F%C]||0)&&(E[F%C]=B[F]);D=E.reduce(function(a,b){return a+b})}for(var G=[],H=0,I=0;C>H;H++)G[H]=I,I+=E[H];w.attr("transform",function(a,b){return"translate("+G[b%C]+","+(5+Math.floor(b/C)*A)+")"}),j?u.attr("transform","translate("+(d-c.right-D)+","+c.top+")"):u.attr("transform","translate(0,"+c.top+")"),e=c.top+c.bottom+Math.ceil(B.length/C)*A}else{var J,K=5,L=5,M=0;w.attr("transform",function(){var a=d3.select(this).select("text").node().getComputedTextLength()+i;return J=L,d<c.left+c.right+J+a&&(L=J=5,K+=A),L+=a,L>M&&(M=L),"translate("+J+","+K+")"}),u.attr("transform","translate("+(d-c.right-M)+","+c.top+")"),e=c.top+c.bottom+K+15}"furious"==o&&v.attr("width",function(a,b){return z[0][b].getComputedTextLength()+27}).attr("height",18).attr("y",-9).attr("x",-15),v.style("fill",r).style("stroke",function(a,b){return a.color||g(a,b)})}),b}var c={top:5,right:0,bottom:5,left:0},d=400,e=20,f=function(a){return a.key},g=a.utils.getColor(),h=!0,i=28,j=!0,k=!0,l=!1,m=!1,n=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),o="classic";return b.dispatch=n,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return d},set:function(a){d=a}},height:{get:function(){return e},set:function(a){e=a}},key:{get:function(){return f},set:function(a){f=a}},align:{get:function(){return h},set:function(a){h=a}},rightAlign:{get:function(){return j},set:function(a){j=a}},padding:{get:function(){return i},set:function(a){i=a}},updateState:{get:function(){return k},set:function(a){k=a}},radioButtonMode:{get:function(){return l},set:function(a){l=a}},expanded:{get:function(){return m},set:function(a){m=a}},vers:{get:function(){return o},set:function(a){o=a}},margin:{get:function(){return c},set:function(a){c.top=void 0!==a.top?a.top:c.top,c.right=void 0!==a.right?a.right:c.right,c.bottom=void 0!==a.bottom?a.bottom:c.bottom,c.left=void 0!==a.left?a.left:c.left}},color:{get:function(){return g},set:function(b){g=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.historicalBar=function(){"use strict";function b(x){return x.each(function(b){w.reset(),k=d3.select(this);var x=a.utils.availableWidth(h,k,g),y=a.utils.availableHeight(i,k,g);a.utils.initSVG(k),l.domain(c||d3.extent(b[0].values.map(n).concat(p))),l.range(r?e||[.5*x/b[0].values.length,x*(b[0].values.length-.5)/b[0].values.length]:e||[0,x]),m.domain(d||d3.extent(b[0].values.map(o).concat(q))).range(f||[y,0]),l.domain()[0]===l.domain()[1]&&l.domain(l.domain()[0]?[l.domain()[0]-.01*l.domain()[0],l.domain()[1]+.01*l.domain()[1]]:[-1,1]),m.domain()[0]===m.domain()[1]&&m.domain(m.domain()[0]?[m.domain()[0]+.01*m.domain()[0],m.domain()[1]-.01*m.domain()[1]]:[-1,1]);var z=k.selectAll("g.nv-wrap.nv-historicalBar-"+j).data([b[0].values]),A=z.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBar-"+j),B=A.append("defs"),C=A.append("g"),D=z.select("g");C.append("g").attr("class","nv-bars"),z.attr("transform","translate("+g.left+","+g.top+")"),k.on("click",function(a,b){u.chartClick({data:a,index:b,pos:d3.event,id:j})}),B.append("clipPath").attr("id","nv-chart-clip-path-"+j).append("rect"),z.select("#nv-chart-clip-path-"+j+" rect").attr("width",x).attr("height",y),D.attr("clip-path",s?"url(#nv-chart-clip-path-"+j+")":"");var E=z.select(".nv-bars").selectAll(".nv-bar").data(function(a){return a},function(a,b){return n(a,b)});E.exit().remove(),E.enter().append("rect").attr("x",0).attr("y",function(b,c){return a.utils.NaNtoZero(m(Math.max(0,o(b,c))))}).attr("height",function(b,c){return a.utils.NaNtoZero(Math.abs(m(o(b,c))-m(0)))}).attr("transform",function(a,c){return"translate("+(l(n(a,c))-x/b[0].values.length*.45)+",0)"}).on("mouseover",function(a,b){v&&(d3.select(this).classed("hover",!0),u.elementMouseover({data:a,index:b,color:d3.select(this).style("fill")}))}).on("mouseout",function(a,b){v&&(d3.select(this).classed("hover",!1),u.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")}))}).on("mousemove",function(a,b){v&&u.elementMousemove({data:a,index:b,color:d3.select(this).style("fill")})}).on("click",function(a,b){v&&(u.elementClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation())}).on("dblclick",function(a,b){v&&(u.elementDblClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation())}),E.attr("fill",function(a,b){return t(a,b)}).attr("class",function(a,b,c){return(o(a,b)<0?"nv-bar negative":"nv-bar positive")+" nv-bar-"+c+"-"+b}).watchTransition(w,"bars").attr("transform",function(a,c){return"translate("+(l(n(a,c))-x/b[0].values.length*.45)+",0)"}).attr("width",x/b[0].values.length*.9),E.watchTransition(w,"bars").attr("y",function(b,c){var d=o(b,c)<0?m(0):m(0)-m(o(b,c))<1?m(0)-1:m(o(b,c));return a.utils.NaNtoZero(d)}).attr("height",function(b,c){return a.utils.NaNtoZero(Math.max(Math.abs(m(o(b,c))-m(0)),1))})}),w.renderEnd("historicalBar immediate"),b}var c,d,e,f,g={top:0,right:0,bottom:0,left:0},h=null,i=null,j=Math.floor(1e4*Math.random()),k=null,l=d3.scale.linear(),m=d3.scale.linear(),n=function(a){return a.x},o=function(a){return a.y},p=[],q=[0],r=!1,s=!0,t=a.utils.defaultColor(),u=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),v=!0,w=a.utils.renderWatch(u,0);return b.highlightPoint=function(a,b){k.select(".nv-bars .nv-bar-0-"+a).classed("hover",b)},b.clearHighlights=function(){k.select(".nv-bars .nv-bar.hover").classed("hover",!1)},b.dispatch=u,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return h},set:function(a){h=a}},height:{get:function(){return i},set:function(a){i=a}},forceX:{get:function(){return p},set:function(a){p=a}},forceY:{get:function(){return q},set:function(a){q=a}},padData:{get:function(){return r},set:function(a){r=a}},x:{get:function(){return n},set:function(a){n=a}},y:{get:function(){return o},set:function(a){o=a}},xScale:{get:function(){return l},set:function(a){l=a}},yScale:{get:function(){return m},set:function(a){m=a}},xDomain:{get:function(){return c},set:function(a){c=a}},yDomain:{get:function(){return d},set:function(a){d=a}},xRange:{get:function(){return e},set:function(a){e=a}},yRange:{get:function(){return f},set:function(a){f=a}},clipEdge:{get:function(){return s},set:function(a){s=a}},id:{get:function(){return j},set:function(a){j=a}},interactive:{get:function(){return v},set:function(a){v=a}},margin:{get:function(){return g},set:function(a){g.top=void 0!==a.top?a.top:g.top,g.right=void 0!==a.right?a.right:g.right,g.bottom=void 0!==a.bottom?a.bottom:g.bottom,g.left=void 0!==a.left?a.left:g.left}},color:{get:function(){return t},set:function(b){t=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.historicalBarChart=function(b){"use strict";function c(b){return b.each(function(k){z.reset(),z.models(f),q&&z.models(g),r&&z.models(h);var w=d3.select(this),A=this;a.utils.initSVG(w);var B=a.utils.availableWidth(n,w,l),C=a.utils.availableHeight(o,w,l);if(c.update=function(){w.transition().duration(y).call(c)},c.container=this,u.disabled=k.map(function(a){return!!a.disabled}),!v){var D;v={};for(D in u)v[D]=u[D]instanceof Array?u[D].slice(0):u[D]}if(!(k&&k.length&&k.filter(function(a){return a.values.length}).length))return a.utils.noData(c,w),c;w.selectAll(".nv-noData").remove(),d=f.xScale(),e=f.yScale();var E=w.selectAll("g.nv-wrap.nv-historicalBarChart").data([k]),F=E.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBarChart").append("g"),G=E.select("g");F.append("g").attr("class","nv-x nv-axis"),F.append("g").attr("class","nv-y nv-axis"),F.append("g").attr("class","nv-barsWrap"),F.append("g").attr("class","nv-legendWrap"),F.append("g").attr("class","nv-interactive"),p&&(i.width(B),G.select(".nv-legendWrap").datum(k).call(i),l.top!=i.height()&&(l.top=i.height(),C=a.utils.availableHeight(o,w,l)),E.select(".nv-legendWrap").attr("transform","translate(0,"+-l.top+")")),E.attr("transform","translate("+l.left+","+l.top+")"),s&&G.select(".nv-y.nv-axis").attr("transform","translate("+B+",0)"),t&&(j.width(B).height(C).margin({left:l.left,top:l.top}).svgContainer(w).xScale(d),E.select(".nv-interactive").call(j)),f.width(B).height(C).color(k.map(function(a,b){return a.color||m(a,b)}).filter(function(a,b){return!k[b].disabled}));var H=G.select(".nv-barsWrap").datum(k.filter(function(a){return!a.disabled}));H.transition().call(f),q&&(g.scale(d)._ticks(a.utils.calcTicksX(B/100,k)).tickSize(-C,0),G.select(".nv-x.nv-axis").attr("transform","translate(0,"+e.range()[0]+")"),G.select(".nv-x.nv-axis").transition().call(g)),r&&(h.scale(e)._ticks(a.utils.calcTicksY(C/36,k)).tickSize(-B,0),G.select(".nv-y.nv-axis").transition().call(h)),j.dispatch.on("elementMousemove",function(b){f.clearHighlights();var d,e,i,n=[];k.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(g){e=a.interactiveBisect(g.values,b.pointXValue,c.x()),f.highlightPoint(e,!0);var h=g.values[e];void 0!==h&&(void 0===d&&(d=h),void 0===i&&(i=c.xScale()(c.x()(h,e))),n.push({key:g.key,value:c.y()(h,e),color:m(g,g.seriesIndex),data:g.values[e]}))});var o=g.tickFormat()(c.x()(d,e));j.tooltip.position({left:i+l.left,top:b.mouseY+l.top}).chartContainer(A.parentNode).valueFormatter(function(a){return h.tickFormat()(a)}).data({value:o,index:e,series:n})(),j.renderGuideLine(i)}),j.dispatch.on("elementMouseout",function(){x.tooltipHide(),f.clearHighlights()}),i.dispatch.on("legendClick",function(a){a.disabled=!a.disabled,k.filter(function(a){return!a.disabled}).length||k.map(function(a){return a.disabled=!1,E.selectAll(".nv-series").classed("disabled",!1),a}),u.disabled=k.map(function(a){return!!a.disabled}),x.stateChange(u),b.transition().call(c)}),i.dispatch.on("legendDblclick",function(a){k.forEach(function(a){a.disabled=!0}),a.disabled=!1,u.disabled=k.map(function(a){return!!a.disabled}),x.stateChange(u),c.update()}),x.on("changeState",function(a){"undefined"!=typeof a.disabled&&(k.forEach(function(b,c){b.disabled=a.disabled[c]}),u.disabled=a.disabled),c.update()})}),z.renderEnd("historicalBarChart immediate"),c}var d,e,f=b||a.models.historicalBar(),g=a.models.axis(),h=a.models.axis(),i=a.models.legend(),j=a.interactiveGuideline(),k=a.models.tooltip(),l={top:30,right:90,bottom:50,left:90},m=a.utils.defaultColor(),n=null,o=null,p=!1,q=!0,r=!0,s=!1,t=!1,u={},v=null,w=null,x=d3.dispatch("tooltipHide","stateChange","changeState","renderEnd"),y=250;g.orient("bottom").tickPadding(7),h.orient(s?"right":"left"),k.duration(0).headerEnabled(!1).valueFormatter(function(a,b){return h.tickFormat()(a,b)}).headerFormatter(function(a,b){return g.tickFormat()(a,b)});var z=a.utils.renderWatch(x,0);return f.dispatch.on("elementMouseover.tooltip",function(a){a.series={key:c.x()(a.data),value:c.y()(a.data),color:a.color},k.data(a).hidden(!1)}),f.dispatch.on("elementMouseout.tooltip",function(){k.hidden(!0)}),f.dispatch.on("elementMousemove.tooltip",function(){k.position({top:d3.event.pageY,left:d3.event.pageX})()}),c.dispatch=x,c.bars=f,c.legend=i,c.xAxis=g,c.yAxis=h,c.interactiveLayer=j,c.tooltip=k,c.options=a.utils.optionsFunc.bind(c),c._options=Object.create({},{width:{get:function(){return n},set:function(a){n=a}},height:{get:function(){return o},set:function(a){o=a}},showLegend:{get:function(){return p},set:function(a){p=a}},showXAxis:{get:function(){return q},set:function(a){q=a}},showYAxis:{get:function(){return r},set:function(a){r=a}},defaultState:{get:function(){return v},set:function(a){v=a}},noData:{get:function(){return w},set:function(a){w=a}},tooltips:{get:function(){return k.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),k.enabled(!!b)}},tooltipContent:{get:function(){return k.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),k.contentGenerator(b)}},margin:{get:function(){return l},set:function(a){l.top=void 0!==a.top?a.top:l.top,l.right=void 0!==a.right?a.right:l.right,l.bottom=void 0!==a.bottom?a.bottom:l.bottom,l.left=void 0!==a.left?a.left:l.left}},color:{get:function(){return m},set:function(b){m=a.utils.getColor(b),i.color(m),f.color(m)}},duration:{get:function(){return y},set:function(a){y=a,z.reset(y),h.duration(y),g.duration(y)}},rightAlignYAxis:{get:function(){return s},set:function(a){s=a,h.orient(a?"right":"left")}},useInteractiveGuideline:{get:function(){return t},set:function(a){t=a,a===!0&&c.interactive(!1)}}}),a.utils.inheritOptions(c,f),a.utils.initOptions(c),c},a.models.ohlcBarChart=function(){var b=a.models.historicalBarChart(a.models.ohlcBar());return b.useInteractiveGuideline(!0),b.interactiveLayer.tooltip.contentGenerator(function(a){var c=a.series[0].data,d=c.open<c.close?"2ca02c":"d62728";return'<h3 style="color: #'+d+'">'+a.value+"</h3><table><tr><td>open:</td><td>"+b.yAxis.tickFormat()(c.open)+"</td></tr><tr><td>close:</td><td>"+b.yAxis.tickFormat()(c.close)+"</td></tr><tr><td>high</td><td>"+b.yAxis.tickFormat()(c.high)+"</td></tr><tr><td>low:</td><td>"+b.yAxis.tickFormat()(c.low)+"</td></tr></table>"}),b},a.models.candlestickBarChart=function(){var b=a.models.historicalBarChart(a.models.candlestickBar());return b.useInteractiveGuideline(!0),b.interactiveLayer.tooltip.contentGenerator(function(a){var c=a.series[0].data,d=c.open<c.close?"2ca02c":"d62728";return'<h3 style="color: #'+d+'">'+a.value+"</h3><table><tr><td>open:</td><td>"+b.yAxis.tickFormat()(c.open)+"</td></tr><tr><td>close:</td><td>"+b.yAxis.tickFormat()(c.close)+"</td></tr><tr><td>high</td><td>"+b.yAxis.tickFormat()(c.high)+"</td></tr><tr><td>low:</td><td>"+b.yAxis.tickFormat()(c.low)+"</td></tr></table>"}),b},a.models.legend=function(){"use strict";function b(p){function q(a,b){return"furious"!=o?"#000":m?a.disengaged?"#000":"#fff":m?void 0:(a.color||(a.color=g(a,b)),a.disabled?a.color:"#fff")}function r(a,b){return m&&"furious"==o&&a.disengaged?"#eee":a.color||g(a,b)}function s(a){return m&&"furious"==o?1:a.disabled?0:1}return p.each(function(b){var g=d-c.left-c.right,p=d3.select(this);a.utils.initSVG(p);var t=p.selectAll("g.nv-legend").data([b]),u=t.enter().append("g").attr("class","nvd3 nv-legend").append("g"),v=t.select("g");t.attr("transform","translate("+c.left+","+c.top+")");var w,x,y=v.selectAll(".nv-series").data(function(a){return"furious"!=o?a:a.filter(function(a){return m?!0:!a.disengaged})}),z=y.enter().append("g").attr("class","nv-series");switch(o){case"furious":x=23;break;case"classic":x=20}if("classic"==o)z.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),w=y.select("circle");else if("furious"==o){z.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3),w=y.select(".nv-legend-symbol"),z.append("g").attr("class","nv-check-box").property("innerHTML",'<path d="M0.5,5 L22.5,5 L22.5,26.5 L0.5,26.5 L0.5,5 Z" class="nv-box"></path><path d="M5.5,12.8618467 L11.9185089,19.2803556 L31,0.198864511" class="nv-check"></path>').attr("transform","translate(-10,-8)scale(0.5)");var A=y.select(".nv-check-box");A.each(function(a,b){d3.select(this).selectAll("path").attr("stroke",q(a,b))})}z.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");var B=y.select("text.nv-legend-text");y.on("mouseover",function(a,b){n.legendMouseover(a,b)}).on("mouseout",function(a,b){n.legendMouseout(a,b)}).on("click",function(a,b){n.legendClick(a,b);var c=y.data();if(k){if("classic"==o)l?(c.forEach(function(a){a.disabled=!0}),a.disabled=!1):(a.disabled=!a.disabled,c.every(function(a){return a.disabled})&&c.forEach(function(a){a.disabled=!1}));else if("furious"==o)if(m)a.disengaged=!a.disengaged,a.userDisabled=void 0==a.userDisabled?!!a.disabled:a.userDisabled,a.disabled=a.disengaged||a.userDisabled;else if(!m){a.disabled=!a.disabled,a.userDisabled=a.disabled;var d=c.filter(function(a){return!a.disengaged});d.every(function(a){return a.userDisabled})&&c.forEach(function(a){a.disabled=a.userDisabled=!1})}n.stateChange({disabled:c.map(function(a){return!!a.disabled}),disengaged:c.map(function(a){return!!a.disengaged})})}}).on("dblclick",function(a,b){if(("furious"!=o||!m)&&(n.legendDblclick(a,b),k)){var c=y.data();c.forEach(function(a){a.disabled=!0,"furious"==o&&(a.userDisabled=a.disabled)}),a.disabled=!1,"furious"==o&&(a.userDisabled=a.disabled),n.stateChange({disabled:c.map(function(a){return!!a.disabled})})}}),y.classed("nv-disabled",function(a){return a.userDisabled}),y.exit().remove(),B.attr("fill",q).text(f);var C=0;if(h){var D=[];y.each(function(){var b,c=d3.select(this).select("text");try{if(b=c.node().getComputedTextLength(),0>=b)throw Error()}catch(d){b=a.utils.calcApproxTextWidth(c)}D.push(b+i)});var E=0,F=[];for(C=0;g>C&&E<D.length;)F[E]=D[E],C+=D[E++];for(0===E&&(E=1);C>g&&E>1;){F=[],E--;for(var G=0;G<D.length;G++)D[G]>(F[G%E]||0)&&(F[G%E]=D[G]);C=F.reduce(function(a,b){return a+b})}for(var H=[],I=0,J=0;E>I;I++)H[I]=J,J+=F[I];y.attr("transform",function(a,b){return"translate("+H[b%E]+","+(5+Math.floor(b/E)*x)+")"}),j?v.attr("transform","translate("+(d-c.right-C)+","+c.top+")"):v.attr("transform","translate(0,"+c.top+")"),e=c.top+c.bottom+Math.ceil(D.length/E)*x}else{var K,L=5,M=5,N=0;y.attr("transform",function(){var a=d3.select(this).select("text").node().getComputedTextLength()+i;return K=M,d<c.left+c.right+K+a&&(M=K=5,L+=x),M+=a,M>N&&(N=M),K+N>C&&(C=K+N),"translate("+K+","+L+")"}),v.attr("transform","translate("+(d-c.right-N)+","+c.top+")"),e=c.top+c.bottom+L+15}if("furious"==o){w.attr("width",function(a,b){return B[0][b].getComputedTextLength()+27}).attr("height",18).attr("y",-9).attr("x",-15),u.insert("rect",":first-child").attr("class","nv-legend-bg").attr("fill","#eee").attr("opacity",0);var O=v.select(".nv-legend-bg");O.transition().duration(300).attr("x",-x).attr("width",C+x-12).attr("height",e+10).attr("y",-c.top-10).attr("opacity",m?1:0)}w.style("fill",r).style("fill-opacity",s).style("stroke",r)}),b}var c={top:5,right:0,bottom:5,left:0},d=400,e=20,f=function(a){return a.key},g=a.utils.getColor(),h=!0,i=32,j=!0,k=!0,l=!1,m=!1,n=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),o="classic";return b.dispatch=n,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return d},set:function(a){d=a}},height:{get:function(){return e},set:function(a){e=a}},key:{get:function(){return f},set:function(a){f=a}},align:{get:function(){return h},set:function(a){h=a}},rightAlign:{get:function(){return j},set:function(a){j=a}},padding:{get:function(){return i},set:function(a){i=a}},updateState:{get:function(){return k},set:function(a){k=a}},radioButtonMode:{get:function(){return l},set:function(a){l=a}},expanded:{get:function(){return m},set:function(a){m=a}},vers:{get:function(){return o},set:function(a){o=a}},margin:{get:function(){return c},set:function(a){c.top=void 0!==a.top?a.top:c.top,c.right=void 0!==a.right?a.right:c.right,c.bottom=void 0!==a.bottom?a.bottom:c.bottom,c.left=void 0!==a.left?a.left:c.left}},color:{get:function(){return g},set:function(b){g=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.line=function(){"use strict";function b(r){return v.reset(),v.models(e),r.each(function(b){i=d3.select(this);var r=a.utils.availableWidth(g,i,f),s=a.utils.availableHeight(h,i,f);a.utils.initSVG(i),c=e.xScale(),d=e.yScale(),t=t||c,u=u||d;var w=i.selectAll("g.nv-wrap.nv-line").data([b]),x=w.enter().append("g").attr("class","nvd3 nv-wrap nv-line"),y=x.append("defs"),z=x.append("g"),A=w.select("g");z.append("g").attr("class","nv-groups"),z.append("g").attr("class","nv-scatterWrap"),w.attr("transform","translate("+f.left+","+f.top+")"),e.width(r).height(s);var B=w.select(".nv-scatterWrap");B.call(e),y.append("clipPath").attr("id","nv-edge-clip-"+e.id()).append("rect"),w.select("#nv-edge-clip-"+e.id()+" rect").attr("width",r).attr("height",s>0?s:0),A.attr("clip-path",p?"url(#nv-edge-clip-"+e.id()+")":""),B.attr("clip-path",p?"url(#nv-edge-clip-"+e.id()+")":"");var C=w.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});C.enter().append("g").style("stroke-opacity",1e-6).style("stroke-width",function(a){return a.strokeWidth||j}).style("fill-opacity",1e-6),C.exit().remove(),C.attr("class",function(a,b){return(a.classed||"")+" nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}).style("fill",function(a,b){return k(a,b)}).style("stroke",function(a,b){return k(a,b)}),C.watchTransition(v,"line: groups").style("stroke-opacity",1).style("fill-opacity",function(a){return a.fillOpacity||.5});var D=C.selectAll("path.nv-area").data(function(a){return o(a)?[a]:[]});D.enter().append("path").attr("class","nv-area").attr("d",function(b){return d3.svg.area().interpolate(q).defined(n).x(function(b,c){return a.utils.NaNtoZero(t(l(b,c)))}).y0(function(b,c){return a.utils.NaNtoZero(u(m(b,c)))}).y1(function(){return u(d.domain()[0]<=0?d.domain()[1]>=0?0:d.domain()[1]:d.domain()[0])}).apply(this,[b.values])}),C.exit().selectAll("path.nv-area").remove(),D.watchTransition(v,"line: areaPaths").attr("d",function(b){return d3.svg.area().interpolate(q).defined(n).x(function(b,d){return a.utils.NaNtoZero(c(l(b,d)))}).y0(function(b,c){return a.utils.NaNtoZero(d(m(b,c)))}).y1(function(){return d(d.domain()[0]<=0?d.domain()[1]>=0?0:d.domain()[1]:d.domain()[0])}).apply(this,[b.values])});var E=C.selectAll("path.nv-line").data(function(a){return[a.values]});E.enter().append("path").attr("class","nv-line").attr("d",d3.svg.line().interpolate(q).defined(n).x(function(b,c){return a.utils.NaNtoZero(t(l(b,c)))}).y(function(b,c){return a.utils.NaNtoZero(u(m(b,c)))})),E.watchTransition(v,"line: linePaths").attr("d",d3.svg.line().interpolate(q).defined(n).x(function(b,d){return a.utils.NaNtoZero(c(l(b,d)))}).y(function(b,c){return a.utils.NaNtoZero(d(m(b,c)))})),t=c.copy(),u=d.copy()}),v.renderEnd("line immediate"),b}var c,d,e=a.models.scatter(),f={top:0,right:0,bottom:0,left:0},g=960,h=500,i=null,j=1.5,k=a.utils.defaultColor(),l=function(a){return a.x},m=function(a){return a.y},n=function(a,b){return!isNaN(m(a,b))&&null!==m(a,b)},o=function(a){return a.area},p=!1,q="linear",r=250,s=d3.dispatch("elementClick","elementMouseover","elementMouseout","renderEnd");e.pointSize(16).pointDomain([16,256]);var t,u,v=a.utils.renderWatch(s,r);return b.dispatch=s,b.scatter=e,e.dispatch.on("elementClick",function(){s.elementClick.apply(this,arguments)}),e.dispatch.on("elementMouseover",function(){s.elementMouseover.apply(this,arguments)}),e.dispatch.on("elementMouseout",function(){s.elementMouseout.apply(this,arguments)}),b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return g},set:function(a){g=a}},height:{get:function(){return h},set:function(a){h=a}},defined:{get:function(){return n},set:function(a){n=a}},interpolate:{get:function(){return q},set:function(a){q=a}},clipEdge:{get:function(){return p},set:function(a){p=a}},margin:{get:function(){return f},set:function(a){f.top=void 0!==a.top?a.top:f.top,f.right=void 0!==a.right?a.right:f.right,f.bottom=void 0!==a.bottom?a.bottom:f.bottom,f.left=void 0!==a.left?a.left:f.left}},duration:{get:function(){return r},set:function(a){r=a,v.reset(r),e.duration(r)}},isArea:{get:function(){return o},set:function(a){o=d3.functor(a)}},x:{get:function(){return l},set:function(a){l=a,e.x(a)}},y:{get:function(){return m},set:function(a){m=a,e.y(a)}},color:{get:function(){return k},set:function(b){k=a.utils.getColor(b),e.color(k)}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.lineChart=function(){"use strict";function b(j){return y.reset(),y.models(e),p&&y.models(f),q&&y.models(g),j.each(function(j){var v=d3.select(this),y=this;a.utils.initSVG(v);var B=a.utils.availableWidth(m,v,k),C=a.utils.availableHeight(n,v,k);if(b.update=function(){0===x?v.call(b):v.transition().duration(x).call(b)},b.container=this,t.setter(A(j),b.update).getter(z(j)).update(),t.disabled=j.map(function(a){return!!a.disabled}),!u){var D;u={};for(D in t)u[D]=t[D]instanceof Array?t[D].slice(0):t[D]
46093}if(!(j&&j.length&&j.filter(function(a){return a.values.length}).length))return a.utils.noData(b,v),b;v.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale();var E=v.selectAll("g.nv-wrap.nv-lineChart").data([j]),F=E.enter().append("g").attr("class","nvd3 nv-wrap nv-lineChart").append("g"),G=E.select("g");F.append("rect").style("opacity",0),F.append("g").attr("class","nv-x nv-axis"),F.append("g").attr("class","nv-y nv-axis"),F.append("g").attr("class","nv-linesWrap"),F.append("g").attr("class","nv-legendWrap"),F.append("g").attr("class","nv-interactive"),G.select("rect").attr("width",B).attr("height",C>0?C:0),o&&(h.width(B),G.select(".nv-legendWrap").datum(j).call(h),k.top!=h.height()&&(k.top=h.height(),C=a.utils.availableHeight(n,v,k)),E.select(".nv-legendWrap").attr("transform","translate(0,"+-k.top+")")),E.attr("transform","translate("+k.left+","+k.top+")"),r&&G.select(".nv-y.nv-axis").attr("transform","translate("+B+",0)"),s&&(i.width(B).height(C).margin({left:k.left,top:k.top}).svgContainer(v).xScale(c),E.select(".nv-interactive").call(i)),e.width(B).height(C).color(j.map(function(a,b){return a.color||l(a,b)}).filter(function(a,b){return!j[b].disabled}));var H=G.select(".nv-linesWrap").datum(j.filter(function(a){return!a.disabled}));H.call(e),p&&(f.scale(c)._ticks(a.utils.calcTicksX(B/100,j)).tickSize(-C,0),G.select(".nv-x.nv-axis").attr("transform","translate(0,"+d.range()[0]+")"),G.select(".nv-x.nv-axis").call(f)),q&&(g.scale(d)._ticks(a.utils.calcTicksY(C/36,j)).tickSize(-B,0),G.select(".nv-y.nv-axis").call(g)),h.dispatch.on("stateChange",function(a){for(var c in a)t[c]=a[c];w.stateChange(t),b.update()}),i.dispatch.on("elementMousemove",function(c){e.clearHighlights();var d,h,m,n=[];if(j.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(f,g){h=a.interactiveBisect(f.values,c.pointXValue,b.x());var i=f.values[h],j=b.y()(i,h);null!=j&&e.highlightPoint(g,h,!0),void 0!==i&&(void 0===d&&(d=i),void 0===m&&(m=b.xScale()(b.x()(i,h))),n.push({key:f.key,value:j,color:l(f,f.seriesIndex)}))}),n.length>2){var o=b.yScale().invert(c.mouseY),p=Math.abs(b.yScale().domain()[0]-b.yScale().domain()[1]),q=.03*p,r=a.nearestValueIndex(n.map(function(a){return a.value}),o,q);null!==r&&(n[r].highlight=!0)}var s=f.tickFormat()(b.x()(d,h));i.tooltip.position({left:c.mouseX+k.left,top:c.mouseY+k.top}).chartContainer(y.parentNode).valueFormatter(function(a){return null==a?"N/A":g.tickFormat()(a)}).data({value:s,index:h,series:n})(),i.renderGuideLine(m)}),i.dispatch.on("elementClick",function(c){var d,f=[];j.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(e){var g=a.interactiveBisect(e.values,c.pointXValue,b.x()),h=e.values[g];if("undefined"!=typeof h){"undefined"==typeof d&&(d=b.xScale()(b.x()(h,g)));var i=b.yScale()(b.y()(h,g));f.push({point:h,pointIndex:g,pos:[d,i],seriesIndex:e.seriesIndex,series:e})}}),e.dispatch.elementClick(f)}),i.dispatch.on("elementMouseout",function(){e.clearHighlights()}),w.on("changeState",function(a){"undefined"!=typeof a.disabled&&j.length===a.disabled.length&&(j.forEach(function(b,c){b.disabled=a.disabled[c]}),t.disabled=a.disabled),b.update()})}),y.renderEnd("lineChart immediate"),b}var c,d,e=a.models.line(),f=a.models.axis(),g=a.models.axis(),h=a.models.legend(),i=a.interactiveGuideline(),j=a.models.tooltip(),k={top:30,right:20,bottom:50,left:60},l=a.utils.defaultColor(),m=null,n=null,o=!0,p=!0,q=!0,r=!1,s=!1,t=a.utils.state(),u=null,v=null,w=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd"),x=250;f.orient("bottom").tickPadding(7),g.orient(r?"right":"left"),j.valueFormatter(function(a,b){return g.tickFormat()(a,b)}).headerFormatter(function(a,b){return f.tickFormat()(a,b)});var y=a.utils.renderWatch(w,x),z=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},A=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return e.dispatch.on("elementMouseover.tooltip",function(a){j.data(a).position(a.pos).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(){j.hidden(!0)}),b.dispatch=w,b.lines=e,b.legend=h,b.xAxis=f,b.yAxis=g,b.interactiveLayer=i,b.tooltip=j,b.dispatch=w,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return m},set:function(a){m=a}},height:{get:function(){return n},set:function(a){n=a}},showLegend:{get:function(){return o},set:function(a){o=a}},showXAxis:{get:function(){return p},set:function(a){p=a}},showYAxis:{get:function(){return q},set:function(a){q=a}},defaultState:{get:function(){return u},set:function(a){u=a}},noData:{get:function(){return v},set:function(a){v=a}},tooltips:{get:function(){return j.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),j.enabled(!!b)}},tooltipContent:{get:function(){return j.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),j.contentGenerator(b)}},margin:{get:function(){return k},set:function(a){k.top=void 0!==a.top?a.top:k.top,k.right=void 0!==a.right?a.right:k.right,k.bottom=void 0!==a.bottom?a.bottom:k.bottom,k.left=void 0!==a.left?a.left:k.left}},duration:{get:function(){return x},set:function(a){x=a,y.reset(x),e.duration(x),f.duration(x),g.duration(x)}},color:{get:function(){return l},set:function(b){l=a.utils.getColor(b),h.color(l),e.color(l)}},rightAlignYAxis:{get:function(){return r},set:function(a){r=a,g.orient(r?"right":"left")}},useInteractiveGuideline:{get:function(){return s},set:function(a){s=a,s&&(e.interactive(!1),e.useVoronoi(!1))}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.linePlusBarChart=function(){"use strict";function b(v){return v.each(function(v){function J(a){var b=+("e"==a),c=b?1:-1,d=X/3;return"M"+.5*c+","+d+"A6,6 0 0 "+b+" "+6.5*c+","+(d+6)+"V"+(2*d-6)+"A6,6 0 0 "+b+" "+.5*c+","+2*d+"ZM"+2.5*c+","+(d+8)+"V"+(2*d-8)+"M"+4.5*c+","+(d+8)+"V"+(2*d-8)}function S(){u.empty()||u.extent(I),kb.data([u.empty()?e.domain():I]).each(function(a){var b=e(a[0])-e.range()[0],c=e.range()[1]-e(a[1]);d3.select(this).select(".left").attr("width",0>b?0:b),d3.select(this).select(".right").attr("x",e(a[1])).attr("width",0>c?0:c)})}function T(){I=u.empty()?null:u.extent(),c=u.empty()?e.domain():u.extent(),K.brush({extent:c,brush:u}),S(),l.width(V).height(W).color(v.map(function(a,b){return a.color||C(a,b)}).filter(function(a,b){return!v[b].disabled&&v[b].bar})),j.width(V).height(W).color(v.map(function(a,b){return a.color||C(a,b)}).filter(function(a,b){return!v[b].disabled&&!v[b].bar}));var b=db.select(".nv-focus .nv-barsWrap").datum(Z.length?Z.map(function(a){return{key:a.key,values:a.values.filter(function(a,b){return l.x()(a,b)>=c[0]&&l.x()(a,b)<=c[1]})}}):[{values:[]}]),h=db.select(".nv-focus .nv-linesWrap").datum($[0].disabled?[{values:[]}]:$.map(function(a){return{area:a.area,fillOpacity:a.fillOpacity,key:a.key,values:a.values.filter(function(a,b){return j.x()(a,b)>=c[0]&&j.x()(a,b)<=c[1]})}}));d=Z.length?l.xScale():j.xScale(),n.scale(d)._ticks(a.utils.calcTicksX(V/100,v)).tickSize(-W,0),n.domain([Math.ceil(c[0]),Math.floor(c[1])]),db.select(".nv-x.nv-axis").transition().duration(L).call(n),b.transition().duration(L).call(l),h.transition().duration(L).call(j),db.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+f.range()[0]+")"),p.scale(f)._ticks(a.utils.calcTicksY(W/36,v)).tickSize(-V,0),q.scale(g)._ticks(a.utils.calcTicksY(W/36,v)).tickSize(Z.length?0:-V,0),db.select(".nv-focus .nv-y1.nv-axis").style("opacity",Z.length?1:0),db.select(".nv-focus .nv-y2.nv-axis").style("opacity",$.length&&!$[0].disabled?1:0).attr("transform","translate("+d.range()[1]+",0)"),db.select(".nv-focus .nv-y1.nv-axis").transition().duration(L).call(p),db.select(".nv-focus .nv-y2.nv-axis").transition().duration(L).call(q)}var U=d3.select(this);a.utils.initSVG(U);var V=a.utils.availableWidth(y,U,w),W=a.utils.availableHeight(z,U,w)-(E?H:0),X=H-x.top-x.bottom;if(b.update=function(){U.transition().duration(L).call(b)},b.container=this,M.setter(R(v),b.update).getter(Q(v)).update(),M.disabled=v.map(function(a){return!!a.disabled}),!N){var Y;N={};for(Y in M)N[Y]=M[Y]instanceof Array?M[Y].slice(0):M[Y]}if(!(v&&v.length&&v.filter(function(a){return a.values.length}).length))return a.utils.noData(b,U),b;U.selectAll(".nv-noData").remove();var Z=v.filter(function(a){return!a.disabled&&a.bar}),$=v.filter(function(a){return!a.bar});d=l.xScale(),e=o.scale(),f=l.yScale(),g=j.yScale(),h=m.yScale(),i=k.yScale();var _=v.filter(function(a){return!a.disabled&&a.bar}).map(function(a){return a.values.map(function(a,b){return{x:A(a,b),y:B(a,b)}})}),ab=v.filter(function(a){return!a.disabled&&!a.bar}).map(function(a){return a.values.map(function(a,b){return{x:A(a,b),y:B(a,b)}})});d.range([0,V]),e.domain(d3.extent(d3.merge(_.concat(ab)),function(a){return a.x})).range([0,V]);var bb=U.selectAll("g.nv-wrap.nv-linePlusBar").data([v]),cb=bb.enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar").append("g"),db=bb.select("g");cb.append("g").attr("class","nv-legendWrap");var eb=cb.append("g").attr("class","nv-focus");eb.append("g").attr("class","nv-x nv-axis"),eb.append("g").attr("class","nv-y1 nv-axis"),eb.append("g").attr("class","nv-y2 nv-axis"),eb.append("g").attr("class","nv-barsWrap"),eb.append("g").attr("class","nv-linesWrap");var fb=cb.append("g").attr("class","nv-context");if(fb.append("g").attr("class","nv-x nv-axis"),fb.append("g").attr("class","nv-y1 nv-axis"),fb.append("g").attr("class","nv-y2 nv-axis"),fb.append("g").attr("class","nv-barsWrap"),fb.append("g").attr("class","nv-linesWrap"),fb.append("g").attr("class","nv-brushBackground"),fb.append("g").attr("class","nv-x nv-brush"),D){var gb=t.align()?V/2:V,hb=t.align()?gb:0;t.width(gb),db.select(".nv-legendWrap").datum(v.map(function(a){return a.originalKey=void 0===a.originalKey?a.key:a.originalKey,a.key=a.originalKey+(a.bar?O:P),a})).call(t),w.top!=t.height()&&(w.top=t.height(),W=a.utils.availableHeight(z,U,w)-H),db.select(".nv-legendWrap").attr("transform","translate("+hb+","+-w.top+")")}bb.attr("transform","translate("+w.left+","+w.top+")"),db.select(".nv-context").style("display",E?"initial":"none"),m.width(V).height(X).color(v.map(function(a,b){return a.color||C(a,b)}).filter(function(a,b){return!v[b].disabled&&v[b].bar})),k.width(V).height(X).color(v.map(function(a,b){return a.color||C(a,b)}).filter(function(a,b){return!v[b].disabled&&!v[b].bar}));var ib=db.select(".nv-context .nv-barsWrap").datum(Z.length?Z:[{values:[]}]),jb=db.select(".nv-context .nv-linesWrap").datum($[0].disabled?[{values:[]}]:$);db.select(".nv-context").attr("transform","translate(0,"+(W+w.bottom+x.top)+")"),ib.transition().call(m),jb.transition().call(k),G&&(o._ticks(a.utils.calcTicksX(V/100,v)).tickSize(-X,0),db.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+h.range()[0]+")"),db.select(".nv-context .nv-x.nv-axis").transition().call(o)),F&&(r.scale(h)._ticks(X/36).tickSize(-V,0),s.scale(i)._ticks(X/36).tickSize(Z.length?0:-V,0),db.select(".nv-context .nv-y3.nv-axis").style("opacity",Z.length?1:0).attr("transform","translate(0,"+e.range()[0]+")"),db.select(".nv-context .nv-y2.nv-axis").style("opacity",$.length?1:0).attr("transform","translate("+e.range()[1]+",0)"),db.select(".nv-context .nv-y1.nv-axis").transition().call(r),db.select(".nv-context .nv-y2.nv-axis").transition().call(s)),u.x(e).on("brush",T),I&&u.extent(I);var kb=db.select(".nv-brushBackground").selectAll("g").data([I||u.extent()]),lb=kb.enter().append("g");lb.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",X),lb.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",X);var mb=db.select(".nv-x.nv-brush").call(u);mb.selectAll("rect").attr("height",X),mb.selectAll(".resize").append("path").attr("d",J),t.dispatch.on("stateChange",function(a){for(var c in a)M[c]=a[c];K.stateChange(M),b.update()}),K.on("changeState",function(a){"undefined"!=typeof a.disabled&&(v.forEach(function(b,c){b.disabled=a.disabled[c]}),M.disabled=a.disabled),b.update()}),T()}),b}var c,d,e,f,g,h,i,j=a.models.line(),k=a.models.line(),l=a.models.historicalBar(),m=a.models.historicalBar(),n=a.models.axis(),o=a.models.axis(),p=a.models.axis(),q=a.models.axis(),r=a.models.axis(),s=a.models.axis(),t=a.models.legend(),u=d3.svg.brush(),v=a.models.tooltip(),w={top:30,right:30,bottom:30,left:60},x={top:0,right:30,bottom:20,left:60},y=null,z=null,A=function(a){return a.x},B=function(a){return a.y},C=a.utils.defaultColor(),D=!0,E=!0,F=!1,G=!0,H=50,I=null,J=null,K=d3.dispatch("brush","stateChange","changeState"),L=0,M=a.utils.state(),N=null,O=" (left axis)",P=" (right axis)";j.clipEdge(!0),k.interactive(!1),n.orient("bottom").tickPadding(5),p.orient("left"),q.orient("right"),o.orient("bottom").tickPadding(5),r.orient("left"),s.orient("right"),v.headerEnabled(!0).headerFormatter(function(a,b){return n.tickFormat()(a,b)});var Q=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},R=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return j.dispatch.on("elementMouseover.tooltip",function(a){v.duration(100).valueFormatter(function(a,b){return q.tickFormat()(a,b)}).data(a).position(a.pos).hidden(!1)}),j.dispatch.on("elementMouseout.tooltip",function(){v.hidden(!0)}),l.dispatch.on("elementMouseover.tooltip",function(a){a.value=b.x()(a.data),a.series={value:b.y()(a.data),color:a.color},v.duration(0).valueFormatter(function(a,b){return p.tickFormat()(a,b)}).data(a).hidden(!1)}),l.dispatch.on("elementMouseout.tooltip",function(){v.hidden(!0)}),l.dispatch.on("elementMousemove.tooltip",function(){v.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=K,b.legend=t,b.lines=j,b.lines2=k,b.bars=l,b.bars2=m,b.xAxis=n,b.x2Axis=o,b.y1Axis=p,b.y2Axis=q,b.y3Axis=r,b.y4Axis=s,b.tooltip=v,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return y},set:function(a){y=a}},height:{get:function(){return z},set:function(a){z=a}},showLegend:{get:function(){return D},set:function(a){D=a}},brushExtent:{get:function(){return I},set:function(a){I=a}},noData:{get:function(){return J},set:function(a){J=a}},focusEnable:{get:function(){return E},set:function(a){E=a}},focusHeight:{get:function(){return H},set:function(a){H=a}},focusShowAxisX:{get:function(){return G},set:function(a){G=a}},focusShowAxisY:{get:function(){return F},set:function(a){F=a}},legendLeftAxisHint:{get:function(){return O},set:function(a){O=a}},legendRightAxisHint:{get:function(){return P},set:function(a){P=a}},tooltips:{get:function(){return v.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),v.enabled(!!b)}},tooltipContent:{get:function(){return v.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),v.contentGenerator(b)}},margin:{get:function(){return w},set:function(a){w.top=void 0!==a.top?a.top:w.top,w.right=void 0!==a.right?a.right:w.right,w.bottom=void 0!==a.bottom?a.bottom:w.bottom,w.left=void 0!==a.left?a.left:w.left}},duration:{get:function(){return L},set:function(a){L=a}},color:{get:function(){return C},set:function(b){C=a.utils.getColor(b),t.color(C)}},x:{get:function(){return A},set:function(a){A=a,j.x(a),k.x(a),l.x(a),m.x(a)}},y:{get:function(){return B},set:function(a){B=a,j.y(a),k.y(a),l.y(a),m.y(a)}}}),a.utils.inheritOptions(b,j),a.utils.initOptions(b),b},a.models.lineWithFocusChart=function(){"use strict";function b(o){return o.each(function(o){function z(a){var b=+("e"==a),c=b?1:-1,d=M/3;return"M"+.5*c+","+d+"A6,6 0 0 "+b+" "+6.5*c+","+(d+6)+"V"+(2*d-6)+"A6,6 0 0 "+b+" "+.5*c+","+2*d+"ZM"+2.5*c+","+(d+8)+"V"+(2*d-8)+"M"+4.5*c+","+(d+8)+"V"+(2*d-8)}function G(){n.empty()||n.extent(y),U.data([n.empty()?e.domain():y]).each(function(a){var b=e(a[0])-c.range()[0],d=K-e(a[1]);d3.select(this).select(".left").attr("width",0>b?0:b),d3.select(this).select(".right").attr("x",e(a[1])).attr("width",0>d?0:d)})}function H(){y=n.empty()?null:n.extent();var a=n.empty()?e.domain():n.extent();if(!(Math.abs(a[0]-a[1])<=1)){A.brush({extent:a,brush:n}),G();var b=Q.select(".nv-focus .nv-linesWrap").datum(o.filter(function(a){return!a.disabled}).map(function(b){return{key:b.key,area:b.area,values:b.values.filter(function(b,c){return g.x()(b,c)>=a[0]&&g.x()(b,c)<=a[1]})}}));b.transition().duration(B).call(g),Q.select(".nv-focus .nv-x.nv-axis").transition().duration(B).call(i),Q.select(".nv-focus .nv-y.nv-axis").transition().duration(B).call(j)}}var I=d3.select(this),J=this;a.utils.initSVG(I);var K=a.utils.availableWidth(t,I,q),L=a.utils.availableHeight(u,I,q)-v,M=v-r.top-r.bottom;if(b.update=function(){I.transition().duration(B).call(b)},b.container=this,C.setter(F(o),b.update).getter(E(o)).update(),C.disabled=o.map(function(a){return!!a.disabled}),!D){var N;D={};for(N in C)D[N]=C[N]instanceof Array?C[N].slice(0):C[N]}if(!(o&&o.length&&o.filter(function(a){return a.values.length}).length))return a.utils.noData(b,I),b;I.selectAll(".nv-noData").remove(),c=g.xScale(),d=g.yScale(),e=h.xScale(),f=h.yScale();var O=I.selectAll("g.nv-wrap.nv-lineWithFocusChart").data([o]),P=O.enter().append("g").attr("class","nvd3 nv-wrap nv-lineWithFocusChart").append("g"),Q=O.select("g");P.append("g").attr("class","nv-legendWrap");var R=P.append("g").attr("class","nv-focus");R.append("g").attr("class","nv-x nv-axis"),R.append("g").attr("class","nv-y nv-axis"),R.append("g").attr("class","nv-linesWrap"),R.append("g").attr("class","nv-interactive");var S=P.append("g").attr("class","nv-context");S.append("g").attr("class","nv-x nv-axis"),S.append("g").attr("class","nv-y nv-axis"),S.append("g").attr("class","nv-linesWrap"),S.append("g").attr("class","nv-brushBackground"),S.append("g").attr("class","nv-x nv-brush"),x&&(m.width(K),Q.select(".nv-legendWrap").datum(o).call(m),q.top!=m.height()&&(q.top=m.height(),L=a.utils.availableHeight(u,I,q)-v),Q.select(".nv-legendWrap").attr("transform","translate(0,"+-q.top+")")),O.attr("transform","translate("+q.left+","+q.top+")"),w&&(p.width(K).height(L).margin({left:q.left,top:q.top}).svgContainer(I).xScale(c),O.select(".nv-interactive").call(p)),g.width(K).height(L).color(o.map(function(a,b){return a.color||s(a,b)}).filter(function(a,b){return!o[b].disabled})),h.defined(g.defined()).width(K).height(M).color(o.map(function(a,b){return a.color||s(a,b)}).filter(function(a,b){return!o[b].disabled})),Q.select(".nv-context").attr("transform","translate(0,"+(L+q.bottom+r.top)+")");var T=Q.select(".nv-context .nv-linesWrap").datum(o.filter(function(a){return!a.disabled}));d3.transition(T).call(h),i.scale(c)._ticks(a.utils.calcTicksX(K/100,o)).tickSize(-L,0),j.scale(d)._ticks(a.utils.calcTicksY(L/36,o)).tickSize(-K,0),Q.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+L+")"),n.x(e).on("brush",function(){H()}),y&&n.extent(y);var U=Q.select(".nv-brushBackground").selectAll("g").data([y||n.extent()]),V=U.enter().append("g");V.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",M),V.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",M);var W=Q.select(".nv-x.nv-brush").call(n);W.selectAll("rect").attr("height",M),W.selectAll(".resize").append("path").attr("d",z),H(),k.scale(e)._ticks(a.utils.calcTicksX(K/100,o)).tickSize(-M,0),Q.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+f.range()[0]+")"),d3.transition(Q.select(".nv-context .nv-x.nv-axis")).call(k),l.scale(f)._ticks(a.utils.calcTicksY(M/36,o)).tickSize(-K,0),d3.transition(Q.select(".nv-context .nv-y.nv-axis")).call(l),Q.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+f.range()[0]+")"),m.dispatch.on("stateChange",function(a){for(var c in a)C[c]=a[c];A.stateChange(C),b.update()}),p.dispatch.on("elementMousemove",function(c){g.clearHighlights();var d,f,h,k=[];if(o.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(i,j){var l=n.empty()?e.domain():n.extent(),m=i.values.filter(function(a,b){return g.x()(a,b)>=l[0]&&g.x()(a,b)<=l[1]});f=a.interactiveBisect(m,c.pointXValue,g.x());var o=m[f],p=b.y()(o,f);null!=p&&g.highlightPoint(j,f,!0),void 0!==o&&(void 0===d&&(d=o),void 0===h&&(h=b.xScale()(b.x()(o,f))),k.push({key:i.key,value:b.y()(o,f),color:s(i,i.seriesIndex)}))}),k.length>2){var l=b.yScale().invert(c.mouseY),m=Math.abs(b.yScale().domain()[0]-b.yScale().domain()[1]),r=.03*m,t=a.nearestValueIndex(k.map(function(a){return a.value}),l,r);null!==t&&(k[t].highlight=!0)}var u=i.tickFormat()(b.x()(d,f));p.tooltip.position({left:c.mouseX+q.left,top:c.mouseY+q.top}).chartContainer(J.parentNode).valueFormatter(function(a){return null==a?"N/A":j.tickFormat()(a)}).data({value:u,index:f,series:k})(),p.renderGuideLine(h)}),p.dispatch.on("elementMouseout",function(){g.clearHighlights()}),A.on("changeState",function(a){"undefined"!=typeof a.disabled&&o.forEach(function(b,c){b.disabled=a.disabled[c]}),b.update()})}),b}var c,d,e,f,g=a.models.line(),h=a.models.line(),i=a.models.axis(),j=a.models.axis(),k=a.models.axis(),l=a.models.axis(),m=a.models.legend(),n=d3.svg.brush(),o=a.models.tooltip(),p=a.interactiveGuideline(),q={top:30,right:30,bottom:30,left:60},r={top:0,right:30,bottom:20,left:60},s=a.utils.defaultColor(),t=null,u=null,v=50,w=!1,x=!0,y=null,z=null,A=d3.dispatch("brush","stateChange","changeState"),B=250,C=a.utils.state(),D=null;g.clipEdge(!0).duration(0),h.interactive(!1),i.orient("bottom").tickPadding(5),j.orient("left"),k.orient("bottom").tickPadding(5),l.orient("left"),o.valueFormatter(function(a,b){return j.tickFormat()(a,b)}).headerFormatter(function(a,b){return i.tickFormat()(a,b)});var E=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},F=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return g.dispatch.on("elementMouseover.tooltip",function(a){o.data(a).position(a.pos).hidden(!1)}),g.dispatch.on("elementMouseout.tooltip",function(){o.hidden(!0)}),b.dispatch=A,b.legend=m,b.lines=g,b.lines2=h,b.xAxis=i,b.yAxis=j,b.x2Axis=k,b.y2Axis=l,b.interactiveLayer=p,b.tooltip=o,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return t},set:function(a){t=a}},height:{get:function(){return u},set:function(a){u=a}},focusHeight:{get:function(){return v},set:function(a){v=a}},showLegend:{get:function(){return x},set:function(a){x=a}},brushExtent:{get:function(){return y},set:function(a){y=a}},defaultState:{get:function(){return D},set:function(a){D=a}},noData:{get:function(){return z},set:function(a){z=a}},tooltips:{get:function(){return o.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),o.enabled(!!b)}},tooltipContent:{get:function(){return o.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),o.contentGenerator(b)}},margin:{get:function(){return q},set:function(a){q.top=void 0!==a.top?a.top:q.top,q.right=void 0!==a.right?a.right:q.right,q.bottom=void 0!==a.bottom?a.bottom:q.bottom,q.left=void 0!==a.left?a.left:q.left}},color:{get:function(){return s},set:function(b){s=a.utils.getColor(b),m.color(s)}},interpolate:{get:function(){return g.interpolate()},set:function(a){g.interpolate(a),h.interpolate(a)}},xTickFormat:{get:function(){return i.tickFormat()},set:function(a){i.tickFormat(a),k.tickFormat(a)}},yTickFormat:{get:function(){return j.tickFormat()},set:function(a){j.tickFormat(a),l.tickFormat(a)}},duration:{get:function(){return B},set:function(a){B=a,j.duration(B),l.duration(B),i.duration(B),k.duration(B)}},x:{get:function(){return g.x()},set:function(a){g.x(a),h.x(a)}},y:{get:function(){return g.y()},set:function(a){g.y(a),h.y(a)}},useInteractiveGuideline:{get:function(){return w},set:function(a){w=a,w&&(g.interactive(!1),g.useVoronoi(!1))}}}),a.utils.inheritOptions(b,g),a.utils.initOptions(b),b},a.models.multiBar=function(){"use strict";function b(E){return C.reset(),E.each(function(b){var E=k-j.left-j.right,F=l-j.top-j.bottom;p=d3.select(this),a.utils.initSVG(p);var G=0;if(x&&b.length&&(x=[{values:b[0].values.map(function(a){return{x:a.x,y:0,series:a.series,size:.01}})}]),u){var H=d3.layout.stack().offset(v).values(function(a){return a.values}).y(r)(!b.length&&x?x:b);H.forEach(function(a,c){a.nonStackable?(b[c].nonStackableSeries=G++,H[c]=b[c]):c>0&&H[c-1].nonStackable&&H[c].values.map(function(a,b){a.y0-=H[c-1].values[b].y,a.y1=a.y0+a.y})}),b=H}b.forEach(function(a,b){a.values.forEach(function(c){c.series=b,c.key=a.key})}),u&&b[0].values.map(function(a,c){var d=0,e=0;b.map(function(a,f){if(!b[f].nonStackable){var g=a.values[c];g.size=Math.abs(g.y),g.y<0?(g.y1=e,e-=g.size):(g.y1=g.size+d,d+=g.size)}})});var I=d&&e?[]:b.map(function(a,b){return a.values.map(function(a,c){return{x:q(a,c),y:r(a,c),y0:a.y0,y1:a.y1,idx:b}})});m.domain(d||d3.merge(I).map(function(a){return a.x})).rangeBands(f||[0,E],A),n.domain(e||d3.extent(d3.merge(I).map(function(a){var c=a.y;return u&&!b[a.idx].nonStackable&&(c=a.y>0?a.y1:a.y1+a.y),c}).concat(s))).range(g||[F,0]),m.domain()[0]===m.domain()[1]&&m.domain(m.domain()[0]?[m.domain()[0]-.01*m.domain()[0],m.domain()[1]+.01*m.domain()[1]]:[-1,1]),n.domain()[0]===n.domain()[1]&&n.domain(n.domain()[0]?[n.domain()[0]+.01*n.domain()[0],n.domain()[1]-.01*n.domain()[1]]:[-1,1]),h=h||m,i=i||n;var J=p.selectAll("g.nv-wrap.nv-multibar").data([b]),K=J.enter().append("g").attr("class","nvd3 nv-wrap nv-multibar"),L=K.append("defs"),M=K.append("g"),N=J.select("g");M.append("g").attr("class","nv-groups"),J.attr("transform","translate("+j.left+","+j.top+")"),L.append("clipPath").attr("id","nv-edge-clip-"+o).append("rect"),J.select("#nv-edge-clip-"+o+" rect").attr("width",E).attr("height",F),N.attr("clip-path",t?"url(#nv-edge-clip-"+o+")":"");var O=J.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a,b){return b});O.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);var P=C.transition(O.exit().selectAll("rect.nv-bar"),"multibarExit",Math.min(100,z)).attr("y",function(a){var c=i(0)||0;return u&&b[a.series]&&!b[a.series].nonStackable&&(c=i(a.y0)),c}).attr("height",0).remove();P.delay&&P.delay(function(a,b){var c=b*(z/(D+1))-b;return c}),O.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}).style("fill",function(a,b){return w(a,b)}).style("stroke",function(a,b){return w(a,b)}),O.style("stroke-opacity",1).style("fill-opacity",.75);var Q=O.selectAll("rect.nv-bar").data(function(a){return x&&!b.length?x.values:a.values});Q.exit().remove();Q.enter().append("rect").attr("class",function(a,b){return r(a,b)<0?"nv-bar negative":"nv-bar positive"}).attr("x",function(a,c,d){return u&&!b[d].nonStackable?0:d*m.rangeBand()/b.length}).attr("y",function(a,c,d){return i(u&&!b[d].nonStackable?a.y0:0)||0}).attr("height",0).attr("width",function(a,c,d){return m.rangeBand()/(u&&!b[d].nonStackable?1:b.length)}).attr("transform",function(a,b){return"translate("+m(q(a,b))+",0)"});Q.style("fill",function(a,b,c){return w(a,c,b)}).style("stroke",function(a,b,c){return w(a,c,b)}).on("mouseover",function(a,b){d3.select(this).classed("hover",!0),B.elementMouseover({data:a,index:b,color:d3.select(this).style("fill")})}).on("mouseout",function(a,b){d3.select(this).classed("hover",!1),B.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")})}).on("mousemove",function(a,b){B.elementMousemove({data:a,index:b,color:d3.select(this).style("fill")})}).on("click",function(a,b){B.elementClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}).on("dblclick",function(a,b){B.elementDblClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}),Q.attr("class",function(a,b){return r(a,b)<0?"nv-bar negative":"nv-bar positive"}).attr("transform",function(a,b){return"translate("+m(q(a,b))+",0)"}),y&&(c||(c=b.map(function(){return!0})),Q.style("fill",function(a,b,d){return d3.rgb(y(a,b)).darker(c.map(function(a,b){return b}).filter(function(a,b){return!c[b]})[d]).toString()}).style("stroke",function(a,b,d){return d3.rgb(y(a,b)).darker(c.map(function(a,b){return b}).filter(function(a,b){return!c[b]})[d]).toString()}));var R=Q.watchTransition(C,"multibar",Math.min(250,z)).delay(function(a,c){return c*z/b[0].values.length});u?R.attr("y",function(a,c,d){var e=0;return e=b[d].nonStackable?r(a,c)<0?n(0):n(0)-n(r(a,c))<-1?n(0)-1:n(r(a,c))||0:n(a.y1)}).attr("height",function(a,c,d){return b[d].nonStackable?Math.max(Math.abs(n(r(a,c))-n(0)),1)||0:Math.max(Math.abs(n(a.y+a.y0)-n(a.y0)),1)}).attr("x",function(a,c,d){var e=0;return b[d].nonStackable&&(e=a.series*m.rangeBand()/b.length,b.length!==G&&(e=b[d].nonStackableSeries*m.rangeBand()/(2*G))),e}).attr("width",function(a,c,d){if(b[d].nonStackable){var e=m.rangeBand()/G;return b.length!==G&&(e=m.rangeBand()/(2*G)),e}return m.rangeBand()}):R.attr("x",function(a){return a.series*m.rangeBand()/b.length}).attr("width",m.rangeBand()/b.length).attr("y",function(a,b){return r(a,b)<0?n(0):n(0)-n(r(a,b))<1?n(0)-1:n(r(a,b))||0}).attr("height",function(a,b){return Math.max(Math.abs(n(r(a,b))-n(0)),1)||0}),h=m.copy(),i=n.copy(),b[0]&&b[0].values&&(D=b[0].values.length)}),C.renderEnd("multibar immediate"),b}var c,d,e,f,g,h,i,j={top:0,right:0,bottom:0,left:0},k=960,l=500,m=d3.scale.ordinal(),n=d3.scale.linear(),o=Math.floor(1e4*Math.random()),p=null,q=function(a){return a.x},r=function(a){return a.y},s=[0],t=!0,u=!1,v="zero",w=a.utils.defaultColor(),x=!1,y=null,z=500,A=.1,B=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),C=a.utils.renderWatch(B,z),D=0;return b.dispatch=B,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return k},set:function(a){k=a}},height:{get:function(){return l},set:function(a){l=a}},x:{get:function(){return q},set:function(a){q=a}},y:{get:function(){return r},set:function(a){r=a}},xScale:{get:function(){return m},set:function(a){m=a}},yScale:{get:function(){return n},set:function(a){n=a}},xDomain:{get:function(){return d},set:function(a){d=a}},yDomain:{get:function(){return e},set:function(a){e=a}},xRange:{get:function(){return f},set:function(a){f=a}},yRange:{get:function(){return g},set:function(a){g=a}},forceY:{get:function(){return s},set:function(a){s=a}},stacked:{get:function(){return u},set:function(a){u=a}},stackOffset:{get:function(){return v},set:function(a){v=a}},clipEdge:{get:function(){return t},set:function(a){t=a}},disabled:{get:function(){return c},set:function(a){c=a}},id:{get:function(){return o},set:function(a){o=a}},hideable:{get:function(){return x},set:function(a){x=a}},groupSpacing:{get:function(){return A},set:function(a){A=a}},margin:{get:function(){return j},set:function(a){j.top=void 0!==a.top?a.top:j.top,j.right=void 0!==a.right?a.right:j.right,j.bottom=void 0!==a.bottom?a.bottom:j.bottom,j.left=void 0!==a.left?a.left:j.left}},duration:{get:function(){return z},set:function(a){z=a,C.reset(z)}},color:{get:function(){return w},set:function(b){w=a.utils.getColor(b)}},barColor:{get:function(){return y},set:function(b){y=b?a.utils.getColor(b):null}}}),a.utils.initOptions(b),b},a.models.multiBarChart=function(){"use strict";function b(j){return D.reset(),D.models(e),r&&D.models(f),s&&D.models(g),j.each(function(j){var z=d3.select(this);a.utils.initSVG(z);var D=a.utils.availableWidth(l,z,k),H=a.utils.availableHeight(m,z,k);if(b.update=function(){0===C?z.call(b):z.transition().duration(C).call(b)},b.container=this,x.setter(G(j),b.update).getter(F(j)).update(),x.disabled=j.map(function(a){return!!a.disabled}),!y){var I;y={};for(I in x)y[I]=x[I]instanceof Array?x[I].slice(0):x[I]}if(!(j&&j.length&&j.filter(function(a){return a.values.length}).length))return a.utils.noData(b,z),b;z.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale();
46094var J=z.selectAll("g.nv-wrap.nv-multiBarWithLegend").data([j]),K=J.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarWithLegend").append("g"),L=J.select("g");if(K.append("g").attr("class","nv-x nv-axis"),K.append("g").attr("class","nv-y nv-axis"),K.append("g").attr("class","nv-barsWrap"),K.append("g").attr("class","nv-legendWrap"),K.append("g").attr("class","nv-controlsWrap"),q&&(h.width(D-B()),L.select(".nv-legendWrap").datum(j).call(h),k.top!=h.height()&&(k.top=h.height(),H=a.utils.availableHeight(m,z,k)),L.select(".nv-legendWrap").attr("transform","translate("+B()+","+-k.top+")")),o){var M=[{key:p.grouped||"Grouped",disabled:e.stacked()},{key:p.stacked||"Stacked",disabled:!e.stacked()}];i.width(B()).color(["#444","#444","#444"]),L.select(".nv-controlsWrap").datum(M).attr("transform","translate(0,"+-k.top+")").call(i)}J.attr("transform","translate("+k.left+","+k.top+")"),t&&L.select(".nv-y.nv-axis").attr("transform","translate("+D+",0)"),e.disabled(j.map(function(a){return a.disabled})).width(D).height(H).color(j.map(function(a,b){return a.color||n(a,b)}).filter(function(a,b){return!j[b].disabled}));var N=L.select(".nv-barsWrap").datum(j.filter(function(a){return!a.disabled}));if(N.call(e),r){f.scale(c)._ticks(a.utils.calcTicksX(D/100,j)).tickSize(-H,0),L.select(".nv-x.nv-axis").attr("transform","translate(0,"+d.range()[0]+")"),L.select(".nv-x.nv-axis").call(f);var O=L.select(".nv-x.nv-axis > g").selectAll("g");if(O.selectAll("line, text").style("opacity",1),v){var P=function(a,b){return"translate("+a+","+b+")"},Q=5,R=17;O.selectAll("text").attr("transform",function(a,b,c){return P(0,c%2==0?Q:R)});var S=d3.selectAll(".nv-x.nv-axis .nv-wrap g g text")[0].length;L.selectAll(".nv-x.nv-axis .nv-axisMaxMin text").attr("transform",function(a,b){return P(0,0===b||S%2!==0?R:Q)})}u&&O.filter(function(a,b){return b%Math.ceil(j[0].values.length/(D/100))!==0}).selectAll("text, line").style("opacity",0),w&&O.selectAll(".tick text").attr("transform","rotate("+w+" 0,0)").style("text-anchor",w>0?"start":"end"),L.select(".nv-x.nv-axis").selectAll("g.nv-axisMaxMin text").style("opacity",1)}s&&(g.scale(d)._ticks(a.utils.calcTicksY(H/36,j)).tickSize(-D,0),L.select(".nv-y.nv-axis").call(g)),h.dispatch.on("stateChange",function(a){for(var c in a)x[c]=a[c];A.stateChange(x),b.update()}),i.dispatch.on("legendClick",function(a){if(a.disabled){switch(M=M.map(function(a){return a.disabled=!0,a}),a.disabled=!1,a.key){case"Grouped":case p.grouped:e.stacked(!1);break;case"Stacked":case p.stacked:e.stacked(!0)}x.stacked=e.stacked(),A.stateChange(x),b.update()}}),A.on("changeState",function(a){"undefined"!=typeof a.disabled&&(j.forEach(function(b,c){b.disabled=a.disabled[c]}),x.disabled=a.disabled),"undefined"!=typeof a.stacked&&(e.stacked(a.stacked),x.stacked=a.stacked,E=a.stacked),b.update()})}),D.renderEnd("multibarchart immediate"),b}var c,d,e=a.models.multiBar(),f=a.models.axis(),g=a.models.axis(),h=a.models.legend(),i=a.models.legend(),j=a.models.tooltip(),k={top:30,right:20,bottom:50,left:60},l=null,m=null,n=a.utils.defaultColor(),o=!0,p={},q=!0,r=!0,s=!0,t=!1,u=!0,v=!1,w=0,x=a.utils.state(),y=null,z=null,A=d3.dispatch("stateChange","changeState","renderEnd"),B=function(){return o?180:0},C=250;x.stacked=!1,e.stacked(!1),f.orient("bottom").tickPadding(7).showMaxMin(!1).tickFormat(function(a){return a}),g.orient(t?"right":"left").tickFormat(d3.format(",.1f")),j.duration(0).valueFormatter(function(a,b){return g.tickFormat()(a,b)}).headerFormatter(function(a,b){return f.tickFormat()(a,b)}),i.updateState(!1);var D=a.utils.renderWatch(A),E=!1,F=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),stacked:E}}},G=function(a){return function(b){void 0!==b.stacked&&(E=b.stacked),void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return e.dispatch.on("elementMouseover.tooltip",function(a){a.value=b.x()(a.data),a.series={key:a.data.key,value:b.y()(a.data),color:a.color},j.data(a).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(){j.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(){j.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=A,b.multibar=e,b.legend=h,b.controls=i,b.xAxis=f,b.yAxis=g,b.state=x,b.tooltip=j,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return l},set:function(a){l=a}},height:{get:function(){return m},set:function(a){m=a}},showLegend:{get:function(){return q},set:function(a){q=a}},showControls:{get:function(){return o},set:function(a){o=a}},controlLabels:{get:function(){return p},set:function(a){p=a}},showXAxis:{get:function(){return r},set:function(a){r=a}},showYAxis:{get:function(){return s},set:function(a){s=a}},defaultState:{get:function(){return y},set:function(a){y=a}},noData:{get:function(){return z},set:function(a){z=a}},reduceXTicks:{get:function(){return u},set:function(a){u=a}},rotateLabels:{get:function(){return w},set:function(a){w=a}},staggerLabels:{get:function(){return v},set:function(a){v=a}},tooltips:{get:function(){return j.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),j.enabled(!!b)}},tooltipContent:{get:function(){return j.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),j.contentGenerator(b)}},margin:{get:function(){return k},set:function(a){k.top=void 0!==a.top?a.top:k.top,k.right=void 0!==a.right?a.right:k.right,k.bottom=void 0!==a.bottom?a.bottom:k.bottom,k.left=void 0!==a.left?a.left:k.left}},duration:{get:function(){return C},set:function(a){C=a,e.duration(C),f.duration(C),g.duration(C),D.reset(C)}},color:{get:function(){return n},set:function(b){n=a.utils.getColor(b),h.color(n)}},rightAlignYAxis:{get:function(){return t},set:function(a){t=a,g.orient(t?"right":"left")}},barColor:{get:function(){return e.barColor},set:function(a){e.barColor(a),h.color(function(a,b){return d3.rgb("#ccc").darker(1.5*b).toString()})}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.multiBarHorizontal=function(){"use strict";function b(m){return E.reset(),m.each(function(b){var m=k-j.left-j.right,C=l-j.top-j.bottom;n=d3.select(this),a.utils.initSVG(n),w&&(b=d3.layout.stack().offset("zero").values(function(a){return a.values}).y(r)(b)),b.forEach(function(a,b){a.values.forEach(function(c){c.series=b,c.key=a.key})}),w&&b[0].values.map(function(a,c){var d=0,e=0;b.map(function(a){var b=a.values[c];b.size=Math.abs(b.y),b.y<0?(b.y1=e-b.size,e-=b.size):(b.y1=d,d+=b.size)})});var F=d&&e?[]:b.map(function(a){return a.values.map(function(a,b){return{x:q(a,b),y:r(a,b),y0:a.y0,y1:a.y1}})});o.domain(d||d3.merge(F).map(function(a){return a.x})).rangeBands(f||[0,C],A),p.domain(e||d3.extent(d3.merge(F).map(function(a){return w?a.y>0?a.y1+a.y:a.y1:a.y}).concat(t))),p.range(x&&!w?g||[p.domain()[0]<0?z:0,m-(p.domain()[1]>0?z:0)]:g||[0,m]),h=h||o,i=i||d3.scale.linear().domain(p.domain()).range([p(0),p(0)]);{var G=d3.select(this).selectAll("g.nv-wrap.nv-multibarHorizontal").data([b]),H=G.enter().append("g").attr("class","nvd3 nv-wrap nv-multibarHorizontal"),I=(H.append("defs"),H.append("g"));G.select("g")}I.append("g").attr("class","nv-groups"),G.attr("transform","translate("+j.left+","+j.top+")");var J=G.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a,b){return b});J.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),J.exit().watchTransition(E,"multibarhorizontal: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),J.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}).style("fill",function(a,b){return u(a,b)}).style("stroke",function(a,b){return u(a,b)}),J.watchTransition(E,"multibarhorizontal: groups").style("stroke-opacity",1).style("fill-opacity",.75);var K=J.selectAll("g.nv-bar").data(function(a){return a.values});K.exit().remove();var L=K.enter().append("g").attr("transform",function(a,c,d){return"translate("+i(w?a.y0:0)+","+(w?0:d*o.rangeBand()/b.length+o(q(a,c)))+")"});L.append("rect").attr("width",0).attr("height",o.rangeBand()/(w?1:b.length)),K.on("mouseover",function(a,b){d3.select(this).classed("hover",!0),D.elementMouseover({data:a,index:b,color:d3.select(this).style("fill")})}).on("mouseout",function(a,b){d3.select(this).classed("hover",!1),D.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")})}).on("mouseout",function(a,b){D.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")})}).on("mousemove",function(a,b){D.elementMousemove({data:a,index:b,color:d3.select(this).style("fill")})}).on("click",function(a,b){D.elementClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}).on("dblclick",function(a,b){D.elementDblClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}),s(b[0],0)&&(L.append("polyline"),K.select("polyline").attr("fill","none").attr("points",function(a,c){var d=s(a,c),e=.8*o.rangeBand()/(2*(w?1:b.length));d=d.length?d:[-Math.abs(d),Math.abs(d)],d=d.map(function(a){return p(a)-p(0)});var f=[[d[0],-e],[d[0],e],[d[0],0],[d[1],0],[d[1],-e],[d[1],e]];return f.map(function(a){return a.join(",")}).join(" ")}).attr("transform",function(a,c){var d=o.rangeBand()/(2*(w?1:b.length));return"translate("+(r(a,c)<0?0:p(r(a,c))-p(0))+", "+d+")"})),L.append("text"),x&&!w?(K.select("text").attr("text-anchor",function(a,b){return r(a,b)<0?"end":"start"}).attr("y",o.rangeBand()/(2*b.length)).attr("dy",".32em").text(function(a,b){var c=B(r(a,b)),d=s(a,b);return void 0===d?c:d.length?c+"+"+B(Math.abs(d[1]))+"-"+B(Math.abs(d[0])):c+"±"+B(Math.abs(d))}),K.watchTransition(E,"multibarhorizontal: bars").select("text").attr("x",function(a,b){return r(a,b)<0?-4:p(r(a,b))-p(0)+4})):K.selectAll("text").text(""),y&&!w?(L.append("text").classed("nv-bar-label",!0),K.select("text.nv-bar-label").attr("text-anchor",function(a,b){return r(a,b)<0?"start":"end"}).attr("y",o.rangeBand()/(2*b.length)).attr("dy",".32em").text(function(a,b){return q(a,b)}),K.watchTransition(E,"multibarhorizontal: bars").select("text.nv-bar-label").attr("x",function(a,b){return r(a,b)<0?p(0)-p(r(a,b))+4:-4})):K.selectAll("text.nv-bar-label").text(""),K.attr("class",function(a,b){return r(a,b)<0?"nv-bar negative":"nv-bar positive"}),v&&(c||(c=b.map(function(){return!0})),K.style("fill",function(a,b,d){return d3.rgb(v(a,b)).darker(c.map(function(a,b){return b}).filter(function(a,b){return!c[b]})[d]).toString()}).style("stroke",function(a,b,d){return d3.rgb(v(a,b)).darker(c.map(function(a,b){return b}).filter(function(a,b){return!c[b]})[d]).toString()})),w?K.watchTransition(E,"multibarhorizontal: bars").attr("transform",function(a,b){return"translate("+p(a.y1)+","+o(q(a,b))+")"}).select("rect").attr("width",function(a,b){return Math.abs(p(r(a,b)+a.y0)-p(a.y0))}).attr("height",o.rangeBand()):K.watchTransition(E,"multibarhorizontal: bars").attr("transform",function(a,c){return"translate("+p(r(a,c)<0?r(a,c):0)+","+(a.series*o.rangeBand()/b.length+o(q(a,c)))+")"}).select("rect").attr("height",o.rangeBand()/b.length).attr("width",function(a,b){return Math.max(Math.abs(p(r(a,b))-p(0)),1)}),h=o.copy(),i=p.copy()}),E.renderEnd("multibarHorizontal immediate"),b}var c,d,e,f,g,h,i,j={top:0,right:0,bottom:0,left:0},k=960,l=500,m=Math.floor(1e4*Math.random()),n=null,o=d3.scale.ordinal(),p=d3.scale.linear(),q=function(a){return a.x},r=function(a){return a.y},s=function(a){return a.yErr},t=[0],u=a.utils.defaultColor(),v=null,w=!1,x=!1,y=!1,z=60,A=.1,B=d3.format(",.2f"),C=250,D=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),E=a.utils.renderWatch(D,C);return b.dispatch=D,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return k},set:function(a){k=a}},height:{get:function(){return l},set:function(a){l=a}},x:{get:function(){return q},set:function(a){q=a}},y:{get:function(){return r},set:function(a){r=a}},yErr:{get:function(){return s},set:function(a){s=a}},xScale:{get:function(){return o},set:function(a){o=a}},yScale:{get:function(){return p},set:function(a){p=a}},xDomain:{get:function(){return d},set:function(a){d=a}},yDomain:{get:function(){return e},set:function(a){e=a}},xRange:{get:function(){return f},set:function(a){f=a}},yRange:{get:function(){return g},set:function(a){g=a}},forceY:{get:function(){return t},set:function(a){t=a}},stacked:{get:function(){return w},set:function(a){w=a}},showValues:{get:function(){return x},set:function(a){x=a}},disabled:{get:function(){return c},set:function(a){c=a}},id:{get:function(){return m},set:function(a){m=a}},valueFormat:{get:function(){return B},set:function(a){B=a}},valuePadding:{get:function(){return z},set:function(a){z=a}},groupSpacing:{get:function(){return A},set:function(a){A=a}},margin:{get:function(){return j},set:function(a){j.top=void 0!==a.top?a.top:j.top,j.right=void 0!==a.right?a.right:j.right,j.bottom=void 0!==a.bottom?a.bottom:j.bottom,j.left=void 0!==a.left?a.left:j.left}},duration:{get:function(){return C},set:function(a){C=a,E.reset(C)}},color:{get:function(){return u},set:function(b){u=a.utils.getColor(b)}},barColor:{get:function(){return v},set:function(b){v=b?a.utils.getColor(b):null}}}),a.utils.initOptions(b),b},a.models.multiBarHorizontalChart=function(){"use strict";function b(j){return C.reset(),C.models(e),r&&C.models(f),s&&C.models(g),j.each(function(j){var w=d3.select(this);a.utils.initSVG(w);var C=a.utils.availableWidth(l,w,k),D=a.utils.availableHeight(m,w,k);if(b.update=function(){w.transition().duration(z).call(b)},b.container=this,t=e.stacked(),u.setter(B(j),b.update).getter(A(j)).update(),u.disabled=j.map(function(a){return!!a.disabled}),!v){var E;v={};for(E in u)v[E]=u[E]instanceof Array?u[E].slice(0):u[E]}if(!(j&&j.length&&j.filter(function(a){return a.values.length}).length))return a.utils.noData(b,w),b;w.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale();var F=w.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").data([j]),G=F.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarHorizontalChart").append("g"),H=F.select("g");if(G.append("g").attr("class","nv-x nv-axis"),G.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),G.append("g").attr("class","nv-barsWrap"),G.append("g").attr("class","nv-legendWrap"),G.append("g").attr("class","nv-controlsWrap"),q&&(h.width(C-y()),H.select(".nv-legendWrap").datum(j).call(h),k.top!=h.height()&&(k.top=h.height(),D=a.utils.availableHeight(m,w,k)),H.select(".nv-legendWrap").attr("transform","translate("+y()+","+-k.top+")")),o){var I=[{key:p.grouped||"Grouped",disabled:e.stacked()},{key:p.stacked||"Stacked",disabled:!e.stacked()}];i.width(y()).color(["#444","#444","#444"]),H.select(".nv-controlsWrap").datum(I).attr("transform","translate(0,"+-k.top+")").call(i)}F.attr("transform","translate("+k.left+","+k.top+")"),e.disabled(j.map(function(a){return a.disabled})).width(C).height(D).color(j.map(function(a,b){return a.color||n(a,b)}).filter(function(a,b){return!j[b].disabled}));var J=H.select(".nv-barsWrap").datum(j.filter(function(a){return!a.disabled}));if(J.transition().call(e),r){f.scale(c)._ticks(a.utils.calcTicksY(D/24,j)).tickSize(-C,0),H.select(".nv-x.nv-axis").call(f);var K=H.select(".nv-x.nv-axis").selectAll("g");K.selectAll("line, text")}s&&(g.scale(d)._ticks(a.utils.calcTicksX(C/100,j)).tickSize(-D,0),H.select(".nv-y.nv-axis").attr("transform","translate(0,"+D+")"),H.select(".nv-y.nv-axis").call(g)),H.select(".nv-zeroLine line").attr("x1",d(0)).attr("x2",d(0)).attr("y1",0).attr("y2",-D),h.dispatch.on("stateChange",function(a){for(var c in a)u[c]=a[c];x.stateChange(u),b.update()}),i.dispatch.on("legendClick",function(a){if(a.disabled){switch(I=I.map(function(a){return a.disabled=!0,a}),a.disabled=!1,a.key){case"Grouped":e.stacked(!1);break;case"Stacked":e.stacked(!0)}u.stacked=e.stacked(),x.stateChange(u),t=e.stacked(),b.update()}}),x.on("changeState",function(a){"undefined"!=typeof a.disabled&&(j.forEach(function(b,c){b.disabled=a.disabled[c]}),u.disabled=a.disabled),"undefined"!=typeof a.stacked&&(e.stacked(a.stacked),u.stacked=a.stacked,t=a.stacked),b.update()})}),C.renderEnd("multibar horizontal chart immediate"),b}var c,d,e=a.models.multiBarHorizontal(),f=a.models.axis(),g=a.models.axis(),h=a.models.legend().height(30),i=a.models.legend().height(30),j=a.models.tooltip(),k={top:30,right:20,bottom:50,left:60},l=null,m=null,n=a.utils.defaultColor(),o=!0,p={},q=!0,r=!0,s=!0,t=!1,u=a.utils.state(),v=null,w=null,x=d3.dispatch("stateChange","changeState","renderEnd"),y=function(){return o?180:0},z=250;u.stacked=!1,e.stacked(t),f.orient("left").tickPadding(5).showMaxMin(!1).tickFormat(function(a){return a}),g.orient("bottom").tickFormat(d3.format(",.1f")),j.duration(0).valueFormatter(function(a,b){return g.tickFormat()(a,b)}).headerFormatter(function(a,b){return f.tickFormat()(a,b)}),i.updateState(!1);var A=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),stacked:t}}},B=function(a){return function(b){void 0!==b.stacked&&(t=b.stacked),void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}},C=a.utils.renderWatch(x,z);return e.dispatch.on("elementMouseover.tooltip",function(a){a.value=b.x()(a.data),a.series={key:a.data.key,value:b.y()(a.data),color:a.color},j.data(a).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(){j.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(){j.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=x,b.multibar=e,b.legend=h,b.controls=i,b.xAxis=f,b.yAxis=g,b.state=u,b.tooltip=j,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return l},set:function(a){l=a}},height:{get:function(){return m},set:function(a){m=a}},showLegend:{get:function(){return q},set:function(a){q=a}},showControls:{get:function(){return o},set:function(a){o=a}},controlLabels:{get:function(){return p},set:function(a){p=a}},showXAxis:{get:function(){return r},set:function(a){r=a}},showYAxis:{get:function(){return s},set:function(a){s=a}},defaultState:{get:function(){return v},set:function(a){v=a}},noData:{get:function(){return w},set:function(a){w=a}},tooltips:{get:function(){return j.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),j.enabled(!!b)}},tooltipContent:{get:function(){return j.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),j.contentGenerator(b)}},margin:{get:function(){return k},set:function(a){k.top=void 0!==a.top?a.top:k.top,k.right=void 0!==a.right?a.right:k.right,k.bottom=void 0!==a.bottom?a.bottom:k.bottom,k.left=void 0!==a.left?a.left:k.left}},duration:{get:function(){return z},set:function(a){z=a,C.reset(z),e.duration(z),f.duration(z),g.duration(z)}},color:{get:function(){return n},set:function(b){n=a.utils.getColor(b),h.color(n)}},barColor:{get:function(){return e.barColor},set:function(a){e.barColor(a),h.color(function(a,b){return d3.rgb("#ccc").darker(1.5*b).toString()})}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.multiChart=function(){"use strict";function b(j){return j.each(function(j){function k(a){var b=2===j[a.seriesIndex].yAxis?z:y;a.value=a.point.x,a.series={value:a.point.y,color:a.point.color},B.duration(100).valueFormatter(function(a,c){return b.tickFormat()(a,c)}).data(a).position(a.pos).hidden(!1)}function l(a){var b=2===j[a.seriesIndex].yAxis?z:y;a.point.x=v.x()(a.point),a.point.y=v.y()(a.point),B.duration(100).valueFormatter(function(a,c){return b.tickFormat()(a,c)}).data(a).position(a.pos).hidden(!1)}function n(a){var b=2===j[a.data.series].yAxis?z:y;a.value=t.x()(a.data),a.series={value:t.y()(a.data),color:a.color},B.duration(0).valueFormatter(function(a,c){return b.tickFormat()(a,c)}).data(a).hidden(!1)}var C=d3.select(this);a.utils.initSVG(C),b.update=function(){C.transition().call(b)},b.container=this;var D=a.utils.availableWidth(g,C,e),E=a.utils.availableHeight(h,C,e),F=j.filter(function(a){return"line"==a.type&&1==a.yAxis}),G=j.filter(function(a){return"line"==a.type&&2==a.yAxis}),H=j.filter(function(a){return"bar"==a.type&&1==a.yAxis}),I=j.filter(function(a){return"bar"==a.type&&2==a.yAxis}),J=j.filter(function(a){return"area"==a.type&&1==a.yAxis}),K=j.filter(function(a){return"area"==a.type&&2==a.yAxis});if(!(j&&j.length&&j.filter(function(a){return a.values.length}).length))return a.utils.noData(b,C),b;C.selectAll(".nv-noData").remove();var L=j.filter(function(a){return!a.disabled&&1==a.yAxis}).map(function(a){return a.values.map(function(a){return{x:a.x,y:a.y}})}),M=j.filter(function(a){return!a.disabled&&2==a.yAxis}).map(function(a){return a.values.map(function(a){return{x:a.x,y:a.y}})});o.domain(d3.extent(d3.merge(L.concat(M)),function(a){return a.x})).range([0,D]);var N=C.selectAll("g.wrap.multiChart").data([j]),O=N.enter().append("g").attr("class","wrap nvd3 multiChart").append("g");O.append("g").attr("class","nv-x nv-axis"),O.append("g").attr("class","nv-y1 nv-axis"),O.append("g").attr("class","nv-y2 nv-axis"),O.append("g").attr("class","lines1Wrap"),O.append("g").attr("class","lines2Wrap"),O.append("g").attr("class","bars1Wrap"),O.append("g").attr("class","bars2Wrap"),O.append("g").attr("class","stack1Wrap"),O.append("g").attr("class","stack2Wrap"),O.append("g").attr("class","legendWrap");var P=N.select("g"),Q=j.map(function(a,b){return j[b].color||f(a,b)});if(i){var R=A.align()?D/2:D,S=A.align()?R:0;A.width(R),A.color(Q),P.select(".legendWrap").datum(j.map(function(a){return a.originalKey=void 0===a.originalKey?a.key:a.originalKey,a.key=a.originalKey+(1==a.yAxis?"":" (right axis)"),a})).call(A),e.top!=A.height()&&(e.top=A.height(),E=a.utils.availableHeight(h,C,e)),P.select(".legendWrap").attr("transform","translate("+S+","+-e.top+")")}r.width(D).height(E).interpolate(m).color(Q.filter(function(a,b){return!j[b].disabled&&1==j[b].yAxis&&"line"==j[b].type})),s.width(D).height(E).interpolate(m).color(Q.filter(function(a,b){return!j[b].disabled&&2==j[b].yAxis&&"line"==j[b].type})),t.width(D).height(E).color(Q.filter(function(a,b){return!j[b].disabled&&1==j[b].yAxis&&"bar"==j[b].type})),u.width(D).height(E).color(Q.filter(function(a,b){return!j[b].disabled&&2==j[b].yAxis&&"bar"==j[b].type})),v.width(D).height(E).color(Q.filter(function(a,b){return!j[b].disabled&&1==j[b].yAxis&&"area"==j[b].type})),w.width(D).height(E).color(Q.filter(function(a,b){return!j[b].disabled&&2==j[b].yAxis&&"area"==j[b].type})),P.attr("transform","translate("+e.left+","+e.top+")");var T=P.select(".lines1Wrap").datum(F.filter(function(a){return!a.disabled})),U=P.select(".bars1Wrap").datum(H.filter(function(a){return!a.disabled})),V=P.select(".stack1Wrap").datum(J.filter(function(a){return!a.disabled})),W=P.select(".lines2Wrap").datum(G.filter(function(a){return!a.disabled})),X=P.select(".bars2Wrap").datum(I.filter(function(a){return!a.disabled})),Y=P.select(".stack2Wrap").datum(K.filter(function(a){return!a.disabled})),Z=J.length?J.map(function(a){return a.values}).reduce(function(a,b){return a.map(function(a,c){return{x:a.x,y:a.y+b[c].y}})}).concat([{x:0,y:0}]):[],$=K.length?K.map(function(a){return a.values}).reduce(function(a,b){return a.map(function(a,c){return{x:a.x,y:a.y+b[c].y}})}).concat([{x:0,y:0}]):[];p.domain(c||d3.extent(d3.merge(L).concat(Z),function(a){return a.y})).range([0,E]),q.domain(d||d3.extent(d3.merge(M).concat($),function(a){return a.y})).range([0,E]),r.yDomain(p.domain()),t.yDomain(p.domain()),v.yDomain(p.domain()),s.yDomain(q.domain()),u.yDomain(q.domain()),w.yDomain(q.domain()),J.length&&d3.transition(V).call(v),K.length&&d3.transition(Y).call(w),H.length&&d3.transition(U).call(t),I.length&&d3.transition(X).call(u),F.length&&d3.transition(T).call(r),G.length&&d3.transition(W).call(s),x._ticks(a.utils.calcTicksX(D/100,j)).tickSize(-E,0),P.select(".nv-x.nv-axis").attr("transform","translate(0,"+E+")"),d3.transition(P.select(".nv-x.nv-axis")).call(x),y._ticks(a.utils.calcTicksY(E/36,j)).tickSize(-D,0),d3.transition(P.select(".nv-y1.nv-axis")).call(y),z._ticks(a.utils.calcTicksY(E/36,j)).tickSize(-D,0),d3.transition(P.select(".nv-y2.nv-axis")).call(z),P.select(".nv-y1.nv-axis").classed("nv-disabled",L.length?!1:!0).attr("transform","translate("+o.range()[0]+",0)"),P.select(".nv-y2.nv-axis").classed("nv-disabled",M.length?!1:!0).attr("transform","translate("+o.range()[1]+",0)"),A.dispatch.on("stateChange",function(){b.update()}),r.dispatch.on("elementMouseover.tooltip",k),s.dispatch.on("elementMouseover.tooltip",k),r.dispatch.on("elementMouseout.tooltip",function(){B.hidden(!0)}),s.dispatch.on("elementMouseout.tooltip",function(){B.hidden(!0)}),v.dispatch.on("elementMouseover.tooltip",l),w.dispatch.on("elementMouseover.tooltip",l),v.dispatch.on("elementMouseout.tooltip",function(){B.hidden(!0)}),w.dispatch.on("elementMouseout.tooltip",function(){B.hidden(!0)}),t.dispatch.on("elementMouseover.tooltip",n),u.dispatch.on("elementMouseover.tooltip",n),t.dispatch.on("elementMouseout.tooltip",function(){B.hidden(!0)}),u.dispatch.on("elementMouseout.tooltip",function(){B.hidden(!0)}),t.dispatch.on("elementMousemove.tooltip",function(){B.position({top:d3.event.pageY,left:d3.event.pageX})()}),u.dispatch.on("elementMousemove.tooltip",function(){B.position({top:d3.event.pageY,left:d3.event.pageX})()})}),b}var c,d,e={top:30,right:20,bottom:50,left:60},f=a.utils.defaultColor(),g=null,h=null,i=!0,j=null,k=function(a){return a.x},l=function(a){return a.y},m="monotone",n=!0,o=d3.scale.linear(),p=d3.scale.linear(),q=d3.scale.linear(),r=a.models.line().yScale(p),s=a.models.line().yScale(q),t=a.models.multiBar().stacked(!1).yScale(p),u=a.models.multiBar().stacked(!1).yScale(q),v=a.models.stackedArea().yScale(p),w=a.models.stackedArea().yScale(q),x=a.models.axis().scale(o).orient("bottom").tickPadding(5),y=a.models.axis().scale(p).orient("left"),z=a.models.axis().scale(q).orient("right"),A=a.models.legend().height(30),B=a.models.tooltip(),C=d3.dispatch();return b.dispatch=C,b.lines1=r,b.lines2=s,b.bars1=t,b.bars2=u,b.stack1=v,b.stack2=w,b.xAxis=x,b.yAxis1=y,b.yAxis2=z,b.tooltip=B,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return g},set:function(a){g=a}},height:{get:function(){return h},set:function(a){h=a}},showLegend:{get:function(){return i},set:function(a){i=a}},yDomain1:{get:function(){return c},set:function(a){c=a}},yDomain2:{get:function(){return d},set:function(a){d=a}},noData:{get:function(){return j},set:function(a){j=a}},interpolate:{get:function(){return m},set:function(a){m=a}},tooltips:{get:function(){return B.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),B.enabled(!!b)}},tooltipContent:{get:function(){return B.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),B.contentGenerator(b)}},margin:{get:function(){return e},set:function(a){e.top=void 0!==a.top?a.top:e.top,e.right=void 0!==a.right?a.right:e.right,e.bottom=void 0!==a.bottom?a.bottom:e.bottom,e.left=void 0!==a.left?a.left:e.left}},color:{get:function(){return f},set:function(b){f=a.utils.getColor(b)}},x:{get:function(){return k},set:function(a){k=a,r.x(a),s.x(a),t.x(a),u.x(a),v.x(a),w.x(a)}},y:{get:function(){return l},set:function(a){l=a,r.y(a),s.y(a),v.y(a),w.y(a),t.y(a),u.y(a)}},useVoronoi:{get:function(){return n},set:function(a){n=a,r.useVoronoi(a),s.useVoronoi(a),v.useVoronoi(a),w.useVoronoi(a)}}}),a.utils.initOptions(b),b},a.models.ohlcBar=function(){"use strict";function b(y){return y.each(function(b){k=d3.select(this);var y=a.utils.availableWidth(h,k,g),A=a.utils.availableHeight(i,k,g);a.utils.initSVG(k);var B=y/b[0].values.length*.9;l.domain(c||d3.extent(b[0].values.map(n).concat(t))),l.range(v?e||[.5*y/b[0].values.length,y*(b[0].values.length-.5)/b[0].values.length]:e||[5+B/2,y-B/2-5]),m.domain(d||[d3.min(b[0].values.map(s).concat(u)),d3.max(b[0].values.map(r).concat(u))]).range(f||[A,0]),l.domain()[0]===l.domain()[1]&&l.domain(l.domain()[0]?[l.domain()[0]-.01*l.domain()[0],l.domain()[1]+.01*l.domain()[1]]:[-1,1]),m.domain()[0]===m.domain()[1]&&m.domain(m.domain()[0]?[m.domain()[0]+.01*m.domain()[0],m.domain()[1]-.01*m.domain()[1]]:[-1,1]);var C=d3.select(this).selectAll("g.nv-wrap.nv-ohlcBar").data([b[0].values]),D=C.enter().append("g").attr("class","nvd3 nv-wrap nv-ohlcBar"),E=D.append("defs"),F=D.append("g"),G=C.select("g");F.append("g").attr("class","nv-ticks"),C.attr("transform","translate("+g.left+","+g.top+")"),k.on("click",function(a,b){z.chartClick({data:a,index:b,pos:d3.event,id:j})}),E.append("clipPath").attr("id","nv-chart-clip-path-"+j).append("rect"),C.select("#nv-chart-clip-path-"+j+" rect").attr("width",y).attr("height",A),G.attr("clip-path",w?"url(#nv-chart-clip-path-"+j+")":"");var H=C.select(".nv-ticks").selectAll(".nv-tick").data(function(a){return a});H.exit().remove(),H.enter().append("path").attr("class",function(a,b,c){return(p(a,b)>q(a,b)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+c+"-"+b}).attr("d",function(a,b){return"m0,0l0,"+(m(p(a,b))-m(r(a,b)))+"l"+-B/2+",0l"+B/2+",0l0,"+(m(s(a,b))-m(p(a,b)))+"l0,"+(m(q(a,b))-m(s(a,b)))+"l"+B/2+",0l"+-B/2+",0z"}).attr("transform",function(a,b){return"translate("+l(n(a,b))+","+m(r(a,b))+")"}).attr("fill",function(){return x[0]}).attr("stroke",function(){return x[0]}).attr("x",0).attr("y",function(a,b){return m(Math.max(0,o(a,b)))}).attr("height",function(a,b){return Math.abs(m(o(a,b))-m(0))}),H.attr("class",function(a,b,c){return(p(a,b)>q(a,b)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+c+"-"+b}),d3.transition(H).attr("transform",function(a,b){return"translate("+l(n(a,b))+","+m(r(a,b))+")"}).attr("d",function(a,c){var d=y/b[0].values.length*.9;return"m0,0l0,"+(m(p(a,c))-m(r(a,c)))+"l"+-d/2+",0l"+d/2+",0l0,"+(m(s(a,c))-m(p(a,c)))+"l0,"+(m(q(a,c))-m(s(a,c)))+"l"+d/2+",0l"+-d/2+",0z"})}),b}var c,d,e,f,g={top:0,right:0,bottom:0,left:0},h=null,i=null,j=Math.floor(1e4*Math.random()),k=null,l=d3.scale.linear(),m=d3.scale.linear(),n=function(a){return a.x},o=function(a){return a.y},p=function(a){return a.open},q=function(a){return a.close},r=function(a){return a.high},s=function(a){return a.low},t=[],u=[],v=!1,w=!0,x=a.utils.defaultColor(),y=!1,z=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd","chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove");return b.highlightPoint=function(a,c){b.clearHighlights(),k.select(".nv-ohlcBar .nv-tick-0-"+a).classed("hover",c)},b.clearHighlights=function(){k.select(".nv-ohlcBar .nv-tick.hover").classed("hover",!1)},b.dispatch=z,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return h},set:function(a){h=a}},height:{get:function(){return i},set:function(a){i=a}},xScale:{get:function(){return l},set:function(a){l=a}},yScale:{get:function(){return m},set:function(a){m=a}},xDomain:{get:function(){return c},set:function(a){c=a}},yDomain:{get:function(){return d},set:function(a){d=a}},xRange:{get:function(){return e},set:function(a){e=a}},yRange:{get:function(){return f},set:function(a){f=a}},forceX:{get:function(){return t},set:function(a){t=a}},forceY:{get:function(){return u},set:function(a){u=a}},padData:{get:function(){return v},set:function(a){v=a}},clipEdge:{get:function(){return w},set:function(a){w=a}},id:{get:function(){return j},set:function(a){j=a}},interactive:{get:function(){return y},set:function(a){y=a}},x:{get:function(){return n},set:function(a){n=a}},y:{get:function(){return o},set:function(a){o=a}},open:{get:function(){return p()},set:function(a){p=a}},close:{get:function(){return q()},set:function(a){q=a}},high:{get:function(){return r},set:function(a){r=a}},low:{get:function(){return s},set:function(a){s=a}},margin:{get:function(){return g},set:function(a){g.top=void 0!=a.top?a.top:g.top,g.right=void 0!=a.right?a.right:g.right,g.bottom=void 0!=a.bottom?a.bottom:g.bottom,g.left=void 0!=a.left?a.left:g.left
46095}},color:{get:function(){return x},set:function(b){x=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.parallelCoordinates=function(){"use strict";function b(p){return p.each(function(b){function p(a){return F(h.map(function(b){if(isNaN(a[b])||isNaN(parseFloat(a[b]))){var c=g[b].domain(),d=g[b].range(),e=c[0]-(c[1]-c[0])/9;if(J.indexOf(b)<0){var h=d3.scale.linear().domain([e,c[1]]).range([x-12,d[1]]);g[b].brush.y(h),J.push(b)}return[f(b),g[b](e)]}return J.length>0?(D.style("display","inline"),E.style("display","inline")):(D.style("display","none"),E.style("display","none")),[f(b),g[b](a[b])]}))}function q(){var a=h.filter(function(a){return!g[a].brush.empty()}),b=a.map(function(a){return g[a].brush.extent()});k=[],a.forEach(function(a,c){k[c]={dimension:a,extent:b[c]}}),l=[],M.style("display",function(c){var d=a.every(function(a,d){return isNaN(c[a])&&b[d][0]==g[a].brush.y().domain()[0]?!0:b[d][0]<=c[a]&&c[a]<=b[d][1]});return d&&l.push(c),d?null:"none"}),o.brush({filters:k,active:l})}function r(a){m[a]=this.parentNode.__origin__=f(a),L.attr("visibility","hidden")}function s(a){m[a]=Math.min(w,Math.max(0,this.parentNode.__origin__+=d3.event.x)),M.attr("d",p),h.sort(function(a,b){return u(a)-u(b)}),f.domain(h),N.attr("transform",function(a){return"translate("+u(a)+")"})}function t(a){delete this.parentNode.__origin__,delete m[a],d3.select(this.parentNode).attr("transform","translate("+f(a)+")"),M.attr("d",p),L.attr("d",p).attr("visibility",null)}function u(a){var b=m[a];return null==b?f(a):b}var v=d3.select(this),w=a.utils.availableWidth(d,v,c),x=a.utils.availableHeight(e,v,c);a.utils.initSVG(v),l=b,f.rangePoints([0,w],1).domain(h);var y={};h.forEach(function(a){var c=d3.extent(b,function(b){return+b[a]});return y[a]=!1,void 0===c[0]&&(y[a]=!0,c[0]=0,c[1]=0),c[0]===c[1]&&(c[0]=c[0]-1,c[1]=c[1]+1),g[a]=d3.scale.linear().domain(c).range([.9*(x-12),0]),g[a].brush=d3.svg.brush().y(g[a]).on("brush",q),"name"!=a});var z=v.selectAll("g.nv-wrap.nv-parallelCoordinates").data([b]),A=z.enter().append("g").attr("class","nvd3 nv-wrap nv-parallelCoordinates"),B=A.append("g"),C=z.select("g");B.append("g").attr("class","nv-parallelCoordinates background"),B.append("g").attr("class","nv-parallelCoordinates foreground"),B.append("g").attr("class","nv-parallelCoordinates missingValuesline"),z.attr("transform","translate("+c.left+","+c.top+")");var D,E,F=d3.svg.line().interpolate("cardinal").tension(n),G=d3.svg.axis().orient("left"),H=d3.behavior.drag().on("dragstart",r).on("drag",s).on("dragend",t),I=f.range()[1]-f.range()[0],J=[],K=[0+I/2,x-12,w-I/2,x-12];D=z.select(".missingValuesline").selectAll("line").data([K]),D.enter().append("line"),D.exit().remove(),D.attr("x1",function(a){return a[0]}).attr("y1",function(a){return a[1]}).attr("x2",function(a){return a[2]}).attr("y2",function(a){return a[3]}),E=z.select(".missingValuesline").selectAll("text").data(["undefined values"]),E.append("text").data(["undefined values"]),E.enter().append("text"),E.exit().remove(),E.attr("y",x).attr("x",w-92-I/2).text(function(a){return a});var L=z.select(".background").selectAll("path").data(b);L.enter().append("path"),L.exit().remove(),L.attr("d",p);var M=z.select(".foreground").selectAll("path").data(b);M.enter().append("path"),M.exit().remove(),M.attr("d",p).attr("stroke",j),M.on("mouseover",function(a,b){d3.select(this).classed("hover",!0),o.elementMouseover({label:a.name,data:a.data,index:b,pos:[d3.mouse(this.parentNode)[0],d3.mouse(this.parentNode)[1]]})}),M.on("mouseout",function(a,b){d3.select(this).classed("hover",!1),o.elementMouseout({label:a.name,data:a.data,index:b})});var N=C.selectAll(".dimension").data(h),O=N.enter().append("g").attr("class","nv-parallelCoordinates dimension");O.append("g").attr("class","nv-parallelCoordinates nv-axis"),O.append("g").attr("class","nv-parallelCoordinates-brush"),O.append("text").attr("class","nv-parallelCoordinates nv-label"),N.attr("transform",function(a){return"translate("+f(a)+",0)"}),N.exit().remove(),N.select(".nv-label").style("cursor","move").attr("dy","-1em").attr("text-anchor","middle").text(String).on("mouseover",function(a){o.elementMouseover({dim:a,pos:[d3.mouse(this.parentNode.parentNode)[0],d3.mouse(this.parentNode.parentNode)[1]]})}).on("mouseout",function(a){o.elementMouseout({dim:a})}).call(H),N.select(".nv-axis").each(function(a,b){d3.select(this).call(G.scale(g[a]).tickFormat(d3.format(i[b])))}),N.select(".nv-parallelCoordinates-brush").each(function(a){d3.select(this).call(g[a].brush)}).selectAll("rect").attr("x",-8).attr("width",16)}),b}var c={top:30,right:0,bottom:10,left:0},d=null,e=null,f=d3.scale.ordinal(),g={},h=[],i=[],j=a.utils.defaultColor(),k=[],l=[],m=[],n=1,o=d3.dispatch("brush","elementMouseover","elementMouseout");return b.dispatch=o,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return d},set:function(a){d=a}},height:{get:function(){return e},set:function(a){e=a}},dimensionNames:{get:function(){return h},set:function(a){h=a}},dimensionFormats:{get:function(){return i},set:function(a){i=a}},lineTension:{get:function(){return n},set:function(a){n=a}},dimensions:{get:function(){return h},set:function(b){a.deprecated("dimensions","use dimensionNames instead"),h=b}},margin:{get:function(){return c},set:function(a){c.top=void 0!==a.top?a.top:c.top,c.right=void 0!==a.right?a.right:c.right,c.bottom=void 0!==a.bottom?a.bottom:c.bottom,c.left=void 0!==a.left?a.left:c.left}},color:{get:function(){return j},set:function(b){j=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.pie=function(){"use strict";function b(E){return D.reset(),E.each(function(b){function E(a,b){a.endAngle=isNaN(a.endAngle)?0:a.endAngle,a.startAngle=isNaN(a.startAngle)?0:a.startAngle,p||(a.innerRadius=0);var c=d3.interpolate(this._current,a);return this._current=c(0),function(a){return B[b](c(a))}}var F=d-c.left-c.right,G=e-c.top-c.bottom,H=Math.min(F,G)/2,I=[],J=[];if(i=d3.select(this),0===z.length)for(var K=H-H/5,L=y*H,M=0;M<b[0].length;M++)I.push(K),J.push(L);else I=z.map(function(a){return(a.outer-a.outer/5)*H}),J=z.map(function(a){return(a.inner-a.inner/5)*H}),y=d3.min(z.map(function(a){return a.inner-a.inner/5}));a.utils.initSVG(i);var N=i.selectAll(".nv-wrap.nv-pie").data(b),O=N.enter().append("g").attr("class","nvd3 nv-wrap nv-pie nv-chart-"+h),P=O.append("g"),Q=N.select("g"),R=P.append("g").attr("class","nv-pie");P.append("g").attr("class","nv-pieLabels"),N.attr("transform","translate("+c.left+","+c.top+")"),Q.select(".nv-pie").attr("transform","translate("+F/2+","+G/2+")"),Q.select(".nv-pieLabels").attr("transform","translate("+F/2+","+G/2+")"),i.on("click",function(a,b){A.chartClick({data:a,index:b,pos:d3.event,id:h})}),B=[],C=[];for(var M=0;M<b[0].length;M++){var S=d3.svg.arc().outerRadius(I[M]),T=d3.svg.arc().outerRadius(I[M]+5);u!==!1&&(S.startAngle(u),T.startAngle(u)),w!==!1&&(S.endAngle(w),T.endAngle(w)),p&&(S.innerRadius(J[M]),T.innerRadius(J[M])),S.cornerRadius&&x&&(S.cornerRadius(x),T.cornerRadius(x)),B.push(S),C.push(T)}var U=d3.layout.pie().sort(null).value(function(a){return a.disabled?0:g(a)});U.padAngle&&v&&U.padAngle(v),p&&q&&(R.append("text").attr("class","nv-pie-title"),N.select(".nv-pie-title").style("text-anchor","middle").text(function(){return q}).style("font-size",Math.min(F,G)*y*2/(q.length+2)+"px").attr("dy","0.35em").attr("transform",function(){return"translate(0, "+s+")"}));var V=N.select(".nv-pie").selectAll(".nv-slice").data(U),W=N.select(".nv-pieLabels").selectAll(".nv-label").data(U);V.exit().remove(),W.exit().remove();var X=V.enter().append("g");X.attr("class","nv-slice"),X.on("mouseover",function(a,b){d3.select(this).classed("hover",!0),r&&d3.select(this).select("path").transition().duration(70).attr("d",C[b]),A.elementMouseover({data:a.data,index:b,color:d3.select(this).style("fill")})}),X.on("mouseout",function(a,b){d3.select(this).classed("hover",!1),r&&d3.select(this).select("path").transition().duration(50).attr("d",B[b]),A.elementMouseout({data:a.data,index:b})}),X.on("mousemove",function(a,b){A.elementMousemove({data:a.data,index:b})}),X.on("click",function(a,b){A.elementClick({data:a.data,index:b,color:d3.select(this).style("fill")})}),X.on("dblclick",function(a,b){A.elementDblClick({data:a.data,index:b,color:d3.select(this).style("fill")})}),V.attr("fill",function(a,b){return j(a.data,b)}),V.attr("stroke",function(a,b){return j(a.data,b)});X.append("path").each(function(a){this._current=a});if(V.select("path").transition().attr("d",function(a,b){return B[b](a)}).attrTween("d",E),l){for(var Y=[],M=0;M<b[0].length;M++)Y.push(B[M]),m?p&&(Y[M]=d3.svg.arc().outerRadius(B[M].outerRadius()),u!==!1&&Y[M].startAngle(u),w!==!1&&Y[M].endAngle(w)):p||Y[M].innerRadius(0);W.enter().append("g").classed("nv-label",!0).each(function(a){var b=d3.select(this);b.attr("transform",function(a,b){if(t){a.outerRadius=I[b]+10,a.innerRadius=I[b]+15;var c=(a.startAngle+a.endAngle)/2*(180/Math.PI);return(a.startAngle+a.endAngle)/2<Math.PI?c-=90:c+=90,"translate("+Y[b].centroid(a)+") rotate("+c+")"}return a.outerRadius=H+10,a.innerRadius=H+15,"translate("+Y[b].centroid(a)+")"}),b.append("rect").style("stroke","#fff").style("fill","#fff").attr("rx",3).attr("ry",3),b.append("text").style("text-anchor",t?(a.startAngle+a.endAngle)/2<Math.PI?"start":"end":"middle").style("fill","#000")});var Z={},$=14,_=140,ab=function(a){return Math.floor(a[0]/_)*_+","+Math.floor(a[1]/$)*$};W.watchTransition(D,"pie labels").attr("transform",function(a,b){if(t){a.outerRadius=I[b]+10,a.innerRadius=I[b]+15;var c=(a.startAngle+a.endAngle)/2*(180/Math.PI);return(a.startAngle+a.endAngle)/2<Math.PI?c-=90:c+=90,"translate("+Y[b].centroid(a)+") rotate("+c+")"}a.outerRadius=H+10,a.innerRadius=H+15;var d=Y[b].centroid(a);if(a.value){var e=ab(d);Z[e]&&(d[1]-=$),Z[ab(d)]=!0}return"translate("+d+")"}),W.select(".nv-label text").style("text-anchor",function(a){return t?(a.startAngle+a.endAngle)/2<Math.PI?"start":"end":"middle"}).text(function(a,b){var c=(a.endAngle-a.startAngle)/(2*Math.PI),d="";if(!a.value||o>c)return"";if("function"==typeof n)d=n(a,b,{key:f(a.data),value:g(a.data),percent:k(c)});else switch(n){case"key":d=f(a.data);break;case"value":d=k(g(a.data));break;case"percent":d=d3.format("%")(c)}return d})}}),D.renderEnd("pie immediate"),b}var c={top:0,right:0,bottom:0,left:0},d=500,e=500,f=function(a){return a.x},g=function(a){return a.y},h=Math.floor(1e4*Math.random()),i=null,j=a.utils.defaultColor(),k=d3.format(",.2f"),l=!0,m=!1,n="key",o=.02,p=!1,q=!1,r=!0,s=0,t=!1,u=!1,v=!1,w=!1,x=0,y=.5,z=[],A=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),B=[],C=[],D=a.utils.renderWatch(A);return b.dispatch=A,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{arcsRadius:{get:function(){return z},set:function(a){z=a}},width:{get:function(){return d},set:function(a){d=a}},height:{get:function(){return e},set:function(a){e=a}},showLabels:{get:function(){return l},set:function(a){l=a}},title:{get:function(){return q},set:function(a){q=a}},titleOffset:{get:function(){return s},set:function(a){s=a}},labelThreshold:{get:function(){return o},set:function(a){o=a}},valueFormat:{get:function(){return k},set:function(a){k=a}},x:{get:function(){return f},set:function(a){f=a}},id:{get:function(){return h},set:function(a){h=a}},endAngle:{get:function(){return w},set:function(a){w=a}},startAngle:{get:function(){return u},set:function(a){u=a}},padAngle:{get:function(){return v},set:function(a){v=a}},cornerRadius:{get:function(){return x},set:function(a){x=a}},donutRatio:{get:function(){return y},set:function(a){y=a}},labelsOutside:{get:function(){return m},set:function(a){m=a}},labelSunbeamLayout:{get:function(){return t},set:function(a){t=a}},donut:{get:function(){return p},set:function(a){p=a}},growOnHover:{get:function(){return r},set:function(a){r=a}},pieLabelsOutside:{get:function(){return m},set:function(b){m=b,a.deprecated("pieLabelsOutside","use labelsOutside instead")}},donutLabelsOutside:{get:function(){return m},set:function(b){m=b,a.deprecated("donutLabelsOutside","use labelsOutside instead")}},labelFormat:{get:function(){return k},set:function(b){k=b,a.deprecated("labelFormat","use valueFormat instead")}},margin:{get:function(){return c},set:function(a){c.top="undefined"!=typeof a.top?a.top:c.top,c.right="undefined"!=typeof a.right?a.right:c.right,c.bottom="undefined"!=typeof a.bottom?a.bottom:c.bottom,c.left="undefined"!=typeof a.left?a.left:c.left}},y:{get:function(){return g},set:function(a){g=d3.functor(a)}},color:{get:function(){return j},set:function(b){j=a.utils.getColor(b)}},labelType:{get:function(){return n},set:function(a){n=a||"key"}}}),a.utils.initOptions(b),b},a.models.pieChart=function(){"use strict";function b(e){return q.reset(),q.models(c),e.each(function(e){var k=d3.select(this);a.utils.initSVG(k);var n=a.utils.availableWidth(g,k,f),o=a.utils.availableHeight(h,k,f);if(b.update=function(){k.transition().call(b)},b.container=this,l.setter(s(e),b.update).getter(r(e)).update(),l.disabled=e.map(function(a){return!!a.disabled}),!m){var q;m={};for(q in l)m[q]=l[q]instanceof Array?l[q].slice(0):l[q]}if(!e||!e.length)return a.utils.noData(b,k),b;k.selectAll(".nv-noData").remove();var t=k.selectAll("g.nv-wrap.nv-pieChart").data([e]),u=t.enter().append("g").attr("class","nvd3 nv-wrap nv-pieChart").append("g"),v=t.select("g");if(u.append("g").attr("class","nv-pieWrap"),u.append("g").attr("class","nv-legendWrap"),i)if("top"===j)d.width(n).key(c.x()),t.select(".nv-legendWrap").datum(e).call(d),f.top!=d.height()&&(f.top=d.height(),o=a.utils.availableHeight(h,k,f)),t.select(".nv-legendWrap").attr("transform","translate(0,"+-f.top+")");else if("right"===j){var w=a.models.legend().width();w>n/2&&(w=n/2),d.height(o).key(c.x()),d.width(w),n-=d.width(),t.select(".nv-legendWrap").datum(e).call(d).attr("transform","translate("+n+",0)")}t.attr("transform","translate("+f.left+","+f.top+")"),c.width(n).height(o);var x=v.select(".nv-pieWrap").datum([e]);d3.transition(x).call(c),d.dispatch.on("stateChange",function(a){for(var c in a)l[c]=a[c];p.stateChange(l),b.update()}),p.on("changeState",function(a){"undefined"!=typeof a.disabled&&(e.forEach(function(b,c){b.disabled=a.disabled[c]}),l.disabled=a.disabled),b.update()})}),q.renderEnd("pieChart immediate"),b}var c=a.models.pie(),d=a.models.legend(),e=a.models.tooltip(),f={top:30,right:20,bottom:20,left:20},g=null,h=null,i=!0,j="top",k=a.utils.defaultColor(),l=a.utils.state(),m=null,n=null,o=250,p=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd");e.headerEnabled(!1).duration(0).valueFormatter(function(a,b){return c.valueFormat()(a,b)});var q=a.utils.renderWatch(p),r=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},s=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return c.dispatch.on("elementMouseover.tooltip",function(a){a.series={key:b.x()(a.data),value:b.y()(a.data),color:a.color},e.data(a).hidden(!1)}),c.dispatch.on("elementMouseout.tooltip",function(){e.hidden(!0)}),c.dispatch.on("elementMousemove.tooltip",function(){e.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.legend=d,b.dispatch=p,b.pie=c,b.tooltip=e,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{noData:{get:function(){return n},set:function(a){n=a}},showLegend:{get:function(){return i},set:function(a){i=a}},legendPosition:{get:function(){return j},set:function(a){j=a}},defaultState:{get:function(){return m},set:function(a){m=a}},tooltips:{get:function(){return e.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),e.enabled(!!b)}},tooltipContent:{get:function(){return e.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),e.contentGenerator(b)}},color:{get:function(){return k},set:function(a){k=a,d.color(k),c.color(k)}},duration:{get:function(){return o},set:function(a){o=a,q.reset(o)}},margin:{get:function(){return f},set:function(a){f.top=void 0!==a.top?a.top:f.top,f.right=void 0!==a.right?a.right:f.right,f.bottom=void 0!==a.bottom?a.bottom:f.bottom,f.left=void 0!==a.left?a.left:f.left}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.models.scatter=function(){"use strict";function b(N){return P.reset(),N.each(function(b){function N(){if(O=!1,!w)return!1;if(M===!0){var a=d3.merge(b.map(function(a,b){return a.values.map(function(a,c){var d=p(a,c),e=q(a,c);return[m(d)+1e-4*Math.random(),n(e)+1e-4*Math.random(),b,c,a]}).filter(function(a,b){return x(a[4],b)})}));if(0==a.length)return!1;a.length<3&&(a.push([m.range()[0]-20,n.range()[0]-20,null,null]),a.push([m.range()[1]+20,n.range()[1]+20,null,null]),a.push([m.range()[0]-20,n.range()[0]+20,null,null]),a.push([m.range()[1]+20,n.range()[1]-20,null,null]));var c=d3.geom.polygon([[-10,-10],[-10,i+10],[h+10,i+10],[h+10,-10]]),d=d3.geom.voronoi(a).map(function(b,d){return{data:c.clip(b),series:a[d][2],point:a[d][3]}});U.select(".nv-point-paths").selectAll("path").remove();var e=U.select(".nv-point-paths").selectAll("path").data(d),f=e.enter().append("svg:path").attr("d",function(a){return a&&a.data&&0!==a.data.length?"M"+a.data.join(",")+"Z":"M 0 0"}).attr("id",function(a,b){return"nv-path-"+b}).attr("clip-path",function(a,b){return"url(#nv-clip-"+b+")"});C&&f.style("fill",d3.rgb(230,230,230)).style("fill-opacity",.4).style("stroke-opacity",1).style("stroke",d3.rgb(200,200,200)),B&&(U.select(".nv-point-clips").selectAll("clipPath").remove(),U.select(".nv-point-clips").selectAll("clipPath").data(a).enter().append("svg:clipPath").attr("id",function(a,b){return"nv-clip-"+b}).append("svg:circle").attr("cx",function(a){return a[0]}).attr("cy",function(a){return a[1]}).attr("r",D));var k=function(a,c){if(O)return 0;var d=b[a.series];if(void 0!==d){var e=d.values[a.point];e.color=j(d,a.series),e.x=p(e),e.y=q(e);var f=l.node().getBoundingClientRect(),h=window.pageYOffset||document.documentElement.scrollTop,i=window.pageXOffset||document.documentElement.scrollLeft,k={left:m(p(e,a.point))+f.left+i+g.left+10,top:n(q(e,a.point))+f.top+h+g.top+10};c({point:e,series:d,pos:k,seriesIndex:a.series,pointIndex:a.point})}};e.on("click",function(a){k(a,L.elementClick)}).on("dblclick",function(a){k(a,L.elementDblClick)}).on("mouseover",function(a){k(a,L.elementMouseover)}).on("mouseout",function(a){k(a,L.elementMouseout)})}else U.select(".nv-groups").selectAll(".nv-group").selectAll(".nv-point").on("click",function(a,c){if(O||!b[a.series])return 0;var d=b[a.series],e=d.values[c];L.elementClick({point:e,series:d,pos:[m(p(e,c))+g.left,n(q(e,c))+g.top],seriesIndex:a.series,pointIndex:c})}).on("dblclick",function(a,c){if(O||!b[a.series])return 0;var d=b[a.series],e=d.values[c];L.elementDblClick({point:e,series:d,pos:[m(p(e,c))+g.left,n(q(e,c))+g.top],seriesIndex:a.series,pointIndex:c})}).on("mouseover",function(a,c){if(O||!b[a.series])return 0;var d=b[a.series],e=d.values[c];L.elementMouseover({point:e,series:d,pos:[m(p(e,c))+g.left,n(q(e,c))+g.top],seriesIndex:a.series,pointIndex:c,color:j(a,c)})}).on("mouseout",function(a,c){if(O||!b[a.series])return 0;var d=b[a.series],e=d.values[c];L.elementMouseout({point:e,series:d,seriesIndex:a.series,pointIndex:c,color:j(a,c)})})}l=d3.select(this);var R=a.utils.availableWidth(h,l,g),S=a.utils.availableHeight(i,l,g);a.utils.initSVG(l),b.forEach(function(a,b){a.values.forEach(function(a){a.series=b})});var T=E&&F&&I?[]:d3.merge(b.map(function(a){return a.values.map(function(a,b){return{x:p(a,b),y:q(a,b),size:r(a,b)}})}));m.domain(E||d3.extent(T.map(function(a){return a.x}).concat(t))),m.range(y&&b[0]?G||[(R*z+R)/(2*b[0].values.length),R-R*(1+z)/(2*b[0].values.length)]:G||[0,R]),n.domain(F||d3.extent(T.map(function(a){return a.y}).concat(u))).range(H||[S,0]),o.domain(I||d3.extent(T.map(function(a){return a.size}).concat(v))).range(J||Q),K=m.domain()[0]===m.domain()[1]||n.domain()[0]===n.domain()[1],m.domain()[0]===m.domain()[1]&&m.domain(m.domain()[0]?[m.domain()[0]-.01*m.domain()[0],m.domain()[1]+.01*m.domain()[1]]:[-1,1]),n.domain()[0]===n.domain()[1]&&n.domain(n.domain()[0]?[n.domain()[0]-.01*n.domain()[0],n.domain()[1]+.01*n.domain()[1]]:[-1,1]),isNaN(m.domain()[0])&&m.domain([-1,1]),isNaN(n.domain()[0])&&n.domain([-1,1]),c=c||m,d=d||n,e=e||o;var U=l.selectAll("g.nv-wrap.nv-scatter").data([b]),V=U.enter().append("g").attr("class","nvd3 nv-wrap nv-scatter nv-chart-"+k),W=V.append("defs"),X=V.append("g"),Y=U.select("g");U.classed("nv-single-point",K),X.append("g").attr("class","nv-groups"),X.append("g").attr("class","nv-point-paths"),V.append("g").attr("class","nv-point-clips"),U.attr("transform","translate("+g.left+","+g.top+")"),W.append("clipPath").attr("id","nv-edge-clip-"+k).append("rect"),U.select("#nv-edge-clip-"+k+" rect").attr("width",R).attr("height",S>0?S:0),Y.attr("clip-path",A?"url(#nv-edge-clip-"+k+")":""),O=!0;var Z=U.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});Z.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),Z.exit().remove(),Z.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}),Z.watchTransition(P,"scatter: groups").style("fill",function(a,b){return j(a,b)}).style("stroke",function(a,b){return j(a,b)}).style("stroke-opacity",1).style("fill-opacity",.5);var $=Z.selectAll("path.nv-point").data(function(a){return a.values.map(function(a,b){return[a,b]}).filter(function(a,b){return x(a[0],b)})});$.enter().append("path").style("fill",function(a){return a.color}).style("stroke",function(a){return a.color}).attr("transform",function(a){return"translate("+c(p(a[0],a[1]))+","+d(q(a[0],a[1]))+")"}).attr("d",a.utils.symbol().type(function(a){return s(a[0])}).size(function(a){return o(r(a[0],a[1]))})),$.exit().remove(),Z.exit().selectAll("path.nv-point").watchTransition(P,"scatter exit").attr("transform",function(a){return"translate("+m(p(a[0],a[1]))+","+n(q(a[0],a[1]))+")"}).remove(),$.each(function(a){d3.select(this).classed("nv-point",!0).classed("nv-point-"+a[1],!0).classed("nv-noninteractive",!w).classed("hover",!1)}),$.watchTransition(P,"scatter points").attr("transform",function(a){return"translate("+m(p(a[0],a[1]))+","+n(q(a[0],a[1]))+")"}).attr("d",a.utils.symbol().type(function(a){return s(a[0])}).size(function(a){return o(r(a[0],a[1]))})),clearTimeout(f),f=setTimeout(N,300),c=m.copy(),d=n.copy(),e=o.copy()}),P.renderEnd("scatter immediate"),b}var c,d,e,f,g={top:0,right:0,bottom:0,left:0},h=null,i=null,j=a.utils.defaultColor(),k=Math.floor(1e5*Math.random()),l=null,m=d3.scale.linear(),n=d3.scale.linear(),o=d3.scale.linear(),p=function(a){return a.x},q=function(a){return a.y},r=function(a){return a.size||1},s=function(a){return a.shape||"circle"},t=[],u=[],v=[],w=!0,x=function(a){return!a.notActive},y=!1,z=.1,A=!1,B=!0,C=!1,D=function(){return 25},E=null,F=null,G=null,H=null,I=null,J=null,K=!1,L=d3.dispatch("elementClick","elementDblClick","elementMouseover","elementMouseout","renderEnd"),M=!0,N=250,O=!1,P=a.utils.renderWatch(L,N),Q=[16,256];return b.dispatch=L,b.options=a.utils.optionsFunc.bind(b),b._calls=new function(){this.clearHighlights=function(){return a.dom.write(function(){l.selectAll(".nv-point.hover").classed("hover",!1)}),null},this.highlightPoint=function(b,c,d){a.dom.write(function(){l.select(" .nv-series-"+b+" .nv-point-"+c).classed("hover",d)})}},L.on("elementMouseover.point",function(a){w&&b._calls.highlightPoint(a.seriesIndex,a.pointIndex,!0)}),L.on("elementMouseout.point",function(a){w&&b._calls.highlightPoint(a.seriesIndex,a.pointIndex,!1)}),b._options=Object.create({},{width:{get:function(){return h},set:function(a){h=a}},height:{get:function(){return i},set:function(a){i=a}},xScale:{get:function(){return m},set:function(a){m=a}},yScale:{get:function(){return n},set:function(a){n=a}},pointScale:{get:function(){return o},set:function(a){o=a}},xDomain:{get:function(){return E},set:function(a){E=a}},yDomain:{get:function(){return F},set:function(a){F=a}},pointDomain:{get:function(){return I},set:function(a){I=a}},xRange:{get:function(){return G},set:function(a){G=a}},yRange:{get:function(){return H},set:function(a){H=a}},pointRange:{get:function(){return J},set:function(a){J=a}},forceX:{get:function(){return t},set:function(a){t=a}},forceY:{get:function(){return u},set:function(a){u=a}},forcePoint:{get:function(){return v},set:function(a){v=a}},interactive:{get:function(){return w},set:function(a){w=a}},pointActive:{get:function(){return x},set:function(a){x=a}},padDataOuter:{get:function(){return z},set:function(a){z=a}},padData:{get:function(){return y},set:function(a){y=a}},clipEdge:{get:function(){return A},set:function(a){A=a}},clipVoronoi:{get:function(){return B},set:function(a){B=a}},clipRadius:{get:function(){return D},set:function(a){D=a}},showVoronoi:{get:function(){return C},set:function(a){C=a}},id:{get:function(){return k},set:function(a){k=a}},x:{get:function(){return p},set:function(a){p=d3.functor(a)}},y:{get:function(){return q},set:function(a){q=d3.functor(a)}},pointSize:{get:function(){return r},set:function(a){r=d3.functor(a)}},pointShape:{get:function(){return s},set:function(a){s=d3.functor(a)}},margin:{get:function(){return g},set:function(a){g.top=void 0!==a.top?a.top:g.top,g.right=void 0!==a.right?a.right:g.right,g.bottom=void 0!==a.bottom?a.bottom:g.bottom,g.left=void 0!==a.left?a.left:g.left}},duration:{get:function(){return N},set:function(a){N=a,P.reset(N)}},color:{get:function(){return j},set:function(b){j=a.utils.getColor(b)}},useVoronoi:{get:function(){return M},set:function(a){M=a,M===!1&&(B=!1)}}}),a.utils.initOptions(b),b},a.models.scatterChart=function(){"use strict";function b(z){return D.reset(),D.models(c),t&&D.models(d),u&&D.models(e),q&&D.models(g),r&&D.models(h),z.each(function(z){m=d3.select(this),a.utils.initSVG(m);var G=a.utils.availableWidth(k,m,j),H=a.utils.availableHeight(l,m,j);if(b.update=function(){0===A?m.call(b):m.transition().duration(A).call(b)},b.container=this,w.setter(F(z),b.update).getter(E(z)).update(),w.disabled=z.map(function(a){return!!a.disabled}),!x){var I;x={};for(I in w)x[I]=w[I]instanceof Array?w[I].slice(0):w[I]}if(!(z&&z.length&&z.filter(function(a){return a.values.length}).length))return a.utils.noData(b,m),D.renderEnd("scatter immediate"),b;m.selectAll(".nv-noData").remove(),o=c.xScale(),p=c.yScale();var J=m.selectAll("g.nv-wrap.nv-scatterChart").data([z]),K=J.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+c.id()),L=K.append("g"),M=J.select("g");if(L.append("rect").attr("class","nvd3 nv-background").style("pointer-events","none"),L.append("g").attr("class","nv-x nv-axis"),L.append("g").attr("class","nv-y nv-axis"),L.append("g").attr("class","nv-scatterWrap"),L.append("g").attr("class","nv-regressionLinesWrap"),L.append("g").attr("class","nv-distWrap"),L.append("g").attr("class","nv-legendWrap"),v&&M.select(".nv-y.nv-axis").attr("transform","translate("+G+",0)"),s){var N=G;f.width(N),J.select(".nv-legendWrap").datum(z).call(f),j.top!=f.height()&&(j.top=f.height(),H=a.utils.availableHeight(l,m,j)),J.select(".nv-legendWrap").attr("transform","translate(0,"+-j.top+")")}J.attr("transform","translate("+j.left+","+j.top+")"),c.width(G).height(H).color(z.map(function(a,b){return a.color=a.color||n(a,b),a.color}).filter(function(a,b){return!z[b].disabled})),J.select(".nv-scatterWrap").datum(z.filter(function(a){return!a.disabled})).call(c),J.select(".nv-regressionLinesWrap").attr("clip-path","url(#nv-edge-clip-"+c.id()+")");var O=J.select(".nv-regressionLinesWrap").selectAll(".nv-regLines").data(function(a){return a});O.enter().append("g").attr("class","nv-regLines");var P=O.selectAll(".nv-regLine").data(function(a){return[a]});P.enter().append("line").attr("class","nv-regLine").style("stroke-opacity",0),P.filter(function(a){return a.intercept&&a.slope}).watchTransition(D,"scatterPlusLineChart: regline").attr("x1",o.range()[0]).attr("x2",o.range()[1]).attr("y1",function(a){return p(o.domain()[0]*a.slope+a.intercept)}).attr("y2",function(a){return p(o.domain()[1]*a.slope+a.intercept)}).style("stroke",function(a,b,c){return n(a,c)}).style("stroke-opacity",function(a){return a.disabled||"undefined"==typeof a.slope||"undefined"==typeof a.intercept?0:1}),t&&(d.scale(o)._ticks(a.utils.calcTicksX(G/100,z)).tickSize(-H,0),M.select(".nv-x.nv-axis").attr("transform","translate(0,"+p.range()[0]+")").call(d)),u&&(e.scale(p)._ticks(a.utils.calcTicksY(H/36,z)).tickSize(-G,0),M.select(".nv-y.nv-axis").call(e)),q&&(g.getData(c.x()).scale(o).width(G).color(z.map(function(a,b){return a.color||n(a,b)}).filter(function(a,b){return!z[b].disabled})),L.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),M.select(".nv-distributionX").attr("transform","translate(0,"+p.range()[0]+")").datum(z.filter(function(a){return!a.disabled})).call(g)),r&&(h.getData(c.y()).scale(p).width(H).color(z.map(function(a,b){return a.color||n(a,b)}).filter(function(a,b){return!z[b].disabled})),L.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),M.select(".nv-distributionY").attr("transform","translate("+(v?G:-h.size())+",0)").datum(z.filter(function(a){return!a.disabled})).call(h)),f.dispatch.on("stateChange",function(a){for(var c in a)w[c]=a[c];y.stateChange(w),b.update()}),y.on("changeState",function(a){"undefined"!=typeof a.disabled&&(z.forEach(function(b,c){b.disabled=a.disabled[c]}),w.disabled=a.disabled),b.update()}),c.dispatch.on("elementMouseout.tooltip",function(a){i.hidden(!0),m.select(".nv-chart-"+c.id()+" .nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",0),m.select(".nv-chart-"+c.id()+" .nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",h.size())}),c.dispatch.on("elementMouseover.tooltip",function(a){m.select(".nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",a.pos.top-H-j.top),m.select(".nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",a.pos.left+g.size()-j.left),i.position(a.pos).data(a).hidden(!1)}),B=o.copy(),C=p.copy()}),D.renderEnd("scatter with line immediate"),b}var c=a.models.scatter(),d=a.models.axis(),e=a.models.axis(),f=a.models.legend(),g=a.models.distribution(),h=a.models.distribution(),i=a.models.tooltip(),j={top:30,right:20,bottom:50,left:75},k=null,l=null,m=null,n=a.utils.defaultColor(),o=c.xScale(),p=c.yScale(),q=!1,r=!1,s=!0,t=!0,u=!0,v=!1,w=a.utils.state(),x=null,y=d3.dispatch("stateChange","changeState","renderEnd"),z=null,A=250;c.xScale(o).yScale(p),d.orient("bottom").tickPadding(10),e.orient(v?"right":"left").tickPadding(10),g.axis("x"),h.axis("y"),i.headerFormatter(function(a,b){return d.tickFormat()(a,b)}).valueFormatter(function(a,b){return e.tickFormat()(a,b)});var B,C,D=a.utils.renderWatch(y,A),E=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},F=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return b.dispatch=y,b.scatter=c,b.legend=f,b.xAxis=d,b.yAxis=e,b.distX=g,b.distY=h,b.tooltip=i,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return k},set:function(a){k=a}},height:{get:function(){return l},set:function(a){l=a}},container:{get:function(){return m},set:function(a){m=a}},showDistX:{get:function(){return q},set:function(a){q=a}},showDistY:{get:function(){return r},set:function(a){r=a}},showLegend:{get:function(){return s},set:function(a){s=a}},showXAxis:{get:function(){return t},set:function(a){t=a}},showYAxis:{get:function(){return u},set:function(a){u=a}},defaultState:{get:function(){return x},set:function(a){x=a}},noData:{get:function(){return z},set:function(a){z=a}},duration:{get:function(){return A},set:function(a){A=a}},tooltips:{get:function(){return i.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),i.enabled(!!b)
46096}},tooltipContent:{get:function(){return i.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),i.contentGenerator(b)}},tooltipXContent:{get:function(){return i.contentGenerator()},set:function(){a.deprecated("tooltipContent","This option is removed, put values into main tooltip.")}},tooltipYContent:{get:function(){return i.contentGenerator()},set:function(){a.deprecated("tooltipContent","This option is removed, put values into main tooltip.")}},margin:{get:function(){return j},set:function(a){j.top=void 0!==a.top?a.top:j.top,j.right=void 0!==a.right?a.right:j.right,j.bottom=void 0!==a.bottom?a.bottom:j.bottom,j.left=void 0!==a.left?a.left:j.left}},rightAlignYAxis:{get:function(){return v},set:function(a){v=a,e.orient(a?"right":"left")}},color:{get:function(){return n},set:function(b){n=a.utils.getColor(b),f.color(n),g.color(n),h.color(n)}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.models.sparkline=function(){"use strict";function b(k){return k.each(function(b){var k=h-g.left-g.right,q=i-g.top-g.bottom;j=d3.select(this),a.utils.initSVG(j),l.domain(c||d3.extent(b,n)).range(e||[0,k]),m.domain(d||d3.extent(b,o)).range(f||[q,0]);{var r=j.selectAll("g.nv-wrap.nv-sparkline").data([b]),s=r.enter().append("g").attr("class","nvd3 nv-wrap nv-sparkline");s.append("g"),r.select("g")}r.attr("transform","translate("+g.left+","+g.top+")");var t=r.selectAll("path").data(function(a){return[a]});t.enter().append("path"),t.exit().remove(),t.style("stroke",function(a,b){return a.color||p(a,b)}).attr("d",d3.svg.line().x(function(a,b){return l(n(a,b))}).y(function(a,b){return m(o(a,b))}));var u=r.selectAll("circle.nv-point").data(function(a){function b(b){if(-1!=b){var c=a[b];return c.pointIndex=b,c}return null}var c=a.map(function(a,b){return o(a,b)}),d=b(c.lastIndexOf(m.domain()[1])),e=b(c.indexOf(m.domain()[0])),f=b(c.length-1);return[e,d,f].filter(function(a){return null!=a})});u.enter().append("circle"),u.exit().remove(),u.attr("cx",function(a){return l(n(a,a.pointIndex))}).attr("cy",function(a){return m(o(a,a.pointIndex))}).attr("r",2).attr("class",function(a){return n(a,a.pointIndex)==l.domain()[1]?"nv-point nv-currentValue":o(a,a.pointIndex)==m.domain()[0]?"nv-point nv-minValue":"nv-point nv-maxValue"})}),b}var c,d,e,f,g={top:2,right:0,bottom:2,left:0},h=400,i=32,j=null,k=!0,l=d3.scale.linear(),m=d3.scale.linear(),n=function(a){return a.x},o=function(a){return a.y},p=a.utils.getColor(["#000"]);return b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return h},set:function(a){h=a}},height:{get:function(){return i},set:function(a){i=a}},xDomain:{get:function(){return c},set:function(a){c=a}},yDomain:{get:function(){return d},set:function(a){d=a}},xRange:{get:function(){return e},set:function(a){e=a}},yRange:{get:function(){return f},set:function(a){f=a}},xScale:{get:function(){return l},set:function(a){l=a}},yScale:{get:function(){return m},set:function(a){m=a}},animate:{get:function(){return k},set:function(a){k=a}},x:{get:function(){return n},set:function(a){n=d3.functor(a)}},y:{get:function(){return o},set:function(a){o=d3.functor(a)}},margin:{get:function(){return g},set:function(a){g.top=void 0!==a.top?a.top:g.top,g.right=void 0!==a.right?a.right:g.right,g.bottom=void 0!==a.bottom?a.bottom:g.bottom,g.left=void 0!==a.left?a.left:g.left}},color:{get:function(){return p},set:function(b){p=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.sparklinePlus=function(){"use strict";function b(p){return p.each(function(p){function q(){if(!j){var a=z.selectAll(".nv-hoverValue").data(i),b=a.enter().append("g").attr("class","nv-hoverValue").style("stroke-opacity",0).style("fill-opacity",0);a.exit().transition().duration(250).style("stroke-opacity",0).style("fill-opacity",0).remove(),a.attr("transform",function(a){return"translate("+c(e.x()(p[a],a))+",0)"}).transition().duration(250).style("stroke-opacity",1).style("fill-opacity",1),i.length&&(b.append("line").attr("x1",0).attr("y1",-f.top).attr("x2",0).attr("y2",u),b.append("text").attr("class","nv-xValue").attr("x",-6).attr("y",-f.top).attr("text-anchor","end").attr("dy",".9em"),z.select(".nv-hoverValue .nv-xValue").text(k(e.x()(p[i[0]],i[0]))),b.append("text").attr("class","nv-yValue").attr("x",6).attr("y",-f.top).attr("text-anchor","start").attr("dy",".9em"),z.select(".nv-hoverValue .nv-yValue").text(l(e.y()(p[i[0]],i[0]))))}}function r(){function a(a,b){for(var c=Math.abs(e.x()(a[0],0)-b),d=0,f=0;f<a.length;f++)Math.abs(e.x()(a[f],f)-b)<c&&(c=Math.abs(e.x()(a[f],f)-b),d=f);return d}if(!j){var b=d3.mouse(this)[0]-f.left;i=[a(p,Math.round(c.invert(b)))],q()}}var s=d3.select(this);a.utils.initSVG(s);var t=a.utils.availableWidth(g,s,f),u=a.utils.availableHeight(h,s,f);if(b.update=function(){s.call(b)},b.container=this,!p||!p.length)return a.utils.noData(b,s),b;s.selectAll(".nv-noData").remove();var v=e.y()(p[p.length-1],p.length-1);c=e.xScale(),d=e.yScale();var w=s.selectAll("g.nv-wrap.nv-sparklineplus").data([p]),x=w.enter().append("g").attr("class","nvd3 nv-wrap nv-sparklineplus"),y=x.append("g"),z=w.select("g");y.append("g").attr("class","nv-sparklineWrap"),y.append("g").attr("class","nv-valueWrap"),y.append("g").attr("class","nv-hoverArea"),w.attr("transform","translate("+f.left+","+f.top+")");var A=z.select(".nv-sparklineWrap");if(e.width(t).height(u),A.call(e),m){var B=z.select(".nv-valueWrap"),C=B.selectAll(".nv-currentValue").data([v]);C.enter().append("text").attr("class","nv-currentValue").attr("dx",o?-8:8).attr("dy",".9em").style("text-anchor",o?"end":"start"),C.attr("x",t+(o?f.right:0)).attr("y",n?function(a){return d(a)}:0).style("fill",e.color()(p[p.length-1],p.length-1)).text(l(v))}y.select(".nv-hoverArea").append("rect").on("mousemove",r).on("click",function(){j=!j}).on("mouseout",function(){i=[],q()}),z.select(".nv-hoverArea rect").attr("transform",function(){return"translate("+-f.left+","+-f.top+")"}).attr("width",t+f.left+f.right).attr("height",u+f.top)}),b}var c,d,e=a.models.sparkline(),f={top:15,right:100,bottom:10,left:50},g=null,h=null,i=[],j=!1,k=d3.format(",r"),l=d3.format(",.2f"),m=!0,n=!0,o=!1,p=null;return b.sparkline=e,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return g},set:function(a){g=a}},height:{get:function(){return h},set:function(a){h=a}},xTickFormat:{get:function(){return k},set:function(a){k=a}},yTickFormat:{get:function(){return l},set:function(a){l=a}},showLastValue:{get:function(){return m},set:function(a){m=a}},alignValue:{get:function(){return n},set:function(a){n=a}},rightAlignValue:{get:function(){return o},set:function(a){o=a}},noData:{get:function(){return p},set:function(a){p=a}},margin:{get:function(){return f},set:function(a){f.top=void 0!==a.top?a.top:f.top,f.right=void 0!==a.right?a.right:f.right,f.bottom=void 0!==a.bottom?a.bottom:f.bottom,f.left=void 0!==a.left?a.left:f.left}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.stackedArea=function(){"use strict";function b(m){return u.reset(),u.models(r),m.each(function(m){var s=f-e.left-e.right,v=g-e.top-e.bottom;j=d3.select(this),a.utils.initSVG(j),c=r.xScale(),d=r.yScale();var w=m;m.forEach(function(a,b){a.seriesIndex=b,a.values=a.values.map(function(a,c){return a.index=c,a.seriesIndex=b,a})});var x=m.filter(function(a){return!a.disabled});m=d3.layout.stack().order(o).offset(n).values(function(a){return a.values}).x(k).y(l).out(function(a,b,c){a.display={y:c,y0:b}})(x);var y=j.selectAll("g.nv-wrap.nv-stackedarea").data([m]),z=y.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedarea"),A=z.append("defs"),B=z.append("g"),C=y.select("g");B.append("g").attr("class","nv-areaWrap"),B.append("g").attr("class","nv-scatterWrap"),y.attr("transform","translate("+e.left+","+e.top+")"),0==r.forceY().length&&r.forceY().push(0),r.width(s).height(v).x(k).y(function(a){return a.display.y+a.display.y0}).forceY([0]).color(m.map(function(a){return a.color||h(a,a.seriesIndex)}));var D=C.select(".nv-scatterWrap").datum(m);D.call(r),A.append("clipPath").attr("id","nv-edge-clip-"+i).append("rect"),y.select("#nv-edge-clip-"+i+" rect").attr("width",s).attr("height",v),C.attr("clip-path",q?"url(#nv-edge-clip-"+i+")":"");var E=d3.svg.area().x(function(a,b){return c(k(a,b))}).y0(function(a){return d(a.display.y0)}).y1(function(a){return d(a.display.y+a.display.y0)}).interpolate(p),F=d3.svg.area().x(function(a,b){return c(k(a,b))}).y0(function(a){return d(a.display.y0)}).y1(function(a){return d(a.display.y0)}),G=C.select(".nv-areaWrap").selectAll("path.nv-area").data(function(a){return a});G.enter().append("path").attr("class",function(a,b){return"nv-area nv-area-"+b}).attr("d",function(a){return F(a.values,a.seriesIndex)}).on("mouseover",function(a){d3.select(this).classed("hover",!0),t.areaMouseover({point:a,series:a.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:a.seriesIndex})}).on("mouseout",function(a){d3.select(this).classed("hover",!1),t.areaMouseout({point:a,series:a.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:a.seriesIndex})}).on("click",function(a){d3.select(this).classed("hover",!1),t.areaClick({point:a,series:a.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:a.seriesIndex})}),G.exit().remove(),G.style("fill",function(a){return a.color||h(a,a.seriesIndex)}).style("stroke",function(a){return a.color||h(a,a.seriesIndex)}),G.watchTransition(u,"stackedArea path").attr("d",function(a,b){return E(a.values,b)}),r.dispatch.on("elementMouseover.area",function(a){C.select(".nv-chart-"+i+" .nv-area-"+a.seriesIndex).classed("hover",!0)}),r.dispatch.on("elementMouseout.area",function(a){C.select(".nv-chart-"+i+" .nv-area-"+a.seriesIndex).classed("hover",!1)}),b.d3_stackedOffset_stackPercent=function(a){var b,c,d,e=a.length,f=a[0].length,g=[];for(c=0;f>c;++c){for(b=0,d=0;b<w.length;b++)d+=l(w[b].values[c]);if(d)for(b=0;e>b;b++)a[b][c][1]/=d;else for(b=0;e>b;b++)a[b][c][1]=0}for(c=0;f>c;++c)g[c]=0;return g}}),u.renderEnd("stackedArea immediate"),b}var c,d,e={top:0,right:0,bottom:0,left:0},f=960,g=500,h=a.utils.defaultColor(),i=Math.floor(1e5*Math.random()),j=null,k=function(a){return a.x},l=function(a){return a.y},m="stack",n="zero",o="default",p="linear",q=!1,r=a.models.scatter(),s=250,t=d3.dispatch("areaClick","areaMouseover","areaMouseout","renderEnd","elementClick","elementMouseover","elementMouseout");r.pointSize(2.2).pointDomain([2.2,2.2]);var u=a.utils.renderWatch(t,s);return b.dispatch=t,b.scatter=r,r.dispatch.on("elementClick",function(){t.elementClick.apply(this,arguments)}),r.dispatch.on("elementMouseover",function(){t.elementMouseover.apply(this,arguments)}),r.dispatch.on("elementMouseout",function(){t.elementMouseout.apply(this,arguments)}),b.interpolate=function(a){return arguments.length?(p=a,b):p},b.duration=function(a){return arguments.length?(s=a,u.reset(s),r.duration(s),b):s},b.dispatch=t,b.scatter=r,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return f},set:function(a){f=a}},height:{get:function(){return g},set:function(a){g=a}},clipEdge:{get:function(){return q},set:function(a){q=a}},offset:{get:function(){return n},set:function(a){n=a}},order:{get:function(){return o},set:function(a){o=a}},interpolate:{get:function(){return p},set:function(a){p=a}},x:{get:function(){return k},set:function(a){k=d3.functor(a)}},y:{get:function(){return l},set:function(a){l=d3.functor(a)}},margin:{get:function(){return e},set:function(a){e.top=void 0!==a.top?a.top:e.top,e.right=void 0!==a.right?a.right:e.right,e.bottom=void 0!==a.bottom?a.bottom:e.bottom,e.left=void 0!==a.left?a.left:e.left}},color:{get:function(){return h},set:function(b){h=a.utils.getColor(b)}},style:{get:function(){return m},set:function(a){switch(m=a){case"stack":b.offset("zero"),b.order("default");break;case"stream":b.offset("wiggle"),b.order("inside-out");break;case"stream-center":b.offset("silhouette"),b.order("inside-out");break;case"expand":b.offset("expand"),b.order("default");break;case"stack_percent":b.offset(b.d3_stackedOffset_stackPercent),b.order("default")}}},duration:{get:function(){return s},set:function(a){s=a,u.reset(s),r.duration(s)}}}),a.utils.inheritOptions(b,r),a.utils.initOptions(b),b},a.models.stackedAreaChart=function(){"use strict";function b(k){return F.reset(),F.models(e),r&&F.models(f),s&&F.models(g),k.each(function(k){var x=d3.select(this),F=this;a.utils.initSVG(x);var K=a.utils.availableWidth(m,x,l),L=a.utils.availableHeight(n,x,l);if(b.update=function(){x.transition().duration(C).call(b)},b.container=this,v.setter(I(k),b.update).getter(H(k)).update(),v.disabled=k.map(function(a){return!!a.disabled}),!w){var M;w={};for(M in v)w[M]=v[M]instanceof Array?v[M].slice(0):v[M]}if(!(k&&k.length&&k.filter(function(a){return a.values.length}).length))return a.utils.noData(b,x),b;x.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale();var N=x.selectAll("g.nv-wrap.nv-stackedAreaChart").data([k]),O=N.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedAreaChart").append("g"),P=N.select("g");if(O.append("rect").style("opacity",0),O.append("g").attr("class","nv-x nv-axis"),O.append("g").attr("class","nv-y nv-axis"),O.append("g").attr("class","nv-stackedWrap"),O.append("g").attr("class","nv-legendWrap"),O.append("g").attr("class","nv-controlsWrap"),O.append("g").attr("class","nv-interactive"),P.select("rect").attr("width",K).attr("height",L),q){var Q=p?K-z:K;h.width(Q),P.select(".nv-legendWrap").datum(k).call(h),l.top!=h.height()&&(l.top=h.height(),L=a.utils.availableHeight(n,x,l)),P.select(".nv-legendWrap").attr("transform","translate("+(K-Q)+","+-l.top+")")}if(p){var R=[{key:B.stacked||"Stacked",metaKey:"Stacked",disabled:"stack"!=e.style(),style:"stack"},{key:B.stream||"Stream",metaKey:"Stream",disabled:"stream"!=e.style(),style:"stream"},{key:B.expanded||"Expanded",metaKey:"Expanded",disabled:"expand"!=e.style(),style:"expand"},{key:B.stack_percent||"Stack %",metaKey:"Stack_Percent",disabled:"stack_percent"!=e.style(),style:"stack_percent"}];z=A.length/3*260,R=R.filter(function(a){return-1!==A.indexOf(a.metaKey)}),i.width(z).color(["#444","#444","#444"]),P.select(".nv-controlsWrap").datum(R).call(i),l.top!=Math.max(i.height(),h.height())&&(l.top=Math.max(i.height(),h.height()),L=a.utils.availableHeight(n,x,l)),P.select(".nv-controlsWrap").attr("transform","translate(0,"+-l.top+")")}N.attr("transform","translate("+l.left+","+l.top+")"),t&&P.select(".nv-y.nv-axis").attr("transform","translate("+K+",0)"),u&&(j.width(K).height(L).margin({left:l.left,top:l.top}).svgContainer(x).xScale(c),N.select(".nv-interactive").call(j)),e.width(K).height(L);var S=P.select(".nv-stackedWrap").datum(k);if(S.transition().call(e),r&&(f.scale(c)._ticks(a.utils.calcTicksX(K/100,k)).tickSize(-L,0),P.select(".nv-x.nv-axis").attr("transform","translate(0,"+L+")"),P.select(".nv-x.nv-axis").transition().duration(0).call(f)),s){var T;if(T="wiggle"===e.offset()?0:a.utils.calcTicksY(L/36,k),g.scale(d)._ticks(T).tickSize(-K,0),"expand"===e.style()||"stack_percent"===e.style()){var U=g.tickFormat();D&&U===J||(D=U),g.tickFormat(J)}else D&&(g.tickFormat(D),D=null);P.select(".nv-y.nv-axis").transition().duration(0).call(g)}e.dispatch.on("areaClick.toggle",function(a){k.forEach(1===k.filter(function(a){return!a.disabled}).length?function(a){a.disabled=!1}:function(b,c){b.disabled=c!=a.seriesIndex}),v.disabled=k.map(function(a){return!!a.disabled}),y.stateChange(v),b.update()}),h.dispatch.on("stateChange",function(a){for(var c in a)v[c]=a[c];y.stateChange(v),b.update()}),i.dispatch.on("legendClick",function(a){a.disabled&&(R=R.map(function(a){return a.disabled=!0,a}),a.disabled=!1,e.style(a.style),v.style=e.style(),y.stateChange(v),b.update())}),j.dispatch.on("elementMousemove",function(c){e.clearHighlights();var d,g,h,i=[];if(k.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(f,j){g=a.interactiveBisect(f.values,c.pointXValue,b.x());var k=f.values[g],l=b.y()(k,g);if(null!=l&&e.highlightPoint(j,g,!0),"undefined"!=typeof k){"undefined"==typeof d&&(d=k),"undefined"==typeof h&&(h=b.xScale()(b.x()(k,g)));var m="expand"==e.style()?k.display.y:b.y()(k,g);i.push({key:f.key,value:m,color:o(f,f.seriesIndex),stackedValue:k.display})}}),i.reverse(),i.length>2){var m=b.yScale().invert(c.mouseY),n=null;i.forEach(function(a,b){m=Math.abs(m);var c=Math.abs(a.stackedValue.y0),d=Math.abs(a.stackedValue.y);return m>=c&&d+c>=m?void(n=b):void 0}),null!=n&&(i[n].highlight=!0)}var p=f.tickFormat()(b.x()(d,g)),q=j.tooltip.valueFormatter();"expand"===e.style()||"stack_percent"===e.style()?(E||(E=q),q=d3.format(".1%")):E&&(q=E,E=null),j.tooltip.position({left:h+l.left,top:c.mouseY+l.top}).chartContainer(F.parentNode).valueFormatter(q).data({value:p,series:i})(),j.renderGuideLine(h)}),j.dispatch.on("elementMouseout",function(){e.clearHighlights()}),y.on("changeState",function(a){"undefined"!=typeof a.disabled&&k.length===a.disabled.length&&(k.forEach(function(b,c){b.disabled=a.disabled[c]}),v.disabled=a.disabled),"undefined"!=typeof a.style&&(e.style(a.style),G=a.style),b.update()})}),F.renderEnd("stacked Area chart immediate"),b}var c,d,e=a.models.stackedArea(),f=a.models.axis(),g=a.models.axis(),h=a.models.legend(),i=a.models.legend(),j=a.interactiveGuideline(),k=a.models.tooltip(),l={top:30,right:25,bottom:50,left:60},m=null,n=null,o=a.utils.defaultColor(),p=!0,q=!0,r=!0,s=!0,t=!1,u=!1,v=a.utils.state(),w=null,x=null,y=d3.dispatch("stateChange","changeState","renderEnd"),z=250,A=["Stacked","Stream","Expanded"],B={},C=250;v.style=e.style(),f.orient("bottom").tickPadding(7),g.orient(t?"right":"left"),k.headerFormatter(function(a,b){return f.tickFormat()(a,b)}).valueFormatter(function(a,b){return g.tickFormat()(a,b)}),j.tooltip.headerFormatter(function(a,b){return f.tickFormat()(a,b)}).valueFormatter(function(a,b){return g.tickFormat()(a,b)});var D=null,E=null;i.updateState(!1);var F=a.utils.renderWatch(y),G=e.style(),H=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),style:e.style()}}},I=function(a){return function(b){void 0!==b.style&&(G=b.style),void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}},J=d3.format("%");return e.dispatch.on("elementMouseover.tooltip",function(a){a.point.x=e.x()(a.point),a.point.y=e.y()(a.point),k.data(a).position(a.pos).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(){k.hidden(!0)}),b.dispatch=y,b.stacked=e,b.legend=h,b.controls=i,b.xAxis=f,b.yAxis=g,b.interactiveLayer=j,b.tooltip=k,b.dispatch=y,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return m},set:function(a){m=a}},height:{get:function(){return n},set:function(a){n=a}},showLegend:{get:function(){return q},set:function(a){q=a}},showXAxis:{get:function(){return r},set:function(a){r=a}},showYAxis:{get:function(){return s},set:function(a){s=a}},defaultState:{get:function(){return w},set:function(a){w=a}},noData:{get:function(){return x},set:function(a){x=a}},showControls:{get:function(){return p},set:function(a){p=a}},controlLabels:{get:function(){return B},set:function(a){B=a}},controlOptions:{get:function(){return A},set:function(a){A=a}},tooltips:{get:function(){return k.enabled()},set:function(b){a.deprecated("tooltips","use chart.tooltip.enabled() instead"),k.enabled(!!b)}},tooltipContent:{get:function(){return k.contentGenerator()},set:function(b){a.deprecated("tooltipContent","use chart.tooltip.contentGenerator() instead"),k.contentGenerator(b)}},margin:{get:function(){return l},set:function(a){l.top=void 0!==a.top?a.top:l.top,l.right=void 0!==a.right?a.right:l.right,l.bottom=void 0!==a.bottom?a.bottom:l.bottom,l.left=void 0!==a.left?a.left:l.left}},duration:{get:function(){return C},set:function(a){C=a,F.reset(C),e.duration(C),f.duration(C),g.duration(C)}},color:{get:function(){return o},set:function(b){o=a.utils.getColor(b),h.color(o),e.color(o)}},rightAlignYAxis:{get:function(){return t},set:function(a){t=a,g.orient(t?"right":"left")}},useInteractiveGuideline:{get:function(){return u},set:function(a){u=!!a,b.interactive(!a),b.useVoronoi(!a),e.scatter.interactive(!a)}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.sunburst=function(){"use strict";function b(u){return t.reset(),u.each(function(b){function t(a){a.x0=a.x,a.dx0=a.dx}function u(a){var b=d3.interpolate(p.domain(),[a.x,a.x+a.dx]),c=d3.interpolate(q.domain(),[a.y,1]),d=d3.interpolate(q.range(),[a.y?20:0,y]);return function(a,e){return e?function(){return s(a)}:function(e){return p.domain(b(e)),q.domain(c(e)).range(d(e)),s(a)}}}l=d3.select(this);var v,w=a.utils.availableWidth(g,l,f),x=a.utils.availableHeight(h,l,f),y=Math.min(w,x)/2;a.utils.initSVG(l);var z=l.selectAll(".nv-wrap.nv-sunburst").data(b),A=z.enter().append("g").attr("class","nvd3 nv-wrap nv-sunburst nv-chart-"+k),B=A.selectAll("nv-sunburst");z.attr("transform","translate("+w/2+","+x/2+")"),l.on("click",function(a,b){o.chartClick({data:a,index:b,pos:d3.event,id:k})}),q.range([0,y]),c=c||b,e=b[0],r.value(j[i]||j.count),v=B.data(r.nodes).enter().append("path").attr("d",s).style("fill",function(a){return m((a.children?a:a.parent).name)}).style("stroke","#FFF").on("click",function(a){d!==c&&c!==a&&(d=c),c=a,v.transition().duration(n).attrTween("d",u(a))}).each(t).on("dblclick",function(a){d.parent==a&&v.transition().duration(n).attrTween("d",u(e))}).each(t).on("mouseover",function(a){d3.select(this).classed("hover",!0).style("opacity",.8),o.elementMouseover({data:a,color:d3.select(this).style("fill")})}).on("mouseout",function(a){d3.select(this).classed("hover",!1).style("opacity",1),o.elementMouseout({data:a})}).on("mousemove",function(a){o.elementMousemove({data:a})})}),t.renderEnd("sunburst immediate"),b}var c,d,e,f={top:0,right:0,bottom:0,left:0},g=null,h=null,i="count",j={count:function(){return 1},size:function(a){return a.size}},k=Math.floor(1e4*Math.random()),l=null,m=a.utils.defaultColor(),n=500,o=d3.dispatch("chartClick","elementClick","elementDblClick","elementMousemove","elementMouseover","elementMouseout","renderEnd"),p=d3.scale.linear().range([0,2*Math.PI]),q=d3.scale.sqrt(),r=d3.layout.partition().sort(null).value(function(){return 1}),s=d3.svg.arc().startAngle(function(a){return Math.max(0,Math.min(2*Math.PI,p(a.x)))}).endAngle(function(a){return Math.max(0,Math.min(2*Math.PI,p(a.x+a.dx)))}).innerRadius(function(a){return Math.max(0,q(a.y))}).outerRadius(function(a){return Math.max(0,q(a.y+a.dy))}),t=a.utils.renderWatch(o);return b.dispatch=o,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return g},set:function(a){g=a}},height:{get:function(){return h},set:function(a){h=a}},mode:{get:function(){return i},set:function(a){i=a}},id:{get:function(){return k},set:function(a){k=a}},duration:{get:function(){return n},set:function(a){n=a}},margin:{get:function(){return f},set:function(a){f.top=void 0!=a.top?a.top:f.top,f.right=void 0!=a.right?a.right:f.right,f.bottom=void 0!=a.bottom?a.bottom:f.bottom,f.left=void 0!=a.left?a.left:f.left}},color:{get:function(){return m},set:function(b){m=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.sunburstChart=function(){"use strict";function b(d){return m.reset(),m.models(c),d.each(function(d){var h=d3.select(this);a.utils.initSVG(h);var i=a.utils.availableWidth(f,h,e),j=a.utils.availableHeight(g,h,e);if(b.update=function(){0===k?h.call(b):h.transition().duration(k).call(b)},b.container=this,!d||!d.length)return a.utils.noData(b,h),b;h.selectAll(".nv-noData").remove();var l=h.selectAll("g.nv-wrap.nv-sunburstChart").data(d),m=l.enter().append("g").attr("class","nvd3 nv-wrap nv-sunburstChart").append("g"),n=l.select("g");m.append("g").attr("class","nv-sunburstWrap"),l.attr("transform","translate("+e.left+","+e.top+")"),c.width(i).height(j);var o=n.select(".nv-sunburstWrap").datum(d);d3.transition(o).call(c)}),m.renderEnd("sunburstChart immediate"),b}var c=a.models.sunburst(),d=a.models.tooltip(),e={top:30,right:20,bottom:20,left:20},f=null,g=null,h=a.utils.defaultColor(),i=(Math.round(1e5*Math.random()),null),j=null,k=250,l=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd"),m=a.utils.renderWatch(l);return d.headerEnabled(!1).duration(0).valueFormatter(function(a){return a}),c.dispatch.on("elementMouseover.tooltip",function(a){a.series={key:a.data.name,value:a.data.size,color:a.color},d.data(a).hidden(!1)}),c.dispatch.on("elementMouseout.tooltip",function(){d.hidden(!0)}),c.dispatch.on("elementMousemove.tooltip",function(){d.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=l,b.sunburst=c,b.tooltip=d,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{noData:{get:function(){return j},set:function(a){j=a}},defaultState:{get:function(){return i},set:function(a){i=a}},color:{get:function(){return h},set:function(a){h=a,c.color(h)}},duration:{get:function(){return k},set:function(a){k=a,m.reset(k),c.duration(k)}},margin:{get:function(){return e},set:function(a){e.top=void 0!==a.top?a.top:e.top,e.right=void 0!==a.right?a.right:e.right,e.bottom=void 0!==a.bottom?a.bottom:e.bottom,e.left=void 0!==a.left?a.left:e.left}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.version="1.8.1"}();  $(function() {
46097   var $window     = $(window)
46098     , $top_link   = $('#toplink')
46099     , $body       = $('body, html')
46100     , offset      = $('#code').offset().top
46101     , hidePopover = function ($target) {
46102        $target.data('popover-hover', false);
46103
46104        setTimeout(function () {
46105         if (!$target.data('popover-hover')) {
46106          $target.popover('hide');
46107         }
46108        }, 300);
46109     };
46110
46111   $top_link.hide().click(function(event) {
46112    event.preventDefault();
46113    $body.animate({scrollTop:0}, 800);
46114   });
46115
46116   $window.scroll(function() {
46117    if($window.scrollTop() > offset) {
46118     $top_link.fadeIn();
46119    } else {
46120     $top_link.fadeOut();
46121    }
46122   }).scroll();
46123
46124   $('.popin')
46125    .popover({trigger: 'manual'})
46126    .on({
46127     'mouseenter.popover': function () {
46128      var $target = $(this);
46129      var $container = $target.children().first();
46130
46131      $target.data('popover-hover', true);
46132
46133      // popover already displayed
46134      if ($target.next('.popover').length) {
46135       return;
46136      }
46137
46138      // show the popover
46139      $container.popover('show');
46140
46141      // register mouse events on the popover
46142      $target.next('.popover:not(.popover-initialized)')
46143       .on({
46144        'mouseenter': function () {
46145         $target.data('popover-hover', true);
46146        },
46147        'mouseleave': function () {
46148         hidePopover($container);
46149        }
46150       })
46151       .addClass('popover-initialized');
46152     },
46153     'mouseleave.popover': function () {
46154      hidePopover($(this).children().first());
46155     }
46156    });
46157  });
46158!function(){function n(n){return n&&(n.ownerDocument||n.document||n).documentElement}function t(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}function e(n,t){return t>n?-1:n>t?1:n>=t?0:NaN}function r(n){return null===n?NaN:+n}function i(n){return!isNaN(n)}function u(n){return{left:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);i>r;){var u=r+i>>>1;n(t[u],e)<0?r=u+1:i=u}return r},right:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);i>r;){var u=r+i>>>1;n(t[u],e)>0?i=u:r=u+1}return r}}}function o(n){return n.length}function a(n){for(var t=1;n*t%1;)t*=10;return t}function l(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function c(){this._=Object.create(null)}function f(n){return(n+="")===bo||n[0]===_o?_o+n:n}function s(n){return(n+="")[0]===_o?n.slice(1):n}function h(n){return f(n)in this._}function p(n){return(n=f(n))in this._&&delete this._[n]}function g(){var n=[];for(var t in this._)n.push(s(t));return n}function v(){var n=0;for(var t in this._)++n;return n}function d(){for(var n in this._)return!1;return!0}function y(){this._=Object.create(null)}function m(n){return n}function M(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function x(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e=0,r=wo.length;r>e;++e){var i=wo[e]+t;if(i in n)return i}}function b(){}function _(){}function w(n){function t(){for(var t,r=e,i=-1,u=r.length;++i<u;)(t=r[i].on)&&t.apply(this,arguments);return n}var e=[],r=new c;return t.on=function(t,i){var u,o=r.get(t);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,u=e.indexOf(o)).concat(e.slice(u+1)),r.remove(t)),i&&e.push(r.set(t,{on:i})),n)},t}function S(){ao.event.preventDefault()}function k(){for(var n,t=ao.event;n=t.sourceEvent;)t=n;return t}function N(n){for(var t=new _,e=0,r=arguments.length;++e<r;)t[arguments[e]]=w(t);return t.of=function(e,r){return function(i){try{var u=i.sourceEvent=ao.event;i.target=n,ao.event=i,t[i.type].apply(e,r)}finally{ao.event=u}}},t}function E(n){return ko(n,Co),n}function A(n){return"function"==typeof n?n:function(){return No(n,this)}}function C(n){return"function"==typeof n?n:function(){return Eo(n,this)}}function z(n,t){function e(){this.removeAttribute(n)}function r(){this.removeAttributeNS(n.space,n.local)}function i(){this.setAttribute(n,t)}function u(){this.setAttributeNS(n.space,n.local,t)}function o(){var e=t.apply(this,arguments);null==e?this.removeAttribute(n):this.setAttribute(n,e)}function a(){var e=t.apply(this,arguments);null==e?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}return n=ao.ns.qualify(n),null==t?n.local?r:e:"function"==typeof t?n.local?a:o:n.local?u:i}function L(n){return n.trim().replace(/\s+/g," ")}function q(n){return new RegExp("(?:^|\\s+)"+ao.requote(n)+"(?:\\s+|$)","g")}function T(n){return(n+"").trim().split(/^|\s+/)}function R(n,t){function e(){for(var e=-1;++e<i;)n[e](this,t)}function r(){for(var e=-1,r=t.apply(this,arguments);++e<i;)n[e](this,r)}n=T(n).map(D);var i=n.length;return"function"==typeof t?r:e}function D(n){var t=q(n);return function(e,r){if(i=e.classList)return r?i.add(n):i.remove(n);var i=e.getAttribute("class")||"";r?(t.lastIndex=0,t.test(i)||e.setAttribute("class",L(i+" "+n))):e.setAttribute("class",L(i.replace(t," ")))}}function P(n,t,e){function r(){this.style.removeProperty(n)}function i(){this.style.setProperty(n,t,e)}function u(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,e)}return null==t?r:"function"==typeof t?u:i}function U(n,t){function e(){delete this[n]}function r(){this[n]=t}function i(){var e=t.apply(this,arguments);null==e?delete this[n]:this[n]=e}return null==t?e:"function"==typeof t?i:r}function j(n){function t(){var t=this.ownerDocument,e=this.namespaceURI;return e===zo&&t.documentElement.namespaceURI===zo?t.createElement(n):t.createElementNS(e,n)}function e(){return this.ownerDocument.createElementNS(n.space,n.local)}return"function"==typeof n?n:(n=ao.ns.qualify(n)).local?e:t}function F(){var n=this.parentNode;n&&n.removeChild(this)}function H(n){return{__data__:n}}function O(n){return function(){return Ao(this,n)}}function I(n){return arguments.length||(n=e),function(t,e){return t&&e?n(t.__data__,e.__data__):!t-!e}}function Y(n,t){for(var e=0,r=n.length;r>e;e++)for(var i,u=n[e],o=0,a=u.length;a>o;o++)(i=u[o])&&t(i,o,e);return n}function Z(n){return ko(n,qo),n}function V(n){var t,e;return function(r,i,u){var o,a=n[u].update,l=a.length;for(u!=e&&(e=u,t=0),i>=t&&(t=i+1);!(o=a[t])&&++t<l;);return o}}function X(n,t,e){function r(){var t=this[o];t&&(this.removeEventListener(n,t,t.$),delete this[o])}function i(){var i=l(t,co(arguments));r.call(this),this.addEventListener(n,this[o]=i,i.$=e),i._=t}function u(){var t,e=new RegExp("^__on([^.]+)"+ao.requote(n)+"$");for(var r in this)if(t=r.match(e)){var i=this[r];this.removeEventListener(t[1],i,i.$),delete this[r]}}var o="__on"+n,a=n.indexOf("."),l=$;a>0&&(n=n.slice(0,a));var c=To.get(n);return c&&(n=c,l=B),a?t?i:r:t?b:u}function $(n,t){return function(e){var r=ao.event;ao.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{ao.event=r}}}function B(n,t){var e=$(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function W(e){var r=".dragsuppress-"+ ++Do,i="click"+r,u=ao.select(t(e)).on("touchmove"+r,S).on("dragstart"+r,S).on("selectstart"+r,S);if(null==Ro&&(Ro="onselectstart"in e?!1:x(e.style,"userSelect")),Ro){var o=n(e).style,a=o[Ro];o[Ro]="none"}return function(n){if(u.on(r,null),Ro&&(o[Ro]=a),n){var t=function(){u.on(i,null)};u.on(i,function(){S(),t()},!0),setTimeout(t,0)}}}function J(n,e){e.changedTouches&&(e=e.changedTouches[0]);var r=n.ownerSVGElement||n;if(r.createSVGPoint){var i=r.createSVGPoint();if(0>Po){var u=t(n);if(u.scrollX||u.scrollY){r=ao.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=r[0][0].getScreenCTM();Po=!(o.f||o.e),r.remove()}}return Po?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(n.getScreenCTM().inverse()),[i.x,i.y]}var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}function G(){return ao.event.changedTouches[0].identifier}function K(n){return n>0?1:0>n?-1:0}function Q(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function nn(n){return n>1?0:-1>n?Fo:Math.acos(n)}function tn(n){return n>1?Io:-1>n?-Io:Math.asin(n)}function en(n){return((n=Math.exp(n))-1/n)/2}function rn(n){return((n=Math.exp(n))+1/n)/2}function un(n){return((n=Math.exp(2*n))-1)/(n+1)}function on(n){return(n=Math.sin(n/2))*n}function an(){}function ln(n,t,e){return this instanceof ln?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof ln?new ln(n.h,n.s,n.l):_n(""+n,wn,ln):new ln(n,t,e)}function cn(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?u+(o-u)*n/60:180>n?o:240>n?u+(o-u)*(240-n)/60:u}function i(n){return Math.round(255*r(n))}var u,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,o=.5>=e?e*(1+t):e+t-e*t,u=2*e-o,new mn(i(n+120),i(n),i(n-120))}function fn(n,t,e){return this instanceof fn?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof fn?new fn(n.h,n.c,n.l):n instanceof hn?gn(n.l,n.a,n.b):gn((n=Sn((n=ao.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new fn(n,t,e)}function sn(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new hn(e,Math.cos(n*=Yo)*t,Math.sin(n)*t)}function hn(n,t,e){return this instanceof hn?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof hn?new hn(n.l,n.a,n.b):n instanceof fn?sn(n.h,n.c,n.l):Sn((n=mn(n)).r,n.g,n.b):new hn(n,t,e)}function pn(n,t,e){var r=(n+16)/116,i=r+t/500,u=r-e/200;return i=vn(i)*na,r=vn(r)*ta,u=vn(u)*ea,new mn(yn(3.2404542*i-1.5371385*r-.4985314*u),yn(-.969266*i+1.8760108*r+.041556*u),yn(.0556434*i-.2040259*r+1.0572252*u))}function gn(n,t,e){return n>0?new fn(Math.atan2(e,t)*Zo,Math.sqrt(t*t+e*e),n):new fn(NaN,NaN,n)}function vn(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function dn(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function yn(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function mn(n,t,e){return this instanceof mn?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof mn?new mn(n.r,n.g,n.b):_n(""+n,mn,cn):new mn(n,t,e)}function Mn(n){return new mn(n>>16,n>>8&255,255&n)}function xn(n){return Mn(n)+""}function bn(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function _n(n,t,e){var r,i,u,o=0,a=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(n=n.toLowerCase()))switch(i=r[2].split(","),r[1]){case"hsl":return e(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return t(Nn(i[0]),Nn(i[1]),Nn(i[2]))}return(u=ua.get(n))?t(u.r,u.g,u.b):(null==n||"#"!==n.charAt(0)||isNaN(u=parseInt(n.slice(1),16))||(4===n.length?(o=(3840&u)>>4,o=o>>4|o,a=240&u,a=a>>4|a,l=15&u,l=l<<4|l):7===n.length&&(o=(16711680&u)>>16,a=(65280&u)>>8,l=255&u)),t(o,a,l))}function wn(n,t,e){var r,i,u=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-u,l=(o+u)/2;return a?(i=.5>l?a/(o+u):a/(2-o-u),r=n==o?(t-e)/a+(e>t?6:0):t==o?(e-n)/a+2:(n-t)/a+4,r*=60):(r=NaN,i=l>0&&1>l?0:r),new ln(r,i,l)}function Sn(n,t,e){n=kn(n),t=kn(t),e=kn(e);var r=dn((.4124564*n+.3575761*t+.1804375*e)/na),i=dn((.2126729*n+.7151522*t+.072175*e)/ta),u=dn((.0193339*n+.119192*t+.9503041*e)/ea);return hn(116*i-16,500*(r-i),200*(i-u))}function kn(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Nn(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function En(n){return"function"==typeof n?n:function(){return n}}function An(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),Cn(t,e,n,r)}}function Cn(n,t,e,r){function i(){var n,t=l.status;if(!t&&Ln(l)||t>=200&&300>t||304===t){try{n=e.call(u,l)}catch(r){return void o.error.call(u,r)}o.load.call(u,n)}else o.error.call(u,l)}var u={},o=ao.dispatch("beforesend","progress","load","error"),a={},l=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(n)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(n){var t=ao.event;ao.event=n;try{o.progress.call(u,l)}finally{ao.event=t}},u.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?a[n]:(null==t?delete a[n]:a[n]=t+"",u)},u.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",u):t},u.responseType=function(n){return arguments.length?(c=n,u):c},u.response=function(n){return e=n,u},["get","post"].forEach(function(n){u[n]=function(){return u.send.apply(u,[n].concat(co(arguments)))}}),u.send=function(e,r,i){if(2===arguments.length&&"function"==typeof r&&(i=r,r=null),l.open(e,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),l.setRequestHeader)for(var f in a)l.setRequestHeader(f,a[f]);return null!=t&&l.overrideMimeType&&l.overrideMimeType(t),null!=c&&(l.responseType=c),null!=i&&u.on("error",i).on("load",function(n){i(null,n)}),o.beforesend.call(u,l),l.send(null==r?null:r),u},u.abort=function(){return l.abort(),u},ao.rebind(u,o,"on"),null==r?u:u.get(zn(r))}function zn(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function Ln(n){var t=n.responseType;return t&&"text"!==t?n.response:n.responseText}function qn(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var i=e+t,u={c:n,t:i,n:null};return aa?aa.n=u:oa=u,aa=u,la||(ca=clearTimeout(ca),la=1,fa(Tn)),u}function Tn(){var n=Rn(),t=Dn()-n;t>24?(isFinite(t)&&(clearTimeout(ca),ca=setTimeout(Tn,t)),la=0):(la=1,fa(Tn))}function Rn(){for(var n=Date.now(),t=oa;t;)n>=t.t&&t.c(n-t.t)&&(t.c=null),t=t.n;return n}function Dn(){for(var n,t=oa,e=1/0;t;)t.c?(t.t<e&&(e=t.t),t=(n=t).n):t=n?n.n=t.n:oa=t.n;return aa=n,e}function Pn(n,t){return t-(n?Math.ceil(Math.log(n)/Math.LN10):1)}function Un(n,t){var e=Math.pow(10,3*xo(8-t));return{scale:t>8?function(n){return n/e}:function(n){return n*e},symbol:n}}function jn(n){var t=n.decimal,e=n.thousands,r=n.grouping,i=n.currency,u=r&&e?function(n,t){for(var i=n.length,u=[],o=0,a=r[0],l=0;i>0&&a>0&&(l+a+1>t&&(a=Math.max(1,t-l)),u.push(n.substring(i-=a,i+a)),!((l+=a+1)>t));)a=r[o=(o+1)%r.length];return u.reverse().join(e)}:m;return function(n){var e=ha.exec(n),r=e[1]||" ",o=e[2]||">",a=e[3]||"-",l=e[4]||"",c=e[5],f=+e[6],s=e[7],h=e[8],p=e[9],g=1,v="",d="",y=!1,m=!0;switch(h&&(h=+h.substring(1)),(c||"0"===r&&"="===o)&&(c=r="0",o="="),p){case"n":s=!0,p="g";break;case"%":g=100,d="%",p="f";break;case"p":g=100,d="%",p="r";break;case"b":case"o":case"x":case"X":"#"===l&&(v="0"+p.toLowerCase());case"c":m=!1;case"d":y=!0,h=0;break;case"s":g=-1,p="r"}"$"===l&&(v=i[0],d=i[1]),"r"!=p||h||(p="g"),null!=h&&("g"==p?h=Math.max(1,Math.min(21,h)):"e"!=p&&"f"!=p||(h=Math.max(0,Math.min(20,h)))),p=pa.get(p)||Fn;var M=c&&s;return function(n){var e=d;if(y&&n%1)return"";var i=0>n||0===n&&0>1/n?(n=-n,"-"):"-"===a?"":a;if(0>g){var l=ao.formatPrefix(n,h);n=l.scale(n),e=l.symbol+d}else n*=g;n=p(n,h);var x,b,_=n.lastIndexOf(".");if(0>_){var w=m?n.lastIndexOf("e"):-1;0>w?(x=n,b=""):(x=n.substring(0,w),b=n.substring(w))}else x=n.substring(0,_),b=t+n.substring(_+1);!c&&s&&(x=u(x,1/0));var S=v.length+x.length+b.length+(M?0:i.length),k=f>S?new Array(S=f-S+1).join(r):"";return M&&(x=u(k+x,k.length?f-b.length:1/0)),i+=v,n=x+b,("<"===o?i+n+k:">"===o?k+i+n:"^"===o?k.substring(0,S>>=1)+i+n+k.substring(S):i+(M?n:k+n))+e}}}function Fn(n){return n+""}function Hn(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function On(n,t,e){function r(t){var e=n(t),r=u(e,1);return r-t>t-e?e:r}function i(e){return t(e=n(new va(e-1)),1),e}function u(n,e){return t(n=new va(+n),e),n}function o(n,r,u){var o=i(n),a=[];if(u>1)for(;r>o;)e(o)%u||a.push(new Date(+o)),t(o,1);else for(;r>o;)a.push(new Date(+o)),t(o,1);return a}function a(n,t,e){try{va=Hn;var r=new Hn;return r._=n,o(r,t,e)}finally{va=Date}}n.floor=n,n.round=r,n.ceil=i,n.offset=u,n.range=o;var l=n.utc=In(n);return l.floor=l,l.round=In(r),l.ceil=In(i),l.offset=In(u),l.range=a,n}function In(n){return function(t,e){try{va=Hn;var r=new Hn;return r._=t,n(r,e)._}finally{va=Date}}}function Yn(n){function t(n){function t(t){for(var e,i,u,o=[],a=-1,l=0;++a<r;)37===n.charCodeAt(a)&&(o.push(n.slice(l,a)),null!=(i=ya[e=n.charAt(++a)])&&(e=n.charAt(++a)),(u=A[e])&&(e=u(t,null==i?"e"===e?" ":"0":i)),o.push(e),l=a+1);return o.push(n.slice(l,a)),o.join("")}var r=n.length;return t.parse=function(t){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},i=e(r,n,t,0);if(i!=t.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var u=null!=r.Z&&va!==Hn,o=new(u?Hn:va);return"j"in r?o.setFullYear(r.y,0,r.j):"W"in r||"U"in r?("w"in r||(r.w="W"in r?1:0),o.setFullYear(r.y,0,1),o.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(o.getDay()+5)%7:r.w+7*r.U-(o.getDay()+6)%7)):o.setFullYear(r.y,r.m,r.d),o.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),u?o._:o},t.toString=function(){return n},t}function e(n,t,e,r){for(var i,u,o,a=0,l=t.length,c=e.length;l>a;){if(r>=c)return-1;if(i=t.charCodeAt(a++),37===i){if(o=t.charAt(a++),u=C[o in ya?t.charAt(a++):o],!u||(r=u(n,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){_.lastIndex=0;var r=_.exec(t.slice(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){x.lastIndex=0;var r=x.exec(t.slice(e));return r?(n.w=b.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){N.lastIndex=0;var r=N.exec(t.slice(e));return r?(n.m=E.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,e){S.lastIndex=0;var r=S.exec(t.slice(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,r){return e(n,A.c.toString(),t,r)}function l(n,t,r){return e(n,A.x.toString(),t,r)}function c(n,t,r){return e(n,A.X.toString(),t,r)}function f(n,t,e){var r=M.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var s=n.dateTime,h=n.date,p=n.time,g=n.periods,v=n.days,d=n.shortDays,y=n.months,m=n.shortMonths;t.utc=function(n){function e(n){try{va=Hn;var t=new va;return t._=n,r(t)}finally{va=Date}}var r=t(n);return e.parse=function(n){try{va=Hn;var t=r.parse(n);return t&&t._}finally{va=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=ct;var M=ao.map(),x=Vn(v),b=Xn(v),_=Vn(d),w=Xn(d),S=Vn(y),k=Xn(y),N=Vn(m),E=Xn(m);g.forEach(function(n,t){M.set(n.toLowerCase(),t)});var A={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return m[n.getMonth()]},B:function(n){return y[n.getMonth()]},c:t(s),d:function(n,t){return Zn(n.getDate(),t,2)},e:function(n,t){return Zn(n.getDate(),t,2)},H:function(n,t){return Zn(n.getHours(),t,2)},I:function(n,t){return Zn(n.getHours()%12||12,t,2)},j:function(n,t){return Zn(1+ga.dayOfYear(n),t,3)},L:function(n,t){return Zn(n.getMilliseconds(),t,3)},m:function(n,t){return Zn(n.getMonth()+1,t,2)},M:function(n,t){return Zn(n.getMinutes(),t,2)},p:function(n){return g[+(n.getHours()>=12)]},S:function(n,t){return Zn(n.getSeconds(),t,2)},U:function(n,t){return Zn(ga.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return Zn(ga.mondayOfYear(n),t,2)},x:t(h),X:t(p),y:function(n,t){return Zn(n.getFullYear()%100,t,2)},Y:function(n,t){return Zn(n.getFullYear()%1e4,t,4)},Z:at,"%":function(){return"%"}},C={a:r,A:i,b:u,B:o,c:a,d:tt,e:tt,H:rt,I:rt,j:et,L:ot,m:nt,M:it,p:f,S:ut,U:Bn,w:$n,W:Wn,x:l,X:c,y:Gn,Y:Jn,Z:Kn,"%":lt};return t}function Zn(n,t,e){var r=0>n?"-":"",i=(r?-n:n)+"",u=i.length;return r+(e>u?new Array(e-u+1).join(t)+i:i)}function Vn(n){return new RegExp("^(?:"+n.map(ao.requote).join("|")+")","i")}function Xn(n){for(var t=new c,e=-1,r=n.length;++e<r;)t.set(n[e].toLowerCase(),e);return t}function $n(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+1));return r?(n.w=+r[0],e+r[0].length):-1}function Bn(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e));return r?(n.U=+r[0],e+r[0].length):-1}function Wn(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e));return r?(n.W=+r[0],e+r[0].length):-1}function Jn(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+4));return r?(n.y=+r[0],e+r[0].length):-1}function Gn(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.y=Qn(+r[0]),e+r[0].length):-1}function Kn(n,t,e){return/^[+-]\d{4}$/.test(t=t.slice(e,e+5))?(n.Z=-t,e+5):-1}function Qn(n){return n+(n>68?1900:2e3)}function nt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function tt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function et(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function rt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function it(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function ut(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function ot(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function at(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=xo(t)/60|0,i=xo(t)%60;return e+Zn(r,"0",2)+Zn(i,"0",2)}function lt(n,t,e){Ma.lastIndex=0;var r=Ma.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function ct(n){for(var t=n.length,e=-1;++e<t;)n[e][0]=this(n[e][0]);return function(t){for(var e=0,r=n[e];!r[1](t);)r=n[++e];return r[0](t)}}function ft(){}function st(n,t,e){var r=e.s=n+t,i=r-n,u=r-i;e.t=n-u+(t-i)}function ht(n,t){n&&wa.hasOwnProperty(n.type)&&wa[n.type](n,t)}function pt(n,t,e){var r,i=-1,u=n.length-e;for(t.lineStart();++i<u;)r=n[i],t.point(r[0],r[1],r[2]);t.lineEnd()}function gt(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)pt(n[e],t,1);t.polygonEnd()}function vt(){function n(n,t){n*=Yo,t=t*Yo/2+Fo/4;var e=n-r,o=e>=0?1:-1,a=o*e,l=Math.cos(t),c=Math.sin(t),f=u*c,s=i*l+f*Math.cos(a),h=f*o*Math.sin(a);ka.add(Math.atan2(h,s)),r=n,i=l,u=c}var t,e,r,i,u;Na.point=function(o,a){Na.point=n,r=(t=o)*Yo,i=Math.cos(a=(e=a)*Yo/2+Fo/4),u=Math.sin(a)},Na.lineEnd=function(){n(t,e)}}function dt(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function yt(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function mt(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Mt(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function xt(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function bt(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function _t(n){return[Math.atan2(n[1],n[0]),tn(n[2])]}function wt(n,t){return xo(n[0]-t[0])<Uo&&xo(n[1]-t[1])<Uo}function St(n,t){n*=Yo;var e=Math.cos(t*=Yo);kt(e*Math.cos(n),e*Math.sin(n),Math.sin(t))}function kt(n,t,e){++Ea,Ca+=(n-Ca)/Ea,za+=(t-za)/Ea,La+=(e-La)/Ea}function Nt(){function n(n,i){n*=Yo;var u=Math.cos(i*=Yo),o=u*Math.cos(n),a=u*Math.sin(n),l=Math.sin(i),c=Math.atan2(Math.sqrt((c=e*l-r*a)*c+(c=r*o-t*l)*c+(c=t*a-e*o)*c),t*o+e*a+r*l);Aa+=c,qa+=c*(t+(t=o)),Ta+=c*(e+(e=a)),Ra+=c*(r+(r=l)),kt(t,e,r)}var t,e,r;ja.point=function(i,u){i*=Yo;var o=Math.cos(u*=Yo);t=o*Math.cos(i),e=o*Math.sin(i),r=Math.sin(u),ja.point=n,kt(t,e,r)}}function Et(){ja.point=St}function At(){function n(n,t){n*=Yo;var e=Math.cos(t*=Yo),o=e*Math.cos(n),a=e*Math.sin(n),l=Math.sin(t),c=i*l-u*a,f=u*o-r*l,s=r*a-i*o,h=Math.sqrt(c*c+f*f+s*s),p=r*o+i*a+u*l,g=h&&-nn(p)/h,v=Math.atan2(h,p);Da+=g*c,Pa+=g*f,Ua+=g*s,Aa+=v,qa+=v*(r+(r=o)),Ta+=v*(i+(i=a)),Ra+=v*(u+(u=l)),kt(r,i,u)}var t,e,r,i,u;ja.point=function(o,a){t=o,e=a,ja.point=n,o*=Yo;var l=Math.cos(a*=Yo);r=l*Math.cos(o),i=l*Math.sin(o),u=Math.sin(a),kt(r,i,u)},ja.lineEnd=function(){n(t,e),ja.lineEnd=Et,ja.point=St}}function Ct(n,t){function e(e,r){return e=n(e,r),t(e[0],e[1])}return n.invert&&t.invert&&(e.invert=function(e,r){return e=t.invert(e,r),e&&n.invert(e[0],e[1])}),e}function zt(){return!0}function Lt(n,t,e,r,i){var u=[],o=[];if(n.forEach(function(n){if(!((t=n.length-1)<=0)){var t,e=n[0],r=n[t];if(wt(e,r)){i.lineStart();for(var a=0;t>a;++a)i.point((e=n[a])[0],e[1]);return void i.lineEnd()}var l=new Tt(e,n,null,!0),c=new Tt(e,null,l,!1);l.o=c,u.push(l),o.push(c),l=new Tt(r,n,null,!1),c=new Tt(r,null,l,!0),l.o=c,u.push(l),o.push(c)}}),o.sort(t),qt(u),qt(o),u.length){for(var a=0,l=e,c=o.length;c>a;++a)o[a].e=l=!l;for(var f,s,h=u[0];;){for(var p=h,g=!0;p.v;)if((p=p.n)===h)return;f=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(g)for(var a=0,c=f.length;c>a;++a)i.point((s=f[a])[0],s[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(g){f=p.p.z;for(var a=f.length-1;a>=0;--a)i.point((s=f[a])[0],s[1])}else r(p.x,p.p.x,-1,i);p=p.p}p=p.o,f=p.z,g=!g}while(!p.v);i.lineEnd()}}}function qt(n){if(t=n.length){for(var t,e,r=0,i=n[0];++r<t;)i.n=e=n[r],e.p=i,i=e;i.n=e=n[0],e.p=i}}function Tt(n,t,e,r){this.x=n,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Rt(n,t,e,r){return function(i,u){function o(t,e){var r=i(t,e);n(t=r[0],e=r[1])&&u.point(t,e)}function a(n,t){var e=i(n,t);d.point(e[0],e[1])}function l(){m.point=a,d.lineStart()}function c(){m.point=o,d.lineEnd()}function f(n,t){v.push([n,t]);var e=i(n,t);x.point(e[0],e[1])}function s(){x.lineStart(),v=[]}function h(){f(v[0][0],v[0][1]),x.lineEnd();var n,t=x.clean(),e=M.buffer(),r=e.length;if(v.pop(),g.push(v),v=null,r)if(1&t){n=e[0];var i,r=n.length-1,o=-1;if(r>0){for(b||(u.polygonStart(),b=!0),u.lineStart();++o<r;)u.point((i=n[o])[0],i[1]);u.lineEnd()}}else r>1&&2&t&&e.push(e.pop().concat(e.shift())),p.push(e.filter(Dt))}var p,g,v,d=t(u),y=i.invert(r[0],r[1]),m={point:o,lineStart:l,lineEnd:c,polygonStart:function(){m.point=f,m.lineStart=s,m.lineEnd=h,p=[],g=[]},polygonEnd:function(){m.point=o,m.lineStart=l,m.lineEnd=c,p=ao.merge(p);var n=Ot(y,g);p.length?(b||(u.polygonStart(),b=!0),Lt(p,Ut,n,e,u)):n&&(b||(u.polygonStart(),b=!0),u.lineStart(),e(null,null,1,u),u.lineEnd()),b&&(u.polygonEnd(),b=!1),p=g=null},sphere:function(){u.polygonStart(),u.lineStart(),e(null,null,1,u),u.lineEnd(),u.polygonEnd()}},M=Pt(),x=t(M),b=!1;return m}}function Dt(n){return n.length>1}function Pt(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:b,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Ut(n,t){return((n=n.x)[0]<0?n[1]-Io-Uo:Io-n[1])-((t=t.x)[0]<0?t[1]-Io-Uo:Io-t[1])}function jt(n){var t,e=NaN,r=NaN,i=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(u,o){var a=u>0?Fo:-Fo,l=xo(u-e);xo(l-Fo)<Uo?(n.point(e,r=(r+o)/2>0?Io:-Io),n.point(i,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(u,r),t=0):i!==a&&l>=Fo&&(xo(e-i)<Uo&&(e-=i*Uo),xo(u-a)<Uo&&(u-=a*Uo),r=Ft(e,r,u,o),n.point(i,r),n.lineEnd(),n.lineStart(),n.point(a,r),t=0),n.point(e=u,r=o),i=a},lineEnd:function(){n.lineEnd(),e=r=NaN},clean:function(){return 2-t}}}function Ft(n,t,e,r){var i,u,o=Math.sin(n-e);return xo(o)>Uo?Math.atan((Math.sin(t)*(u=Math.cos(r))*Math.sin(e)-Math.sin(r)*(i=Math.cos(t))*Math.sin(n))/(i*u*o)):(t+r)/2}function Ht(n,t,e,r){var i;if(null==n)i=e*Io,r.point(-Fo,i),r.point(0,i),r.point(Fo,i),r.point(Fo,0),r.point(Fo,-i),r.point(0,-i),r.point(-Fo,-i),r.point(-Fo,0),r.point(-Fo,i);else if(xo(n[0]-t[0])>Uo){var u=n[0]<t[0]?Fo:-Fo;i=e*u/2,r.point(-u,i),r.point(0,i),r.point(u,i)}else r.point(t[0],t[1])}function Ot(n,t){var e=n[0],r=n[1],i=[Math.sin(e),-Math.cos(e),0],u=0,o=0;ka.reset();for(var a=0,l=t.length;l>a;++a){var c=t[a],f=c.length;if(f)for(var s=c[0],h=s[0],p=s[1]/2+Fo/4,g=Math.sin(p),v=Math.cos(p),d=1;;){d===f&&(d=0),n=c[d];var y=n[0],m=n[1]/2+Fo/4,M=Math.sin(m),x=Math.cos(m),b=y-h,_=b>=0?1:-1,w=_*b,S=w>Fo,k=g*M;if(ka.add(Math.atan2(k*_*Math.sin(w),v*x+k*Math.cos(w))),u+=S?b+_*Ho:b,S^h>=e^y>=e){var N=mt(dt(s),dt(n));bt(N);var E=mt(i,N);bt(E);var A=(S^b>=0?-1:1)*tn(E[2]);(r>A||r===A&&(N[0]||N[1]))&&(o+=S^b>=0?1:-1)}if(!d++)break;h=y,g=M,v=x,s=n}}return(-Uo>u||Uo>u&&-Uo>ka)^1&o}function It(n){function t(n,t){return Math.cos(n)*Math.cos(t)>u}function e(n){var e,u,l,c,f;return{lineStart:function(){c=l=!1,f=1},point:function(s,h){var p,g=[s,h],v=t(s,h),d=o?v?0:i(s,h):v?i(s+(0>s?Fo:-Fo),h):0;if(!e&&(c=l=v)&&n.lineStart(),v!==l&&(p=r(e,g),(wt(e,p)||wt(g,p))&&(g[0]+=Uo,g[1]+=Uo,v=t(g[0],g[1]))),v!==l)f=0,v?(n.lineStart(),p=r(g,e),n.point(p[0],p[1])):(p=r(e,g),n.point(p[0],p[1]),n.lineEnd()),e=p;else if(a&&e&&o^v){var y;d&u||!(y=r(g,e,!0))||(f=0,o?(n.lineStart(),n.point(y[0][0],y[0][1]),n.point(y[1][0],y[1][1]),n.lineEnd()):(n.point(y[1][0],y[1][1]),n.lineEnd(),n.lineStart(),n.point(y[0][0],y[0][1])))}!v||e&&wt(e,g)||n.point(g[0],g[1]),e=g,l=v,u=d},lineEnd:function(){l&&n.lineEnd(),e=null},clean:function(){return f|(c&&l)<<1}}}function r(n,t,e){var r=dt(n),i=dt(t),o=[1,0,0],a=mt(r,i),l=yt(a,a),c=a[0],f=l-c*c;if(!f)return!e&&n;var s=u*l/f,h=-u*c/f,p=mt(o,a),g=xt(o,s),v=xt(a,h);Mt(g,v);var d=p,y=yt(g,d),m=yt(d,d),M=y*y-m*(yt(g,g)-1);if(!(0>M)){var x=Math.sqrt(M),b=xt(d,(-y-x)/m);if(Mt(b,g),b=_t(b),!e)return b;var _,w=n[0],S=t[0],k=n[1],N=t[1];w>S&&(_=w,w=S,S=_);var E=S-w,A=xo(E-Fo)<Uo,C=A||Uo>E;if(!A&&k>N&&(_=k,k=N,N=_),C?A?k+N>0^b[1]<(xo(b[0]-w)<Uo?k:N):k<=b[1]&&b[1]<=N:E>Fo^(w<=b[0]&&b[0]<=S)){var z=xt(d,(-y+x)/m);return Mt(z,g),[b,_t(z)]}}}function i(t,e){var r=o?n:Fo-n,i=0;return-r>t?i|=1:t>r&&(i|=2),-r>e?i|=4:e>r&&(i|=8),i}var u=Math.cos(n),o=u>0,a=xo(u)>Uo,l=ve(n,6*Yo);return Rt(t,e,l,o?[0,-n]:[-Fo,n-Fo])}function Yt(n,t,e,r){return function(i){var u,o=i.a,a=i.b,l=o.x,c=o.y,f=a.x,s=a.y,h=0,p=1,g=f-l,v=s-c;if(u=n-l,g||!(u>0)){if(u/=g,0>g){if(h>u)return;p>u&&(p=u)}else if(g>0){if(u>p)return;u>h&&(h=u)}if(u=e-l,g||!(0>u)){if(u/=g,0>g){if(u>p)return;u>h&&(h=u)}else if(g>0){if(h>u)return;p>u&&(p=u)}if(u=t-c,v||!(u>0)){if(u/=v,0>v){if(h>u)return;p>u&&(p=u)}else if(v>0){if(u>p)return;u>h&&(h=u)}if(u=r-c,v||!(0>u)){if(u/=v,0>v){if(u>p)return;u>h&&(h=u)}else if(v>0){if(h>u)return;p>u&&(p=u)}return h>0&&(i.a={x:l+h*g,y:c+h*v}),1>p&&(i.b={x:l+p*g,y:c+p*v}),i}}}}}}function Zt(n,t,e,r){function i(r,i){return xo(r[0]-n)<Uo?i>0?0:3:xo(r[0]-e)<Uo?i>0?2:1:xo(r[1]-t)<Uo?i>0?1:0:i>0?3:2}function u(n,t){return o(n.x,t.x)}function o(n,t){var e=i(n,1),r=i(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(a){function l(n){for(var t=0,e=d.length,r=n[1],i=0;e>i;++i)for(var u,o=1,a=d[i],l=a.length,c=a[0];l>o;++o)u=a[o],c[1]<=r?u[1]>r&&Q(c,u,n)>0&&++t:u[1]<=r&&Q(c,u,n)<0&&--t,c=u;return 0!==t}function c(u,a,l,c){var f=0,s=0;if(null==u||(f=i(u,l))!==(s=i(a,l))||o(u,a)<0^l>0){do c.point(0===f||3===f?n:e,f>1?r:t);while((f=(f+l+4)%4)!==s)}else c.point(a[0],a[1])}function f(i,u){return i>=n&&e>=i&&u>=t&&r>=u}function s(n,t){f(n,t)&&a.point(n,t)}function h(){C.point=g,d&&d.push(y=[]),S=!0,w=!1,b=_=NaN}function p(){v&&(g(m,M),x&&w&&E.rejoin(),v.push(E.buffer())),C.point=s,w&&a.lineEnd()}function g(n,t){n=Math.max(-Ha,Math.min(Ha,n)),t=Math.max(-Ha,Math.min(Ha,t));var e=f(n,t);if(d&&y.push([n,t]),S)m=n,M=t,x=e,S=!1,e&&(a.lineStart(),a.point(n,t));else if(e&&w)a.point(n,t);else{var r={a:{x:b,y:_},b:{x:n,y:t}};A(r)?(w||(a.lineStart(),a.point(r.a.x,r.a.y)),a.point(r.b.x,r.b.y),e||a.lineEnd(),k=!1):e&&(a.lineStart(),a.point(n,t),k=!1)}b=n,_=t,w=e}var v,d,y,m,M,x,b,_,w,S,k,N=a,E=Pt(),A=Yt(n,t,e,r),C={point:s,lineStart:h,lineEnd:p,polygonStart:function(){a=E,v=[],d=[],k=!0},polygonEnd:function(){a=N,v=ao.merge(v);var t=l([n,r]),e=k&&t,i=v.length;(e||i)&&(a.polygonStart(),e&&(a.lineStart(),c(null,null,1,a),a.lineEnd()),i&&Lt(v,u,t,c,a),a.polygonEnd()),v=d=y=null}};return C}}function Vt(n){var t=0,e=Fo/3,r=ae(n),i=r(t,e);return i.parallels=function(n){return arguments.length?r(t=n[0]*Fo/180,e=n[1]*Fo/180):[t/Fo*180,e/Fo*180]},i}function Xt(n,t){function e(n,t){var e=Math.sqrt(u-2*i*Math.sin(t))/i;return[e*Math.sin(n*=i),o-e*Math.cos(n)]}var r=Math.sin(n),i=(r+Math.sin(t))/2,u=1+r*(2*i-r),o=Math.sqrt(u)/i;return e.invert=function(n,t){var e=o-t;return[Math.atan2(n,e)/i,tn((u-(n*n+e*e)*i*i)/(2*i))]},e}function $t(){function n(n,t){Ia+=i*n-r*t,r=n,i=t}var t,e,r,i;$a.point=function(u,o){$a.point=n,t=r=u,e=i=o},$a.lineEnd=function(){n(t,e)}}function Bt(n,t){Ya>n&&(Ya=n),n>Va&&(Va=n),Za>t&&(Za=t),t>Xa&&(Xa=t)}function Wt(){function n(n,t){o.push("M",n,",",t,u)}function t(n,t){o.push("M",n,",",t),a.point=e}function e(n,t){o.push("L",n,",",t)}function r(){a.point=n}function i(){o.push("Z")}var u=Jt(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:r,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=r,a.point=n},pointRadius:function(n){return u=Jt(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function Jt(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function Gt(n,t){Ca+=n,za+=t,++La}function Kt(){function n(n,r){var i=n-t,u=r-e,o=Math.sqrt(i*i+u*u);qa+=o*(t+n)/2,Ta+=o*(e+r)/2,Ra+=o,Gt(t=n,e=r)}var t,e;Wa.point=function(r,i){Wa.point=n,Gt(t=r,e=i)}}function Qt(){Wa.point=Gt}function ne(){function n(n,t){var e=n-r,u=t-i,o=Math.sqrt(e*e+u*u);qa+=o*(r+n)/2,Ta+=o*(i+t)/2,Ra+=o,o=i*n-r*t,Da+=o*(r+n),Pa+=o*(i+t),Ua+=3*o,Gt(r=n,i=t)}var t,e,r,i;Wa.point=function(u,o){Wa.point=n,Gt(t=r=u,e=i=o)},Wa.lineEnd=function(){n(t,e)}}function te(n){function t(t,e){n.moveTo(t+o,e),n.arc(t,e,o,0,Ho)}function e(t,e){n.moveTo(t,e),a.point=r}function r(t,e){n.lineTo(t,e)}function i(){a.point=t}function u(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=e},lineEnd:i,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=i,a.point=t},pointRadius:function(n){return o=n,a},result:b};return a}function ee(n){function t(n){return(a?r:e)(n)}function e(t){return ue(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){M=NaN,S.point=u,t.lineStart()}function u(e,r){var u=dt([e,r]),o=n(e,r);i(M,x,m,b,_,w,M=o[0],x=o[1],m=e,b=u[0],_=u[1],w=u[2],a,t),t.point(M,x)}function o(){S.point=e,t.lineEnd()}function l(){
46159r(),S.point=c,S.lineEnd=f}function c(n,t){u(s=n,h=t),p=M,g=x,v=b,d=_,y=w,S.point=u}function f(){i(M,x,m,b,_,w,p,g,s,v,d,y,a,t),S.lineEnd=o,o()}var s,h,p,g,v,d,y,m,M,x,b,_,w,S={point:e,lineStart:r,lineEnd:o,polygonStart:function(){t.polygonStart(),S.lineStart=l},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function i(t,e,r,a,l,c,f,s,h,p,g,v,d,y){var m=f-t,M=s-e,x=m*m+M*M;if(x>4*u&&d--){var b=a+p,_=l+g,w=c+v,S=Math.sqrt(b*b+_*_+w*w),k=Math.asin(w/=S),N=xo(xo(w)-1)<Uo||xo(r-h)<Uo?(r+h)/2:Math.atan2(_,b),E=n(N,k),A=E[0],C=E[1],z=A-t,L=C-e,q=M*z-m*L;(q*q/x>u||xo((m*z+M*L)/x-.5)>.3||o>a*p+l*g+c*v)&&(i(t,e,r,a,l,c,A,C,N,b/=S,_/=S,w,d,y),y.point(A,C),i(A,C,N,b,_,w,f,s,h,p,g,v,d,y))}}var u=.5,o=Math.cos(30*Yo),a=16;return t.precision=function(n){return arguments.length?(a=(u=n*n)>0&&16,t):Math.sqrt(u)},t}function re(n){var t=ee(function(t,e){return n([t*Zo,e*Zo])});return function(n){return le(t(n))}}function ie(n){this.stream=n}function ue(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function oe(n){return ae(function(){return n})()}function ae(n){function t(n){return n=a(n[0]*Yo,n[1]*Yo),[n[0]*h+l,c-n[1]*h]}function e(n){return n=a.invert((n[0]-l)/h,(c-n[1])/h),n&&[n[0]*Zo,n[1]*Zo]}function r(){a=Ct(o=se(y,M,x),u);var n=u(v,d);return l=p-n[0]*h,c=g+n[1]*h,i()}function i(){return f&&(f.valid=!1,f=null),t}var u,o,a,l,c,f,s=ee(function(n,t){return n=u(n,t),[n[0]*h+l,c-n[1]*h]}),h=150,p=480,g=250,v=0,d=0,y=0,M=0,x=0,b=Fa,_=m,w=null,S=null;return t.stream=function(n){return f&&(f.valid=!1),f=le(b(o,s(_(n)))),f.valid=!0,f},t.clipAngle=function(n){return arguments.length?(b=null==n?(w=n,Fa):It((w=+n)*Yo),i()):w},t.clipExtent=function(n){return arguments.length?(S=n,_=n?Zt(n[0][0],n[0][1],n[1][0],n[1][1]):m,i()):S},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(p=+n[0],g=+n[1],r()):[p,g]},t.center=function(n){return arguments.length?(v=n[0]%360*Yo,d=n[1]%360*Yo,r()):[v*Zo,d*Zo]},t.rotate=function(n){return arguments.length?(y=n[0]%360*Yo,M=n[1]%360*Yo,x=n.length>2?n[2]%360*Yo:0,r()):[y*Zo,M*Zo,x*Zo]},ao.rebind(t,s,"precision"),function(){return u=n.apply(this,arguments),t.invert=u.invert&&e,r()}}function le(n){return ue(n,function(t,e){n.point(t*Yo,e*Yo)})}function ce(n,t){return[n,t]}function fe(n,t){return[n>Fo?n-Ho:-Fo>n?n+Ho:n,t]}function se(n,t,e){return n?t||e?Ct(pe(n),ge(t,e)):pe(n):t||e?ge(t,e):fe}function he(n){return function(t,e){return t+=n,[t>Fo?t-Ho:-Fo>t?t+Ho:t,e]}}function pe(n){var t=he(n);return t.invert=he(-n),t}function ge(n,t){function e(n,t){var e=Math.cos(t),a=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),f=c*r+a*i;return[Math.atan2(l*u-f*o,a*r-c*i),tn(f*u+l*o)]}var r=Math.cos(n),i=Math.sin(n),u=Math.cos(t),o=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),a=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),f=c*u-l*o;return[Math.atan2(l*u+c*o,a*r+f*i),tn(f*r-a*i)]},e}function ve(n,t){var e=Math.cos(n),r=Math.sin(n);return function(i,u,o,a){var l=o*t;null!=i?(i=de(e,i),u=de(e,u),(o>0?u>i:i>u)&&(i+=o*Ho)):(i=n+o*Ho,u=n-.5*l);for(var c,f=i;o>0?f>u:u>f;f-=l)a.point((c=_t([e,-r*Math.cos(f),-r*Math.sin(f)]))[0],c[1])}}function de(n,t){var e=dt(t);e[0]-=n,bt(e);var r=nn(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-Uo)%(2*Math.PI)}function ye(n,t,e){var r=ao.range(n,t-Uo,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function me(n,t,e){var r=ao.range(n,t-Uo,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function Me(n){return n.source}function xe(n){return n.target}function be(n,t,e,r){var i=Math.cos(t),u=Math.sin(t),o=Math.cos(r),a=Math.sin(r),l=i*Math.cos(n),c=i*Math.sin(n),f=o*Math.cos(e),s=o*Math.sin(e),h=2*Math.asin(Math.sqrt(on(r-t)+i*o*on(e-n))),p=1/Math.sin(h),g=h?function(n){var t=Math.sin(n*=h)*p,e=Math.sin(h-n)*p,r=e*l+t*f,i=e*c+t*s,o=e*u+t*a;return[Math.atan2(i,r)*Zo,Math.atan2(o,Math.sqrt(r*r+i*i))*Zo]}:function(){return[n*Zo,t*Zo]};return g.distance=h,g}function _e(){function n(n,i){var u=Math.sin(i*=Yo),o=Math.cos(i),a=xo((n*=Yo)-t),l=Math.cos(a);Ja+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=r*u-e*o*l)*a),e*u+r*o*l),t=n,e=u,r=o}var t,e,r;Ga.point=function(i,u){t=i*Yo,e=Math.sin(u*=Yo),r=Math.cos(u),Ga.point=n},Ga.lineEnd=function(){Ga.point=Ga.lineEnd=b}}function we(n,t){function e(t,e){var r=Math.cos(t),i=Math.cos(e),u=n(r*i);return[u*i*Math.sin(t),u*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),i=t(r),u=Math.sin(i),o=Math.cos(i);return[Math.atan2(n*u,r*o),Math.asin(r&&e*u/r)]},e}function Se(n,t){function e(n,t){o>0?-Io+Uo>t&&(t=-Io+Uo):t>Io-Uo&&(t=Io-Uo);var e=o/Math.pow(i(t),u);return[e*Math.sin(u*n),o-e*Math.cos(u*n)]}var r=Math.cos(n),i=function(n){return Math.tan(Fo/4+n/2)},u=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(i(t)/i(n)),o=r*Math.pow(i(n),u)/u;return u?(e.invert=function(n,t){var e=o-t,r=K(u)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/u,2*Math.atan(Math.pow(o/r,1/u))-Io]},e):Ne}function ke(n,t){function e(n,t){var e=u-t;return[e*Math.sin(i*n),u-e*Math.cos(i*n)]}var r=Math.cos(n),i=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),u=r/i+n;return xo(i)<Uo?ce:(e.invert=function(n,t){var e=u-t;return[Math.atan2(n,e)/i,u-K(i)*Math.sqrt(n*n+e*e)]},e)}function Ne(n,t){return[n,Math.log(Math.tan(Fo/4+t/2))]}function Ee(n){var t,e=oe(n),r=e.scale,i=e.translate,u=e.clipExtent;return e.scale=function(){var n=r.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.translate=function(){var n=i.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.clipExtent=function(n){var o=u.apply(e,arguments);if(o===e){if(t=null==n){var a=Fo*r(),l=i();u([[l[0]-a,l[1]-a],[l[0]+a,l[1]+a]])}}else t&&(o=null);return o},e.clipExtent(null)}function Ae(n,t){return[Math.log(Math.tan(Fo/4+t/2)),-n]}function Ce(n){return n[0]}function ze(n){return n[1]}function Le(n){for(var t=n.length,e=[0,1],r=2,i=2;t>i;i++){for(;r>1&&Q(n[e[r-2]],n[e[r-1]],n[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}function qe(n,t){return n[0]-t[0]||n[1]-t[1]}function Te(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Re(n,t,e,r){var i=n[0],u=e[0],o=t[0]-i,a=r[0]-u,l=n[1],c=e[1],f=t[1]-l,s=r[1]-c,h=(a*(l-c)-s*(i-u))/(s*o-a*f);return[i+h*o,l+h*f]}function De(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function Pe(){rr(this),this.edge=this.site=this.circle=null}function Ue(n){var t=cl.pop()||new Pe;return t.site=n,t}function je(n){Be(n),ol.remove(n),cl.push(n),rr(n)}function Fe(n){var t=n.circle,e=t.x,r=t.cy,i={x:e,y:r},u=n.P,o=n.N,a=[n];je(n);for(var l=u;l.circle&&xo(e-l.circle.x)<Uo&&xo(r-l.circle.cy)<Uo;)u=l.P,a.unshift(l),je(l),l=u;a.unshift(l),Be(l);for(var c=o;c.circle&&xo(e-c.circle.x)<Uo&&xo(r-c.circle.cy)<Uo;)o=c.N,a.push(c),je(c),c=o;a.push(c),Be(c);var f,s=a.length;for(f=1;s>f;++f)c=a[f],l=a[f-1],nr(c.edge,l.site,c.site,i);l=a[0],c=a[s-1],c.edge=Ke(l.site,c.site,null,i),$e(l),$e(c)}function He(n){for(var t,e,r,i,u=n.x,o=n.y,a=ol._;a;)if(r=Oe(a,o)-u,r>Uo)a=a.L;else{if(i=u-Ie(a,o),!(i>Uo)){r>-Uo?(t=a.P,e=a):i>-Uo?(t=a,e=a.N):t=e=a;break}if(!a.R){t=a;break}a=a.R}var l=Ue(n);if(ol.insert(t,l),t||e){if(t===e)return Be(t),e=Ue(t.site),ol.insert(l,e),l.edge=e.edge=Ke(t.site,l.site),$e(t),void $e(e);if(!e)return void(l.edge=Ke(t.site,l.site));Be(t),Be(e);var c=t.site,f=c.x,s=c.y,h=n.x-f,p=n.y-s,g=e.site,v=g.x-f,d=g.y-s,y=2*(h*d-p*v),m=h*h+p*p,M=v*v+d*d,x={x:(d*m-p*M)/y+f,y:(h*M-v*m)/y+s};nr(e.edge,c,g,x),l.edge=Ke(c,n,null,x),e.edge=Ke(n,g,null,x),$e(t),$e(e)}}function Oe(n,t){var e=n.site,r=e.x,i=e.y,u=i-t;if(!u)return r;var o=n.P;if(!o)return-(1/0);e=o.site;var a=e.x,l=e.y,c=l-t;if(!c)return a;var f=a-r,s=1/u-1/c,h=f/c;return s?(-h+Math.sqrt(h*h-2*s*(f*f/(-2*c)-l+c/2+i-u/2)))/s+r:(r+a)/2}function Ie(n,t){var e=n.N;if(e)return Oe(e,t);var r=n.site;return r.y===t?r.x:1/0}function Ye(n){this.site=n,this.edges=[]}function Ze(n){for(var t,e,r,i,u,o,a,l,c,f,s=n[0][0],h=n[1][0],p=n[0][1],g=n[1][1],v=ul,d=v.length;d--;)if(u=v[d],u&&u.prepare())for(a=u.edges,l=a.length,o=0;l>o;)f=a[o].end(),r=f.x,i=f.y,c=a[++o%l].start(),t=c.x,e=c.y,(xo(r-t)>Uo||xo(i-e)>Uo)&&(a.splice(o,0,new tr(Qe(u.site,f,xo(r-s)<Uo&&g-i>Uo?{x:s,y:xo(t-s)<Uo?e:g}:xo(i-g)<Uo&&h-r>Uo?{x:xo(e-g)<Uo?t:h,y:g}:xo(r-h)<Uo&&i-p>Uo?{x:h,y:xo(t-h)<Uo?e:p}:xo(i-p)<Uo&&r-s>Uo?{x:xo(e-p)<Uo?t:s,y:p}:null),u.site,null)),++l)}function Ve(n,t){return t.angle-n.angle}function Xe(){rr(this),this.x=this.y=this.arc=this.site=this.cy=null}function $e(n){var t=n.P,e=n.N;if(t&&e){var r=t.site,i=n.site,u=e.site;if(r!==u){var o=i.x,a=i.y,l=r.x-o,c=r.y-a,f=u.x-o,s=u.y-a,h=2*(l*s-c*f);if(!(h>=-jo)){var p=l*l+c*c,g=f*f+s*s,v=(s*p-c*g)/h,d=(l*g-f*p)/h,s=d+a,y=fl.pop()||new Xe;y.arc=n,y.site=i,y.x=v+o,y.y=s+Math.sqrt(v*v+d*d),y.cy=s,n.circle=y;for(var m=null,M=ll._;M;)if(y.y<M.y||y.y===M.y&&y.x<=M.x){if(!M.L){m=M.P;break}M=M.L}else{if(!M.R){m=M;break}M=M.R}ll.insert(m,y),m||(al=y)}}}}function Be(n){var t=n.circle;t&&(t.P||(al=t.N),ll.remove(t),fl.push(t),rr(t),n.circle=null)}function We(n){for(var t,e=il,r=Yt(n[0][0],n[0][1],n[1][0],n[1][1]),i=e.length;i--;)t=e[i],(!Je(t,n)||!r(t)||xo(t.a.x-t.b.x)<Uo&&xo(t.a.y-t.b.y)<Uo)&&(t.a=t.b=null,e.splice(i,1))}function Je(n,t){var e=n.b;if(e)return!0;var r,i,u=n.a,o=t[0][0],a=t[1][0],l=t[0][1],c=t[1][1],f=n.l,s=n.r,h=f.x,p=f.y,g=s.x,v=s.y,d=(h+g)/2,y=(p+v)/2;if(v===p){if(o>d||d>=a)return;if(h>g){if(u){if(u.y>=c)return}else u={x:d,y:l};e={x:d,y:c}}else{if(u){if(u.y<l)return}else u={x:d,y:c};e={x:d,y:l}}}else if(r=(h-g)/(v-p),i=y-r*d,-1>r||r>1)if(h>g){if(u){if(u.y>=c)return}else u={x:(l-i)/r,y:l};e={x:(c-i)/r,y:c}}else{if(u){if(u.y<l)return}else u={x:(c-i)/r,y:c};e={x:(l-i)/r,y:l}}else if(v>p){if(u){if(u.x>=a)return}else u={x:o,y:r*o+i};e={x:a,y:r*a+i}}else{if(u){if(u.x<o)return}else u={x:a,y:r*a+i};e={x:o,y:r*o+i}}return n.a=u,n.b=e,!0}function Ge(n,t){this.l=n,this.r=t,this.a=this.b=null}function Ke(n,t,e,r){var i=new Ge(n,t);return il.push(i),e&&nr(i,n,t,e),r&&nr(i,t,n,r),ul[n.i].edges.push(new tr(i,n,t)),ul[t.i].edges.push(new tr(i,t,n)),i}function Qe(n,t,e){var r=new Ge(n,null);return r.a=t,r.b=e,il.push(r),r}function nr(n,t,e,r){n.a||n.b?n.l===e?n.b=r:n.a=r:(n.a=r,n.l=t,n.r=e)}function tr(n,t,e){var r=n.a,i=n.b;this.edge=n,this.site=t,this.angle=e?Math.atan2(e.y-t.y,e.x-t.x):n.l===t?Math.atan2(i.x-r.x,r.y-i.y):Math.atan2(r.x-i.x,i.y-r.y)}function er(){this._=null}function rr(n){n.U=n.C=n.L=n.R=n.P=n.N=null}function ir(n,t){var e=t,r=t.R,i=e.U;i?i.L===e?i.L=r:i.R=r:n._=r,r.U=i,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function ur(n,t){var e=t,r=t.L,i=e.U;i?i.L===e?i.L=r:i.R=r:n._=r,r.U=i,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function or(n){for(;n.L;)n=n.L;return n}function ar(n,t){var e,r,i,u=n.sort(lr).pop();for(il=[],ul=new Array(n.length),ol=new er,ll=new er;;)if(i=al,u&&(!i||u.y<i.y||u.y===i.y&&u.x<i.x))u.x===e&&u.y===r||(ul[u.i]=new Ye(u),He(u),e=u.x,r=u.y),u=n.pop();else{if(!i)break;Fe(i.arc)}t&&(We(t),Ze(t));var o={cells:ul,edges:il};return ol=ll=il=ul=null,o}function lr(n,t){return t.y-n.y||t.x-n.x}function cr(n,t,e){return(n.x-e.x)*(t.y-n.y)-(n.x-t.x)*(e.y-n.y)}function fr(n){return n.x}function sr(n){return n.y}function hr(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function pr(n,t,e,r,i,u){if(!n(t,e,r,i,u)){var o=.5*(e+i),a=.5*(r+u),l=t.nodes;l[0]&&pr(n,l[0],e,r,o,a),l[1]&&pr(n,l[1],o,r,i,a),l[2]&&pr(n,l[2],e,a,o,u),l[3]&&pr(n,l[3],o,a,i,u)}}function gr(n,t,e,r,i,u,o){var a,l=1/0;return function c(n,f,s,h,p){if(!(f>u||s>o||r>h||i>p)){if(g=n.point){var g,v=t-n.x,d=e-n.y,y=v*v+d*d;if(l>y){var m=Math.sqrt(l=y);r=t-m,i=e-m,u=t+m,o=e+m,a=g}}for(var M=n.nodes,x=.5*(f+h),b=.5*(s+p),_=t>=x,w=e>=b,S=w<<1|_,k=S+4;k>S;++S)if(n=M[3&S])switch(3&S){case 0:c(n,f,s,x,b);break;case 1:c(n,x,s,h,b);break;case 2:c(n,f,b,x,p);break;case 3:c(n,x,b,h,p)}}}(n,r,i,u,o),a}function vr(n,t){n=ao.rgb(n),t=ao.rgb(t);var e=n.r,r=n.g,i=n.b,u=t.r-e,o=t.g-r,a=t.b-i;return function(n){return"#"+bn(Math.round(e+u*n))+bn(Math.round(r+o*n))+bn(Math.round(i+a*n))}}function dr(n,t){var e,r={},i={};for(e in n)e in t?r[e]=Mr(n[e],t[e]):i[e]=n[e];for(e in t)e in n||(i[e]=t[e]);return function(n){for(e in r)i[e]=r[e](n);return i}}function yr(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}function mr(n,t){var e,r,i,u=hl.lastIndex=pl.lastIndex=0,o=-1,a=[],l=[];for(n+="",t+="";(e=hl.exec(n))&&(r=pl.exec(t));)(i=r.index)>u&&(i=t.slice(u,i),a[o]?a[o]+=i:a[++o]=i),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,l.push({i:o,x:yr(e,r)})),u=pl.lastIndex;return u<t.length&&(i=t.slice(u),a[o]?a[o]+=i:a[++o]=i),a.length<2?l[0]?(t=l[0].x,function(n){return t(n)+""}):function(){return t}:(t=l.length,function(n){for(var e,r=0;t>r;++r)a[(e=l[r]).i]=e.x(n);return a.join("")})}function Mr(n,t){for(var e,r=ao.interpolators.length;--r>=0&&!(e=ao.interpolators[r](n,t)););return e}function xr(n,t){var e,r=[],i=[],u=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;a>e;++e)r.push(Mr(n[e],t[e]));for(;u>e;++e)i[e]=n[e];for(;o>e;++e)i[e]=t[e];return function(n){for(e=0;a>e;++e)i[e]=r[e](n);return i}}function br(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function _r(n){return function(t){return 1-n(1-t)}}function wr(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function Sr(n){return n*n}function kr(n){return n*n*n}function Nr(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function Er(n){return function(t){return Math.pow(t,n)}}function Ar(n){return 1-Math.cos(n*Io)}function Cr(n){return Math.pow(2,10*(n-1))}function zr(n){return 1-Math.sqrt(1-n*n)}function Lr(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/Ho*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*Ho/t)}}function qr(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function Tr(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Rr(n,t){n=ao.hcl(n),t=ao.hcl(t);var e=n.h,r=n.c,i=n.l,u=t.h-e,o=t.c-r,a=t.l-i;return isNaN(o)&&(o=0,r=isNaN(r)?t.c:r),isNaN(u)?(u=0,e=isNaN(e)?t.h:e):u>180?u-=360:-180>u&&(u+=360),function(n){return sn(e+u*n,r+o*n,i+a*n)+""}}function Dr(n,t){n=ao.hsl(n),t=ao.hsl(t);var e=n.h,r=n.s,i=n.l,u=t.h-e,o=t.s-r,a=t.l-i;return isNaN(o)&&(o=0,r=isNaN(r)?t.s:r),isNaN(u)?(u=0,e=isNaN(e)?t.h:e):u>180?u-=360:-180>u&&(u+=360),function(n){return cn(e+u*n,r+o*n,i+a*n)+""}}function Pr(n,t){n=ao.lab(n),t=ao.lab(t);var e=n.l,r=n.a,i=n.b,u=t.l-e,o=t.a-r,a=t.b-i;return function(n){return pn(e+u*n,r+o*n,i+a*n)+""}}function Ur(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function jr(n){var t=[n.a,n.b],e=[n.c,n.d],r=Hr(t),i=Fr(t,e),u=Hr(Or(e,t,-i))||0;t[0]*e[1]<e[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,i*=-1),this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-e[0],e[1]))*Zo,this.translate=[n.e,n.f],this.scale=[r,u],this.skew=u?Math.atan2(i,u)*Zo:0}function Fr(n,t){return n[0]*t[0]+n[1]*t[1]}function Hr(n){var t=Math.sqrt(Fr(n,n));return t&&(n[0]/=t,n[1]/=t),t}function Or(n,t,e){return n[0]+=e*t[0],n[1]+=e*t[1],n}function Ir(n){return n.length?n.pop()+",":""}function Yr(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var i=e.push("translate(",null,",",null,")");r.push({i:i-4,x:yr(n[0],t[0])},{i:i-2,x:yr(n[1],t[1])})}else(t[0]||t[1])&&e.push("translate("+t+")")}function Zr(n,t,e,r){n!==t?(n-t>180?t+=360:t-n>180&&(n+=360),r.push({i:e.push(Ir(e)+"rotate(",null,")")-2,x:yr(n,t)})):t&&e.push(Ir(e)+"rotate("+t+")")}function Vr(n,t,e,r){n!==t?r.push({i:e.push(Ir(e)+"skewX(",null,")")-2,x:yr(n,t)}):t&&e.push(Ir(e)+"skewX("+t+")")}function Xr(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var i=e.push(Ir(e)+"scale(",null,",",null,")");r.push({i:i-4,x:yr(n[0],t[0])},{i:i-2,x:yr(n[1],t[1])})}else 1===t[0]&&1===t[1]||e.push(Ir(e)+"scale("+t+")")}function $r(n,t){var e=[],r=[];return n=ao.transform(n),t=ao.transform(t),Yr(n.translate,t.translate,e,r),Zr(n.rotate,t.rotate,e,r),Vr(n.skew,t.skew,e,r),Xr(n.scale,t.scale,e,r),n=t=null,function(n){for(var t,i=-1,u=r.length;++i<u;)e[(t=r[i]).i]=t.x(n);return e.join("")}}function Br(n,t){return t=(t-=n=+n)||1/t,function(e){return(e-n)/t}}function Wr(n,t){return t=(t-=n=+n)||1/t,function(e){return Math.max(0,Math.min(1,(e-n)/t))}}function Jr(n){for(var t=n.source,e=n.target,r=Kr(t,e),i=[t];t!==r;)t=t.parent,i.push(t);for(var u=i.length;e!==r;)i.splice(u,0,e),e=e.parent;return i}function Gr(n){for(var t=[],e=n.parent;null!=e;)t.push(n),n=e,e=e.parent;return t.push(n),t}function Kr(n,t){if(n===t)return n;for(var e=Gr(n),r=Gr(t),i=e.pop(),u=r.pop(),o=null;i===u;)o=i,i=e.pop(),u=r.pop();return o}function Qr(n){n.fixed|=2}function ni(n){n.fixed&=-7}function ti(n){n.fixed|=4,n.px=n.x,n.py=n.y}function ei(n){n.fixed&=-5}function ri(n,t,e){var r=0,i=0;if(n.charge=0,!n.leaf)for(var u,o=n.nodes,a=o.length,l=-1;++l<a;)u=o[l],null!=u&&(ri(u,t,e),n.charge+=u.charge,r+=u.charge*u.cx,i+=u.charge*u.cy);if(n.point){n.leaf||(n.point.x+=Math.random()-.5,n.point.y+=Math.random()-.5);var c=t*e[n.point.index];n.charge+=n.pointCharge=c,r+=c*n.point.x,i+=c*n.point.y}n.cx=r/n.charge,n.cy=i/n.charge}function ii(n,t){return ao.rebind(n,t,"sort","children","value"),n.nodes=n,n.links=fi,n}function ui(n,t){for(var e=[n];null!=(n=e.pop());)if(t(n),(i=n.children)&&(r=i.length))for(var r,i;--r>=0;)e.push(i[r])}function oi(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(u=n.children)&&(i=u.length))for(var i,u,o=-1;++o<i;)e.push(u[o]);for(;null!=(n=r.pop());)t(n)}function ai(n){return n.children}function li(n){return n.value}function ci(n,t){return t.value-n.value}function fi(n){return ao.merge(n.map(function(n){return(n.children||[]).map(function(t){return{source:n,target:t}})}))}function si(n){return n.x}function hi(n){return n.y}function pi(n,t,e){n.y0=t,n.y=e}function gi(n){return ao.range(n.length)}function vi(n){for(var t=-1,e=n[0].length,r=[];++t<e;)r[t]=0;return r}function di(n){for(var t,e=1,r=0,i=n[0][1],u=n.length;u>e;++e)(t=n[e][1])>i&&(r=e,i=t);return r}function yi(n){return n.reduce(mi,0)}function mi(n,t){return n+t[1]}function Mi(n,t){return xi(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function xi(n,t){for(var e=-1,r=+n[0],i=(n[1]-r)/t,u=[];++e<=t;)u[e]=i*e+r;return u}function bi(n){return[ao.min(n),ao.max(n)]}function _i(n,t){return n.value-t.value}function wi(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function Si(n,t){n._pack_next=t,t._pack_prev=n}function ki(n,t){var e=t.x-n.x,r=t.y-n.y,i=n.r+t.r;return.999*i*i>e*e+r*r}function Ni(n){function t(n){f=Math.min(n.x-n.r,f),s=Math.max(n.x+n.r,s),h=Math.min(n.y-n.r,h),p=Math.max(n.y+n.r,p)}if((e=n.children)&&(c=e.length)){var e,r,i,u,o,a,l,c,f=1/0,s=-(1/0),h=1/0,p=-(1/0);if(e.forEach(Ei),r=e[0],r.x=-r.r,r.y=0,t(r),c>1&&(i=e[1],i.x=i.r,i.y=0,t(i),c>2))for(u=e[2],zi(r,i,u),t(u),wi(r,u),r._pack_prev=u,wi(u,i),i=r._pack_next,o=3;c>o;o++){zi(r,i,u=e[o]);var g=0,v=1,d=1;for(a=i._pack_next;a!==i;a=a._pack_next,v++)if(ki(a,u)){g=1;break}if(1==g)for(l=r._pack_prev;l!==a._pack_prev&&!ki(l,u);l=l._pack_prev,d++);g?(d>v||v==d&&i.r<r.r?Si(r,i=a):Si(r=l,i),o--):(wi(r,u),i=u,t(u))}var y=(f+s)/2,m=(h+p)/2,M=0;for(o=0;c>o;o++)u=e[o],u.x-=y,u.y-=m,M=Math.max(M,u.r+Math.sqrt(u.x*u.x+u.y*u.y));n.r=M,e.forEach(Ai)}}function Ei(n){n._pack_next=n._pack_prev=n}function Ai(n){delete n._pack_next,delete n._pack_prev}function Ci(n,t,e,r){var i=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,i)for(var u=-1,o=i.length;++u<o;)Ci(i[u],t,e,r)}function zi(n,t,e){var r=n.r+e.r,i=t.x-n.x,u=t.y-n.y;if(r&&(i||u)){var o=t.r+e.r,a=i*i+u*u;o*=o,r*=r;var l=.5+(r-o)/(2*a),c=Math.sqrt(Math.max(0,2*o*(r+a)-(r-=a)*r-o*o))/(2*a);e.x=n.x+l*i+c*u,e.y=n.y+l*u-c*i}else e.x=n.x+r,e.y=n.y}function Li(n,t){return n.parent==t.parent?1:2}function qi(n){var t=n.children;return t.length?t[0]:n.t}function Ti(n){var t,e=n.children;return(t=e.length)?e[t-1]:n.t}function Ri(n,t,e){var r=e/(t.i-n.i);t.c-=r,t.s+=e,n.c+=r,t.z+=e,t.m+=e}function Di(n){for(var t,e=0,r=0,i=n.children,u=i.length;--u>=0;)t=i[u],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function Pi(n,t,e){return n.a.parent===t.parent?n.a:e}function Ui(n){return 1+ao.max(n,function(n){return n.y})}function ji(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Fi(n){var t=n.children;return t&&t.length?Fi(t[0]):n}function Hi(n){var t,e=n.children;return e&&(t=e.length)?Hi(e[t-1]):n}function Oi(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function Ii(n,t){var e=n.x+t[3],r=n.y+t[0],i=n.dx-t[1]-t[3],u=n.dy-t[0]-t[2];return 0>i&&(e+=i/2,i=0),0>u&&(r+=u/2,u=0),{x:e,y:r,dx:i,dy:u}}function Yi(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function Zi(n){return n.rangeExtent?n.rangeExtent():Yi(n.range())}function Vi(n,t,e,r){var i=e(n[0],n[1]),u=r(t[0],t[1]);return function(n){return u(i(n))}}function Xi(n,t){var e,r=0,i=n.length-1,u=n[r],o=n[i];return u>o&&(e=r,r=i,i=e,e=u,u=o,o=e),n[r]=t.floor(u),n[i]=t.ceil(o),n}function $i(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:Sl}function Bi(n,t,e,r){var i=[],u=[],o=0,a=Math.min(n.length,t.length)-1;for(n[a]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++o<=a;)i.push(e(n[o-1],n[o])),u.push(r(t[o-1],t[o]));return function(t){var e=ao.bisect(n,t,1,a)-1;return u[e](i[e](t))}}function Wi(n,t,e,r){function i(){var i=Math.min(n.length,t.length)>2?Bi:Vi,l=r?Wr:Br;return o=i(n,t,l,e),a=i(t,n,l,Mr),u}function u(n){return o(n)}var o,a;return u.invert=function(n){return a(n)},u.domain=function(t){return arguments.length?(n=t.map(Number),i()):n},u.range=function(n){return arguments.length?(t=n,i()):t},u.rangeRound=function(n){return u.range(n).interpolate(Ur)},u.clamp=function(n){return arguments.length?(r=n,i()):r},u.interpolate=function(n){return arguments.length?(e=n,i()):e},u.ticks=function(t){return Qi(n,t)},u.tickFormat=function(t,e){return nu(n,t,e)},u.nice=function(t){return Gi(n,t),i()},u.copy=function(){return Wi(n,t,e,r)},i()}function Ji(n,t){return ao.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Gi(n,t){return Xi(n,$i(Ki(n,t)[2])),Xi(n,$i(Ki(n,t)[2])),n}function Ki(n,t){null==t&&(t=10);var e=Yi(n),r=e[1]-e[0],i=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),u=t/r*i;return.15>=u?i*=10:.35>=u?i*=5:.75>=u&&(i*=2),e[0]=Math.ceil(e[0]/i)*i,e[1]=Math.floor(e[1]/i)*i+.5*i,e[2]=i,e}function Qi(n,t){return ao.range.apply(ao,Ki(n,t))}function nu(n,t,e){var r=Ki(n,t);if(e){var i=ha.exec(e);if(i.shift(),"s"===i[8]){var u=ao.formatPrefix(Math.max(xo(r[0]),xo(r[1])));return i[7]||(i[7]="."+tu(u.scale(r[2]))),i[8]="f",e=ao.format(i.join("")),function(n){return e(u.scale(n))+u.symbol}}i[7]||(i[7]="."+eu(i[8],r)),e=i.join("")}else e=",."+tu(r[2])+"f";return ao.format(e)}function tu(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function eu(n,t){var e=tu(t[2]);return n in kl?Math.abs(e-tu(Math.max(xo(t[0]),xo(t[1]))))+ +("e"!==n):e-2*("%"===n)}function ru(n,t,e,r){function i(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function u(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function o(t){return n(i(t))}return o.invert=function(t){return u(n.invert(t))},o.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(i)),o):r},o.base=function(e){return arguments.length?(t=+e,n.domain(r.map(i)),o):t},o.nice=function(){var t=Xi(r.map(i),e?Math:El);return n.domain(t),r=t.map(u),o},o.ticks=function(){var n=Yi(r),o=[],a=n[0],l=n[1],c=Math.floor(i(a)),f=Math.ceil(i(l)),s=t%1?2:t;if(isFinite(f-c)){if(e){for(;f>c;c++)for(var h=1;s>h;h++)o.push(u(c)*h);o.push(u(c))}else for(o.push(u(c));c++<f;)for(var h=s-1;h>0;h--)o.push(u(c)*h);for(c=0;o[c]<a;c++);for(f=o.length;o[f-1]>l;f--);o=o.slice(c,f)}return o},o.tickFormat=function(n,e){if(!arguments.length)return Nl;arguments.length<2?e=Nl:"function"!=typeof e&&(e=ao.format(e));var r=Math.max(1,t*n/o.ticks().length);return function(n){var o=n/u(Math.round(i(n)));return t-.5>o*t&&(o*=t),r>=o?e(n):""}},o.copy=function(){return ru(n.copy(),t,e,r)},Ji(o,n)}function iu(n,t,e){function r(t){return n(i(t))}var i=uu(t),u=uu(1/t);return r.invert=function(t){return u(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(i)),r):e},r.ticks=function(n){return Qi(e,n)},r.tickFormat=function(n,t){return nu(e,n,t)},r.nice=function(n){return r.domain(Gi(e,n))},r.exponent=function(o){return arguments.length?(i=uu(t=o),u=uu(1/t),n.domain(e.map(i)),r):t},r.copy=function(){return iu(n.copy(),t,e)},Ji(r,n)}function uu(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function ou(n,t){function e(e){return u[((i.get(e)||("range"===t.t?i.set(e,n.push(e)):NaN))-1)%u.length]}function r(t,e){return ao.range(n.length).map(function(n){return t+e*n})}var i,u,o;return e.domain=function(r){if(!arguments.length)return n;n=[],i=new c;for(var u,o=-1,a=r.length;++o<a;)i.has(u=r[o])||i.set(u,n.push(u));return e[t.t].apply(e,t.a)},e.range=function(n){return arguments.length?(u=n,o=0,t={t:"range",a:arguments},e):u},e.rangePoints=function(i,a){arguments.length<2&&(a=0);var l=i[0],c=i[1],f=n.length<2?(l=(l+c)/2,0):(c-l)/(n.length-1+a);return u=r(l+f*a/2,f),o=0,t={t:"rangePoints",a:arguments},e},e.rangeRoundPoints=function(i,a){arguments.length<2&&(a=0);var l=i[0],c=i[1],f=n.length<2?(l=c=Math.round((l+c)/2),0):(c-l)/(n.length-1+a)|0;return u=r(l+Math.round(f*a/2+(c-l-(n.length-1+a)*f)/2),f),o=0,t={t:"rangeRoundPoints",a:arguments},e},e.rangeBands=function(i,a,l){arguments.length<2&&(a=0),arguments.length<3&&(l=a);var c=i[1]<i[0],f=i[c-0],s=i[1-c],h=(s-f)/(n.length-a+2*l);return u=r(f+h*l,h),c&&u.reverse(),o=h*(1-a),t={t:"rangeBands",a:arguments},e},e.rangeRoundBands=function(i,a,l){arguments.length<2&&(a=0),arguments.length<3&&(l=a);var c=i[1]<i[0],f=i[c-0],s=i[1-c],h=Math.floor((s-f)/(n.length-a+2*l));return u=r(f+Math.round((s-f-(n.length-a)*h)/2),h),c&&u.reverse(),o=Math.round(h*(1-a)),t={t:"rangeRoundBands",a:arguments},e},e.rangeBand=function(){return o},e.rangeExtent=function(){return Yi(t.a[0])},e.copy=function(){return ou(n,t)},e.domain(n)}function au(n,t){function u(){var e=0,r=t.length;for(a=[];++e<r;)a[e-1]=ao.quantile(n,e/r);return o}function o(n){return isNaN(n=+n)?void 0:t[ao.bisect(a,n)]}var a;return o.domain=function(t){return arguments.length?(n=t.map(r).filter(i).sort(e),u()):n},o.range=function(n){return arguments.length?(t=n,u()):t},o.quantiles=function(){return a},o.invertExtent=function(e){return e=t.indexOf(e),0>e?[NaN,NaN]:[e>0?a[e-1]:n[0],e<a.length?a[e]:n[n.length-1]]},o.copy=function(){return au(n,t)},u()}function lu(n,t,e){function r(t){return e[Math.max(0,Math.min(o,Math.floor(u*(t-n))))]}function i(){return u=e.length/(t-n),o=e.length-1,r}var u,o;return r.domain=function(e){return arguments.length?(n=+e[0],t=+e[e.length-1],i()):[n,t]},r.range=function(n){return arguments.length?(e=n,i()):e},r.invertExtent=function(t){return t=e.indexOf(t),t=0>t?NaN:t/u+n,[t,t+1/u]},r.copy=function(){return lu(n,t,e)},i()}function cu(n,t){function e(e){return e>=e?t[ao.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return cu(n,t)},e}function fu(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return Qi(n,t)},t.tickFormat=function(t,e){return nu(n,t,e)},t.copy=function(){return fu(n)},t}function su(){return 0}function hu(n){return n.innerRadius}function pu(n){return n.outerRadius}function gu(n){return n.startAngle}function vu(n){return n.endAngle}function du(n){return n&&n.padAngle}function yu(n,t,e,r){return(n-e)*t-(t-r)*n>0?0:1}function mu(n,t,e,r,i){var u=n[0]-t[0],o=n[1]-t[1],a=(i?r:-r)/Math.sqrt(u*u+o*o),l=a*o,c=-a*u,f=n[0]+l,s=n[1]+c,h=t[0]+l,p=t[1]+c,g=(f+h)/2,v=(s+p)/2,d=h-f,y=p-s,m=d*d+y*y,M=e-r,x=f*p-h*s,b=(0>y?-1:1)*Math.sqrt(Math.max(0,M*M*m-x*x)),_=(x*y-d*b)/m,w=(-x*d-y*b)/m,S=(x*y+d*b)/m,k=(-x*d+y*b)/m,N=_-g,E=w-v,A=S-g,C=k-v;return N*N+E*E>A*A+C*C&&(_=S,w=k),[[_-l,w-c],[_*e/M,w*e/M]]}function Mu(n){function t(t){function o(){c.push("M",u(n(f),a))}for(var l,c=[],f=[],s=-1,h=t.length,p=En(e),g=En(r);++s<h;)i.call(this,l=t[s],s)?f.push([+p.call(this,l,s),+g.call(this,l,s)]):f.length&&(o(),f=[]);return f.length&&o(),c.length?c.join(""):null}var e=Ce,r=ze,i=zt,u=xu,o=u.key,a=.7;return t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t.defined=function(n){return arguments.length?(i=n,t):i},t.interpolate=function(n){return arguments.length?(o="function"==typeof n?u=n:(u=Tl.get(n)||xu).key,t):o},t.tension=function(n){return arguments.length?(a=n,t):a},t}function xu(n){return n.length>1?n.join("L"):n+"Z"}function bu(n){return n.join("L")+"Z"}function _u(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t<e;)i.push("H",(r[0]+(r=n[t])[0])/2,"V",r[1]);return e>1&&i.push("H",r[0]),i.join("")}function wu(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t<e;)i.push("V",(r=n[t])[1],"H",r[0]);return i.join("")}function Su(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t<e;)i.push("H",(r=n[t])[0],"V",r[1]);return i.join("")}function ku(n,t){return n.length<4?xu(n):n[1]+Au(n.slice(1,-1),Cu(n,t))}function Nu(n,t){return n.length<3?bu(n):n[0]+Au((n.push(n[0]),n),Cu([n[n.length-2]].concat(n,[n[1]]),t))}function Eu(n,t){return n.length<3?xu(n):n[0]+Au(n,Cu(n,t))}function Au(n,t){if(t.length<1||n.length!=t.length&&n.length!=t.length+2)return xu(n);var e=n.length!=t.length,r="",i=n[0],u=n[1],o=t[0],a=o,l=1;if(e&&(r+="Q"+(u[0]-2*o[0]/3)+","+(u[1]-2*o[1]/3)+","+u[0]+","+u[1],i=n[1],l=2),t.length>1){a=t[1],u=n[l],l++,r+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(u[0]-a[0])+","+(u[1]-a[1])+","+u[0]+","+u[1];for(var c=2;c<t.length;c++,l++)u=n[l],a=t[c],r+="S"+(u[0]-a[0])+","+(u[1]-a[1])+","+u[0]+","+u[1]}if(e){var f=n[l];r+="Q"+(u[0]+2*a[0]/3)+","+(u[1]+2*a[1]/3)+","+f[0]+","+f[1]}return r}function Cu(n,t){for(var e,r=[],i=(1-t)/2,u=n[0],o=n[1],a=1,l=n.length;++a<l;)e=u,u=o,o=n[a],r.push([i*(o[0]-e[0]),i*(o[1]-e[1])]);return r}function zu(n){if(n.length<3)return xu(n);var t=1,e=n.length,r=n[0],i=r[0],u=r[1],o=[i,i,i,(r=n[1])[0]],a=[u,u,u,r[1]],l=[i,",",u,"L",Ru(Pl,o),",",Ru(Pl,a)];for(n.push(n[e-1]);++t<=e;)r=n[t],o.shift(),o.push(r[0]),a.shift(),a.push(r[1]),Du(l,o,a);return n.pop(),l.push("L",r),l.join("")}function Lu(n){if(n.length<4)return xu(n);for(var t,e=[],r=-1,i=n.length,u=[0],o=[0];++r<3;)t=n[r],u.push(t[0]),o.push(t[1]);for(e.push(Ru(Pl,u)+","+Ru(Pl,o)),--r;++r<i;)t=n[r],u.shift(),u.push(t[0]),o.shift(),o.push(t[1]),Du(e,u,o);return e.join("")}function qu(n){for(var t,e,r=-1,i=n.length,u=i+4,o=[],a=[];++r<4;)e=n[r%i],o.push(e[0]),a.push(e[1]);for(t=[Ru(Pl,o),",",Ru(Pl,a)],--r;++r<u;)e=n[r%i],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),Du(t,o,a);return t.join("")}function Tu(n,t){var e=n.length-1;if(e)for(var r,i,u=n[0][0],o=n[0][1],a=n[e][0]-u,l=n[e][1]-o,c=-1;++c<=e;)r=n[c],i=c/e,r[0]=t*r[0]+(1-t)*(u+i*a),r[1]=t*r[1]+(1-t)*(o+i*l);return zu(n)}function Ru(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function Du(n,t,e){n.push("C",Ru(Rl,t),",",Ru(Rl,e),",",Ru(Dl,t),",",Ru(Dl,e),",",Ru(Pl,t),",",Ru(Pl,e))}function Pu(n,t){return(t[1]-n[1])/(t[0]-n[0])}function Uu(n){for(var t=0,e=n.length-1,r=[],i=n[0],u=n[1],o=r[0]=Pu(i,u);++t<e;)r[t]=(o+(o=Pu(i=u,u=n[t+1])))/2;return r[t]=o,r}function ju(n){for(var t,e,r,i,u=[],o=Uu(n),a=-1,l=n.length-1;++a<l;)t=Pu(n[a],n[a+1]),xo(t)<Uo?o[a]=o[a+1]=0:(e=o[a]/t,r=o[a+1]/t,i=e*e+r*r,i>9&&(i=3*t/Math.sqrt(i),o[a]=i*e,o[a+1]=i*r));for(a=-1;++a<=l;)i=(n[Math.min(l,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),u.push([i||0,o[a]*i||0]);return u}function Fu(n){return n.length<3?xu(n):n[0]+Au(n,ju(n))}function Hu(n){for(var t,e,r,i=-1,u=n.length;++i<u;)t=n[i],e=t[0],r=t[1]-Io,t[0]=e*Math.cos(r),t[1]=e*Math.sin(r);return n}function Ou(n){function t(t){function l(){v.push("M",a(n(y),s),f,c(n(d.reverse()),s),"Z")}for(var h,p,g,v=[],d=[],y=[],m=-1,M=t.length,x=En(e),b=En(i),_=e===r?function(){
46160return p}:En(r),w=i===u?function(){return g}:En(u);++m<M;)o.call(this,h=t[m],m)?(d.push([p=+x.call(this,h,m),g=+b.call(this,h,m)]),y.push([+_.call(this,h,m),+w.call(this,h,m)])):d.length&&(l(),d=[],y=[]);return d.length&&l(),v.length?v.join(""):null}var e=Ce,r=Ce,i=0,u=ze,o=zt,a=xu,l=a.key,c=a,f="L",s=.7;return t.x=function(n){return arguments.length?(e=r=n,t):r},t.x0=function(n){return arguments.length?(e=n,t):e},t.x1=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(i=u=n,t):u},t.y0=function(n){return arguments.length?(i=n,t):i},t.y1=function(n){return arguments.length?(u=n,t):u},t.defined=function(n){return arguments.length?(o=n,t):o},t.interpolate=function(n){return arguments.length?(l="function"==typeof n?a=n:(a=Tl.get(n)||xu).key,c=a.reverse||a,f=a.closed?"M":"L",t):l},t.tension=function(n){return arguments.length?(s=n,t):s},t}function Iu(n){return n.radius}function Yu(n){return[n.x,n.y]}function Zu(n){return function(){var t=n.apply(this,arguments),e=t[0],r=t[1]-Io;return[e*Math.cos(r),e*Math.sin(r)]}}function Vu(){return 64}function Xu(){return"circle"}function $u(n){var t=Math.sqrt(n/Fo);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Bu(n){return function(){var t,e,r;(t=this[n])&&(r=t[e=t.active])&&(r.timer.c=null,r.timer.t=NaN,--t.count?delete t[e]:delete this[n],t.active+=.5,r.event&&r.event.interrupt.call(this,this.__data__,r.index))}}function Wu(n,t,e){return ko(n,Yl),n.namespace=t,n.id=e,n}function Ju(n,t,e,r){var i=n.id,u=n.namespace;return Y(n,"function"==typeof e?function(n,o,a){n[u][i].tween.set(t,r(e.call(n,n.__data__,o,a)))}:(e=r(e),function(n){n[u][i].tween.set(t,e)}))}function Gu(n){return null==n&&(n=""),function(){this.textContent=n}}function Ku(n){return null==n?"__transition__":"__transition_"+n+"__"}function Qu(n,t,e,r,i){function u(n){var t=v.delay;return f.t=t+l,n>=t?o(n-t):void(f.c=o)}function o(e){var i=g.active,u=g[i];u&&(u.timer.c=null,u.timer.t=NaN,--g.count,delete g[i],u.event&&u.event.interrupt.call(n,n.__data__,u.index));for(var o in g)if(r>+o){var c=g[o];c.timer.c=null,c.timer.t=NaN,--g.count,delete g[o]}f.c=a,qn(function(){return f.c&&a(e||1)&&(f.c=null,f.t=NaN),1},0,l),g.active=r,v.event&&v.event.start.call(n,n.__data__,t),p=[],v.tween.forEach(function(e,r){(r=r.call(n,n.__data__,t))&&p.push(r)}),h=v.ease,s=v.duration}function a(i){for(var u=i/s,o=h(u),a=p.length;a>0;)p[--a].call(n,o);return u>=1?(v.event&&v.event.end.call(n,n.__data__,t),--g.count?delete g[r]:delete n[e],1):void 0}var l,f,s,h,p,g=n[e]||(n[e]={active:0,count:0}),v=g[r];v||(l=i.time,f=qn(u,0,l),v=g[r]={tween:new c,time:l,timer:f,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++g.count)}function no(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate("+(isFinite(r)?r:e(n))+",0)"})}function to(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate(0,"+(isFinite(r)?r:e(n))+")"})}function eo(n){return n.toISOString()}function ro(n,t,e){function r(t){return n(t)}function i(n,e){var r=n[1]-n[0],i=r/e,u=ao.bisect(Kl,i);return u==Kl.length?[t.year,Ki(n.map(function(n){return n/31536e6}),e)[2]]:u?t[i/Kl[u-1]<Kl[u]/i?u-1:u]:[tc,Ki(n,e)[2]]}return r.invert=function(t){return io(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain(t),r):n.domain().map(io)},r.nice=function(n,t){function e(e){return!isNaN(e)&&!n.range(e,io(+e+1),t).length}var u=r.domain(),o=Yi(u),a=null==n?i(o,10):"number"==typeof n&&i(o,n);return a&&(n=a[0],t=a[1]),r.domain(Xi(u,t>1?{floor:function(t){for(;e(t=n.floor(t));)t=io(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=io(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Yi(r.domain()),u=null==n?i(e,10):"number"==typeof n?i(e,n):!n.range&&[{range:n},t];return u&&(n=u[0],t=u[1]),n.range(e[0],io(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return ro(n.copy(),t,e)},Ji(r,n)}function io(n){return new Date(n)}function uo(n){return JSON.parse(n.responseText)}function oo(n){var t=fo.createRange();return t.selectNode(fo.body),t.createContextualFragment(n.responseText)}var ao={version:"3.5.17"},lo=[].slice,co=function(n){return lo.call(n)},fo=this.document;if(fo)try{co(fo.documentElement.childNodes)[0].nodeType}catch(so){co=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}if(Date.now||(Date.now=function(){return+new Date}),fo)try{fo.createElement("DIV").style.setProperty("opacity",0,"")}catch(ho){var po=this.Element.prototype,go=po.setAttribute,vo=po.setAttributeNS,yo=this.CSSStyleDeclaration.prototype,mo=yo.setProperty;po.setAttribute=function(n,t){go.call(this,n,t+"")},po.setAttributeNS=function(n,t,e){vo.call(this,n,t,e+"")},yo.setProperty=function(n,t,e){mo.call(this,n,t+"",e)}}ao.ascending=e,ao.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:NaN},ao.min=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i<u;)if(null!=(r=n[i])&&r>=r){e=r;break}for(;++i<u;)null!=(r=n[i])&&e>r&&(e=r)}else{for(;++i<u;)if(null!=(r=t.call(n,n[i],i))&&r>=r){e=r;break}for(;++i<u;)null!=(r=t.call(n,n[i],i))&&e>r&&(e=r)}return e},ao.max=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i<u;)if(null!=(r=n[i])&&r>=r){e=r;break}for(;++i<u;)null!=(r=n[i])&&r>e&&(e=r)}else{for(;++i<u;)if(null!=(r=t.call(n,n[i],i))&&r>=r){e=r;break}for(;++i<u;)null!=(r=t.call(n,n[i],i))&&r>e&&(e=r)}return e},ao.extent=function(n,t){var e,r,i,u=-1,o=n.length;if(1===arguments.length){for(;++u<o;)if(null!=(r=n[u])&&r>=r){e=i=r;break}for(;++u<o;)null!=(r=n[u])&&(e>r&&(e=r),r>i&&(i=r))}else{for(;++u<o;)if(null!=(r=t.call(n,n[u],u))&&r>=r){e=i=r;break}for(;++u<o;)null!=(r=t.call(n,n[u],u))&&(e>r&&(e=r),r>i&&(i=r))}return[e,i]},ao.sum=function(n,t){var e,r=0,u=n.length,o=-1;if(1===arguments.length)for(;++o<u;)i(e=+n[o])&&(r+=e);else for(;++o<u;)i(e=+t.call(n,n[o],o))&&(r+=e);return r},ao.mean=function(n,t){var e,u=0,o=n.length,a=-1,l=o;if(1===arguments.length)for(;++a<o;)i(e=r(n[a]))?u+=e:--l;else for(;++a<o;)i(e=r(t.call(n,n[a],a)))?u+=e:--l;return l?u/l:void 0},ao.quantile=function(n,t){var e=(n.length-1)*t+1,r=Math.floor(e),i=+n[r-1],u=e-r;return u?i+u*(n[r]-i):i},ao.median=function(n,t){var u,o=[],a=n.length,l=-1;if(1===arguments.length)for(;++l<a;)i(u=r(n[l]))&&o.push(u);else for(;++l<a;)i(u=r(t.call(n,n[l],l)))&&o.push(u);return o.length?ao.quantile(o.sort(e),.5):void 0},ao.variance=function(n,t){var e,u,o=n.length,a=0,l=0,c=-1,f=0;if(1===arguments.length)for(;++c<o;)i(e=r(n[c]))&&(u=e-a,a+=u/++f,l+=u*(e-a));else for(;++c<o;)i(e=r(t.call(n,n[c],c)))&&(u=e-a,a+=u/++f,l+=u*(e-a));return f>1?l/(f-1):void 0},ao.deviation=function(){var n=ao.variance.apply(this,arguments);return n?Math.sqrt(n):n};var Mo=u(e);ao.bisectLeft=Mo.left,ao.bisect=ao.bisectRight=Mo.right,ao.bisector=function(n){return u(1===n.length?function(t,r){return e(n(t),r)}:n)},ao.shuffle=function(n,t,e){(u=arguments.length)<3&&(e=n.length,2>u&&(t=0));for(var r,i,u=e-t;u;)i=Math.random()*u--|0,r=n[u+t],n[u+t]=n[i+t],n[i+t]=r;return n},ao.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},ao.pairs=function(n){for(var t,e=0,r=n.length-1,i=n[0],u=new Array(0>r?0:r);r>e;)u[e]=[t=i,i=n[++e]];return u},ao.transpose=function(n){if(!(i=n.length))return[];for(var t=-1,e=ao.min(n,o),r=new Array(e);++t<e;)for(var i,u=-1,a=r[t]=new Array(i);++u<i;)a[u]=n[u][t];return r},ao.zip=function(){return ao.transpose(arguments)},ao.keys=function(n){var t=[];for(var e in n)t.push(e);return t},ao.values=function(n){var t=[];for(var e in n)t.push(n[e]);return t},ao.entries=function(n){var t=[];for(var e in n)t.push({key:e,value:n[e]});return t},ao.merge=function(n){for(var t,e,r,i=n.length,u=-1,o=0;++u<i;)o+=n[u].length;for(e=new Array(o);--i>=0;)for(r=n[i],t=r.length;--t>=0;)e[--o]=r[t];return e};var xo=Math.abs;ao.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),(t-n)/e===1/0)throw new Error("infinite range");var r,i=[],u=a(xo(e)),o=-1;if(n*=u,t*=u,e*=u,0>e)for(;(r=n+e*++o)>t;)i.push(r/u);else for(;(r=n+e*++o)<t;)i.push(r/u);return i},ao.map=function(n,t){var e=new c;if(n instanceof c)n.forEach(function(n,t){e.set(n,t)});else if(Array.isArray(n)){var r,i=-1,u=n.length;if(1===arguments.length)for(;++i<u;)e.set(i,n[i]);else for(;++i<u;)e.set(t.call(n,r=n[i],i),r)}else for(var o in n)e.set(o,n[o]);return e};var bo="__proto__",_o="\x00";l(c,{has:h,get:function(n){return this._[f(n)]},set:function(n,t){return this._[f(n)]=t},remove:p,keys:g,values:function(){var n=[];for(var t in this._)n.push(this._[t]);return n},entries:function(){var n=[];for(var t in this._)n.push({key:s(t),value:this._[t]});return n},size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,s(t),this._[t])}}),ao.nest=function(){function n(t,o,a){if(a>=u.length)return r?r.call(i,o):e?o.sort(e):o;for(var l,f,s,h,p=-1,g=o.length,v=u[a++],d=new c;++p<g;)(h=d.get(l=v(f=o[p])))?h.push(f):d.set(l,[f]);return t?(f=t(),s=function(e,r){f.set(e,n(t,r,a))}):(f={},s=function(e,r){f[e]=n(t,r,a)}),d.forEach(s),f}function t(n,e){if(e>=u.length)return n;var r=[],i=o[e++];return n.forEach(function(n,i){r.push({key:n,values:t(i,e)})}),i?r.sort(function(n,t){return i(n.key,t.key)}):r}var e,r,i={},u=[],o=[];return i.map=function(t,e){return n(e,t,0)},i.entries=function(e){return t(n(ao.map,e,0),0)},i.key=function(n){return u.push(n),i},i.sortKeys=function(n){return o[u.length-1]=n,i},i.sortValues=function(n){return e=n,i},i.rollup=function(n){return r=n,i},i},ao.set=function(n){var t=new y;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},l(y,{has:h,add:function(n){return this._[f(n+="")]=!0,n},remove:p,values:g,size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,s(t))}}),ao.behavior={},ao.rebind=function(n,t){for(var e,r=1,i=arguments.length;++r<i;)n[e=arguments[r]]=M(n,t,t[e]);return n};var wo=["webkit","ms","moz","Moz","o","O"];ao.dispatch=function(){for(var n=new _,t=-1,e=arguments.length;++t<e;)n[arguments[t]]=w(n);return n},_.prototype.on=function(n,t){var e=n.indexOf("."),r="";if(e>=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},ao.event=null,ao.requote=function(n){return n.replace(So,"\\$&")};var So=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ko={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},No=function(n,t){return t.querySelector(n)},Eo=function(n,t){return t.querySelectorAll(n)},Ao=function(n,t){var e=n.matches||n[x(n,"matchesSelector")];return(Ao=function(n,t){return e.call(n,t)})(n,t)};"function"==typeof Sizzle&&(No=function(n,t){return Sizzle(n,t)[0]||null},Eo=Sizzle,Ao=Sizzle.matchesSelector),ao.selection=function(){return ao.select(fo.documentElement)};var Co=ao.selection.prototype=[];Co.select=function(n){var t,e,r,i,u=[];n=A(n);for(var o=-1,a=this.length;++o<a;){u.push(t=[]),t.parentNode=(r=this[o]).parentNode;for(var l=-1,c=r.length;++l<c;)(i=r[l])?(t.push(e=n.call(i,i.__data__,l,o)),e&&"__data__"in i&&(e.__data__=i.__data__)):t.push(null)}return E(u)},Co.selectAll=function(n){var t,e,r=[];n=C(n);for(var i=-1,u=this.length;++i<u;)for(var o=this[i],a=-1,l=o.length;++a<l;)(e=o[a])&&(r.push(t=co(n.call(e,e.__data__,a,i))),t.parentNode=e);return E(r)};var zo="http://www.w3.org/1999/xhtml",Lo={svg:"http://www.w3.org/2000/svg",xhtml:zo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};ao.ns={prefix:Lo,qualify:function(n){var t=n.indexOf(":"),e=n;return t>=0&&"xmlns"!==(e=n.slice(0,t))&&(n=n.slice(t+1)),Lo.hasOwnProperty(e)?{space:Lo[e],local:n}:n}},Co.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=ao.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(z(t,n[t]));return this}return this.each(z(n,t))},Co.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=T(n)).length,i=-1;if(t=e.classList){for(;++i<r;)if(!t.contains(n[i]))return!1}else for(t=e.getAttribute("class");++i<r;)if(!q(n[i]).test(t))return!1;return!0}for(t in n)this.each(R(t,n[t]));return this}return this.each(R(n,t))},Co.style=function(n,e,r){var i=arguments.length;if(3>i){if("string"!=typeof n){2>i&&(e="");for(r in n)this.each(P(r,n[r],e));return this}if(2>i){var u=this.node();return t(u).getComputedStyle(u,null).getPropertyValue(n)}r=""}return this.each(P(n,e,r))},Co.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(U(t,n[t]));return this}return this.each(U(n,t))},Co.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},Co.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},Co.append=function(n){return n=j(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},Co.insert=function(n,t){return n=j(n),t=A(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},Co.remove=function(){return this.each(F)},Co.data=function(n,t){function e(n,e){var r,i,u,o=n.length,s=e.length,h=Math.min(o,s),p=new Array(s),g=new Array(s),v=new Array(o);if(t){var d,y=new c,m=new Array(o);for(r=-1;++r<o;)(i=n[r])&&(y.has(d=t.call(i,i.__data__,r))?v[r]=i:y.set(d,i),m[r]=d);for(r=-1;++r<s;)(i=y.get(d=t.call(e,u=e[r],r)))?i!==!0&&(p[r]=i,i.__data__=u):g[r]=H(u),y.set(d,!0);for(r=-1;++r<o;)r in m&&y.get(m[r])!==!0&&(v[r]=n[r])}else{for(r=-1;++r<h;)i=n[r],u=e[r],i?(i.__data__=u,p[r]=i):g[r]=H(u);for(;s>r;++r)g[r]=H(e[r]);for(;o>r;++r)v[r]=n[r]}g.update=p,g.parentNode=p.parentNode=v.parentNode=n.parentNode,a.push(g),l.push(p),f.push(v)}var r,i,u=-1,o=this.length;if(!arguments.length){for(n=new Array(o=(r=this[0]).length);++u<o;)(i=r[u])&&(n[u]=i.__data__);return n}var a=Z([]),l=E([]),f=E([]);if("function"==typeof n)for(;++u<o;)e(r=this[u],n.call(r,r.parentNode.__data__,u));else for(;++u<o;)e(r=this[u],n);return l.enter=function(){return a},l.exit=function(){return f},l},Co.datum=function(n){return arguments.length?this.property("__data__",n):this.property("__data__")},Co.filter=function(n){var t,e,r,i=[];"function"!=typeof n&&(n=O(n));for(var u=0,o=this.length;o>u;u++){i.push(t=[]),t.parentNode=(e=this[u]).parentNode;for(var a=0,l=e.length;l>a;a++)(r=e[a])&&n.call(r,r.__data__,a,u)&&t.push(r)}return E(i)},Co.order=function(){for(var n=-1,t=this.length;++n<t;)for(var e,r=this[n],i=r.length-1,u=r[i];--i>=0;)(e=r[i])&&(u&&u!==e.nextSibling&&u.parentNode.insertBefore(e,u),u=e);return this},Co.sort=function(n){n=I.apply(this,arguments);for(var t=-1,e=this.length;++t<e;)this[t].sort(n);return this.order()},Co.each=function(n){return Y(this,function(t,e,r){n.call(t,t.__data__,e,r)})},Co.call=function(n){var t=co(arguments);return n.apply(t[0]=this,t),this},Co.empty=function(){return!this.node()},Co.node=function(){for(var n=0,t=this.length;t>n;n++)for(var e=this[n],r=0,i=e.length;i>r;r++){var u=e[r];if(u)return u}return null},Co.size=function(){var n=0;return Y(this,function(){++n}),n};var qo=[];ao.selection.enter=Z,ao.selection.enter.prototype=qo,qo.append=Co.append,qo.empty=Co.empty,qo.node=Co.node,qo.call=Co.call,qo.size=Co.size,qo.select=function(n){for(var t,e,r,i,u,o=[],a=-1,l=this.length;++a<l;){r=(i=this[a]).update,o.push(t=[]),t.parentNode=i.parentNode;for(var c=-1,f=i.length;++c<f;)(u=i[c])?(t.push(r[c]=e=n.call(i.parentNode,u.__data__,c,a)),e.__data__=u.__data__):t.push(null)}return E(o)},qo.insert=function(n,t){return arguments.length<2&&(t=V(this)),Co.insert.call(this,n,t)},ao.select=function(t){var e;return"string"==typeof t?(e=[No(t,fo)],e.parentNode=fo.documentElement):(e=[t],e.parentNode=n(t)),E([e])},ao.selectAll=function(n){var t;return"string"==typeof n?(t=co(Eo(n,fo)),t.parentNode=fo.documentElement):(t=co(n),t.parentNode=null),E([t])},Co.on=function(n,t,e){var r=arguments.length;if(3>r){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(X(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(X(n,t,e))};var To=ao.map({mouseenter:"mouseover",mouseleave:"mouseout"});fo&&To.forEach(function(n){"on"+n in fo&&To.remove(n)});var Ro,Do=0;ao.mouse=function(n){return J(n,k())};var Po=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;ao.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=k().changedTouches),t)for(var r,i=0,u=t.length;u>i;++i)if((r=t[i]).identifier===e)return J(n,r)},ao.behavior.drag=function(){function n(){this.on("mousedown.drag",u).on("touchstart.drag",o)}function e(n,t,e,u,o){return function(){function a(){var n,e,r=t(h,v);r&&(n=r[0]-M[0],e=r[1]-M[1],g|=n|e,M=r,p({type:"drag",x:r[0]+c[0],y:r[1]+c[1],dx:n,dy:e}))}function l(){t(h,v)&&(y.on(u+d,null).on(o+d,null),m(g),p({type:"dragend"}))}var c,f=this,s=ao.event.target.correspondingElement||ao.event.target,h=f.parentNode,p=r.of(f,arguments),g=0,v=n(),d=".drag"+(null==v?"":"-"+v),y=ao.select(e(s)).on(u+d,a).on(o+d,l),m=W(s),M=t(h,v);i?(c=i.apply(f,arguments),c=[c.x-M[0],c.y-M[1]]):c=[0,0],p({type:"dragstart"})}}var r=N(n,"drag","dragstart","dragend"),i=null,u=e(b,ao.mouse,t,"mousemove","mouseup"),o=e(G,ao.touch,m,"touchmove","touchend");return n.origin=function(t){return arguments.length?(i=t,n):i},ao.rebind(n,r,"on")},ao.touches=function(n,t){return arguments.length<2&&(t=k().touches),t?co(t).map(function(t){var e=J(n,t);return e.identifier=t.identifier,e}):[]};var Uo=1e-6,jo=Uo*Uo,Fo=Math.PI,Ho=2*Fo,Oo=Ho-Uo,Io=Fo/2,Yo=Fo/180,Zo=180/Fo,Vo=Math.SQRT2,Xo=2,$o=4;ao.interpolateZoom=function(n,t){var e,r,i=n[0],u=n[1],o=n[2],a=t[0],l=t[1],c=t[2],f=a-i,s=l-u,h=f*f+s*s;if(jo>h)r=Math.log(c/o)/Vo,e=function(n){return[i+n*f,u+n*s,o*Math.exp(Vo*n*r)]};else{var p=Math.sqrt(h),g=(c*c-o*o+$o*h)/(2*o*Xo*p),v=(c*c-o*o-$o*h)/(2*c*Xo*p),d=Math.log(Math.sqrt(g*g+1)-g),y=Math.log(Math.sqrt(v*v+1)-v);r=(y-d)/Vo,e=function(n){var t=n*r,e=rn(d),a=o/(Xo*p)*(e*un(Vo*t+d)-en(d));return[i+a*f,u+a*s,o*e/rn(Vo*t+d)]}}return e.duration=1e3*r,e},ao.behavior.zoom=function(){function n(n){n.on(L,s).on(Wo+".zoom",p).on("dblclick.zoom",g).on(R,h)}function e(n){return[(n[0]-k.x)/k.k,(n[1]-k.y)/k.k]}function r(n){return[n[0]*k.k+k.x,n[1]*k.k+k.y]}function i(n){k.k=Math.max(A[0],Math.min(A[1],n))}function u(n,t){t=r(t),k.x+=n[0]-t[0],k.y+=n[1]-t[1]}function o(t,e,r,o){t.__chart__={x:k.x,y:k.y,k:k.k},i(Math.pow(2,o)),u(d=e,r),t=ao.select(t),C>0&&(t=t.transition().duration(C)),t.call(n.event)}function a(){b&&b.domain(x.range().map(function(n){return(n-k.x)/k.k}).map(x.invert)),w&&w.domain(_.range().map(function(n){return(n-k.y)/k.k}).map(_.invert))}function l(n){z++||n({type:"zoomstart"})}function c(n){a(),n({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function f(n){--z||(n({type:"zoomend"}),d=null)}function s(){function n(){a=1,u(ao.mouse(i),h),c(o)}function r(){s.on(q,null).on(T,null),p(a),f(o)}var i=this,o=D.of(i,arguments),a=0,s=ao.select(t(i)).on(q,n).on(T,r),h=e(ao.mouse(i)),p=W(i);Il.call(i),l(o)}function h(){function n(){var n=ao.touches(g);return p=k.k,n.forEach(function(n){n.identifier in d&&(d[n.identifier]=e(n))}),n}function t(){var t=ao.event.target;ao.select(t).on(x,r).on(b,a),_.push(t);for(var e=ao.event.changedTouches,i=0,u=e.length;u>i;++i)d[e[i].identifier]=null;var l=n(),c=Date.now();if(1===l.length){if(500>c-M){var f=l[0];o(g,f,d[f.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),S()}M=c}else if(l.length>1){var f=l[0],s=l[1],h=f[0]-s[0],p=f[1]-s[1];y=h*h+p*p}}function r(){var n,t,e,r,o=ao.touches(g);Il.call(g);for(var a=0,l=o.length;l>a;++a,r=null)if(e=o[a],r=d[e.identifier]){if(t)break;n=e,t=r}if(r){var f=(f=e[0]-n[0])*f+(f=e[1]-n[1])*f,s=y&&Math.sqrt(f/y);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+r[0])/2,(t[1]+r[1])/2],i(s*p)}M=null,u(n,t),c(v)}function a(){if(ao.event.touches.length){for(var t=ao.event.changedTouches,e=0,r=t.length;r>e;++e)delete d[t[e].identifier];for(var i in d)return void n()}ao.selectAll(_).on(m,null),w.on(L,s).on(R,h),N(),f(v)}var p,g=this,v=D.of(g,arguments),d={},y=0,m=".zoom-"+ao.event.changedTouches[0].identifier,x="touchmove"+m,b="touchend"+m,_=[],w=ao.select(g),N=W(g);t(),l(v),w.on(L,null).on(R,t)}function p(){var n=D.of(this,arguments);m?clearTimeout(m):(Il.call(this),v=e(d=y||ao.mouse(this)),l(n)),m=setTimeout(function(){m=null,f(n)},50),S(),i(Math.pow(2,.002*Bo())*k.k),u(d,v),c(n)}function g(){var n=ao.mouse(this),t=Math.log(k.k)/Math.LN2;o(this,n,e(n),ao.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}var v,d,y,m,M,x,b,_,w,k={x:0,y:0,k:1},E=[960,500],A=Jo,C=250,z=0,L="mousedown.zoom",q="mousemove.zoom",T="mouseup.zoom",R="touchstart.zoom",D=N(n,"zoomstart","zoom","zoomend");return Wo||(Wo="onwheel"in fo?(Bo=function(){return-ao.event.deltaY*(ao.event.deltaMode?120:1)},"wheel"):"onmousewheel"in fo?(Bo=function(){return ao.event.wheelDelta},"mousewheel"):(Bo=function(){return-ao.event.detail},"MozMousePixelScroll")),n.event=function(n){n.each(function(){var n=D.of(this,arguments),t=k;Hl?ao.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},l(n)}).tween("zoom:zoom",function(){var e=E[0],r=E[1],i=d?d[0]:e/2,u=d?d[1]:r/2,o=ao.interpolateZoom([(i-k.x)/k.k,(u-k.y)/k.k,e/k.k],[(i-t.x)/t.k,(u-t.y)/t.k,e/t.k]);return function(t){var r=o(t),a=e/r[2];this.__chart__=k={x:i-r[0]*a,y:u-r[1]*a,k:a},c(n)}}).each("interrupt.zoom",function(){f(n)}).each("end.zoom",function(){f(n)}):(this.__chart__=k,l(n),c(n),f(n))})},n.translate=function(t){return arguments.length?(k={x:+t[0],y:+t[1],k:k.k},a(),n):[k.x,k.y]},n.scale=function(t){return arguments.length?(k={x:k.x,y:k.y,k:null},i(+t),a(),n):k.k},n.scaleExtent=function(t){return arguments.length?(A=null==t?Jo:[+t[0],+t[1]],n):A},n.center=function(t){return arguments.length?(y=t&&[+t[0],+t[1]],n):y},n.size=function(t){return arguments.length?(E=t&&[+t[0],+t[1]],n):E},n.duration=function(t){return arguments.length?(C=+t,n):C},n.x=function(t){return arguments.length?(b=t,x=t.copy(),k={x:0,y:0,k:1},n):b},n.y=function(t){return arguments.length?(w=t,_=t.copy(),k={x:0,y:0,k:1},n):w},ao.rebind(n,D,"on")};var Bo,Wo,Jo=[0,1/0];ao.color=an,an.prototype.toString=function(){return this.rgb()+""},ao.hsl=ln;var Go=ln.prototype=new an;Go.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,this.l/n)},Go.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,n*this.l)},Go.rgb=function(){return cn(this.h,this.s,this.l)},ao.hcl=fn;var Ko=fn.prototype=new an;Ko.brighter=function(n){return new fn(this.h,this.c,Math.min(100,this.l+Qo*(arguments.length?n:1)))},Ko.darker=function(n){return new fn(this.h,this.c,Math.max(0,this.l-Qo*(arguments.length?n:1)))},Ko.rgb=function(){return sn(this.h,this.c,this.l).rgb()},ao.lab=hn;var Qo=18,na=.95047,ta=1,ea=1.08883,ra=hn.prototype=new an;ra.brighter=function(n){return new hn(Math.min(100,this.l+Qo*(arguments.length?n:1)),this.a,this.b)},ra.darker=function(n){return new hn(Math.max(0,this.l-Qo*(arguments.length?n:1)),this.a,this.b)},ra.rgb=function(){return pn(this.l,this.a,this.b)},ao.rgb=mn;var ia=mn.prototype=new an;ia.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,i=30;return t||e||r?(t&&i>t&&(t=i),e&&i>e&&(e=i),r&&i>r&&(r=i),new mn(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new mn(i,i,i)},ia.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new mn(n*this.r,n*this.g,n*this.b)},ia.hsl=function(){return wn(this.r,this.g,this.b)},ia.toString=function(){return"#"+bn(this.r)+bn(this.g)+bn(this.b)};var ua=ao.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});ua.forEach(function(n,t){ua.set(n,Mn(t))}),ao.functor=En,ao.xhr=An(m),ao.dsv=function(n,t){function e(n,e,u){arguments.length<3&&(u=e,e=null);var o=Cn(n,t,null==e?r:i(e),u);return o.row=function(n){return arguments.length?o.response(null==(e=n)?r:i(n)):e},o}function r(n){return e.parse(n.responseText)}function i(n){return function(t){return e.parse(t.responseText,n)}}function u(t){return t.map(o).join(n)}function o(n){return a.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var a=new RegExp('["'+n+"\n]"),l=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var i=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(i(n),e)}:i})},e.parseRows=function(n,t){function e(){if(f>=c)return o;if(i)return i=!1,u;var t=f;if(34===n.charCodeAt(t)){for(var e=t;e++<c;)if(34===n.charCodeAt(e)){if(34!==n.charCodeAt(e+1))break;++e}f=e+2;var r=n.charCodeAt(e+1);return 13===r?(i=!0,10===n.charCodeAt(e+2)&&++f):10===r&&(i=!0),n.slice(t+1,e).replace(/""/g,'"')}for(;c>f;){var r=n.charCodeAt(f++),a=1;if(10===r)i=!0;else if(13===r)i=!0,10===n.charCodeAt(f)&&(++f,++a);else if(r!==l)continue;return n.slice(t,f-a)}return n.slice(t)}for(var r,i,u={},o={},a=[],c=n.length,f=0,s=0;(r=e())!==o;){for(var h=[];r!==u&&r!==o;)h.push(r),r=e();t&&null==(h=t(h,s++))||a.push(h)}return a},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new y,i=[];return t.forEach(function(n){for(var t in n)r.has(t)||i.push(r.add(t))}),[i.map(o).join(n)].concat(t.map(function(t){return i.map(function(n){return o(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(u).join("\n")},e},ao.csv=ao.dsv(",","text/csv"),ao.tsv=ao.dsv("	","text/tab-separated-values");var oa,aa,la,ca,fa=this[x(this,"requestAnimationFrame")]||function(n){setTimeout(n,17)};ao.timer=function(){qn.apply(this,arguments)},ao.timer.flush=function(){Rn(),Dn()},ao.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var sa=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Un);ao.formatPrefix=function(n,t){var e=0;return(n=+n)&&(0>n&&(n*=-1),t&&(n=ao.round(n,Pn(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),sa[8+e/3]};var ha=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,pa=ao.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=ao.round(n,Pn(n,t))).toFixed(Math.max(0,Math.min(20,Pn(n*(1+1e-15),t))))}}),ga=ao.time={},va=Date;Hn.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){da.setUTCDate.apply(this._,arguments)},setDay:function(){da.setUTCDay.apply(this._,arguments)},setFullYear:function(){da.setUTCFullYear.apply(this._,arguments)},setHours:function(){da.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){da.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){da.setUTCMinutes.apply(this._,arguments)},setMonth:function(){da.setUTCMonth.apply(this._,arguments)},setSeconds:function(){da.setUTCSeconds.apply(this._,arguments)},setTime:function(){da.setTime.apply(this._,arguments)}};var da=Date.prototype;ga.year=On(function(n){return n=ga.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),ga.years=ga.year.range,ga.years.utc=ga.year.utc.range,ga.day=On(function(n){var t=new va(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),ga.days=ga.day.range,ga.days.utc=ga.day.utc.range,ga.dayOfYear=function(n){var t=ga.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=ga[n]=On(function(n){return(n=ga.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=ga.year(n).getDay();return Math.floor((ga.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});ga[n+"s"]=e.range,ga[n+"s"].utc=e.utc.range,ga[n+"OfYear"]=function(n){var e=ga.year(n).getDay();return Math.floor((ga.dayOfYear(n)+(e+t)%7)/7)}}),ga.week=ga.sunday,ga.weeks=ga.sunday.range,ga.weeks.utc=ga.sunday.utc.range,ga.weekOfYear=ga.sundayOfYear;var ya={"-":"",_:" ",0:"0"},ma=/^\s*\d+/,Ma=/^%/;ao.locale=function(n){return{numberFormat:jn(n),timeFormat:Yn(n)}};var xa=ao.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
46161shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});ao.format=xa.numberFormat,ao.geo={},ft.prototype={s:0,t:0,add:function(n){st(n,this.t,ba),st(ba.s,this.s,this),this.s?this.t+=ba.t:this.s=ba.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ba=new ft;ao.geo.stream=function(n,t){n&&_a.hasOwnProperty(n.type)?_a[n.type](n,t):ht(n,t)};var _a={Feature:function(n,t){ht(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,i=e.length;++r<i;)ht(e[r].geometry,t)}},wa={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)n=e[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){pt(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)pt(e[r],t,0)},Polygon:function(n,t){gt(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)gt(e[r],t)},GeometryCollection:function(n,t){for(var e=n.geometries,r=-1,i=e.length;++r<i;)ht(e[r],t)}};ao.geo.area=function(n){return Sa=0,ao.geo.stream(n,Na),Sa};var Sa,ka=new ft,Na={sphere:function(){Sa+=4*Fo},point:b,lineStart:b,lineEnd:b,polygonStart:function(){ka.reset(),Na.lineStart=vt},polygonEnd:function(){var n=2*ka;Sa+=0>n?4*Fo+n:n,Na.lineStart=Na.lineEnd=Na.point=b}};ao.geo.bounds=function(){function n(n,t){M.push(x=[f=n,h=n]),s>t&&(s=t),t>p&&(p=t)}function t(t,e){var r=dt([t*Yo,e*Yo]);if(y){var i=mt(y,r),u=[i[1],-i[0],0],o=mt(u,i);bt(o),o=_t(o);var l=t-g,c=l>0?1:-1,v=o[0]*Zo*c,d=xo(l)>180;if(d^(v>c*g&&c*t>v)){var m=o[1]*Zo;m>p&&(p=m)}else if(v=(v+360)%360-180,d^(v>c*g&&c*t>v)){var m=-o[1]*Zo;s>m&&(s=m)}else s>e&&(s=e),e>p&&(p=e);d?g>t?a(f,t)>a(f,h)&&(h=t):a(t,h)>a(f,h)&&(f=t):h>=f?(f>t&&(f=t),t>h&&(h=t)):t>g?a(f,t)>a(f,h)&&(h=t):a(t,h)>a(f,h)&&(f=t)}else n(t,e);y=r,g=t}function e(){b.point=t}function r(){x[0]=f,x[1]=h,b.point=n,y=null}function i(n,e){if(y){var r=n-g;m+=xo(r)>180?r+(r>0?360:-360):r}else v=n,d=e;Na.point(n,e),t(n,e)}function u(){Na.lineStart()}function o(){i(v,d),Na.lineEnd(),xo(m)>Uo&&(f=-(h=180)),x[0]=f,x[1]=h,y=null}function a(n,t){return(t-=n)<0?t+360:t}function l(n,t){return n[0]-t[0]}function c(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}var f,s,h,p,g,v,d,y,m,M,x,b={point:n,lineStart:e,lineEnd:r,polygonStart:function(){b.point=i,b.lineStart=u,b.lineEnd=o,m=0,Na.polygonStart()},polygonEnd:function(){Na.polygonEnd(),b.point=n,b.lineStart=e,b.lineEnd=r,0>ka?(f=-(h=180),s=-(p=90)):m>Uo?p=90:-Uo>m&&(s=-90),x[0]=f,x[1]=h}};return function(n){p=h=-(f=s=1/0),M=[],ao.geo.stream(n,b);var t=M.length;if(t){M.sort(l);for(var e,r=1,i=M[0],u=[i];t>r;++r)e=M[r],c(e[0],i)||c(e[1],i)?(a(i[0],e[1])>a(i[0],i[1])&&(i[1]=e[1]),a(e[0],i[1])>a(i[0],i[1])&&(i[0]=e[0])):u.push(i=e);for(var o,e,g=-(1/0),t=u.length-1,r=0,i=u[t];t>=r;i=e,++r)e=u[r],(o=a(i[1],e[0]))>g&&(g=o,f=e[0],h=i[1])}return M=x=null,f===1/0||s===1/0?[[NaN,NaN],[NaN,NaN]]:[[f,s],[h,p]]}}(),ao.geo.centroid=function(n){Ea=Aa=Ca=za=La=qa=Ta=Ra=Da=Pa=Ua=0,ao.geo.stream(n,ja);var t=Da,e=Pa,r=Ua,i=t*t+e*e+r*r;return jo>i&&(t=qa,e=Ta,r=Ra,Uo>Aa&&(t=Ca,e=za,r=La),i=t*t+e*e+r*r,jo>i)?[NaN,NaN]:[Math.atan2(e,t)*Zo,tn(r/Math.sqrt(i))*Zo]};var Ea,Aa,Ca,za,La,qa,Ta,Ra,Da,Pa,Ua,ja={sphere:b,point:St,lineStart:Nt,lineEnd:Et,polygonStart:function(){ja.lineStart=At},polygonEnd:function(){ja.lineStart=Nt}},Fa=Rt(zt,jt,Ht,[-Fo,-Fo/2]),Ha=1e9;ao.geo.clipExtent=function(){var n,t,e,r,i,u,o={stream:function(n){return i&&(i.valid=!1),i=u(n),i.valid=!0,i},extent:function(a){return arguments.length?(u=Zt(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),i&&(i.valid=!1,i=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(ao.geo.conicEqualArea=function(){return Vt(Xt)}).raw=Xt,ao.geo.albers=function(){return ao.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},ao.geo.albersUsa=function(){function n(n){var u=n[0],o=n[1];return t=null,e(u,o),t||(r(u,o),t)||i(u,o),t}var t,e,r,i,u=ao.geo.albers(),o=ao.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=ao.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=u.scale(),e=u.translate(),r=(n[0]-e[0])/t,i=(n[1]-e[1])/t;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?o:i>=.166&&.234>i&&r>=-.214&&-.115>r?a:u).invert(n)},n.stream=function(n){var t=u.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,i){t.point(n,i),e.point(n,i),r.point(n,i)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(u.precision(t),o.precision(t),a.precision(t),n):u.precision()},n.scale=function(t){return arguments.length?(u.scale(t),o.scale(.35*t),a.scale(t),n.translate(u.translate())):u.scale()},n.translate=function(t){if(!arguments.length)return u.translate();var c=u.scale(),f=+t[0],s=+t[1];return e=u.translate(t).clipExtent([[f-.455*c,s-.238*c],[f+.455*c,s+.238*c]]).stream(l).point,r=o.translate([f-.307*c,s+.201*c]).clipExtent([[f-.425*c+Uo,s+.12*c+Uo],[f-.214*c-Uo,s+.234*c-Uo]]).stream(l).point,i=a.translate([f-.205*c,s+.212*c]).clipExtent([[f-.214*c+Uo,s+.166*c+Uo],[f-.115*c-Uo,s+.234*c-Uo]]).stream(l).point,n},n.scale(1070)};var Oa,Ia,Ya,Za,Va,Xa,$a={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Ia=0,$a.lineStart=$t},polygonEnd:function(){$a.lineStart=$a.lineEnd=$a.point=b,Oa+=xo(Ia/2)}},Ba={point:Bt,lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Wa={point:Gt,lineStart:Kt,lineEnd:Qt,polygonStart:function(){Wa.lineStart=ne},polygonEnd:function(){Wa.point=Gt,Wa.lineStart=Kt,Wa.lineEnd=Qt}};ao.geo.path=function(){function n(n){return n&&("function"==typeof a&&u.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=i(u)),ao.geo.stream(n,o)),u.result()}function t(){return o=null,n}var e,r,i,u,o,a=4.5;return n.area=function(n){return Oa=0,ao.geo.stream(n,i($a)),Oa},n.centroid=function(n){return Ca=za=La=qa=Ta=Ra=Da=Pa=Ua=0,ao.geo.stream(n,i(Wa)),Ua?[Da/Ua,Pa/Ua]:Ra?[qa/Ra,Ta/Ra]:La?[Ca/La,za/La]:[NaN,NaN]},n.bounds=function(n){return Va=Xa=-(Ya=Za=1/0),ao.geo.stream(n,i(Ba)),[[Ya,Za],[Va,Xa]]},n.projection=function(n){return arguments.length?(i=(e=n)?n.stream||re(n):m,t()):e},n.context=function(n){return arguments.length?(u=null==(r=n)?new Wt:new te(n),"function"!=typeof a&&u.pointRadius(a),t()):r},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(u.pointRadius(+t),+t),n):a},n.projection(ao.geo.albersUsa()).context(null)},ao.geo.transform=function(n){return{stream:function(t){var e=new ie(t);for(var r in n)e[r]=n[r];return e}}},ie.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},ao.geo.projection=oe,ao.geo.projectionMutator=ae,(ao.geo.equirectangular=function(){return oe(ce)}).raw=ce.invert=ce,ao.geo.rotation=function(n){function t(t){return t=n(t[0]*Yo,t[1]*Yo),t[0]*=Zo,t[1]*=Zo,t}return n=se(n[0]%360*Yo,n[1]*Yo,n.length>2?n[2]*Yo:0),t.invert=function(t){return t=n.invert(t[0]*Yo,t[1]*Yo),t[0]*=Zo,t[1]*=Zo,t},t},fe.invert=ce,ao.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=se(-n[0]*Yo,-n[1]*Yo,0).invert,i=[];return e(null,null,1,{point:function(n,e){i.push(n=t(n,e)),n[0]*=Zo,n[1]*=Zo}}),{type:"Polygon",coordinates:[i]}}var t,e,r=[0,0],i=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=ve((t=+r)*Yo,i*Yo),n):t},n.precision=function(r){return arguments.length?(e=ve(t*Yo,(i=+r)*Yo),n):i},n.angle(90)},ao.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Yo,i=n[1]*Yo,u=t[1]*Yo,o=Math.sin(r),a=Math.cos(r),l=Math.sin(i),c=Math.cos(i),f=Math.sin(u),s=Math.cos(u);return Math.atan2(Math.sqrt((e=s*o)*e+(e=c*f-l*s*a)*e),l*f+c*s*a)},ao.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return ao.range(Math.ceil(u/d)*d,i,d).map(h).concat(ao.range(Math.ceil(c/y)*y,l,y).map(p)).concat(ao.range(Math.ceil(r/g)*g,e,g).filter(function(n){return xo(n%d)>Uo}).map(f)).concat(ao.range(Math.ceil(a/v)*v,o,v).filter(function(n){return xo(n%y)>Uo}).map(s))}var e,r,i,u,o,a,l,c,f,s,h,p,g=10,v=g,d=90,y=360,m=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(u).concat(p(l).slice(1),h(i).reverse().slice(1),p(c).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(u=+t[0][0],i=+t[1][0],c=+t[0][1],l=+t[1][1],u>i&&(t=u,u=i,i=t),c>l&&(t=c,c=l,l=t),n.precision(m)):[[u,c],[i,l]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],o=+t[1][1],r>e&&(t=r,r=e,e=t),a>o&&(t=a,a=o,o=t),n.precision(m)):[[r,a],[e,o]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],y=+t[1],n):[d,y]},n.minorStep=function(t){return arguments.length?(g=+t[0],v=+t[1],n):[g,v]},n.precision=function(t){return arguments.length?(m=+t,f=ye(a,o,90),s=me(r,e,m),h=ye(c,l,90),p=me(u,i,m),n):m},n.majorExtent([[-180,-90+Uo],[180,90-Uo]]).minorExtent([[-180,-80-Uo],[180,80+Uo]])},ao.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||i.apply(this,arguments)]}}var t,e,r=Me,i=xe;return n.distance=function(){return ao.geo.distance(t||r.apply(this,arguments),e||i.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(i=t,e="function"==typeof t?null:t,n):i},n.precision=function(){return arguments.length?n:0},n},ao.geo.interpolate=function(n,t){return be(n[0]*Yo,n[1]*Yo,t[0]*Yo,t[1]*Yo)},ao.geo.length=function(n){return Ja=0,ao.geo.stream(n,Ga),Ja};var Ja,Ga={sphere:b,point:b,lineStart:_e,lineEnd:b,polygonStart:b,polygonEnd:b},Ka=we(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(ao.geo.azimuthalEqualArea=function(){return oe(Ka)}).raw=Ka;var Qa=we(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},m);(ao.geo.azimuthalEquidistant=function(){return oe(Qa)}).raw=Qa,(ao.geo.conicConformal=function(){return Vt(Se)}).raw=Se,(ao.geo.conicEquidistant=function(){return Vt(ke)}).raw=ke;var nl=we(function(n){return 1/n},Math.atan);(ao.geo.gnomonic=function(){return oe(nl)}).raw=nl,Ne.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Io]},(ao.geo.mercator=function(){return Ee(Ne)}).raw=Ne;var tl=we(function(){return 1},Math.asin);(ao.geo.orthographic=function(){return oe(tl)}).raw=tl;var el=we(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(ao.geo.stereographic=function(){return oe(el)}).raw=el,Ae.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-Io]},(ao.geo.transverseMercator=function(){var n=Ee(Ae),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=Ae,ao.geom={},ao.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,i=En(e),u=En(r),o=n.length,a=[],l=[];for(t=0;o>t;t++)a.push([+i.call(this,n[t],t),+u.call(this,n[t],t),t]);for(a.sort(qe),t=0;o>t;t++)l.push([a[t][0],-a[t][1]]);var c=Le(a),f=Le(l),s=f[0]===c[0],h=f[f.length-1]===c[c.length-1],p=[];for(t=c.length-1;t>=0;--t)p.push(n[a[c[t]][2]]);for(t=+s;t<f.length-h;++t)p.push(n[a[f[t]][2]]);return p}var e=Ce,r=ze;return arguments.length?t(n):(t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t)},ao.geom.polygon=function(n){return ko(n,rl),n};var rl=ao.geom.polygon.prototype=[];rl.area=function(){for(var n,t=-1,e=this.length,r=this[e-1],i=0;++t<e;)n=r,r=this[t],i+=n[1]*r[0]-n[0]*r[1];return.5*i},rl.centroid=function(n){var t,e,r=-1,i=this.length,u=0,o=0,a=this[i-1];for(arguments.length||(n=-1/(6*this.area()));++r<i;)t=a,a=this[r],e=t[0]*a[1]-a[0]*t[1],u+=(t[0]+a[0])*e,o+=(t[1]+a[1])*e;return[u*n,o*n]},rl.clip=function(n){for(var t,e,r,i,u,o,a=De(n),l=-1,c=this.length-De(this),f=this[c-1];++l<c;){for(t=n.slice(),n.length=0,i=this[l],u=t[(r=t.length-a)-1],e=-1;++e<r;)o=t[e],Te(o,f,i)?(Te(u,f,i)||n.push(Re(u,o,f,i)),n.push(o)):Te(u,f,i)&&n.push(Re(u,o,f,i)),u=o;a&&n.push(n[0]),f=i}return n};var il,ul,ol,al,ll,cl=[],fl=[];Ye.prototype.prepare=function(){for(var n,t=this.edges,e=t.length;e--;)n=t[e].edge,n.b&&n.a||t.splice(e,1);return t.sort(Ve),t.length},tr.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},er.prototype={insert:function(n,t){var e,r,i;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=or(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)r=e.U,e===r.L?(i=r.R,i&&i.C?(e.C=i.C=!1,r.C=!0,n=r):(n===e.R&&(ir(this,e),n=e,e=n.U),e.C=!1,r.C=!0,ur(this,r))):(i=r.L,i&&i.C?(e.C=i.C=!1,r.C=!0,n=r):(n===e.L&&(ur(this,e),n=e,e=n.U),e.C=!1,r.C=!0,ir(this,r))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t,e,r,i=n.U,u=n.L,o=n.R;if(e=u?o?or(o):u:o,i?i.L===n?i.L=e:i.R=e:this._=e,u&&o?(r=e.C,e.C=n.C,e.L=u,u.U=e,e!==o?(i=e.U,e.U=n.U,n=e.R,i.L=n,e.R=o,o.U=e):(e.U=i,i=e,n=e.R)):(r=n.C,n=e),n&&(n.U=i),!r){if(n&&n.C)return void(n.C=!1);do{if(n===this._)break;if(n===i.L){if(t=i.R,t.C&&(t.C=!1,i.C=!0,ir(this,i),t=i.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,ur(this,t),t=i.R),t.C=i.C,i.C=t.R.C=!1,ir(this,i),n=this._;break}}else if(t=i.L,t.C&&(t.C=!1,i.C=!0,ur(this,i),t=i.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,ir(this,t),t=i.L),t.C=i.C,i.C=t.L.C=!1,ur(this,i),n=this._;break}t.C=!0,n=i,i=i.U}while(!n.C);n&&(n.C=!1)}}},ao.geom.voronoi=function(n){function t(n){var t=new Array(n.length),r=a[0][0],i=a[0][1],u=a[1][0],o=a[1][1];return ar(e(n),a).cells.forEach(function(e,a){var l=e.edges,c=e.site,f=t[a]=l.length?l.map(function(n){var t=n.start();return[t.x,t.y]}):c.x>=r&&c.x<=u&&c.y>=i&&c.y<=o?[[r,o],[u,o],[u,i],[r,i]]:[];f.point=n[a]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(u(n,t)/Uo)*Uo,y:Math.round(o(n,t)/Uo)*Uo,i:t}})}var r=Ce,i=ze,u=r,o=i,a=sl;return n?t(n):(t.links=function(n){return ar(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return ar(e(n)).cells.forEach(function(e,r){for(var i,u,o=e.site,a=e.edges.sort(Ve),l=-1,c=a.length,f=a[c-1].edge,s=f.l===o?f.r:f.l;++l<c;)i=f,u=s,f=a[l].edge,s=f.l===o?f.r:f.l,r<u.i&&r<s.i&&cr(o,u,s)<0&&t.push([n[r],n[u.i],n[s.i]])}),t},t.x=function(n){return arguments.length?(u=En(r=n),t):r},t.y=function(n){return arguments.length?(o=En(i=n),t):i},t.clipExtent=function(n){return arguments.length?(a=null==n?sl:n,t):a===sl?null:a},t.size=function(n){return arguments.length?t.clipExtent(n&&[[0,0],n]):a===sl?null:a&&a[1]},t)};var sl=[[-1e6,-1e6],[1e6,1e6]];ao.geom.delaunay=function(n){return ao.geom.voronoi().triangles(n)},ao.geom.quadtree=function(n,t,e,r,i){function u(n){function u(n,t,e,r,i,u,o,a){if(!isNaN(e)&&!isNaN(r))if(n.leaf){var l=n.x,f=n.y;if(null!=l)if(xo(l-e)+xo(f-r)<.01)c(n,t,e,r,i,u,o,a);else{var s=n.point;n.x=n.y=n.point=null,c(n,s,l,f,i,u,o,a),c(n,t,e,r,i,u,o,a)}else n.x=e,n.y=r,n.point=t}else c(n,t,e,r,i,u,o,a)}function c(n,t,e,r,i,o,a,l){var c=.5*(i+a),f=.5*(o+l),s=e>=c,h=r>=f,p=h<<1|s;n.leaf=!1,n=n.nodes[p]||(n.nodes[p]=hr()),s?i=c:a=c,h?o=f:l=f,u(n,t,e,r,i,o,a,l)}var f,s,h,p,g,v,d,y,m,M=En(a),x=En(l);if(null!=t)v=t,d=e,y=r,m=i;else if(y=m=-(v=d=1/0),s=[],h=[],g=n.length,o)for(p=0;g>p;++p)f=n[p],f.x<v&&(v=f.x),f.y<d&&(d=f.y),f.x>y&&(y=f.x),f.y>m&&(m=f.y),s.push(f.x),h.push(f.y);else for(p=0;g>p;++p){var b=+M(f=n[p],p),_=+x(f,p);v>b&&(v=b),d>_&&(d=_),b>y&&(y=b),_>m&&(m=_),s.push(b),h.push(_)}var w=y-v,S=m-d;w>S?m=d+w:y=v+S;var k=hr();if(k.add=function(n){u(k,n,+M(n,++p),+x(n,p),v,d,y,m)},k.visit=function(n){pr(n,k,v,d,y,m)},k.find=function(n){return gr(k,n[0],n[1],v,d,y,m)},p=-1,null==t){for(;++p<g;)u(k,n[p],s[p],h[p],v,d,y,m);--p}else n.forEach(k.add);return s=h=n=f=null,k}var o,a=Ce,l=ze;return(o=arguments.length)?(a=fr,l=sr,3===o&&(i=e,r=t,e=t=0),u(n)):(u.x=function(n){return arguments.length?(a=n,u):a},u.y=function(n){return arguments.length?(l=n,u):l},u.extent=function(n){return arguments.length?(null==n?t=e=r=i=null:(t=+n[0][0],e=+n[0][1],r=+n[1][0],i=+n[1][1]),u):null==t?null:[[t,e],[r,i]]},u.size=function(n){return arguments.length?(null==n?t=e=r=i=null:(t=e=0,r=+n[0],i=+n[1]),u):null==t?null:[r-t,i-e]},u)},ao.interpolateRgb=vr,ao.interpolateObject=dr,ao.interpolateNumber=yr,ao.interpolateString=mr;var hl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pl=new RegExp(hl.source,"g");ao.interpolate=Mr,ao.interpolators=[function(n,t){var e=typeof t;return("string"===e?ua.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?vr:mr:t instanceof an?vr:Array.isArray(t)?xr:"object"===e&&isNaN(t)?dr:yr)(n,t)}],ao.interpolateArray=xr;var gl=function(){return m},vl=ao.map({linear:gl,poly:Er,quad:function(){return Sr},cubic:function(){return kr},sin:function(){return Ar},exp:function(){return Cr},circle:function(){return zr},elastic:Lr,back:qr,bounce:function(){return Tr}}),dl=ao.map({"in":m,out:_r,"in-out":wr,"out-in":function(n){return wr(_r(n))}});ao.ease=function(n){var t=n.indexOf("-"),e=t>=0?n.slice(0,t):n,r=t>=0?n.slice(t+1):"in";return e=vl.get(e)||gl,r=dl.get(r)||m,br(r(e.apply(null,lo.call(arguments,1))))},ao.interpolateHcl=Rr,ao.interpolateHsl=Dr,ao.interpolateLab=Pr,ao.interpolateRound=Ur,ao.transform=function(n){var t=fo.createElementNS(ao.ns.prefix.svg,"g");return(ao.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new jr(e?e.matrix:yl)})(n)},jr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var yl={a:1,b:0,c:0,d:1,e:0,f:0};ao.interpolateTransform=$r,ao.layout={},ao.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++e<r;)t.push(Jr(n[e]));return t}},ao.layout.chord=function(){function n(){var n,c,s,h,p,g={},v=[],d=ao.range(u),y=[];for(e=[],r=[],n=0,h=-1;++h<u;){for(c=0,p=-1;++p<u;)c+=i[h][p];v.push(c),y.push(ao.range(u)),n+=c}for(o&&d.sort(function(n,t){return o(v[n],v[t])}),a&&y.forEach(function(n,t){n.sort(function(n,e){return a(i[t][n],i[t][e])})}),n=(Ho-f*u)/n,c=0,h=-1;++h<u;){for(s=c,p=-1;++p<u;){var m=d[h],M=y[m][p],x=i[m][M],b=c,_=c+=x*n;g[m+"-"+M]={index:m,subindex:M,startAngle:b,endAngle:_,value:x}}r[m]={index:m,startAngle:s,endAngle:c,value:v[m]},c+=f}for(h=-1;++h<u;)for(p=h-1;++p<u;){var w=g[h+"-"+p],S=g[p+"-"+h];(w.value||S.value)&&e.push(w.value<S.value?{source:S,target:w}:{source:w,target:S})}l&&t()}function t(){e.sort(function(n,t){return l((n.source.value+n.target.value)/2,(t.source.value+t.target.value)/2)})}var e,r,i,u,o,a,l,c={},f=0;return c.matrix=function(n){return arguments.length?(u=(i=n)&&i.length,e=r=null,c):i},c.padding=function(n){return arguments.length?(f=n,e=r=null,c):f},c.sortGroups=function(n){return arguments.length?(o=n,e=r=null,c):o},c.sortSubgroups=function(n){return arguments.length?(a=n,e=null,c):a},c.sortChords=function(n){return arguments.length?(l=n,e&&t(),c):l},c.chords=function(){return e||n(),e},c.groups=function(){return r||n(),r},c},ao.layout.force=function(){function n(n){return function(t,e,r,i){if(t.point!==n){var u=t.cx-n.x,o=t.cy-n.y,a=i-e,l=u*u+o*o;if(l>a*a/y){if(v>l){var c=t.charge/l;n.px-=u*c,n.py-=o*c}return!0}if(t.point&&l&&v>l){var c=t.pointCharge/l;n.px-=u*c,n.py-=o*c}}return!t.charge}}function t(n){n.px=ao.event.x,n.py=ao.event.y,l.resume()}var e,r,i,u,o,a,l={},c=ao.dispatch("start","tick","end"),f=[1,1],s=.9,h=ml,p=Ml,g=-30,v=xl,d=.1,y=.64,M=[],x=[];return l.tick=function(){if((i*=.99)<.005)return e=null,c.end({type:"end",alpha:i=0}),!0;var t,r,l,h,p,v,y,m,b,_=M.length,w=x.length;for(r=0;w>r;++r)l=x[r],h=l.source,p=l.target,m=p.x-h.x,b=p.y-h.y,(v=m*m+b*b)&&(v=i*o[r]*((v=Math.sqrt(v))-u[r])/v,m*=v,b*=v,p.x-=m*(y=h.weight+p.weight?h.weight/(h.weight+p.weight):.5),p.y-=b*y,h.x+=m*(y=1-y),h.y+=b*y);if((y=i*d)&&(m=f[0]/2,b=f[1]/2,r=-1,y))for(;++r<_;)l=M[r],l.x+=(m-l.x)*y,l.y+=(b-l.y)*y;if(g)for(ri(t=ao.geom.quadtree(M),i,a),r=-1;++r<_;)(l=M[r]).fixed||t.visit(n(l));for(r=-1;++r<_;)l=M[r],l.fixed?(l.x=l.px,l.y=l.py):(l.x-=(l.px-(l.px=l.x))*s,l.y-=(l.py-(l.py=l.y))*s);c.tick({type:"tick",alpha:i})},l.nodes=function(n){return arguments.length?(M=n,l):M},l.links=function(n){return arguments.length?(x=n,l):x},l.size=function(n){return arguments.length?(f=n,l):f},l.linkDistance=function(n){return arguments.length?(h="function"==typeof n?n:+n,l):h},l.distance=l.linkDistance,l.linkStrength=function(n){return arguments.length?(p="function"==typeof n?n:+n,l):p},l.friction=function(n){return arguments.length?(s=+n,l):s},l.charge=function(n){return arguments.length?(g="function"==typeof n?n:+n,l):g},l.chargeDistance=function(n){return arguments.length?(v=n*n,l):Math.sqrt(v)},l.gravity=function(n){return arguments.length?(d=+n,l):d},l.theta=function(n){return arguments.length?(y=n*n,l):Math.sqrt(y)},l.alpha=function(n){return arguments.length?(n=+n,i?n>0?i=n:(e.c=null,e.t=NaN,e=null,c.end({type:"end",alpha:i=0})):n>0&&(c.start({type:"start",alpha:i=n}),e=qn(l.tick)),l):i},l.start=function(){function n(n,r){if(!e){for(e=new Array(i),l=0;i>l;++l)e[l]=[];for(l=0;c>l;++l){var u=x[l];e[u.source.index].push(u.target),e[u.target.index].push(u.source)}}for(var o,a=e[t],l=-1,f=a.length;++l<f;)if(!isNaN(o=a[l][n]))return o;return Math.random()*r}var t,e,r,i=M.length,c=x.length,s=f[0],v=f[1];for(t=0;i>t;++t)(r=M[t]).index=t,r.weight=0;for(t=0;c>t;++t)r=x[t],"number"==typeof r.source&&(r.source=M[r.source]),"number"==typeof r.target&&(r.target=M[r.target]),++r.source.weight,++r.target.weight;for(t=0;i>t;++t)r=M[t],isNaN(r.x)&&(r.x=n("x",s)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(u=[],"function"==typeof h)for(t=0;c>t;++t)u[t]=+h.call(this,x[t],t);else for(t=0;c>t;++t)u[t]=h;if(o=[],"function"==typeof p)for(t=0;c>t;++t)o[t]=+p.call(this,x[t],t);else for(t=0;c>t;++t)o[t]=p;if(a=[],"function"==typeof g)for(t=0;i>t;++t)a[t]=+g.call(this,M[t],t);else for(t=0;i>t;++t)a[t]=g;return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){return r||(r=ao.behavior.drag().origin(m).on("dragstart.force",Qr).on("drag.force",t).on("dragend.force",ni)),arguments.length?void this.on("mouseover.force",ti).on("mouseout.force",ei).call(r):r},ao.rebind(l,c,"on")};var ml=20,Ml=1,xl=1/0;ao.layout.hierarchy=function(){function n(i){var u,o=[i],a=[];for(i.depth=0;null!=(u=o.pop());)if(a.push(u),(c=e.call(n,u,u.depth))&&(l=c.length)){for(var l,c,f;--l>=0;)o.push(f=c[l]),f.parent=u,f.depth=u.depth+1;r&&(u.value=0),u.children=c}else r&&(u.value=+r.call(n,u,u.depth)||0),delete u.children;return oi(i,function(n){var e,i;t&&(e=n.children)&&e.sort(t),r&&(i=n.parent)&&(i.value+=n.value)}),a}var t=ci,e=ai,r=li;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(ui(t,function(n){n.children&&(n.value=0)}),oi(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},ao.layout.partition=function(){function n(t,e,r,i){var u=t.children;if(t.x=e,t.y=t.depth*i,t.dx=r,t.dy=i,u&&(o=u.length)){var o,a,l,c=-1;for(r=t.value?r/t.value:0;++c<o;)n(a=u[c],e,l=a.value*r,i),e+=l}}function t(n){var e=n.children,r=0;if(e&&(i=e.length))for(var i,u=-1;++u<i;)r=Math.max(r,t(e[u]));return 1+r}function e(e,u){var o=r.call(this,e,u);return n(o[0],0,i[0],i[1]/t(o[0])),o}var r=ao.layout.hierarchy(),i=[1,1];return e.size=function(n){return arguments.length?(i=n,e):i},ii(e,r)},ao.layout.pie=function(){function n(o){var a,l=o.length,c=o.map(function(e,r){return+t.call(n,e,r)}),f=+("function"==typeof r?r.apply(this,arguments):r),s=("function"==typeof i?i.apply(this,arguments):i)-f,h=Math.min(Math.abs(s)/l,+("function"==typeof u?u.apply(this,arguments):u)),p=h*(0>s?-1:1),g=ao.sum(c),v=g?(s-l*p)/g:0,d=ao.range(l),y=[];return null!=e&&d.sort(e===bl?function(n,t){return c[t]-c[n]}:function(n,t){return e(o[n],o[t])}),d.forEach(function(n){y[n]={data:o[n],value:a=c[n],startAngle:f,endAngle:f+=a*v+p,padAngle:h}}),y}var t=Number,e=bl,r=0,i=Ho,u=0;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(i=t,n):i},n.padAngle=function(t){return arguments.length?(u=t,n):u},n};var bl={};ao.layout.stack=function(){function n(a,l){if(!(h=a.length))return a;var c=a.map(function(e,r){return t.call(n,e,r)}),f=c.map(function(t){return t.map(function(t,e){return[u.call(n,t,e),o.call(n,t,e)]})}),s=e.call(n,f,l);c=ao.permute(c,s),f=ao.permute(f,s);var h,p,g,v,d=r.call(n,f,l),y=c[0].length;for(g=0;y>g;++g)for(i.call(n,c[0][g],v=d[g],f[0][g][1]),p=1;h>p;++p)i.call(n,c[p][g],v+=f[p-1][g][1],f[p][g][1]);return a}var t=m,e=gi,r=vi,i=pi,u=si,o=hi;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:_l.get(t)||gi,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:wl.get(t)||vi,n):r},n.x=function(t){return arguments.length?(u=t,n):u},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(i=t,n):i},n};var _l=ao.map({"inside-out":function(n){var t,e,r=n.length,i=n.map(di),u=n.map(yi),o=ao.range(r).sort(function(n,t){return i[n]-i[t]}),a=0,l=0,c=[],f=[];for(t=0;r>t;++t)e=o[t],l>a?(a+=u[e],c.push(e)):(l+=u[e],f.push(e));return f.reverse().concat(c)},reverse:function(n){return ao.range(n.length).reverse()},"default":gi}),wl=ao.map({silhouette:function(n){var t,e,r,i=n.length,u=n[0].length,o=[],a=0,l=[];for(e=0;u>e;++e){for(t=0,r=0;i>t;t++)r+=n[t][e][1];r>a&&(a=r),o.push(r)}for(e=0;u>e;++e)l[e]=(a-o[e])/2;return l},wiggle:function(n){var t,e,r,i,u,o,a,l,c,f=n.length,s=n[0],h=s.length,p=[];for(p[0]=l=c=0,e=1;h>e;++e){for(t=0,i=0;f>t;++t)i+=n[t][e][1];for(t=0,u=0,a=s[e][0]-s[e-1][0];f>t;++t){for(r=0,o=(n[t][e][1]-n[t][e-1][1])/(2*a);t>r;++r)o+=(n[r][e][1]-n[r][e-1][1])/a;u+=o*n[t][e][1]}p[e]=l-=i?u/i*a:0,c>l&&(c=l)}for(e=0;h>e;++e)p[e]-=c;return p},expand:function(n){var t,e,r,i=n.length,u=n[0].length,o=1/i,a=[];for(e=0;u>e;++e){for(t=0,r=0;i>t;t++)r+=n[t][e][1];if(r)for(t=0;i>t;t++)n[t][e][1]/=r;else for(t=0;i>t;t++)n[t][e][1]=o}for(e=0;u>e;++e)a[e]=0;return a},zero:vi});ao.layout.histogram=function(){function n(n,u){for(var o,a,l=[],c=n.map(e,this),f=r.call(this,c,u),s=i.call(this,f,c,u),u=-1,h=c.length,p=s.length-1,g=t?1:1/h;++u<p;)o=l[u]=[],o.dx=s[u+1]-(o.x=s[u]),o.y=0;if(p>0)for(u=-1;++u<h;)a=c[u],a>=f[0]&&a<=f[1]&&(o=l[ao.bisect(s,a,1,p)-1],o.y+=g,o.push(n[u]));return l}var t=!0,e=Number,r=bi,i=Mi;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=En(t),n):r},n.bins=function(t){return arguments.length?(i="number"==typeof t?function(n){return xi(n,t)}:En(t),n):i},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},ao.layout.pack=function(){function n(n,u){var o=e.call(this,n,u),a=o[0],l=i[0],c=i[1],f=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,oi(a,function(n){n.r=+f(n.value)}),oi(a,Ni),r){var s=r*(t?1:Math.max(2*a.r/l,2*a.r/c))/2;oi(a,function(n){n.r+=s}),oi(a,Ni),oi(a,function(n){n.r-=s})}return Ci(a,l/2,c/2,t?1:1/Math.max(2*a.r/l,2*a.r/c)),o}var t,e=ao.layout.hierarchy().sort(_i),r=0,i=[1,1];return n.size=function(t){return arguments.length?(i=t,n):i},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},ii(n,e)},ao.layout.tree=function(){function n(n,i){var f=o.call(this,n,i),s=f[0],h=t(s);if(oi(h,e),h.parent.m=-h.z,ui(h,r),c)ui(s,u);else{var p=s,g=s,v=s;ui(s,function(n){n.x<p.x&&(p=n),n.x>g.x&&(g=n),n.depth>v.depth&&(v=n)});var d=a(p,g)/2-p.x,y=l[0]/(g.x+a(g,p)/2+d),m=l[1]/(v.depth||1);ui(s,function(n){n.x=(n.x+d)*y,n.y=n.depth*m})}return f}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var i,u=t.children,o=0,a=u.length;a>o;++o)r.push((u[o]=i={_:u[o],parent:t,children:(i=u[o].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=i);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){Di(n);var u=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+a(n._,r._),n.m=n.z-u):n.z=u}else r&&(n.z=r.z+a(n._,r._));n.parent.A=i(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function i(n,t,e){if(t){for(var r,i=n,u=n,o=t,l=i.parent.children[0],c=i.m,f=u.m,s=o.m,h=l.m;o=Ti(o),i=qi(i),o&&i;)l=qi(l),u=Ti(u),u.a=n,r=o.z+s-i.z-c+a(o._,i._),r>0&&(Ri(Pi(o,n,e),n,r),c+=r,f+=r),s+=o.m,c+=i.m,h+=l.m,f+=u.m;o&&!Ti(u)&&(u.t=o,u.m+=s-f),i&&!qi(l)&&(l.t=i,l.m+=c-h,e=n)}return e}function u(n){n.x*=l[0],n.y=n.depth*l[1]}var o=ao.layout.hierarchy().sort(null).value(null),a=Li,l=[1,1],c=null;return n.separation=function(t){return arguments.length?(a=t,n):a},n.size=function(t){return arguments.length?(c=null==(l=t)?u:null,n):c?null:l},n.nodeSize=function(t){return arguments.length?(c=null==(l=t)?null:u,n):c?l:null},ii(n,o)},ao.layout.cluster=function(){function n(n,u){var o,a=t.call(this,n,u),l=a[0],c=0;oi(l,function(n){var t=n.children;t&&t.length?(n.x=ji(t),n.y=Ui(t)):(n.x=o?c+=e(n,o):0,n.y=0,o=n)});var f=Fi(l),s=Hi(l),h=f.x-e(f,s)/2,p=s.x+e(s,f)/2;return oi(l,i?function(n){n.x=(n.x-l.x)*r[0],n.y=(l.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(p-h)*r[0],n.y=(1-(l.y?n.y/l.y:1))*r[1]}),a}var t=ao.layout.hierarchy().sort(null).value(null),e=Li,r=[1,1],i=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(i=null==(r=t),n):i?null:r},n.nodeSize=function(t){return arguments.length?(i=null!=(r=t),n):i?r:null},ii(n,t)},ao.layout.treemap=function(){function n(n,t){for(var e,r,i=-1,u=n.length;++i<u;)r=(e=n[i]).value*(0>t?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var u=e.children;if(u&&u.length){var o,a,l,c=s(e),f=[],h=u.slice(),g=1/0,v="slice"===p?c.dx:"dice"===p?c.dy:"slice-dice"===p?1&e.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(n(h,c.dx*c.dy/e.value),f.area=0;(l=h.length)>0;)f.push(o=h[l-1]),f.area+=o.area,"squarify"!==p||(a=r(f,v))<=g?(h.pop(),g=a):(f.area-=f.pop().area,i(f,v,c,!1),v=Math.min(c.dx,c.dy),f.length=f.area=0,g=1/0);f.length&&(i(f,v,c,!0),f.length=f.area=0),u.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var u,o=s(t),a=r.slice(),l=[];for(n(a,o.dx*o.dy/t.value),l.area=0;u=a.pop();)l.push(u),l.area+=u.area,null!=u.z&&(i(l,u.z?o.dx:o.dy,o,!a.length),l.length=l.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,i=0,u=1/0,o=-1,a=n.length;++o<a;)(e=n[o].area)&&(u>e&&(u=e),e>i&&(i=e));return r*=r,t*=t,r?Math.max(t*i*g/r,r/(t*u*g)):1/0}function i(n,t,e,r){var i,u=-1,o=n.length,a=e.x,c=e.y,f=t?l(n.area/t):0;
46162if(t==e.dx){for((r||f>e.dy)&&(f=e.dy);++u<o;)i=n[u],i.x=a,i.y=c,i.dy=f,a+=i.dx=Math.min(e.x+e.dx-a,f?l(i.area/f):0);i.z=!0,i.dx+=e.x+e.dx-a,e.y+=f,e.dy-=f}else{for((r||f>e.dx)&&(f=e.dx);++u<o;)i=n[u],i.x=a,i.y=c,i.dx=f,c+=i.dy=Math.min(e.y+e.dy-c,f?l(i.area/f):0);i.z=!1,i.dy+=e.y+e.dy-c,e.x+=f,e.dx-=f}}function u(r){var i=o||a(r),u=i[0];return u.x=u.y=0,u.value?(u.dx=c[0],u.dy=c[1]):u.dx=u.dy=0,o&&a.revalue(u),n([u],u.dx*u.dy/u.value),(o?e:t)(u),h&&(o=i),i}var o,a=ao.layout.hierarchy(),l=Math.round,c=[1,1],f=null,s=Oi,h=!1,p="squarify",g=.5*(1+Math.sqrt(5));return u.size=function(n){return arguments.length?(c=n,u):c},u.padding=function(n){function t(t){var e=n.call(u,t,t.depth);return null==e?Oi(t):Ii(t,"number"==typeof e?[e,e,e,e]:e)}function e(t){return Ii(t,n)}if(!arguments.length)return f;var r;return s=null==(f=n)?Oi:"function"==(r=typeof n)?t:"number"===r?(n=[n,n,n,n],e):e,u},u.round=function(n){return arguments.length?(l=n?Math.round:Number,u):l!=Number},u.sticky=function(n){return arguments.length?(h=n,o=null,u):h},u.ratio=function(n){return arguments.length?(g=n,u):g},u.mode=function(n){return arguments.length?(p=n+"",u):p},ii(u,a)},ao.random={normal:function(n,t){var e=arguments.length;return 2>e&&(t=1),1>e&&(n=0),function(){var e,r,i;do e=2*Math.random()-1,r=2*Math.random()-1,i=e*e+r*r;while(!i||i>1);return n+t*e*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var n=ao.random.normal.apply(ao,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=ao.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},ao.scale={};var Sl={floor:m,ceil:m};ao.scale.linear=function(){return Wi([0,1],[0,1],Mr,!1)};var kl={s:1,g:1,p:1,r:1,e:1};ao.scale.log=function(){return ru(ao.scale.linear().domain([0,1]),10,!0,[1,10])};var Nl=ao.format(".0e"),El={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};ao.scale.pow=function(){return iu(ao.scale.linear(),1,[0,1])},ao.scale.sqrt=function(){return ao.scale.pow().exponent(.5)},ao.scale.ordinal=function(){return ou([],{t:"range",a:[[]]})},ao.scale.category10=function(){return ao.scale.ordinal().range(Al)},ao.scale.category20=function(){return ao.scale.ordinal().range(Cl)},ao.scale.category20b=function(){return ao.scale.ordinal().range(zl)},ao.scale.category20c=function(){return ao.scale.ordinal().range(Ll)};var Al=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(xn),Cl=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(xn),zl=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(xn),Ll=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(xn);ao.scale.quantile=function(){return au([],[])},ao.scale.quantize=function(){return lu(0,1,[0,1])},ao.scale.threshold=function(){return cu([.5],[0,1])},ao.scale.identity=function(){return fu([0,1])},ao.svg={},ao.svg.arc=function(){function n(){var n=Math.max(0,+e.apply(this,arguments)),c=Math.max(0,+r.apply(this,arguments)),f=o.apply(this,arguments)-Io,s=a.apply(this,arguments)-Io,h=Math.abs(s-f),p=f>s?0:1;if(n>c&&(g=c,c=n,n=g),h>=Oo)return t(c,p)+(n?t(n,1-p):"")+"Z";var g,v,d,y,m,M,x,b,_,w,S,k,N=0,E=0,A=[];if((y=(+l.apply(this,arguments)||0)/2)&&(d=u===ql?Math.sqrt(n*n+c*c):+u.apply(this,arguments),p||(E*=-1),c&&(E=tn(d/c*Math.sin(y))),n&&(N=tn(d/n*Math.sin(y)))),c){m=c*Math.cos(f+E),M=c*Math.sin(f+E),x=c*Math.cos(s-E),b=c*Math.sin(s-E);var C=Math.abs(s-f-2*E)<=Fo?0:1;if(E&&yu(m,M,x,b)===p^C){var z=(f+s)/2;m=c*Math.cos(z),M=c*Math.sin(z),x=b=null}}else m=M=0;if(n){_=n*Math.cos(s-N),w=n*Math.sin(s-N),S=n*Math.cos(f+N),k=n*Math.sin(f+N);var L=Math.abs(f-s+2*N)<=Fo?0:1;if(N&&yu(_,w,S,k)===1-p^L){var q=(f+s)/2;_=n*Math.cos(q),w=n*Math.sin(q),S=k=null}}else _=w=0;if(h>Uo&&(g=Math.min(Math.abs(c-n)/2,+i.apply(this,arguments)))>.001){v=c>n^p?0:1;var T=g,R=g;if(Fo>h){var D=null==S?[_,w]:null==x?[m,M]:Re([m,M],[S,k],[x,b],[_,w]),P=m-D[0],U=M-D[1],j=x-D[0],F=b-D[1],H=1/Math.sin(Math.acos((P*j+U*F)/(Math.sqrt(P*P+U*U)*Math.sqrt(j*j+F*F)))/2),O=Math.sqrt(D[0]*D[0]+D[1]*D[1]);R=Math.min(g,(n-O)/(H-1)),T=Math.min(g,(c-O)/(H+1))}if(null!=x){var I=mu(null==S?[_,w]:[S,k],[m,M],c,T,p),Y=mu([x,b],[_,w],c,T,p);g===T?A.push("M",I[0],"A",T,",",T," 0 0,",v," ",I[1],"A",c,",",c," 0 ",1-p^yu(I[1][0],I[1][1],Y[1][0],Y[1][1]),",",p," ",Y[1],"A",T,",",T," 0 0,",v," ",Y[0]):A.push("M",I[0],"A",T,",",T," 0 1,",v," ",Y[0])}else A.push("M",m,",",M);if(null!=S){var Z=mu([m,M],[S,k],n,-R,p),V=mu([_,w],null==x?[m,M]:[x,b],n,-R,p);g===R?A.push("L",V[0],"A",R,",",R," 0 0,",v," ",V[1],"A",n,",",n," 0 ",p^yu(V[1][0],V[1][1],Z[1][0],Z[1][1]),",",1-p," ",Z[1],"A",R,",",R," 0 0,",v," ",Z[0]):A.push("L",V[0],"A",R,",",R," 0 0,",v," ",Z[0])}else A.push("L",_,",",w)}else A.push("M",m,",",M),null!=x&&A.push("A",c,",",c," 0 ",C,",",p," ",x,",",b),A.push("L",_,",",w),null!=S&&A.push("A",n,",",n," 0 ",L,",",1-p," ",S,",",k);return A.push("Z"),A.join("")}function t(n,t){return"M0,"+n+"A"+n+","+n+" 0 1,"+t+" 0,"+-n+"A"+n+","+n+" 0 1,"+t+" 0,"+n}var e=hu,r=pu,i=su,u=ql,o=gu,a=vu,l=du;return n.innerRadius=function(t){return arguments.length?(e=En(t),n):e},n.outerRadius=function(t){return arguments.length?(r=En(t),n):r},n.cornerRadius=function(t){return arguments.length?(i=En(t),n):i},n.padRadius=function(t){return arguments.length?(u=t==ql?ql:En(t),n):u},n.startAngle=function(t){return arguments.length?(o=En(t),n):o},n.endAngle=function(t){return arguments.length?(a=En(t),n):a},n.padAngle=function(t){return arguments.length?(l=En(t),n):l},n.centroid=function(){var n=(+e.apply(this,arguments)+ +r.apply(this,arguments))/2,t=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-Io;return[Math.cos(t)*n,Math.sin(t)*n]},n};var ql="auto";ao.svg.line=function(){return Mu(m)};var Tl=ao.map({linear:xu,"linear-closed":bu,step:_u,"step-before":wu,"step-after":Su,basis:zu,"basis-open":Lu,"basis-closed":qu,bundle:Tu,cardinal:Eu,"cardinal-open":ku,"cardinal-closed":Nu,monotone:Fu});Tl.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var Rl=[0,2/3,1/3,0],Dl=[0,1/3,2/3,0],Pl=[0,1/6,2/3,1/6];ao.svg.line.radial=function(){var n=Mu(Hu);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},wu.reverse=Su,Su.reverse=wu,ao.svg.area=function(){return Ou(m)},ao.svg.area.radial=function(){var n=Ou(Hu);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},ao.svg.chord=function(){function n(n,a){var l=t(this,u,n,a),c=t(this,o,n,a);return"M"+l.p0+r(l.r,l.p1,l.a1-l.a0)+(e(l,c)?i(l.r,l.p1,l.r,l.p0):i(l.r,l.p1,c.r,c.p0)+r(c.r,c.p1,c.a1-c.a0)+i(c.r,c.p1,l.r,l.p0))+"Z"}function t(n,t,e,r){var i=t.call(n,e,r),u=a.call(n,i,r),o=l.call(n,i,r)-Io,f=c.call(n,i,r)-Io;return{r:u,a0:o,a1:f,p0:[u*Math.cos(o),u*Math.sin(o)],p1:[u*Math.cos(f),u*Math.sin(f)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>Fo)+",1 "+t}function i(n,t,e,r){return"Q 0,0 "+r}var u=Me,o=xe,a=Iu,l=gu,c=vu;return n.radius=function(t){return arguments.length?(a=En(t),n):a},n.source=function(t){return arguments.length?(u=En(t),n):u},n.target=function(t){return arguments.length?(o=En(t),n):o},n.startAngle=function(t){return arguments.length?(l=En(t),n):l},n.endAngle=function(t){return arguments.length?(c=En(t),n):c},n},ao.svg.diagonal=function(){function n(n,i){var u=t.call(this,n,i),o=e.call(this,n,i),a=(u.y+o.y)/2,l=[u,{x:u.x,y:a},{x:o.x,y:a},o];return l=l.map(r),"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var t=Me,e=xe,r=Yu;return n.source=function(e){return arguments.length?(t=En(e),n):t},n.target=function(t){return arguments.length?(e=En(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},ao.svg.diagonal.radial=function(){var n=ao.svg.diagonal(),t=Yu,e=n.projection;return n.projection=function(n){return arguments.length?e(Zu(t=n)):t},n},ao.svg.symbol=function(){function n(n,r){return(Ul.get(t.call(this,n,r))||$u)(e.call(this,n,r))}var t=Xu,e=Vu;return n.type=function(e){return arguments.length?(t=En(e),n):t},n.size=function(t){return arguments.length?(e=En(t),n):e},n};var Ul=ao.map({circle:$u,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*Fl)),e=t*Fl;return"M0,"+-t+"L"+e+",0 0,"+t+" "+-e+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/jl),e=t*jl/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/jl),e=t*jl/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});ao.svg.symbolTypes=Ul.keys();var jl=Math.sqrt(3),Fl=Math.tan(30*Yo);Co.transition=function(n){for(var t,e,r=Hl||++Zl,i=Ku(n),u=[],o=Ol||{time:Date.now(),ease:Nr,delay:0,duration:250},a=-1,l=this.length;++a<l;){u.push(t=[]);for(var c=this[a],f=-1,s=c.length;++f<s;)(e=c[f])&&Qu(e,f,i,r,o),t.push(e)}return Wu(u,i,r)},Co.interrupt=function(n){return this.each(null==n?Il:Bu(Ku(n)))};var Hl,Ol,Il=Bu(Ku()),Yl=[],Zl=0;Yl.call=Co.call,Yl.empty=Co.empty,Yl.node=Co.node,Yl.size=Co.size,ao.transition=function(n,t){return n&&n.transition?Hl?n.transition(t):n:ao.selection().transition(n)},ao.transition.prototype=Yl,Yl.select=function(n){var t,e,r,i=this.id,u=this.namespace,o=[];n=A(n);for(var a=-1,l=this.length;++a<l;){o.push(t=[]);for(var c=this[a],f=-1,s=c.length;++f<s;)(r=c[f])&&(e=n.call(r,r.__data__,f,a))?("__data__"in r&&(e.__data__=r.__data__),Qu(e,f,u,i,r[u][i]),t.push(e)):t.push(null)}return Wu(o,u,i)},Yl.selectAll=function(n){var t,e,r,i,u,o=this.id,a=this.namespace,l=[];n=C(n);for(var c=-1,f=this.length;++c<f;)for(var s=this[c],h=-1,p=s.length;++h<p;)if(r=s[h]){u=r[a][o],e=n.call(r,r.__data__,h,c),l.push(t=[]);for(var g=-1,v=e.length;++g<v;)(i=e[g])&&Qu(i,g,a,o,u),t.push(i)}return Wu(l,a,o)},Yl.filter=function(n){var t,e,r,i=[];"function"!=typeof n&&(n=O(n));for(var u=0,o=this.length;o>u;u++){i.push(t=[]);for(var e=this[u],a=0,l=e.length;l>a;a++)(r=e[a])&&n.call(r,r.__data__,a,u)&&t.push(r)}return Wu(i,this.namespace,this.id)},Yl.tween=function(n,t){var e=this.id,r=this.namespace;return arguments.length<2?this.node()[r][e].tween.get(n):Y(this,null==t?function(t){t[r][e].tween.remove(n)}:function(i){i[r][e].tween.set(n,t)})},Yl.attr=function(n,t){function e(){this.removeAttribute(a)}function r(){this.removeAttributeNS(a.space,a.local)}function i(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(a);return e!==n&&(t=o(e,n),function(n){this.setAttribute(a,t(n))})})}function u(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(a.space,a.local);return e!==n&&(t=o(e,n),function(n){this.setAttributeNS(a.space,a.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?$r:Mr,a=ao.ns.qualify(n);return Ju(this,"attr."+n,t,a.local?u:i)},Yl.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(i));return r&&function(n){this.setAttribute(i,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(i.space,i.local));return r&&function(n){this.setAttributeNS(i.space,i.local,r(n))}}var i=ao.ns.qualify(n);return this.tween("attr."+n,i.local?r:e)},Yl.style=function(n,e,r){function i(){this.style.removeProperty(n)}function u(e){return null==e?i:(e+="",function(){var i,u=t(this).getComputedStyle(this,null).getPropertyValue(n);return u!==e&&(i=Mr(u,e),function(t){this.style.setProperty(n,i(t),r)})})}var o=arguments.length;if(3>o){if("string"!=typeof n){2>o&&(e="");for(r in n)this.style(r,n[r],e);return this}r=""}return Ju(this,"style."+n,e,u)},Yl.styleTween=function(n,e,r){function i(i,u){var o=e.call(this,i,u,t(this).getComputedStyle(this,null).getPropertyValue(n));return o&&function(t){this.style.setProperty(n,o(t),r)}}return arguments.length<3&&(r=""),this.tween("style."+n,i)},Yl.text=function(n){return Ju(this,"text",n,Gu)},Yl.remove=function(){var n=this.namespace;return this.each("end.transition",function(){var t;this[n].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Yl.ease=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].ease:("function"!=typeof n&&(n=ao.ease.apply(ao,arguments)),Y(this,function(r){r[e][t].ease=n}))},Yl.delay=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].delay:Y(this,"function"==typeof n?function(r,i,u){r[e][t].delay=+n.call(r,r.__data__,i,u)}:(n=+n,function(r){r[e][t].delay=n}))},Yl.duration=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].duration:Y(this,"function"==typeof n?function(r,i,u){r[e][t].duration=Math.max(1,n.call(r,r.__data__,i,u))}:(n=Math.max(1,n),function(r){r[e][t].duration=n}))},Yl.each=function(n,t){var e=this.id,r=this.namespace;if(arguments.length<2){var i=Ol,u=Hl;try{Hl=e,Y(this,function(t,i,u){Ol=t[r][e],n.call(t,t.__data__,i,u)})}finally{Ol=i,Hl=u}}else Y(this,function(i){var u=i[r][e];(u.event||(u.event=ao.dispatch("start","end","interrupt"))).on(n,t)});return this},Yl.transition=function(){for(var n,t,e,r,i=this.id,u=++Zl,o=this.namespace,a=[],l=0,c=this.length;c>l;l++){a.push(n=[]);for(var t=this[l],f=0,s=t.length;s>f;f++)(e=t[f])&&(r=e[o][i],Qu(e,f,o,u,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),n.push(e)}return Wu(a,o,u)},ao.svg.axis=function(){function n(n){n.each(function(){var n,c=ao.select(this),f=this.__chart__||e,s=this.__chart__=e.copy(),h=null==l?s.ticks?s.ticks.apply(s,a):s.domain():l,p=null==t?s.tickFormat?s.tickFormat.apply(s,a):m:t,g=c.selectAll(".tick").data(h,s),v=g.enter().insert("g",".domain").attr("class","tick").style("opacity",Uo),d=ao.transition(g.exit()).style("opacity",Uo).remove(),y=ao.transition(g.order()).style("opacity",1),M=Math.max(i,0)+o,x=Zi(s),b=c.selectAll(".domain").data([0]),_=(b.enter().append("path").attr("class","domain"),ao.transition(b));v.append("line"),v.append("text");var w,S,k,N,E=v.select("line"),A=y.select("line"),C=g.select("text").text(p),z=v.select("text"),L=y.select("text"),q="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(n=no,w="x",k="y",S="x2",N="y2",C.attr("dy",0>q?"0em":".71em").style("text-anchor","middle"),_.attr("d","M"+x[0]+","+q*u+"V0H"+x[1]+"V"+q*u)):(n=to,w="y",k="x",S="y2",N="x2",C.attr("dy",".32em").style("text-anchor",0>q?"end":"start"),_.attr("d","M"+q*u+","+x[0]+"H0V"+x[1]+"H"+q*u)),E.attr(N,q*i),z.attr(k,q*M),A.attr(S,0).attr(N,q*i),L.attr(w,0).attr(k,q*M),s.rangeBand){var T=s,R=T.rangeBand()/2;f=s=function(n){return T(n)+R}}else f.rangeBand?f=s:d.call(n,s,f);v.call(n,f,s),y.call(n,s,s)})}var t,e=ao.scale.linear(),r=Vl,i=6,u=6,o=3,a=[10],l=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Xl?t+"":Vl,n):r},n.ticks=function(){return arguments.length?(a=co(arguments),n):a},n.tickValues=function(t){return arguments.length?(l=t,n):l},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(i=+t,u=+arguments[e-1],n):i},n.innerTickSize=function(t){return arguments.length?(i=+t,n):i},n.outerTickSize=function(t){return arguments.length?(u=+t,n):u},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var Vl="bottom",Xl={top:1,right:1,bottom:1,left:1};ao.svg.brush=function(){function n(t){t.each(function(){var t=ao.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",u).on("touchstart.brush",u),o=t.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=t.selectAll(".resize").data(v,m);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return $l[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),a.style("display",n.empty()?"none":null);var l,s=ao.transition(t),h=ao.transition(o);c&&(l=Zi(c),h.attr("x",l[0]).attr("width",l[1]-l[0]),r(s)),f&&(l=Zi(f),h.attr("y",l[0]).attr("height",l[1]-l[0]),i(s)),e(s)})}function e(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+s[+/e$/.test(n)]+","+h[+/^s/.test(n)]+")"})}function r(n){n.select(".extent").attr("x",s[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function i(n){n.select(".extent").attr("y",h[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function u(){function u(){32==ao.event.keyCode&&(C||(M=null,L[0]-=s[1],L[1]-=h[1],C=2),S())}function v(){32==ao.event.keyCode&&2==C&&(L[0]+=s[1],L[1]+=h[1],C=0,S())}function d(){var n=ao.mouse(b),t=!1;x&&(n[0]+=x[0],n[1]+=x[1]),C||(ao.event.altKey?(M||(M=[(s[0]+s[1])/2,(h[0]+h[1])/2]),L[0]=s[+(n[0]<M[0])],L[1]=h[+(n[1]<M[1])]):M=null),E&&y(n,c,0)&&(r(k),t=!0),A&&y(n,f,1)&&(i(k),t=!0),t&&(e(k),w({type:"brush",mode:C?"move":"resize"}))}function y(n,t,e){var r,i,u=Zi(t),l=u[0],c=u[1],f=L[e],v=e?h:s,d=v[1]-v[0];return C&&(l-=f,c-=d+f),r=(e?g:p)?Math.max(l,Math.min(c,n[e])):n[e],C?i=(r+=f)+d:(M&&(f=Math.max(l,Math.min(c,2*M[e]-r))),r>f?(i=r,r=f):i=f),v[0]!=r||v[1]!=i?(e?a=null:o=null,v[0]=r,v[1]=i,!0):void 0}function m(){d(),k.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),ao.select("body").style("cursor",null),q.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),z(),w({type:"brushend"})}var M,x,b=this,_=ao.select(ao.event.target),w=l.of(b,arguments),k=ao.select(b),N=_.datum(),E=!/^(n|s)$/.test(N)&&c,A=!/^(e|w)$/.test(N)&&f,C=_.classed("extent"),z=W(b),L=ao.mouse(b),q=ao.select(t(b)).on("keydown.brush",u).on("keyup.brush",v);if(ao.event.changedTouches?q.on("touchmove.brush",d).on("touchend.brush",m):q.on("mousemove.brush",d).on("mouseup.brush",m),k.interrupt().selectAll("*").interrupt(),C)L[0]=s[0]-L[0],L[1]=h[0]-L[1];else if(N){var T=+/w$/.test(N),R=+/^n/.test(N);x=[s[1-T]-L[0],h[1-R]-L[1]],L[0]=s[T],L[1]=h[R]}else ao.event.altKey&&(M=L.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null),ao.select("body").style("cursor",_.style("cursor")),w({type:"brushstart"}),d()}var o,a,l=N(n,"brushstart","brush","brushend"),c=null,f=null,s=[0,0],h=[0,0],p=!0,g=!0,v=Bl[0];return n.event=function(n){n.each(function(){var n=l.of(this,arguments),t={x:s,y:h,i:o,j:a},e=this.__chart__||t;this.__chart__=t,Hl?ao.select(this).transition().each("start.brush",function(){o=e.i,a=e.j,s=e.x,h=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=xr(s,t.x),r=xr(h,t.y);return o=a=null,function(i){s=t.x=e(i),h=t.y=r(i),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){o=t.i,a=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(c=t,v=Bl[!c<<1|!f],n):c},n.y=function(t){return arguments.length?(f=t,v=Bl[!c<<1|!f],n):f},n.clamp=function(t){return arguments.length?(c&&f?(p=!!t[0],g=!!t[1]):c?p=!!t:f&&(g=!!t),n):c&&f?[p,g]:c?p:f?g:null},n.extent=function(t){var e,r,i,u,l;return arguments.length?(c&&(e=t[0],r=t[1],f&&(e=e[0],r=r[0]),o=[e,r],c.invert&&(e=c(e),r=c(r)),e>r&&(l=e,e=r,r=l),e==s[0]&&r==s[1]||(s=[e,r])),f&&(i=t[0],u=t[1],c&&(i=i[1],u=u[1]),a=[i,u],f.invert&&(i=f(i),u=f(u)),i>u&&(l=i,i=u,u=l),i==h[0]&&u==h[1]||(h=[i,u])),n):(c&&(o?(e=o[0],r=o[1]):(e=s[0],r=s[1],c.invert&&(e=c.invert(e),r=c.invert(r)),e>r&&(l=e,e=r,r=l))),f&&(a?(i=a[0],u=a[1]):(i=h[0],u=h[1],f.invert&&(i=f.invert(i),u=f.invert(u)),i>u&&(l=i,i=u,u=l))),c&&f?[[e,i],[r,u]]:c?[e,r]:f&&[i,u])},n.clear=function(){return n.empty()||(s=[0,0],h=[0,0],o=a=null),n},n.empty=function(){return!!c&&s[0]==s[1]||!!f&&h[0]==h[1]},ao.rebind(n,l,"on")};var $l={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Bl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Wl=ga.format=xa.timeFormat,Jl=Wl.utc,Gl=Jl("%Y-%m-%dT%H:%M:%S.%LZ");Wl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?eo:Gl,eo.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},eo.toString=Gl.toString,ga.second=On(function(n){return new va(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),ga.seconds=ga.second.range,ga.seconds.utc=ga.second.utc.range,ga.minute=On(function(n){return new va(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),ga.minutes=ga.minute.range,ga.minutes.utc=ga.minute.utc.range,ga.hour=On(function(n){var t=n.getTimezoneOffset()/60;return new va(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),ga.hours=ga.hour.range,ga.hours.utc=ga.hour.utc.range,ga.month=On(function(n){return n=ga.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),ga.months=ga.month.range,ga.months.utc=ga.month.utc.range;var Kl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Ql=[[ga.second,1],[ga.second,5],[ga.second,15],[ga.second,30],[ga.minute,1],[ga.minute,5],[ga.minute,15],[ga.minute,30],[ga.hour,1],[ga.hour,3],[ga.hour,6],[ga.hour,12],[ga.day,1],[ga.day,2],[ga.week,1],[ga.month,1],[ga.month,3],[ga.year,1]],nc=Wl.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",zt]]),tc={range:function(n,t,e){return ao.range(Math.ceil(n/e)*e,+t,e).map(io)},floor:m,ceil:m};Ql.year=ga.year,ga.scale=function(){return ro(ao.scale.linear(),Ql,nc)};var ec=Ql.map(function(n){return[n[0].utc,n[1]]}),rc=Jl.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",zt]]);ec.year=ga.year.utc,ga.scale.utc=function(){return ro(ao.scale.linear(),ec,rc)},ao.text=An(function(n){return n.responseText}),ao.json=function(n,t){return Cn(n,"application/json",uo,t)},ao.html=function(n,t){return Cn(n,"text/html",oo,t)},ao.xml=An(function(n){return n.responseXML}),"function"==typeof define&&define.amd?(this.d3=ao,define(ao)):"object"==typeof module&&module.exports?module.exports=ao:this.d3=ao}();/*
46163 Copyright (C) Federico Zivolo 2019
46164 Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT).
46165 */(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.Popper=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var o=e.ownerDocument.defaultView,n=o.getComputedStyle(e,null);return t?n[t]:n}function o(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function n(e){if(!e)return document.body;switch(e.nodeName){case'HTML':case'BODY':return e.ownerDocument.body;case'#document':return e.body;}var i=t(e),r=i.overflow,p=i.overflowX,s=i.overflowY;return /(auto|scroll|overlay)/.test(r+s+p)?e:n(o(e))}function r(e){return 11===e?pe:10===e?se:pe||se}function p(e){if(!e)return document.documentElement;for(var o=r(10)?document.body:null,n=e.offsetParent||null;n===o&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TH','TD','TABLE'].indexOf(n.nodeName)&&'static'===t(n,'position')?p(n):n:e?e.ownerDocument.documentElement:document.documentElement}function s(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||p(e.firstElementChild)===e)}function d(e){return null===e.parentNode?e:d(e.parentNode)}function a(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,n=o?e:t,i=o?t:e,r=document.createRange();r.setStart(n,0),r.setEnd(i,0);var l=r.commonAncestorContainer;if(e!==l&&t!==l||n.contains(i))return s(l)?l:p(l);var f=d(e);return f.host?a(f.host,t):a(e,d(t).host)}function l(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:'top',o='top'===t?'scrollTop':'scrollLeft',n=e.nodeName;if('BODY'===n||'HTML'===n){var i=e.ownerDocument.documentElement,r=e.ownerDocument.scrollingElement||i;return r[o]}return e[o]}function f(e,t){var o=2<arguments.length&&void 0!==arguments[2]&&arguments[2],n=l(t,'top'),i=l(t,'left'),r=o?-1:1;return e.top+=n*r,e.bottom+=n*r,e.left+=i*r,e.right+=i*r,e}function m(e,t){var o='x'===t?'Left':'Top',n='Left'==o?'Right':'Bottom';return parseFloat(e['border'+o+'Width'],10)+parseFloat(e['border'+n+'Width'],10)}function h(e,t,o,n){return ee(t['offset'+e],t['scroll'+e],o['client'+e],o['offset'+e],o['scroll'+e],r(10)?parseInt(o['offset'+e])+parseInt(n['margin'+('Height'===e?'Top':'Left')])+parseInt(n['margin'+('Height'===e?'Bottom':'Right')]):0)}function c(e){var t=e.body,o=e.documentElement,n=r(10)&&getComputedStyle(o);return{height:h('Height',t,o,n),width:h('Width',t,o,n)}}function g(e){return fe({},e,{right:e.left+e.width,bottom:e.top+e.height})}function u(e){var o={};try{if(r(10)){o=e.getBoundingClientRect();var n=l(e,'top'),i=l(e,'left');o.top+=n,o.left+=i,o.bottom+=n,o.right+=i}else o=e.getBoundingClientRect()}catch(t){}var p={left:o.left,top:o.top,width:o.right-o.left,height:o.bottom-o.top},s='HTML'===e.nodeName?c(e.ownerDocument):{},d=s.width||e.clientWidth||p.right-p.left,a=s.height||e.clientHeight||p.bottom-p.top,f=e.offsetWidth-d,h=e.offsetHeight-a;if(f||h){var u=t(e);f-=m(u,'x'),h-=m(u,'y'),p.width-=f,p.height-=h}return g(p)}function b(e,o){var i=2<arguments.length&&void 0!==arguments[2]&&arguments[2],p=r(10),s='HTML'===o.nodeName,d=u(e),a=u(o),l=n(e),m=t(o),h=parseFloat(m.borderTopWidth,10),c=parseFloat(m.borderLeftWidth,10);i&&s&&(a.top=ee(a.top,0),a.left=ee(a.left,0));var b=g({top:d.top-a.top-h,left:d.left-a.left-c,width:d.width,height:d.height});if(b.marginTop=0,b.marginLeft=0,!p&&s){var w=parseFloat(m.marginTop,10),y=parseFloat(m.marginLeft,10);b.top-=h-w,b.bottom-=h-w,b.left-=c-y,b.right-=c-y,b.marginTop=w,b.marginLeft=y}return(p&&!i?o.contains(l):o===l&&'BODY'!==l.nodeName)&&(b=f(b,o)),b}function w(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=e.ownerDocument.documentElement,n=b(e,o),i=ee(o.clientWidth,window.innerWidth||0),r=ee(o.clientHeight,window.innerHeight||0),p=t?0:l(o),s=t?0:l(o,'left'),d={top:p-n.top+n.marginTop,left:s-n.left+n.marginLeft,width:i,height:r};return g(d)}function y(e){var n=e.nodeName;if('BODY'===n||'HTML'===n)return!1;if('fixed'===t(e,'position'))return!0;var i=o(e);return!!i&&y(i)}function E(e){if(!e||!e.parentElement||r())return document.documentElement;for(var o=e.parentElement;o&&'none'===t(o,'transform');)o=o.parentElement;return o||document.documentElement}function v(e,t,i,r){var p=4<arguments.length&&void 0!==arguments[4]&&arguments[4],s={top:0,left:0},d=p?E(e):a(e,t);if('viewport'===r)s=w(d,p);else{var l;'scrollParent'===r?(l=n(o(t)),'BODY'===l.nodeName&&(l=e.ownerDocument.documentElement)):'window'===r?l=e.ownerDocument.documentElement:l=r;var f=b(l,d,p);if('HTML'===l.nodeName&&!y(d)){var m=c(e.ownerDocument),h=m.height,g=m.width;s.top+=f.top-f.marginTop,s.bottom=h+f.top,s.left+=f.left-f.marginLeft,s.right=g+f.left}else s=f}i=i||0;var u='number'==typeof i;return s.left+=u?i:i.left||0,s.top+=u?i:i.top||0,s.right-=u?i:i.right||0,s.bottom-=u?i:i.bottom||0,s}function x(e){var t=e.width,o=e.height;return t*o}function O(e,t,o,n,i){var r=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf('auto'))return e;var p=v(o,n,r,i),s={top:{width:p.width,height:t.top-p.top},right:{width:p.right-t.right,height:p.height},bottom:{width:p.width,height:p.bottom-t.bottom},left:{width:t.left-p.left,height:p.height}},d=Object.keys(s).map(function(e){return fe({key:e},s[e],{area:x(s[e])})}).sort(function(e,t){return t.area-e.area}),a=d.filter(function(e){var t=e.width,n=e.height;return t>=o.clientWidth&&n>=o.clientHeight}),l=0<a.length?a[0].key:d[0].key,f=e.split('-')[1];return l+(f?'-'+f:'')}function L(e,t,o){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,i=n?E(t):a(t,o);return b(o,i,n)}function S(e){var t=e.ownerDocument.defaultView,o=t.getComputedStyle(e),n=parseFloat(o.marginTop||0)+parseFloat(o.marginBottom||0),i=parseFloat(o.marginLeft||0)+parseFloat(o.marginRight||0),r={width:e.offsetWidth+i,height:e.offsetHeight+n};return r}function T(e){var t={left:'right',right:'left',bottom:'top',top:'bottom'};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function C(e,t,o){o=o.split('-')[0];var n=S(e),i={width:n.width,height:n.height},r=-1!==['right','left'].indexOf(o),p=r?'top':'left',s=r?'left':'top',d=r?'height':'width',a=r?'width':'height';return i[p]=t[p]+t[d]/2-n[d]/2,i[s]=o===s?t[s]-n[a]:t[T(s)],i}function D(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function N(e,t,o){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===o});var n=D(e,function(e){return e[t]===o});return e.indexOf(n)}function P(t,o,n){var i=void 0===n?t:t.slice(0,N(t,'name',n));return i.forEach(function(t){t['function']&&console.warn('`modifier.function` is deprecated, use `modifier.fn`!');var n=t['function']||t.fn;t.enabled&&e(n)&&(o.offsets.popper=g(o.offsets.popper),o.offsets.reference=g(o.offsets.reference),o=n(o,t))}),o}function k(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=L(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=O(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=C(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?'fixed':'absolute',e=P(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function W(e,t){return e.some(function(e){var o=e.name,n=e.enabled;return n&&o===t})}function B(e){for(var t=[!1,'ms','Webkit','Moz','O'],o=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<t.length;n++){var i=t[n],r=i?''+i+o:e;if('undefined'!=typeof document.body.style[r])return r}return null}function H(){return this.state.isDestroyed=!0,W(this.modifiers,'applyStyle')&&(this.popper.removeAttribute('x-placement'),this.popper.style.position='',this.popper.style.top='',this.popper.style.left='',this.popper.style.right='',this.popper.style.bottom='',this.popper.style.willChange='',this.popper.style[B('transform')]=''),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function A(e){var t=e.ownerDocument;return t?t.defaultView:window}function M(e,t,o,i){var r='BODY'===e.nodeName,p=r?e.ownerDocument.defaultView:e;p.addEventListener(t,o,{passive:!0}),r||M(n(p.parentNode),t,o,i),i.push(p)}function F(e,t,o,i){o.updateBound=i,A(e).addEventListener('resize',o.updateBound,{passive:!0});var r=n(e);return M(r,'scroll',o.updateBound,o.scrollParents),o.scrollElement=r,o.eventsEnabled=!0,o}function I(){this.state.eventsEnabled||(this.state=F(this.reference,this.options,this.state,this.scheduleUpdate))}function R(e,t){return A(e).removeEventListener('resize',t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener('scroll',t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}function U(){this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=R(this.reference,this.state))}function Y(e){return''!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function V(e,t){Object.keys(t).forEach(function(o){var n='';-1!==['width','height','top','right','bottom','left'].indexOf(o)&&Y(t[o])&&(n='px'),e.style[o]=t[o]+n})}function j(e,t){Object.keys(t).forEach(function(o){var n=t[o];!1===n?e.removeAttribute(o):e.setAttribute(o,t[o])})}function q(e,t){var o=e.offsets,n=o.popper,i=o.reference,r=$,p=function(e){return e},s=r(i.width),d=r(n.width),a=-1!==['left','right'].indexOf(e.placement),l=-1!==e.placement.indexOf('-'),f=t?a||l||s%2==d%2?r:Z:p,m=t?r:p;return{left:f(1==s%2&&1==d%2&&!l&&t?n.left-1:n.left),top:m(n.top),bottom:m(n.bottom),right:f(n.right)}}function K(e,t,o){var n=D(e,function(e){var o=e.name;return o===t}),i=!!n&&e.some(function(e){return e.name===o&&e.enabled&&e.order<n.order});if(!i){var r='`'+t+'`';console.warn('`'+o+'`'+' modifier is required by '+r+' modifier in order to work, be sure to include it before '+r+'!')}return i}function z(e){return'end'===e?'start':'start'===e?'end':e}function G(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=ce.indexOf(e),n=ce.slice(o+1).concat(ce.slice(0,o));return t?n.reverse():n}function _(e,t,o,n){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),r=+i[1],p=i[2];if(!r)return e;if(0===p.indexOf('%')){var s;switch(p){case'%p':s=o;break;case'%':case'%r':default:s=n;}var d=g(s);return d[t]/100*r}if('vh'===p||'vw'===p){var a;return a='vh'===p?ee(document.documentElement.clientHeight,window.innerHeight||0):ee(document.documentElement.clientWidth,window.innerWidth||0),a/100*r}return r}function X(e,t,o,n){var i=[0,0],r=-1!==['right','left'].indexOf(n),p=e.split(/(\+|\-)/).map(function(e){return e.trim()}),s=p.indexOf(D(p,function(e){return-1!==e.search(/,|\s/)}));p[s]&&-1===p[s].indexOf(',')&&console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');var d=/\s*,\s*|\s+/,a=-1===s?[p]:[p.slice(0,s).concat([p[s].split(d)[0]]),[p[s].split(d)[1]].concat(p.slice(s+1))];return a=a.map(function(e,n){var i=(1===n?!r:r)?'height':'width',p=!1;return e.reduce(function(e,t){return''===e[e.length-1]&&-1!==['+','-'].indexOf(t)?(e[e.length-1]=t,p=!0,e):p?(e[e.length-1]+=t,p=!1,e):e.concat(t)},[]).map(function(e){return _(e,i,t,o)})}),a.forEach(function(e,t){e.forEach(function(o,n){Y(o)&&(i[t]+=o*('-'===e[n-1]?-1:1))})}),i}function J(e,t){var o,n=t.offset,i=e.placement,r=e.offsets,p=r.popper,s=r.reference,d=i.split('-')[0];return o=Y(+n)?[+n,0]:X(n,p,s,d),'left'===d?(p.top+=o[0],p.left-=o[1]):'right'===d?(p.top+=o[0],p.left+=o[1]):'top'===d?(p.left+=o[0],p.top-=o[1]):'bottom'===d&&(p.left+=o[0],p.top+=o[1]),e.popper=p,e}for(var Q=Math.min,Z=Math.floor,$=Math.round,ee=Math.max,te='undefined'!=typeof window&&'undefined'!=typeof document,oe=['Edge','Trident','Firefox'],ne=0,ie=0;ie<oe.length;ie+=1)if(te&&0<=navigator.userAgent.indexOf(oe[ie])){ne=1;break}var i=te&&window.Promise,re=i?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},ne))}},pe=te&&!!(window.MSInputMethodContext&&document.documentMode),se=te&&/MSIE 10/.test(navigator.userAgent),de=function(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')},ae=function(){function e(e,t){for(var o,n=0;n<t.length;n++)o=t[n],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),le=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},fe=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var n in t=arguments[o],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},me=te&&/Firefox/i.test(navigator.userAgent),he=['auto-start','auto','auto-end','top-start','top','top-end','right-start','right','right-end','bottom-end','bottom','bottom-start','left-end','left','left-start'],ce=he.slice(3),ge={FLIP:'flip',CLOCKWISE:'clockwise',COUNTERCLOCKWISE:'counterclockwise'},ue=function(){function t(o,n){var i=this,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};de(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=re(this.update.bind(this)),this.options=fe({},t.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=o&&o.jquery?o[0]:o,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(fe({},t.Defaults.modifiers,r.modifiers)).forEach(function(e){i.options.modifiers[e]=fe({},t.Defaults.modifiers[e]||{},r.modifiers?r.modifiers[e]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return fe({name:e},i.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(t){t.enabled&&e(t.onLoad)&&t.onLoad(i.reference,i.popper,i.options,t,i.state)}),this.update();var p=this.options.eventsEnabled;p&&this.enableEventListeners(),this.state.eventsEnabled=p}return ae(t,[{key:'update',value:function(){return k.call(this)}},{key:'destroy',value:function(){return H.call(this)}},{key:'enableEventListeners',value:function(){return I.call(this)}},{key:'disableEventListeners',value:function(){return U.call(this)}}]),t}();return ue.Utils=('undefined'==typeof window?global:window).PopperUtils,ue.placements=he,ue.Defaults={placement:'bottom',positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,o=t.split('-')[0],n=t.split('-')[1];if(n){var i=e.offsets,r=i.reference,p=i.popper,s=-1!==['bottom','top'].indexOf(o),d=s?'left':'top',a=s?'width':'height',l={start:le({},d,r[d]),end:le({},d,r[d]+r[a]-p[a])};e.offsets.popper=fe({},p,l[n])}return e}},offset:{order:200,enabled:!0,fn:J,offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var o=t.boundariesElement||p(e.instance.popper);e.instance.reference===o&&(o=p(o));var n=B('transform'),i=e.instance.popper.style,r=i.top,s=i.left,d=i[n];i.top='',i.left='',i[n]='';var a=v(e.instance.popper,e.instance.reference,t.padding,o,e.positionFixed);i.top=r,i.left=s,i[n]=d,t.boundaries=a;var l=t.priority,f=e.offsets.popper,m={primary:function(e){var o=f[e];return f[e]<a[e]&&!t.escapeWithReference&&(o=ee(f[e],a[e])),le({},e,o)},secondary:function(e){var o='right'===e?'left':'top',n=f[o];return f[e]>a[e]&&!t.escapeWithReference&&(n=Q(f[o],a[e]-('right'===e?f.width:f.height))),le({},o,n)}};return l.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';f=fe({},f,m[t](e))}),e.offsets.popper=f,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,n=t.reference,i=e.placement.split('-')[0],r=Z,p=-1!==['top','bottom'].indexOf(i),s=p?'right':'bottom',d=p?'left':'top',a=p?'width':'height';return o[s]<r(n[d])&&(e.offsets.popper[d]=r(n[d])-o[a]),o[d]>r(n[s])&&(e.offsets.popper[d]=r(n[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,o){var n;if(!K(e.instance.modifiers,'arrow','keepTogether'))return e;var i=o.element;if('string'==typeof i){if(i=e.instance.popper.querySelector(i),!i)return e;}else if(!e.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var r=e.placement.split('-')[0],p=e.offsets,s=p.popper,d=p.reference,a=-1!==['left','right'].indexOf(r),l=a?'height':'width',f=a?'Top':'Left',m=f.toLowerCase(),h=a?'left':'top',c=a?'bottom':'right',u=S(i)[l];d[c]-u<s[m]&&(e.offsets.popper[m]-=s[m]-(d[c]-u)),d[m]+u>s[c]&&(e.offsets.popper[m]+=d[m]+u-s[c]),e.offsets.popper=g(e.offsets.popper);var b=d[m]+d[l]/2-u/2,w=t(e.instance.popper),y=parseFloat(w['margin'+f],10),E=parseFloat(w['border'+f+'Width'],10),v=b-e.offsets.popper[m]-y-E;return v=ee(Q(s[l]-u,v),0),e.arrowElement=i,e.offsets.arrow=(n={},le(n,m,$(v)),le(n,h,''),n),e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(W(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=v(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),n=e.placement.split('-')[0],i=T(n),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case ge.FLIP:p=[n,i];break;case ge.CLOCKWISE:p=G(n);break;case ge.COUNTERCLOCKWISE:p=G(n,!0);break;default:p=t.behavior;}return p.forEach(function(s,d){if(n!==s||p.length===d+1)return e;n=e.placement.split('-')[0],i=T(n);var a=e.offsets.popper,l=e.offsets.reference,f=Z,m='left'===n&&f(a.right)>f(l.left)||'right'===n&&f(a.left)<f(l.right)||'top'===n&&f(a.bottom)>f(l.top)||'bottom'===n&&f(a.top)<f(l.bottom),h=f(a.left)<f(o.left),c=f(a.right)>f(o.right),g=f(a.top)<f(o.top),u=f(a.bottom)>f(o.bottom),b='left'===n&&h||'right'===n&&c||'top'===n&&g||'bottom'===n&&u,w=-1!==['top','bottom'].indexOf(n),y=!!t.flipVariations&&(w&&'start'===r&&h||w&&'end'===r&&c||!w&&'start'===r&&g||!w&&'end'===r&&u),E=!!t.flipVariationsByContent&&(w&&'start'===r&&c||w&&'end'===r&&h||!w&&'start'===r&&u||!w&&'end'===r&&g),v=y||E;(m||b||v)&&(e.flipped=!0,(m||b)&&(n=p[d+1]),v&&(r=z(r)),e.placement=n+(r?'-'+r:''),e.offsets.popper=fe({},e.offsets.popper,C(e.instance.popper,e.offsets.reference,e.placement)),e=P(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport',flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],n=e.offsets,i=n.popper,r=n.reference,p=-1!==['left','right'].indexOf(o),s=-1===['top','left'].indexOf(o);return i[p?'left':'top']=r[o]-(s?i[p?'width':'height']:0),e.placement=T(t),e.offsets.popper=g(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!K(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=D(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottom<o.top||t.left>o.right||t.top>o.bottom||t.right<o.left){if(!0===e.hide)return e;e.hide=!0,e.attributes['x-out-of-boundaries']=''}else{if(!1===e.hide)return e;e.hide=!1,e.attributes['x-out-of-boundaries']=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var o=t.x,n=t.y,i=e.offsets.popper,r=D(e.instance.modifiers,function(e){return'applyStyle'===e.name}).gpuAcceleration;void 0!==r&&console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');var s,d,a=void 0===r?t.gpuAcceleration:r,l=p(e.instance.popper),f=u(l),m={position:i.position},h=q(e,2>window.devicePixelRatio||!me),c='bottom'===o?'top':'bottom',g='right'===n?'left':'right',b=B('transform');if(d='bottom'==c?'HTML'===l.nodeName?-l.clientHeight+h.bottom:-f.height+h.bottom:h.top,s='right'==g?'HTML'===l.nodeName?-l.clientWidth+h.right:-f.width+h.right:h.left,a&&b)m[b]='translate3d('+s+'px, '+d+'px, 0)',m[c]=0,m[g]=0,m.willChange='transform';else{var w='bottom'==c?-1:1,y='right'==g?-1:1;m[c]=d*w,m[g]=s*y,m.willChange=c+', '+g}var E={"x-placement":e.placement};return e.attributes=fe({},E,e.attributes),e.styles=fe({},m,e.styles),e.arrowStyles=fe({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:'bottom',y:'right'},applyStyle:{order:900,enabled:!0,fn:function(e){return V(e.instance.popper,e.styles),j(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&V(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,o,n,i){var r=L(i,t,e,o.positionFixed),p=O(o.placement,r,t,e,o.modifiers.flip.boundariesElement,o.modifiers.flip.padding);return t.setAttribute('x-placement',p),V(t,{position:o.positionFixed?'fixed':'absolute'}),o},gpuAcceleration:void 0}}},ue});
46166//# sourceMappingURL=popper.min.js.map
46167/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */
46168!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),D=function(e,t){return e===t&&(l=!0),0},j={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&j.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(D),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(B," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace($,"$1"));return s[S]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[S]||(e[S]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[S]&&(v=Ce(v)),y&&!y[S]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace($,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace($," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=A[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[S]?i.push(a):o.push(a);(a=A(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=S.split("").sort(D).join("")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);S.find=d,S.expr=d.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=d.uniqueSort,S.text=d.getText,S.isXMLDoc=d.isXML,S.contains=d.contains,S.escapeSelector=d.escape;var h=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(D(this,e||[],!1))},not:function(e){return this.pushStack(D(this,e||[],!0))},is:function(e){return!!D(this,"string"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var j,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t,n){return h(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return h(e,"nextSibling")},prevAll:function(e){return h(e,"previousSibling")},nextUntil:function(e,t,n){return h(e,"nextSibling",n)},prevUntil:function(e,t,n){return h(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},S.each(e.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){var n;while(-1<(n=S.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},S.extend({Deferred:function(e){var o=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){C.setTimeout(function(){throw e})};var F=S.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),S.ready()}S.fn.ready=function(e){return F.then(e)["catch"](function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}}),S.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener("DOMContentLoaded",B),C.addEventListener("load",B));var $=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)$(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;while(n--)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){Q.set(this,n)}):$(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===S.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=s(),l=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Y.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ue[s]=u)))):"none"!==n&&(l[c]="none",Y.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",y.option=!!ce.lastChild;var ge={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,y.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","</select>"]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;S.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ve(f.appendChild(o),"script"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}var be=/^key/,we=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Te=/^([^.]*)(?:\.(.+)|)/;function Ce(){return!0}function Ee(){return!1}function Se(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function ke(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)ke(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ee;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Ae(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,Ce)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(t);if(V(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(P)||[""]).length;while(l--)d=g=(s=Te.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(P)||[""]).length;while(l--)if(d=g=(s=Te.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||S.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=S.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Ae(t,"click",Ce),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Ae(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ce:Ee,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Ee,isPropagationStopped:Ee,isImmediatePropagationStopped:Ee,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ce,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ce,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ce,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&be.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&we.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Ae(this,e,Se),!1},trigger:function(){return Ae(this,e),!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return ke(this,e,t,n,r)},one:function(e,t,n,r){return ke(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Ee),this.each(function(){S.event.remove(this,e,n,t)})}});var Ne=/<script|<style|<link/i,De=/checked\s*(?:[^=]|=\s*.checked.)/i,je=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=S.extend({},o),Q.set(t,a))}}function Pe(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!y.checkClone&&De.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),Pe(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ve(e,"script"),Le)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,He),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Y.access(u,"globalEval")&&S.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):b(u.textContent.replace(je,""),u,l))}return n}function Re(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ve(r)),r.parentNode&&(n&&ie(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Oe(o[r],a[r]);else Oe(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(e,"script")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Re(this,e,!0)},remove:function(e){return Re(this,e)},text:function(e){return $(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Pe(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||qe(this,e).appendChild(e)})},prepend:function(){return Pe(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=qe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ne.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return Pe(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Me=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Ie=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},We=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Fe=new RegExp(ne.join("|"),"i");function Be(e,t,n){var r,i,o,a,s=e.style;return(n=n||Ie(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ie(e)||(a=S.style(e,t)),!y.pixelBoxStyles()&&Me.test(a)&&Fe.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function $e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement("div"),l=E.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=E.createElement("table"),t=E.createElement("tr"),n=E.createElement("div"),e.style.cssText="position:absolute;left:-11111px",t.style.height="1px",n.style.height="9px",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=3<parseInt(r.height),re.removeChild(e)),a}}))}();var _e=["Webkit","Moz","ms"],ze=E.createElement("div").style,Ue={};function Xe(e){var t=S.cssProps[e]||Ue[e];return t||(e in ze?e:Ue[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=_e.length;while(n--)if((e=_e[n]+t)in ze)return e}(e)||e)}var Ve=/^(none|table(?!-c[ea]).+)/,Ge=/^--/,Ye={position:"absolute",visibility:"hidden",display:"block"},Qe={letterSpacing:"0",fontWeight:"400"};function Je(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ke(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+ne[a]+"Width",!0,i))):(u+=S.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=S.css(e,"border"+ne[a]+"Width",!0,i):s+=S.css(e,"border"+ne[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Ze(e,t,n){var r=Ie(e),i=(!y.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=Be(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Me.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||!y.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Ke(e,t,n||(i?"border":"content"),o,r,a)+"px"}function et(e,t,n,r,i){return new et.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Be(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Ge.test(t),l=e.style;if(u||(t=Xe(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Ge.test(t)||(t=Xe(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Be(e,t,r)),"normal"===i&&t in Qe&&(i=Qe[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ve.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Ze(e,u,n):We(e,Ye,function(){return Ze(e,u,n)})},set:function(e,t,n){var r,i=Ie(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===S.css(e,"boxSizing",!1,i),s=n?Ke(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Ke(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=S.css(e,u)),Je(0,t,s)}}}),S.cssHooks.marginLeft=$e(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Be(e,"marginLeft"))||e.getBoundingClientRect().left-We(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(S.cssHooks[i+o].set=Je)}),S.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Ie(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=et).prototype={constructor:et,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,n=et.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):et.propHooks._default.set(this),this}}).init.prototype=et.prototype,(et.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Xe(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=et.prototype.init,S.fx.step={};var tt,nt,rt,it,ot=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function st(){nt&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(st):C.setTimeout(st,S.fx.interval),S.fx.tick())}function ut(){return C.setTimeout(function(){tt=void 0}),tt=Date.now()}function lt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ct(e,t,n){for(var r,i=(ft.tweeners[t]||[]).concat(ft.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ft(o,e,t){var n,a,r=0,i=ft.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=tt||ut(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:tt||ut(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=ft.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ct,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(ft,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],ft.tweeners[n]=ft.tweeners[n]||[],ft.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),v=Y.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ot.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,"display"),le([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Y.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,"fxshow"),d)S.style(e,r,d[r])})),u=ct(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ft.prefilters.unshift(e):ft.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=ft(this,S.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&at.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Y.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each(["toggle","show","hide"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(lt(r,!0),e,t,n)}}),S.each({slideDown:lt("show"),slideUp:lt("hide"),slideToggle:lt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(tt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),tt=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){nt||(nt=!0,st())},S.fx.stop=function(){nt=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},rt=E.createElement("input"),it=E.createElement("select").appendChild(E.createElement("option")),rt.type="checkbox",y.checkOn=""!==rt.value,y.optSelected=it.selected,(rt=E.createElement("input")).value="t",rt.type="radio",y.radioValue="t"===rt.value;var pt,dt=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return $(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),pt={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var a=dt[t]||S.find.attr;dt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=dt[o],dt[o]=r,r=null!=a(e,t,n)?o:null,dt[o]=i),r}});var ht=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function vt(e){return(e.match(P)||[]).join(" ")}function yt(e){return e.getAttribute&&e.getAttribute("class")||""}function mt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return $(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):ht.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),y.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).addClass(t.call(this,e,yt(this)))});if((e=mt(t)).length)while(n=this[u++])if(i=yt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=e[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).removeClass(t.call(this,e,yt(this)))});if(!arguments.length)return this.attr("class","");if((e=mt(t)).length)while(n=this[u++])if(i=yt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=e[a++])while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){S(this).toggleClass(i.call(this,e,yt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=S(this),r=mt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&"boolean"!==o||((e=yt(this))&&Y.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+vt(yt(n))+" ").indexOf(t))return!0;return!1}});var xt=/\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,S(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?"":e+""})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(xt,""):null==e?"":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:vt(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=S.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},y.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;var bt=/^(?:focusinfocus|focusoutblur)$/,wt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!bt.test(d+S.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[S.expando]?e:new S.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,bt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,wt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,wt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),y.focusin||S.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){S.event.simulate(r,e.target,S.event.fix(e))};S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var Tt=C.location,Ct={guid:Date.now()},Et=/\?/;S.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||S.error("Invalid XML: "+e),t};var St=/\[\]$/,kt=/\r?\n/g,At=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;function Dt(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||St.test(n)?i(n,t):Dt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)Dt(n+"["+t+"]",e[t],r,i)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)Dt(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Nt.test(this.nodeName)&&!At.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(kt,"\r\n")}}):{name:t.name,value:n.replace(kt,"\r\n")}}).get()}});var jt=/%20/g,qt=/#.*$/,Lt=/([?&])_=[^&]*/,Ht=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Pt=/^\/\//,Rt={},Mt={},It="*/".concat("*"),Wt=E.createElement("a");function Ft(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Bt(t,i,o,a){var s={},u=t===Mt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function $t(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Wt.href=Tt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Tt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Tt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":It,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?$t($t(e,S.ajaxSettings),t):$t(S.ajaxSettings,e)},ajaxPrefilter:Ft(Rt),ajaxTransport:Ft(Mt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=S.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?S(y):S.event,x=S.Deferred(),b=S.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Ht.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Tt.href)+"").replace(Pt,Tt.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(P)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Wt.protocol+"//"+Wt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=S.param(v.data,v.traditional)),Bt(Rt,v,t,T),h)return T;for(i in(g=S.event&&v.global)&&0==S.active++&&S.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Ot.test(v.type),f=v.url.replace(qt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(jt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(Et.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Lt,"$1"),o=(Et.test(f)?"&":"?")+"_="+Ct.guid+++o),v.url=f+o),v.ifModified&&(S.lastModified[f]&&T.setRequestHeader("If-Modified-Since",S.lastModified[f]),S.etag[f]&&T.setRequestHeader("If-None-Match",S.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+It+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Bt(Mt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<S.inArray("script",v.dataTypes)&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(S.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(S.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var _t={0:200,1223:204},zt=S.ajaxSettings.xhr();y.cors=!!zt&&"withCredentials"in zt,y.ajax=zt=!!zt,S.ajaxTransport(function(i){var o,a;if(y.cors||zt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(_t[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=vt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Gt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=m,S.isWindow=x,S.camelCase=X,S.type=w,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Gt,"")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return S});var Yt=C.jQuery,Qt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Qt),e&&C.jQuery===S&&(C.jQuery=Yt),S},"undefined"==typeof e&&(C.jQuery=C.$=S),S});
46169/*!
46170  * Bootstrap v4.5.0 (https://getbootstrap.com/)
46171  * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
46172  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
46173  */
46174!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e((t=t||self).bootstrap={},t.jQuery,t.Popper)}(this,(function(t,e,n){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;function l(t){var n=this,i=!1;return e(this).one(c.TRANSITION_END,(function(){i=!0})),setTimeout((function(){i||c.triggerTransitionEnd(n)}),t),this}var c={TRANSITION_END:"bsTransitionEnd",getUID:function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},getSelectorFromElement:function(t){var e=t.getAttribute("data-target");if(!e||"#"===e){var n=t.getAttribute("href");e=n&&"#"!==n?n.trim():""}try{return document.querySelector(e)?e:null}catch(t){return null}},getTransitionDurationFromElement:function(t){if(!t)return 0;var n=e(t).css("transition-duration"),i=e(t).css("transition-delay"),o=parseFloat(n),s=parseFloat(i);return o||s?(n=n.split(",")[0],i=i.split(",")[0],1e3*(parseFloat(n)+parseFloat(i))):0},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(t){e(t).trigger("transitionend")},supportsTransitionEnd:function(){return Boolean("transitionend")},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,n){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var o=n[i],s=e[i],r=s&&c.isElement(s)?"element":null===(a=s)||"undefined"==typeof a?""+a:{}.toString.call(a).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(o).test(r))throw new Error(t.toUpperCase()+': Option "'+i+'" provided type "'+r+'" but expected type "'+o+'".')}var a},findShadowRoot:function(t){if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){var e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?c.findShadowRoot(t.parentNode):null},jQueryDetection:function(){if("undefined"==typeof e)throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");var t=e.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1===t[0]&&9===t[1]&&t[2]<1||t[0]>=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}};c.jQueryDetection(),e.fn.emulateTransitionEnd=l,e.event.special[c.TRANSITION_END]={bindType:"transitionend",delegateType:"transitionend",handle:function(t){if(e(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}};var h="alert",u=e.fn[h],d=function(){function t(t){this._element=t}var n=t.prototype;return n.close=function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},n.dispose=function(){e.removeData(this._element,"bs.alert"),this._element=null},n._getRootElement=function(t){var n=c.getSelectorFromElement(t),i=!1;return n&&(i=document.querySelector(n)),i||(i=e(t).closest(".alert")[0]),i},n._triggerCloseEvent=function(t){var n=e.Event("close.bs.alert");return e(t).trigger(n),n},n._removeElement=function(t){var n=this;if(e(t).removeClass("show"),e(t).hasClass("fade")){var i=c.getTransitionDurationFromElement(t);e(t).one(c.TRANSITION_END,(function(e){return n._destroyElement(t,e)})).emulateTransitionEnd(i)}else this._destroyElement(t)},n._destroyElement=function(t){e(t).detach().trigger("closed.bs.alert").remove()},t._jQueryInterface=function(n){return this.each((function(){var i=e(this),o=i.data("bs.alert");o||(o=new t(this),i.data("bs.alert",o)),"close"===n&&o[n](this)}))},t._handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}}]),t}();e(document).on("click.bs.alert.data-api",'[data-dismiss="alert"]',d._handleDismiss(new d)),e.fn[h]=d._jQueryInterface,e.fn[h].Constructor=d,e.fn[h].noConflict=function(){return e.fn[h]=u,d._jQueryInterface};var f=e.fn.button,g=function(){function t(t){this._element=t}var n=t.prototype;return n.toggle=function(){var t=!0,n=!0,i=e(this._element).closest('[data-toggle="buttons"]')[0];if(i){var o=this._element.querySelector('input:not([type="hidden"])');if(o){if("radio"===o.type)if(o.checked&&this._element.classList.contains("active"))t=!1;else{var s=i.querySelector(".active");s&&e(s).removeClass("active")}t&&("checkbox"!==o.type&&"radio"!==o.type||(o.checked=!this._element.classList.contains("active")),e(o).trigger("change")),o.focus(),n=!1}}this._element.hasAttribute("disabled")||this._element.classList.contains("disabled")||(n&&this._element.setAttribute("aria-pressed",!this._element.classList.contains("active")),t&&e(this._element).toggleClass("active"))},n.dispose=function(){e.removeData(this._element,"bs.button"),this._element=null},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.button");i||(i=new t(this),e(this).data("bs.button",i)),"toggle"===n&&i[n]()}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}}]),t}();e(document).on("click.bs.button.data-api",'[data-toggle^="button"]',(function(t){var n=t.target,i=n;if(e(n).hasClass("btn")||(n=e(n).closest(".btn")[0]),!n||n.hasAttribute("disabled")||n.classList.contains("disabled"))t.preventDefault();else{var o=n.querySelector('input:not([type="hidden"])');if(o&&(o.hasAttribute("disabled")||o.classList.contains("disabled")))return void t.preventDefault();"LABEL"===i.tagName&&o&&"checkbox"===o.type&&t.preventDefault(),g._jQueryInterface.call(e(n),"toggle")}})).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',(function(t){var n=e(t.target).closest(".btn")[0];e(n).toggleClass("focus",/^focus(in)?$/.test(t.type))})),e(window).on("load.bs.button.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-toggle="buttons"] .btn')),e=0,n=t.length;e<n;e++){var i=t[e],o=i.querySelector('input:not([type="hidden"])');o.checked||o.hasAttribute("checked")?i.classList.add("active"):i.classList.remove("active")}for(var s=0,r=(t=[].slice.call(document.querySelectorAll('[data-toggle="button"]'))).length;s<r;s++){var a=t[s];"true"===a.getAttribute("aria-pressed")?a.classList.add("active"):a.classList.remove("active")}})),e.fn.button=g._jQueryInterface,e.fn.button.Constructor=g,e.fn.button.noConflict=function(){return e.fn.button=f,g._jQueryInterface};var m="carousel",p=".bs.carousel",_=e.fn[m],v={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0,touch:!0},b={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean",touch:"boolean"},y={TOUCH:"touch",PEN:"pen"},E=function(){function t(t,e){this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this.touchStartX=0,this.touchDeltaX=0,this._config=this._getConfig(e),this._element=t,this._indicatorsElement=this._element.querySelector(".carousel-indicators"),this._touchSupported="ontouchstart"in document.documentElement||navigator.maxTouchPoints>0,this._pointerEvent=Boolean(window.PointerEvent||window.MSPointerEvent),this._addEventListeners()}var n=t.prototype;return n.next=function(){this._isSliding||this._slide("next")},n.nextWhenVisible=function(){!document.hidden&&e(this._element).is(":visible")&&"hidden"!==e(this._element).css("visibility")&&this.next()},n.prev=function(){this._isSliding||this._slide("prev")},n.pause=function(t){t||(this._isPaused=!0),this._element.querySelector(".carousel-item-next, .carousel-item-prev")&&(c.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},n.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},n.to=function(t){var n=this;this._activeElement=this._element.querySelector(".active.carousel-item");var i=this._getItemIndex(this._activeElement);if(!(t>this._items.length-1||t<0))if(this._isSliding)e(this._element).one("slid.bs.carousel",(function(){return n.to(t)}));else{if(i===t)return this.pause(),void this.cycle();var o=t>i?"next":"prev";this._slide(o,this._items[t])}},n.dispose=function(){e(this._element).off(p),e.removeData(this._element,"bs.carousel"),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},n._getConfig=function(t){return t=a(a({},v),t),c.typeCheckConfig(m,t,b),t},n._handleSwipe=function(){var t=Math.abs(this.touchDeltaX);if(!(t<=40)){var e=t/this.touchDeltaX;this.touchDeltaX=0,e>0&&this.prev(),e<0&&this.next()}},n._addEventListeners=function(){var t=this;this._config.keyboard&&e(this._element).on("keydown.bs.carousel",(function(e){return t._keydown(e)})),"hover"===this._config.pause&&e(this._element).on("mouseenter.bs.carousel",(function(e){return t.pause(e)})).on("mouseleave.bs.carousel",(function(e){return t.cycle(e)})),this._config.touch&&this._addTouchEventListeners()},n._addTouchEventListeners=function(){var t=this;if(this._touchSupported){var n=function(e){t._pointerEvent&&y[e.originalEvent.pointerType.toUpperCase()]?t.touchStartX=e.originalEvent.clientX:t._pointerEvent||(t.touchStartX=e.originalEvent.touches[0].clientX)},i=function(e){t._pointerEvent&&y[e.originalEvent.pointerType.toUpperCase()]&&(t.touchDeltaX=e.originalEvent.clientX-t.touchStartX),t._handleSwipe(),"hover"===t._config.pause&&(t.pause(),t.touchTimeout&&clearTimeout(t.touchTimeout),t.touchTimeout=setTimeout((function(e){return t.cycle(e)}),500+t._config.interval))};e(this._element.querySelectorAll(".carousel-item img")).on("dragstart.bs.carousel",(function(t){return t.preventDefault()})),this._pointerEvent?(e(this._element).on("pointerdown.bs.carousel",(function(t){return n(t)})),e(this._element).on("pointerup.bs.carousel",(function(t){return i(t)})),this._element.classList.add("pointer-event")):(e(this._element).on("touchstart.bs.carousel",(function(t){return n(t)})),e(this._element).on("touchmove.bs.carousel",(function(e){return function(e){e.originalEvent.touches&&e.originalEvent.touches.length>1?t.touchDeltaX=0:t.touchDeltaX=e.originalEvent.touches[0].clientX-t.touchStartX}(e)})),e(this._element).on("touchend.bs.carousel",(function(t){return i(t)})))}},n._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next()}},n._getItemIndex=function(t){return this._items=t&&t.parentNode?[].slice.call(t.parentNode.querySelectorAll(".carousel-item")):[],this._items.indexOf(t)},n._getItemByDirection=function(t,e){var n="next"===t,i="prev"===t,o=this._getItemIndex(e),s=this._items.length-1;if((i&&0===o||n&&o===s)&&!this._config.wrap)return e;var r=(o+("prev"===t?-1:1))%this._items.length;return-1===r?this._items[this._items.length-1]:this._items[r]},n._triggerSlideEvent=function(t,n){var i=this._getItemIndex(t),o=this._getItemIndex(this._element.querySelector(".active.carousel-item")),s=e.Event("slide.bs.carousel",{relatedTarget:t,direction:n,from:o,to:i});return e(this._element).trigger(s),s},n._setActiveIndicatorElement=function(t){if(this._indicatorsElement){var n=[].slice.call(this._indicatorsElement.querySelectorAll(".active"));e(n).removeClass("active");var i=this._indicatorsElement.children[this._getItemIndex(t)];i&&e(i).addClass("active")}},n._slide=function(t,n){var i,o,s,r=this,a=this._element.querySelector(".active.carousel-item"),l=this._getItemIndex(a),h=n||a&&this._getItemByDirection(t,a),u=this._getItemIndex(h),d=Boolean(this._interval);if("next"===t?(i="carousel-item-left",o="carousel-item-next",s="left"):(i="carousel-item-right",o="carousel-item-prev",s="right"),h&&e(h).hasClass("active"))this._isSliding=!1;else if(!this._triggerSlideEvent(h,s).isDefaultPrevented()&&a&&h){this._isSliding=!0,d&&this.pause(),this._setActiveIndicatorElement(h);var f=e.Event("slid.bs.carousel",{relatedTarget:h,direction:s,from:l,to:u});if(e(this._element).hasClass("slide")){e(h).addClass(o),c.reflow(h),e(a).addClass(i),e(h).addClass(i);var g=parseInt(h.getAttribute("data-interval"),10);g?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,this._config.interval=g):this._config.interval=this._config.defaultInterval||this._config.interval;var m=c.getTransitionDurationFromElement(a);e(a).one(c.TRANSITION_END,(function(){e(h).removeClass(i+" "+o).addClass("active"),e(a).removeClass("active "+o+" "+i),r._isSliding=!1,setTimeout((function(){return e(r._element).trigger(f)}),0)})).emulateTransitionEnd(m)}else e(a).removeClass("active"),e(h).addClass("active"),this._isSliding=!1,e(this._element).trigger(f);d&&this.cycle()}},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.carousel"),o=a(a({},v),e(this).data());"object"==typeof n&&(o=a(a({},o),n));var s="string"==typeof n?n:o.slide;if(i||(i=new t(this,o),e(this).data("bs.carousel",i)),"number"==typeof n)i.to(n);else if("string"==typeof s){if("undefined"==typeof i[s])throw new TypeError('No method named "'+s+'"');i[s]()}else o.interval&&o.ride&&(i.pause(),i.cycle())}))},t._dataApiClickHandler=function(n){var i=c.getSelectorFromElement(this);if(i){var o=e(i)[0];if(o&&e(o).hasClass("carousel")){var s=a(a({},e(o).data()),e(this).data()),r=this.getAttribute("data-slide-to");r&&(s.interval=!1),t._jQueryInterface.call(e(o),s),r&&e(o).data("bs.carousel").to(r),n.preventDefault()}}},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return v}}]),t}();e(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",E._dataApiClickHandler),e(window).on("load.bs.carousel.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-ride="carousel"]')),n=0,i=t.length;n<i;n++){var o=e(t[n]);E._jQueryInterface.call(o,o.data())}})),e.fn[m]=E._jQueryInterface,e.fn[m].Constructor=E,e.fn[m].noConflict=function(){return e.fn[m]=_,E._jQueryInterface};var w="collapse",T=e.fn[w],C={toggle:!0,parent:""},S={toggle:"boolean",parent:"(string|element)"},D=function(){function t(t,e){this._isTransitioning=!1,this._element=t,this._config=this._getConfig(e),this._triggerArray=[].slice.call(document.querySelectorAll('[data-toggle="collapse"][href="#'+t.id+'"],[data-toggle="collapse"][data-target="#'+t.id+'"]'));for(var n=[].slice.call(document.querySelectorAll('[data-toggle="collapse"]')),i=0,o=n.length;i<o;i++){var s=n[i],r=c.getSelectorFromElement(s),a=[].slice.call(document.querySelectorAll(r)).filter((function(e){return e===t}));null!==r&&a.length>0&&(this._selector=r,this._triggerArray.push(s))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var n=t.prototype;return n.toggle=function(){e(this._element).hasClass("show")?this.hide():this.show()},n.show=function(){var n,i,o=this;if(!this._isTransitioning&&!e(this._element).hasClass("show")&&(this._parent&&0===(n=[].slice.call(this._parent.querySelectorAll(".show, .collapsing")).filter((function(t){return"string"==typeof o._config.parent?t.getAttribute("data-parent")===o._config.parent:t.classList.contains("collapse")}))).length&&(n=null),!(n&&(i=e(n).not(this._selector).data("bs.collapse"))&&i._isTransitioning))){var s=e.Event("show.bs.collapse");if(e(this._element).trigger(s),!s.isDefaultPrevented()){n&&(t._jQueryInterface.call(e(n).not(this._selector),"hide"),i||e(n).data("bs.collapse",null));var r=this._getDimension();e(this._element).removeClass("collapse").addClass("collapsing"),this._element.style[r]=0,this._triggerArray.length&&e(this._triggerArray).removeClass("collapsed").attr("aria-expanded",!0),this.setTransitioning(!0);var a="scroll"+(r[0].toUpperCase()+r.slice(1)),l=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,(function(){e(o._element).removeClass("collapsing").addClass("collapse show"),o._element.style[r]="",o.setTransitioning(!1),e(o._element).trigger("shown.bs.collapse")})).emulateTransitionEnd(l),this._element.style[r]=this._element[a]+"px"}}},n.hide=function(){var t=this;if(!this._isTransitioning&&e(this._element).hasClass("show")){var n=e.Event("hide.bs.collapse");if(e(this._element).trigger(n),!n.isDefaultPrevented()){var i=this._getDimension();this._element.style[i]=this._element.getBoundingClientRect()[i]+"px",c.reflow(this._element),e(this._element).addClass("collapsing").removeClass("collapse show");var o=this._triggerArray.length;if(o>0)for(var s=0;s<o;s++){var r=this._triggerArray[s],a=c.getSelectorFromElement(r);if(null!==a)e([].slice.call(document.querySelectorAll(a))).hasClass("show")||e(r).addClass("collapsed").attr("aria-expanded",!1)}this.setTransitioning(!0);this._element.style[i]="";var l=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,(function(){t.setTransitioning(!1),e(t._element).removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")})).emulateTransitionEnd(l)}}},n.setTransitioning=function(t){this._isTransitioning=t},n.dispose=function(){e.removeData(this._element,"bs.collapse"),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},n._getConfig=function(t){return(t=a(a({},C),t)).toggle=Boolean(t.toggle),c.typeCheckConfig(w,t,S),t},n._getDimension=function(){return e(this._element).hasClass("width")?"width":"height"},n._getParent=function(){var n,i=this;c.isElement(this._config.parent)?(n=this._config.parent,"undefined"!=typeof this._config.parent.jquery&&(n=this._config.parent[0])):n=document.querySelector(this._config.parent);var o='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]',s=[].slice.call(n.querySelectorAll(o));return e(s).each((function(e,n){i._addAriaAndCollapsedClass(t._getTargetFromElement(n),[n])})),n},n._addAriaAndCollapsedClass=function(t,n){var i=e(t).hasClass("show");n.length&&e(n).toggleClass("collapsed",!i).attr("aria-expanded",i)},t._getTargetFromElement=function(t){var e=c.getSelectorFromElement(t);return e?document.querySelector(e):null},t._jQueryInterface=function(n){return this.each((function(){var i=e(this),o=i.data("bs.collapse"),s=a(a(a({},C),i.data()),"object"==typeof n&&n?n:{});if(!o&&s.toggle&&"string"==typeof n&&/show|hide/.test(n)&&(s.toggle=!1),o||(o=new t(this,s),i.data("bs.collapse",o)),"string"==typeof n){if("undefined"==typeof o[n])throw new TypeError('No method named "'+n+'"');o[n]()}}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return C}}]),t}();e(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',(function(t){"A"===t.currentTarget.tagName&&t.preventDefault();var n=e(this),i=c.getSelectorFromElement(this),o=[].slice.call(document.querySelectorAll(i));e(o).each((function(){var t=e(this),i=t.data("bs.collapse")?"toggle":n.data();D._jQueryInterface.call(t,i)}))})),e.fn[w]=D._jQueryInterface,e.fn[w].Constructor=D,e.fn[w].noConflict=function(){return e.fn[w]=T,D._jQueryInterface};var k="dropdown",N=e.fn[k],A=new RegExp("38|40|27"),I={offset:0,flip:!0,boundary:"scrollParent",reference:"toggle",display:"dynamic",popperConfig:null},O={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)",reference:"(string|element)",display:"string",popperConfig:"(null|object)"},j=function(){function t(t,e){this._element=t,this._popper=null,this._config=this._getConfig(e),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}var i=t.prototype;return i.toggle=function(){if(!this._element.disabled&&!e(this._element).hasClass("disabled")){var n=e(this._menu).hasClass("show");t._clearMenus(),n||this.show(!0)}},i.show=function(i){if(void 0===i&&(i=!1),!(this._element.disabled||e(this._element).hasClass("disabled")||e(this._menu).hasClass("show"))){var o={relatedTarget:this._element},s=e.Event("show.bs.dropdown",o),r=t._getParentFromElement(this._element);if(e(r).trigger(s),!s.isDefaultPrevented()){if(!this._inNavbar&&i){if("undefined"==typeof n)throw new TypeError("Bootstrap's dropdowns require Popper.js (https://popper.js.org/)");var a=this._element;"parent"===this._config.reference?a=r:c.isElement(this._config.reference)&&(a=this._config.reference,"undefined"!=typeof this._config.reference.jquery&&(a=this._config.reference[0])),"scrollParent"!==this._config.boundary&&e(r).addClass("position-static"),this._popper=new n(a,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&0===e(r).closest(".navbar-nav").length&&e(document.body).children().on("mouseover",null,e.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),e(this._menu).toggleClass("show"),e(r).toggleClass("show").trigger(e.Event("shown.bs.dropdown",o))}}},i.hide=function(){if(!this._element.disabled&&!e(this._element).hasClass("disabled")&&e(this._menu).hasClass("show")){var n={relatedTarget:this._element},i=e.Event("hide.bs.dropdown",n),o=t._getParentFromElement(this._element);e(o).trigger(i),i.isDefaultPrevented()||(this._popper&&this._popper.destroy(),e(this._menu).toggleClass("show"),e(o).toggleClass("show").trigger(e.Event("hidden.bs.dropdown",n)))}},i.dispose=function(){e.removeData(this._element,"bs.dropdown"),e(this._element).off(".bs.dropdown"),this._element=null,this._menu=null,null!==this._popper&&(this._popper.destroy(),this._popper=null)},i.update=function(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},i._addEventListeners=function(){var t=this;e(this._element).on("click.bs.dropdown",(function(e){e.preventDefault(),e.stopPropagation(),t.toggle()}))},i._getConfig=function(t){return t=a(a(a({},this.constructor.Default),e(this._element).data()),t),c.typeCheckConfig(k,t,this.constructor.DefaultType),t},i._getMenuElement=function(){if(!this._menu){var e=t._getParentFromElement(this._element);e&&(this._menu=e.querySelector(".dropdown-menu"))}return this._menu},i._getPlacement=function(){var t=e(this._element.parentNode),n="bottom-start";return t.hasClass("dropup")?n=e(this._menu).hasClass("dropdown-menu-right")?"top-end":"top-start":t.hasClass("dropright")?n="right-start":t.hasClass("dropleft")?n="left-start":e(this._menu).hasClass("dropdown-menu-right")&&(n="bottom-end"),n},i._detectNavbar=function(){return e(this._element).closest(".navbar").length>0},i._getOffset=function(){var t=this,e={};return"function"==typeof this._config.offset?e.fn=function(e){return e.offsets=a(a({},e.offsets),t._config.offset(e.offsets,t._element)||{}),e}:e.offset=this._config.offset,e},i._getPopperConfig=function(){var t={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};return"static"===this._config.display&&(t.modifiers.applyStyle={enabled:!1}),a(a({},t),this._config.popperConfig)},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.dropdown");if(i||(i=new t(this,"object"==typeof n?n:null),e(this).data("bs.dropdown",i)),"string"==typeof n){if("undefined"==typeof i[n])throw new TypeError('No method named "'+n+'"');i[n]()}}))},t._clearMenus=function(n){if(!n||3!==n.which&&("keyup"!==n.type||9===n.which))for(var i=[].slice.call(document.querySelectorAll('[data-toggle="dropdown"]')),o=0,s=i.length;o<s;o++){var r=t._getParentFromElement(i[o]),a=e(i[o]).data("bs.dropdown"),l={relatedTarget:i[o]};if(n&&"click"===n.type&&(l.clickEvent=n),a){var c=a._menu;if(e(r).hasClass("show")&&!(n&&("click"===n.type&&/input|textarea/i.test(n.target.tagName)||"keyup"===n.type&&9===n.which)&&e.contains(r,n.target))){var h=e.Event("hide.bs.dropdown",l);e(r).trigger(h),h.isDefaultPrevented()||("ontouchstart"in document.documentElement&&e(document.body).children().off("mouseover",null,e.noop),i[o].setAttribute("aria-expanded","false"),a._popper&&a._popper.destroy(),e(c).removeClass("show"),e(r).removeClass("show").trigger(e.Event("hidden.bs.dropdown",l)))}}}},t._getParentFromElement=function(t){var e,n=c.getSelectorFromElement(t);return n&&(e=document.querySelector(n)),e||t.parentNode},t._dataApiKeydownHandler=function(n){if(!(/input|textarea/i.test(n.target.tagName)?32===n.which||27!==n.which&&(40!==n.which&&38!==n.which||e(n.target).closest(".dropdown-menu").length):!A.test(n.which))&&!this.disabled&&!e(this).hasClass("disabled")){var i=t._getParentFromElement(this),o=e(i).hasClass("show");if(o||27!==n.which){if(n.preventDefault(),n.stopPropagation(),!o||o&&(27===n.which||32===n.which))return 27===n.which&&e(i.querySelector('[data-toggle="dropdown"]')).trigger("focus"),void e(this).trigger("click");var s=[].slice.call(i.querySelectorAll(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)")).filter((function(t){return e(t).is(":visible")}));if(0!==s.length){var r=s.indexOf(n.target);38===n.which&&r>0&&r--,40===n.which&&r<s.length-1&&r++,r<0&&(r=0),s[r].focus()}}}},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return I}},{key:"DefaultType",get:function(){return O}}]),t}();e(document).on("keydown.bs.dropdown.data-api",'[data-toggle="dropdown"]',j._dataApiKeydownHandler).on("keydown.bs.dropdown.data-api",".dropdown-menu",j._dataApiKeydownHandler).on("click.bs.dropdown.data-api keyup.bs.dropdown.data-api",j._clearMenus).on("click.bs.dropdown.data-api",'[data-toggle="dropdown"]',(function(t){t.preventDefault(),t.stopPropagation(),j._jQueryInterface.call(e(this),"toggle")})).on("click.bs.dropdown.data-api",".dropdown form",(function(t){t.stopPropagation()})),e.fn[k]=j._jQueryInterface,e.fn[k].Constructor=j,e.fn[k].noConflict=function(){return e.fn[k]=N,j._jQueryInterface};var P=e.fn.modal,x={backdrop:!0,keyboard:!0,focus:!0,show:!0},L={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean",show:"boolean"},R=function(){function t(t,e){this._config=this._getConfig(e),this._element=t,this._dialog=t.querySelector(".modal-dialog"),this._backdrop=null,this._isShown=!1,this._isBodyOverflowing=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._scrollbarWidth=0}var n=t.prototype;return n.toggle=function(t){return this._isShown?this.hide():this.show(t)},n.show=function(t){var n=this;if(!this._isShown&&!this._isTransitioning){e(this._element).hasClass("fade")&&(this._isTransitioning=!0);var i=e.Event("show.bs.modal",{relatedTarget:t});e(this._element).trigger(i),this._isShown||i.isDefaultPrevented()||(this._isShown=!0,this._checkScrollbar(),this._setScrollbar(),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),e(this._element).on("click.dismiss.bs.modal",'[data-dismiss="modal"]',(function(t){return n.hide(t)})),e(this._dialog).on("mousedown.dismiss.bs.modal",(function(){e(n._element).one("mouseup.dismiss.bs.modal",(function(t){e(t.target).is(n._element)&&(n._ignoreBackdropClick=!0)}))})),this._showBackdrop((function(){return n._showElement(t)})))}},n.hide=function(t){var n=this;if(t&&t.preventDefault(),this._isShown&&!this._isTransitioning){var i=e.Event("hide.bs.modal");if(e(this._element).trigger(i),this._isShown&&!i.isDefaultPrevented()){this._isShown=!1;var o=e(this._element).hasClass("fade");if(o&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),e(document).off("focusin.bs.modal"),e(this._element).removeClass("show"),e(this._element).off("click.dismiss.bs.modal"),e(this._dialog).off("mousedown.dismiss.bs.modal"),o){var s=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,(function(t){return n._hideModal(t)})).emulateTransitionEnd(s)}else this._hideModal()}}},n.dispose=function(){[window,this._element,this._dialog].forEach((function(t){return e(t).off(".bs.modal")})),e(document).off("focusin.bs.modal"),e.removeData(this._element,"bs.modal"),this._config=null,this._element=null,this._dialog=null,this._backdrop=null,this._isShown=null,this._isBodyOverflowing=null,this._ignoreBackdropClick=null,this._isTransitioning=null,this._scrollbarWidth=null},n.handleUpdate=function(){this._adjustDialog()},n._getConfig=function(t){return t=a(a({},x),t),c.typeCheckConfig("modal",t,L),t},n._triggerBackdropTransition=function(){var t=this;if("static"===this._config.backdrop){var n=e.Event("hidePrevented.bs.modal");if(e(this._element).trigger(n),n.defaultPrevented)return;this._element.classList.add("modal-static");var i=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,(function(){t._element.classList.remove("modal-static")})).emulateTransitionEnd(i),this._element.focus()}else this.hide()},n._showElement=function(t){var n=this,i=e(this._element).hasClass("fade"),o=this._dialog?this._dialog.querySelector(".modal-body"):null;this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),e(this._dialog).hasClass("modal-dialog-scrollable")&&o?o.scrollTop=0:this._element.scrollTop=0,i&&c.reflow(this._element),e(this._element).addClass("show"),this._config.focus&&this._enforceFocus();var s=e.Event("shown.bs.modal",{relatedTarget:t}),r=function(){n._config.focus&&n._element.focus(),n._isTransitioning=!1,e(n._element).trigger(s)};if(i){var a=c.getTransitionDurationFromElement(this._dialog);e(this._dialog).one(c.TRANSITION_END,r).emulateTransitionEnd(a)}else r()},n._enforceFocus=function(){var t=this;e(document).off("focusin.bs.modal").on("focusin.bs.modal",(function(n){document!==n.target&&t._element!==n.target&&0===e(t._element).has(n.target).length&&t._element.focus()}))},n._setEscapeEvent=function(){var t=this;this._isShown?e(this._element).on("keydown.dismiss.bs.modal",(function(e){t._config.keyboard&&27===e.which?(e.preventDefault(),t.hide()):t._config.keyboard||27!==e.which||t._triggerBackdropTransition()})):this._isShown||e(this._element).off("keydown.dismiss.bs.modal")},n._setResizeEvent=function(){var t=this;this._isShown?e(window).on("resize.bs.modal",(function(e){return t.handleUpdate(e)})):e(window).off("resize.bs.modal")},n._hideModal=function(){var t=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._isTransitioning=!1,this._showBackdrop((function(){e(document.body).removeClass("modal-open"),t._resetAdjustments(),t._resetScrollbar(),e(t._element).trigger("hidden.bs.modal")}))},n._removeBackdrop=function(){this._backdrop&&(e(this._backdrop).remove(),this._backdrop=null)},n._showBackdrop=function(t){var n=this,i=e(this._element).hasClass("fade")?"fade":"";if(this._isShown&&this._config.backdrop){if(this._backdrop=document.createElement("div"),this._backdrop.className="modal-backdrop",i&&this._backdrop.classList.add(i),e(this._backdrop).appendTo(document.body),e(this._element).on("click.dismiss.bs.modal",(function(t){n._ignoreBackdropClick?n._ignoreBackdropClick=!1:t.target===t.currentTarget&&n._triggerBackdropTransition()})),i&&c.reflow(this._backdrop),e(this._backdrop).addClass("show"),!t)return;if(!i)return void t();var o=c.getTransitionDurationFromElement(this._backdrop);e(this._backdrop).one(c.TRANSITION_END,t).emulateTransitionEnd(o)}else if(!this._isShown&&this._backdrop){e(this._backdrop).removeClass("show");var s=function(){n._removeBackdrop(),t&&t()};if(e(this._element).hasClass("fade")){var r=c.getTransitionDurationFromElement(this._backdrop);e(this._backdrop).one(c.TRANSITION_END,s).emulateTransitionEnd(r)}else s()}else t&&t()},n._adjustDialog=function(){var t=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},n._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},n._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=Math.round(t.left+t.right)<window.innerWidth,this._scrollbarWidth=this._getScrollbarWidth()},n._setScrollbar=function(){var t=this;if(this._isBodyOverflowing){var n=[].slice.call(document.querySelectorAll(".fixed-top, .fixed-bottom, .is-fixed, .sticky-top")),i=[].slice.call(document.querySelectorAll(".sticky-top"));e(n).each((function(n,i){var o=i.style.paddingRight,s=e(i).css("padding-right");e(i).data("padding-right",o).css("padding-right",parseFloat(s)+t._scrollbarWidth+"px")})),e(i).each((function(n,i){var o=i.style.marginRight,s=e(i).css("margin-right");e(i).data("margin-right",o).css("margin-right",parseFloat(s)-t._scrollbarWidth+"px")}));var o=document.body.style.paddingRight,s=e(document.body).css("padding-right");e(document.body).data("padding-right",o).css("padding-right",parseFloat(s)+this._scrollbarWidth+"px")}e(document.body).addClass("modal-open")},n._resetScrollbar=function(){var t=[].slice.call(document.querySelectorAll(".fixed-top, .fixed-bottom, .is-fixed, .sticky-top"));e(t).each((function(t,n){var i=e(n).data("padding-right");e(n).removeData("padding-right"),n.style.paddingRight=i||""}));var n=[].slice.call(document.querySelectorAll(".sticky-top"));e(n).each((function(t,n){var i=e(n).data("margin-right");"undefined"!=typeof i&&e(n).css("margin-right",i).removeData("margin-right")}));var i=e(document.body).data("padding-right");e(document.body).removeData("padding-right"),document.body.style.paddingRight=i||""},n._getScrollbarWidth=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e},t._jQueryInterface=function(n,i){return this.each((function(){var o=e(this).data("bs.modal"),s=a(a(a({},x),e(this).data()),"object"==typeof n&&n?n:{});if(o||(o=new t(this,s),e(this).data("bs.modal",o)),"string"==typeof n){if("undefined"==typeof o[n])throw new TypeError('No method named "'+n+'"');o[n](i)}else s.show&&o.show(i)}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return x}}]),t}();e(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',(function(t){var n,i=this,o=c.getSelectorFromElement(this);o&&(n=document.querySelector(o));var s=e(n).data("bs.modal")?"toggle":a(a({},e(n).data()),e(this).data());"A"!==this.tagName&&"AREA"!==this.tagName||t.preventDefault();var r=e(n).one("show.bs.modal",(function(t){t.isDefaultPrevented()||r.one("hidden.bs.modal",(function(){e(i).is(":visible")&&i.focus()}))}));R._jQueryInterface.call(e(n),s,this)})),e.fn.modal=R._jQueryInterface,e.fn.modal.Constructor=R,e.fn.modal.noConflict=function(){return e.fn.modal=P,R._jQueryInterface};var q=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],F={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Q=/^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi,B=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;function H(t,e,n){if(0===t.length)return t;if(n&&"function"==typeof n)return n(t);for(var i=(new window.DOMParser).parseFromString(t,"text/html"),o=Object.keys(e),s=[].slice.call(i.body.querySelectorAll("*")),r=function(t,n){var i=s[t],r=i.nodeName.toLowerCase();if(-1===o.indexOf(i.nodeName.toLowerCase()))return i.parentNode.removeChild(i),"continue";var a=[].slice.call(i.attributes),l=[].concat(e["*"]||[],e[r]||[]);a.forEach((function(t){(function(t,e){var n=t.nodeName.toLowerCase();if(-1!==e.indexOf(n))return-1===q.indexOf(n)||Boolean(t.nodeValue.match(Q)||t.nodeValue.match(B));for(var i=e.filter((function(t){return t instanceof RegExp})),o=0,s=i.length;o<s;o++)if(n.match(i[o]))return!0;return!1})(t,l)||i.removeAttribute(t.nodeName)}))},a=0,l=s.length;a<l;a++)r(a);return i.body.innerHTML}var U="tooltip",M=e.fn[U],W=new RegExp("(^|\\s)bs-tooltip\\S+","g"),V=["sanitize","whiteList","sanitizeFn"],z={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string|function)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)",boundary:"(string|element)",sanitize:"boolean",sanitizeFn:"(null|function)",whiteList:"object",popperConfig:"(null|object)"},K={AUTO:"auto",TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left"},X={animation:!0,template:'<div class="tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:F,popperConfig:null},Y={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"},$=function(){function t(t,e){if("undefined"==typeof n)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var i=t.prototype;return i.enable=function(){this._isEnabled=!0},i.disable=function(){this._isEnabled=!1},i.toggleEnabled=function(){this._isEnabled=!this._isEnabled},i.toggle=function(t){if(this._isEnabled)if(t){var n=this.constructor.DATA_KEY,i=e(t.currentTarget).data(n);i||(i=new this.constructor(t.currentTarget,this._getDelegateConfig()),e(t.currentTarget).data(n,i)),i._activeTrigger.click=!i._activeTrigger.click,i._isWithActiveTrigger()?i._enter(null,i):i._leave(null,i)}else{if(e(this.getTipElement()).hasClass("show"))return void this._leave(null,this);this._enter(null,this)}},i.dispose=function(){clearTimeout(this._timeout),e.removeData(this.element,this.constructor.DATA_KEY),e(this.element).off(this.constructor.EVENT_KEY),e(this.element).closest(".modal").off("hide.bs.modal",this._hideModalHandler),this.tip&&e(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},i.show=function(){var t=this;if("none"===e(this.element).css("display"))throw new Error("Please use show on visible elements");var i=e.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){e(this.element).trigger(i);var o=c.findShadowRoot(this.element),s=e.contains(null!==o?o:this.element.ownerDocument.documentElement,this.element);if(i.isDefaultPrevented()||!s)return;var r=this.getTipElement(),a=c.getUID(this.constructor.NAME);r.setAttribute("id",a),this.element.setAttribute("aria-describedby",a),this.setContent(),this.config.animation&&e(r).addClass("fade");var l="function"==typeof this.config.placement?this.config.placement.call(this,r,this.element):this.config.placement,h=this._getAttachment(l);this.addAttachmentClass(h);var u=this._getContainer();e(r).data(this.constructor.DATA_KEY,this),e.contains(this.element.ownerDocument.documentElement,this.tip)||e(r).appendTo(u),e(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new n(this.element,r,this._getPopperConfig(h)),e(r).addClass("show"),"ontouchstart"in document.documentElement&&e(document.body).children().on("mouseover",null,e.noop);var d=function(){t.config.animation&&t._fixTransition();var n=t._hoverState;t._hoverState=null,e(t.element).trigger(t.constructor.Event.SHOWN),"out"===n&&t._leave(null,t)};if(e(this.tip).hasClass("fade")){var f=c.getTransitionDurationFromElement(this.tip);e(this.tip).one(c.TRANSITION_END,d).emulateTransitionEnd(f)}else d()}},i.hide=function(t){var n=this,i=this.getTipElement(),o=e.Event(this.constructor.Event.HIDE),s=function(){"show"!==n._hoverState&&i.parentNode&&i.parentNode.removeChild(i),n._cleanTipClass(),n.element.removeAttribute("aria-describedby"),e(n.element).trigger(n.constructor.Event.HIDDEN),null!==n._popper&&n._popper.destroy(),t&&t()};if(e(this.element).trigger(o),!o.isDefaultPrevented()){if(e(i).removeClass("show"),"ontouchstart"in document.documentElement&&e(document.body).children().off("mouseover",null,e.noop),this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,e(this.tip).hasClass("fade")){var r=c.getTransitionDurationFromElement(i);e(i).one(c.TRANSITION_END,s).emulateTransitionEnd(r)}else s();this._hoverState=""}},i.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},i.isWithContent=function(){return Boolean(this.getTitle())},i.addAttachmentClass=function(t){e(this.getTipElement()).addClass("bs-tooltip-"+t)},i.getTipElement=function(){return this.tip=this.tip||e(this.config.template)[0],this.tip},i.setContent=function(){var t=this.getTipElement();this.setElementContent(e(t.querySelectorAll(".tooltip-inner")),this.getTitle()),e(t).removeClass("fade show")},i.setElementContent=function(t,n){"object"!=typeof n||!n.nodeType&&!n.jquery?this.config.html?(this.config.sanitize&&(n=H(n,this.config.whiteList,this.config.sanitizeFn)),t.html(n)):t.text(n):this.config.html?e(n).parent().is(t)||t.empty().append(n):t.text(e(n).text())},i.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},i._getPopperConfig=function(t){var e=this;return a(a({},{placement:t,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:".arrow"},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}}),this.config.popperConfig)},i._getOffset=function(){var t=this,e={};return"function"==typeof this.config.offset?e.fn=function(e){return e.offsets=a(a({},e.offsets),t.config.offset(e.offsets,t.element)||{}),e}:e.offset=this.config.offset,e},i._getContainer=function(){return!1===this.config.container?document.body:c.isElement(this.config.container)?e(this.config.container):e(document).find(this.config.container)},i._getAttachment=function(t){return K[t.toUpperCase()]},i._setListeners=function(){var t=this;this.config.trigger.split(" ").forEach((function(n){if("click"===n)e(t.element).on(t.constructor.Event.CLICK,t.config.selector,(function(e){return t.toggle(e)}));else if("manual"!==n){var i="hover"===n?t.constructor.Event.MOUSEENTER:t.constructor.Event.FOCUSIN,o="hover"===n?t.constructor.Event.MOUSELEAVE:t.constructor.Event.FOCUSOUT;e(t.element).on(i,t.config.selector,(function(e){return t._enter(e)})).on(o,t.config.selector,(function(e){return t._leave(e)}))}})),this._hideModalHandler=function(){t.element&&t.hide()},e(this.element).closest(".modal").on("hide.bs.modal",this._hideModalHandler),this.config.selector?this.config=a(a({},this.config),{},{trigger:"manual",selector:""}):this._fixTitle()},i._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},i._enter=function(t,n){var i=this.constructor.DATA_KEY;(n=n||e(t.currentTarget).data(i))||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),e(t.currentTarget).data(i,n)),t&&(n._activeTrigger["focusin"===t.type?"focus":"hover"]=!0),e(n.getTipElement()).hasClass("show")||"show"===n._hoverState?n._hoverState="show":(clearTimeout(n._timeout),n._hoverState="show",n.config.delay&&n.config.delay.show?n._timeout=setTimeout((function(){"show"===n._hoverState&&n.show()}),n.config.delay.show):n.show())},i._leave=function(t,n){var i=this.constructor.DATA_KEY;(n=n||e(t.currentTarget).data(i))||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),e(t.currentTarget).data(i,n)),t&&(n._activeTrigger["focusout"===t.type?"focus":"hover"]=!1),n._isWithActiveTrigger()||(clearTimeout(n._timeout),n._hoverState="out",n.config.delay&&n.config.delay.hide?n._timeout=setTimeout((function(){"out"===n._hoverState&&n.hide()}),n.config.delay.hide):n.hide())},i._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},i._getConfig=function(t){var n=e(this.element).data();return Object.keys(n).forEach((function(t){-1!==V.indexOf(t)&&delete n[t]})),"number"==typeof(t=a(a(a({},this.constructor.Default),n),"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),c.typeCheckConfig(U,t,this.constructor.DefaultType),t.sanitize&&(t.template=H(t.template,t.whiteList,t.sanitizeFn)),t},i._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},i._cleanTipClass=function(){var t=e(this.getTipElement()),n=t.attr("class").match(W);null!==n&&n.length&&t.removeClass(n.join(""))},i._handlePopperPlacementChange=function(t){this.tip=t.instance.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},i._fixTransition=function(){var t=this.getTipElement(),n=this.config.animation;null===t.getAttribute("x-placement")&&(e(t).removeClass("fade"),this.config.animation=!1,this.hide(),this.show(),this.config.animation=n)},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.tooltip"),o="object"==typeof n&&n;if((i||!/dispose|hide/.test(n))&&(i||(i=new t(this,o),e(this).data("bs.tooltip",i)),"string"==typeof n)){if("undefined"==typeof i[n])throw new TypeError('No method named "'+n+'"');i[n]()}}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return X}},{key:"NAME",get:function(){return U}},{key:"DATA_KEY",get:function(){return"bs.tooltip"}},{key:"Event",get:function(){return Y}},{key:"EVENT_KEY",get:function(){return".bs.tooltip"}},{key:"DefaultType",get:function(){return z}}]),t}();e.fn[U]=$._jQueryInterface,e.fn[U].Constructor=$,e.fn[U].noConflict=function(){return e.fn[U]=M,$._jQueryInterface};var J="popover",G=e.fn[J],Z=new RegExp("(^|\\s)bs-popover\\S+","g"),tt=a(a({},$.Default),{},{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'}),et=a(a({},$.DefaultType),{},{content:"(string|element|function)"}),nt={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"},it=function(t){var n,i;function s(){return t.apply(this,arguments)||this}i=t,(n=s).prototype=Object.create(i.prototype),n.prototype.constructor=n,n.__proto__=i;var r=s.prototype;return r.isWithContent=function(){return this.getTitle()||this._getContent()},r.addAttachmentClass=function(t){e(this.getTipElement()).addClass("bs-popover-"+t)},r.getTipElement=function(){return this.tip=this.tip||e(this.config.template)[0],this.tip},r.setContent=function(){var t=e(this.getTipElement());this.setElementContent(t.find(".popover-header"),this.getTitle());var n=this._getContent();"function"==typeof n&&(n=n.call(this.element)),this.setElementContent(t.find(".popover-body"),n),t.removeClass("fade show")},r._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},r._cleanTipClass=function(){var t=e(this.getTipElement()),n=t.attr("class").match(Z);null!==n&&n.length>0&&t.removeClass(n.join(""))},s._jQueryInterface=function(t){return this.each((function(){var n=e(this).data("bs.popover"),i="object"==typeof t?t:null;if((n||!/dispose|hide/.test(t))&&(n||(n=new s(this,i),e(this).data("bs.popover",n)),"string"==typeof t)){if("undefined"==typeof n[t])throw new TypeError('No method named "'+t+'"');n[t]()}}))},o(s,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return tt}},{key:"NAME",get:function(){return J}},{key:"DATA_KEY",get:function(){return"bs.popover"}},{key:"Event",get:function(){return nt}},{key:"EVENT_KEY",get:function(){return".bs.popover"}},{key:"DefaultType",get:function(){return et}}]),s}($);e.fn[J]=it._jQueryInterface,e.fn[J].Constructor=it,e.fn[J].noConflict=function(){return e.fn[J]=G,it._jQueryInterface};var ot="scrollspy",st=e.fn[ot],rt={offset:10,method:"auto",target:""},at={offset:"number",method:"string",target:"(string|element)"},lt=function(){function t(t,n){var i=this;this._element=t,this._scrollElement="BODY"===t.tagName?window:t,this._config=this._getConfig(n),this._selector=this._config.target+" .nav-link,"+this._config.target+" .list-group-item,"+this._config.target+" .dropdown-item",this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,e(this._scrollElement).on("scroll.bs.scrollspy",(function(t){return i._process(t)})),this.refresh(),this._process()}var n=t.prototype;return n.refresh=function(){var t=this,n=this._scrollElement===this._scrollElement.window?"offset":"position",i="auto"===this._config.method?n:this._config.method,o="position"===i?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map((function(t){var n,s=c.getSelectorFromElement(t);if(s&&(n=document.querySelector(s)),n){var r=n.getBoundingClientRect();if(r.width||r.height)return[e(n)[i]().top+o,s]}return null})).filter((function(t){return t})).sort((function(t,e){return t[0]-e[0]})).forEach((function(e){t._offsets.push(e[0]),t._targets.push(e[1])}))},n.dispose=function(){e.removeData(this._element,"bs.scrollspy"),e(this._scrollElement).off(".bs.scrollspy"),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},n._getConfig=function(t){if("string"!=typeof(t=a(a({},rt),"object"==typeof t&&t?t:{})).target&&c.isElement(t.target)){var n=e(t.target).attr("id");n||(n=c.getUID(ot),e(t.target).attr("id",n)),t.target="#"+n}return c.typeCheckConfig(ot,t,at),t},n._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},n._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},n._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},n._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=n){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t<this._offsets[0]&&this._offsets[0]>0)return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;){this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||t<this._offsets[o+1])&&this._activate(this._targets[o])}}},n._activate=function(t){this._activeTarget=t,this._clear();var n=this._selector.split(",").map((function(e){return e+'[data-target="'+t+'"],'+e+'[href="'+t+'"]'})),i=e([].slice.call(document.querySelectorAll(n.join(","))));i.hasClass("dropdown-item")?(i.closest(".dropdown").find(".dropdown-toggle").addClass("active"),i.addClass("active")):(i.addClass("active"),i.parents(".nav, .list-group").prev(".nav-link, .list-group-item").addClass("active"),i.parents(".nav, .list-group").prev(".nav-item").children(".nav-link").addClass("active")),e(this._scrollElement).trigger("activate.bs.scrollspy",{relatedTarget:t})},n._clear=function(){[].slice.call(document.querySelectorAll(this._selector)).filter((function(t){return t.classList.contains("active")})).forEach((function(t){return t.classList.remove("active")}))},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.scrollspy");if(i||(i=new t(this,"object"==typeof n&&n),e(this).data("bs.scrollspy",i)),"string"==typeof n){if("undefined"==typeof i[n])throw new TypeError('No method named "'+n+'"');i[n]()}}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return rt}}]),t}();e(window).on("load.bs.scrollspy.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-spy="scroll"]')),n=t.length;n--;){var i=e(t[n]);lt._jQueryInterface.call(i,i.data())}})),e.fn[ot]=lt._jQueryInterface,e.fn[ot].Constructor=lt,e.fn[ot].noConflict=function(){return e.fn[ot]=st,lt._jQueryInterface};var ct=e.fn.tab,ht=function(){function t(t){this._element=t}var n=t.prototype;return n.show=function(){var t=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&e(this._element).hasClass("active")||e(this._element).hasClass("disabled"))){var n,i,o=e(this._element).closest(".nav, .list-group")[0],s=c.getSelectorFromElement(this._element);if(o){var r="UL"===o.nodeName||"OL"===o.nodeName?"> li > .active":".active";i=(i=e.makeArray(e(o).find(r)))[i.length-1]}var a=e.Event("hide.bs.tab",{relatedTarget:this._element}),l=e.Event("show.bs.tab",{relatedTarget:i});if(i&&e(i).trigger(a),e(this._element).trigger(l),!l.isDefaultPrevented()&&!a.isDefaultPrevented()){s&&(n=document.querySelector(s)),this._activate(this._element,o);var h=function(){var n=e.Event("hidden.bs.tab",{relatedTarget:t._element}),o=e.Event("shown.bs.tab",{relatedTarget:i});e(i).trigger(n),e(t._element).trigger(o)};n?this._activate(n,n.parentNode,h):h()}}},n.dispose=function(){e.removeData(this._element,"bs.tab"),this._element=null},n._activate=function(t,n,i){var o=this,s=(!n||"UL"!==n.nodeName&&"OL"!==n.nodeName?e(n).children(".active"):e(n).find("> li > .active"))[0],r=i&&s&&e(s).hasClass("fade"),a=function(){return o._transitionComplete(t,s,i)};if(s&&r){var l=c.getTransitionDurationFromElement(s);e(s).removeClass("show").one(c.TRANSITION_END,a).emulateTransitionEnd(l)}else a()},n._transitionComplete=function(t,n,i){if(n){e(n).removeClass("active");var o=e(n.parentNode).find("> .dropdown-menu .active")[0];o&&e(o).removeClass("active"),"tab"===n.getAttribute("role")&&n.setAttribute("aria-selected",!1)}if(e(t).addClass("active"),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!0),c.reflow(t),t.classList.contains("fade")&&t.classList.add("show"),t.parentNode&&e(t.parentNode).hasClass("dropdown-menu")){var s=e(t).closest(".dropdown")[0];if(s){var r=[].slice.call(s.querySelectorAll(".dropdown-toggle"));e(r).addClass("active")}t.setAttribute("aria-expanded",!0)}i&&i()},t._jQueryInterface=function(n){return this.each((function(){var i=e(this),o=i.data("bs.tab");if(o||(o=new t(this),i.data("bs.tab",o)),"string"==typeof n){if("undefined"==typeof o[n])throw new TypeError('No method named "'+n+'"');o[n]()}}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}}]),t}();e(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',(function(t){t.preventDefault(),ht._jQueryInterface.call(e(this),"show")})),e.fn.tab=ht._jQueryInterface,e.fn.tab.Constructor=ht,e.fn.tab.noConflict=function(){return e.fn.tab=ct,ht._jQueryInterface};var ut=e.fn.toast,dt={animation:"boolean",autohide:"boolean",delay:"number"},ft={animation:!0,autohide:!0,delay:500},gt=function(){function t(t,e){this._element=t,this._config=this._getConfig(e),this._timeout=null,this._setListeners()}var n=t.prototype;return n.show=function(){var t=this,n=e.Event("show.bs.toast");if(e(this._element).trigger(n),!n.isDefaultPrevented()){this._config.animation&&this._element.classList.add("fade");var i=function(){t._element.classList.remove("showing"),t._element.classList.add("show"),e(t._element).trigger("shown.bs.toast"),t._config.autohide&&(t._timeout=setTimeout((function(){t.hide()}),t._config.delay))};if(this._element.classList.remove("hide"),c.reflow(this._element),this._element.classList.add("showing"),this._config.animation){var o=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,i).emulateTransitionEnd(o)}else i()}},n.hide=function(){if(this._element.classList.contains("show")){var t=e.Event("hide.bs.toast");e(this._element).trigger(t),t.isDefaultPrevented()||this._close()}},n.dispose=function(){clearTimeout(this._timeout),this._timeout=null,this._element.classList.contains("show")&&this._element.classList.remove("show"),e(this._element).off("click.dismiss.bs.toast"),e.removeData(this._element,"bs.toast"),this._element=null,this._config=null},n._getConfig=function(t){return t=a(a(a({},ft),e(this._element).data()),"object"==typeof t&&t?t:{}),c.typeCheckConfig("toast",t,this.constructor.DefaultType),t},n._setListeners=function(){var t=this;e(this._element).on("click.dismiss.bs.toast",'[data-dismiss="toast"]',(function(){return t.hide()}))},n._close=function(){var t=this,n=function(){t._element.classList.add("hide"),e(t._element).trigger("hidden.bs.toast")};if(this._element.classList.remove("show"),this._config.animation){var i=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,n).emulateTransitionEnd(i)}else n()},t._jQueryInterface=function(n){return this.each((function(){var i=e(this),o=i.data("bs.toast");if(o||(o=new t(this,"object"==typeof n&&n),i.data("bs.toast",o)),"string"==typeof n){if("undefined"==typeof o[n])throw new TypeError('No method named "'+n+'"');o[n](this)}}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"DefaultType",get:function(){return dt}},{key:"Default",get:function(){return ft}}]),t}();e.fn.toast=gt._jQueryInterface,e.fn.toast.Constructor=gt,e.fn.toast.noConflict=function(){return e.fn.toast=ut,gt._jQueryInterface},t.Alert=d,t.Button=g,t.Carousel=E,t.Collapse=D,t.Dropdown=j,t.Modal=R,t.Popover=it,t.Scrollspy=lt,t.Tab=ht,t.Toast=gt,t.Tooltip=$,t.Util=c,Object.defineProperty(t,"__esModule",{value:!0})}));
46175//# sourceMappingURL=bootstrap.min.js.map      <tr>
46176       <td class="{{methods_level}}" colspan="4">{{name}}</td>
46177       <td class="{{methods_level}} big">{{methods_bar}}</td>
46178       <td class="{{methods_level}} small"><div align="right">{{methods_tested_percent}}</div></td>
46179       <td class="{{methods_level}} small"><div align="right">{{methods_number}}</div></td>
46180       <td class="{{methods_level}} small">{{crap}}</td>
46181       <td class="{{paths_level}} big">{{paths_bar}}</td>
46182       <td class="{{paths_level}} small"><div align="right">{{paths_executed_percent}}</div></td>
46183       <td class="{{paths_level}} small"><div align="right">{{paths_number}}</div></td>
46184       <td class="{{branches_level}} big">{{branches_bar}}</td>
46185       <td class="{{branches_level}} small"><div align="right">{{branches_executed_percent}}</div></td>
46186       <td class="{{branches_level}} small"><div align="right">{{branches_number}}</div></td>
46187       <td class="{{lines_level}} big">{{lines_bar}}</td>
46188       <td class="{{lines_level}} small"><div align="right">{{lines_executed_percent}}</div></td>
46189       <td class="{{lines_level}} small"><div align="right">{{lines_number}}</div></td>
46190      </tr>
46191
46192<!DOCTYPE html>
46193<html lang="en">
46194 <head>
46195  <meta charset="UTF-8">
46196  <title>Code Coverage for {{full_path}}</title>
46197  <meta name="viewport" content="width=device-width, initial-scale=1.0">
46198  <link href="{{path_to_root}}_css/bootstrap.min.css" rel="stylesheet" type="text/css">
46199  <link href="{{path_to_root}}_css/octicons.css" rel="stylesheet" type="text/css">
46200  <link href="{{path_to_root}}_css/style.css" rel="stylesheet" type="text/css">
46201  <link href="{{path_to_root}}_css/custom.css" rel="stylesheet" type="text/css">
46202 </head>
46203 <body>
46204  <header>
46205   <div class="container-fluid">
46206    <div class="row">
46207     <div class="col-md-12">
46208      <nav aria-label="breadcrumb">
46209       <ol class="breadcrumb">
46210{{breadcrumbs}}
46211       </ol>
46212      </nav>
46213     </div>
46214    </div>
46215   </div>
46216  </header>
46217  <div class="container-fluid">
46218   <div class="table-responsive">
46219    <table class="table table-bordered">
46220     <thead>
46221      <tr>
46222       <td>&nbsp;</td>
46223       <td colspan="16"><div align="center"><strong>Code Coverage</strong></div></td>
46224      </tr>
46225      <tr>
46226       <td>&nbsp;</td>
46227       <td colspan="3"><div align="center"><strong>Classes and Traits</strong></div></td>
46228       <td colspan="4"><div align="center"><strong>Functions and Methods</strong></div></td>
46229       <td colspan="3"><div align="center"><strong>Paths</strong></div></td>
46230       <td colspan="3"><div align="center"><strong>Branches</strong></div></td>
46231       <td colspan="3"><div align="center"><strong>Lines</strong></div></td>
46232      </tr>
46233     </thead>
46234     <tbody>
46235{{items}}
46236     </tbody>
46237    </table>
46238   </div>
46239{{lines}}
46240{{structure}}
46241   <footer>
46242    <hr/>
46243    <h4>Legend</h4>
46244    {{legend}}
46245    <p>
46246     <small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage {{version}}</a> using {{runtime}}{{generator}} at {{date}}.</small>
46247    </p>
46248    <a title="Back to the top" id="toplink" href="#">
46249        <svg xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewBox="0 0 12 16"><path fill-rule="evenodd" d="M12 11L6 5l-6 6h12z"/></svg>
46250    </a>
46251   </footer>
46252  </div>
46253  <script src="{{path_to_root}}_js/jquery.min.js" type="text/javascript"></script>
46254  <script src="{{path_to_root}}_js/popper.min.js" type="text/javascript"></script>
46255  <script src="{{path_to_root}}_js/bootstrap.min.js" type="text/javascript"></script>
46256  <script src="{{path_to_root}}_js/file.js" type="text/javascript"></script>
46257 </body>
46258</html>
46259      <tr>
46260       <td class="{{classes_level}}">{{name}}</td>
46261       <td class="{{classes_level}} big">{{classes_bar}}</td>
46262       <td class="{{classes_level}} small"><div align="right">{{classes_tested_percent}}</div></td>
46263       <td class="{{classes_level}} small"><div align="right">{{classes_number}}</div></td>
46264       <td class="{{methods_level}} big">{{methods_bar}}</td>
46265       <td class="{{methods_level}} small"><div align="right">{{methods_tested_percent}}</div></td>
46266       <td class="{{methods_level}} small"><div align="right">{{methods_number}}</div></td>
46267       <td class="{{methods_level}} small">{{crap}}</td>
46268       <td class="{{paths_level}} big">{{paths_bar}}</td>
46269       <td class="{{paths_level}} small"><div align="right">{{paths_executed_percent}}</div></td>
46270       <td class="{{paths_level}} small"><div align="right">{{paths_number}}</div></td>
46271       <td class="{{branches_level}} big">{{branches_bar}}</td>
46272       <td class="{{branches_level}} small"><div align="right">{{branches_executed_percent}}</div></td>
46273       <td class="{{branches_level}} small"><div align="right">{{branches_number}}</div></td>
46274       <td class="{{lines_level}} big">{{lines_bar}}</td>
46275       <td class="{{lines_level}} small"><div align="right">{{lines_executed_percent}}</div></td>
46276       <td class="{{lines_level}} small"><div align="right">{{lines_number}}</div></td>
46277      </tr>
46278
46279<table id="code" class="table table-borderless table-condensed">
46280<tbody>
46281{{lines}}
46282</tbody>
46283</table>
46284    <tr class="{{class}} d-flex"><td {{popover}} class="col-1 text-right"><a id="{{lineNumber}}" href="#{{lineNumber}}">{{lineNumber}}</a></td><td class="col-11 codeLine">{{lineContent}}</td></tr>
46285      <tr>
46286       <td class="{{lines_level}}">{{icon}}{{name}}</td>
46287       <td class="{{lines_level}} big">{{lines_bar}}</td>
46288       <td class="{{lines_level}} small"><div align="right">{{lines_executed_percent}}</div></td>
46289       <td class="{{lines_level}} small"><div align="right">{{lines_number}}</div></td>
46290       <td class="{{methods_level}} big">{{methods_bar}}</td>
46291       <td class="{{methods_level}} small"><div align="right">{{methods_tested_percent}}</div></td>
46292       <td class="{{methods_level}} small"><div align="right">{{methods_number}}</div></td>
46293       <td class="{{classes_level}} big">{{classes_bar}}</td>
46294       <td class="{{classes_level}} small"><div align="right">{{classes_tested_percent}}</div></td>
46295       <td class="{{classes_level}} small"><div align="right">{{classes_number}}</div></td>
46296      </tr>
46297
46298       <div class="progress">
46299         <div class="progress-bar bg-{{level}}" role="progressbar" aria-valuenow="{{percent}}" aria-valuemin="0" aria-valuemax="100" style="width: {{percent}}%">
46300           <span class="sr-only">{{percent}}% covered ({{level}})</span>
46301         </div>
46302       </div>
46303      <tr>
46304       <td class="{{methods_level}}" colspan="4">{{name}}</td>
46305       <td class="{{methods_level}} big">{{methods_bar}}</td>
46306       <td class="{{methods_level}} small"><div align="right">{{methods_tested_percent}}</div></td>
46307       <td class="{{methods_level}} small"><div align="right">{{methods_number}}</div></td>
46308       <td class="{{methods_level}} small">{{crap}}</td>
46309       <td class="{{lines_level}} big">{{lines_bar}}</td>
46310       <td class="{{lines_level}} small"><div align="right">{{lines_executed_percent}}</div></td>
46311       <td class="{{lines_level}} small"><div align="right">{{lines_number}}</div></td>
46312      </tr>
46313
46314/*!
46315 * Bootstrap v4.5.0 (https://getbootstrap.com/)
46316 * Copyright 2011-2020 The Bootstrap Authors
46317 * Copyright 2011-2020 Twitter, Inc.
46318 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
46319 */:root{--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#007bff;--secondary:#6c757d;--success:#28a745;--info:#17a2b8;--warning:#ffc107;--danger:#dc3545;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]){color:inherit;text-decoration:none}a:not([href]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-weight:500;line-height:1.2}.h1,h1{font-size:2.5rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.75rem}.h4,h4{font-size:1.5rem}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:6rem;font-weight:300;line-height:1.2}.display-2{font-size:5.5rem;font-weight:300;line-height:1.2}.display-3{font-size:4.5rem;font-weight:300;line-height:1.2}.display-4{font-size:3.5rem;font-weight:300;line-height:1.2}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:80%;font-weight:400}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:90%;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.25rem}.blockquote-footer{display:block;font-size:80%;color:#6c757d}.blockquote-footer::before{content:"\2014\00A0"}.img-fluid{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:#fff;border:1px solid #dee2e6;border-radius:.25rem;max-width:100%;height:auto}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:90%;color:#6c757d}code{font-size:87.5%;color:#e83e8c;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:87.5%;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}pre{display:block;font-size:87.5%;color:#212529}pre code{font-size:inherit;color:inherit;word-break:normal}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){.container{max-width:1140px}}.container-fluid,.container-lg,.container-md,.container-sm,.container-xl{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container,.container-sm{max-width:540px}}@media (min-width:768px){.container,.container-md,.container-sm{max-width:720px}}@media (min-width:992px){.container,.container-lg,.container-md,.container-sm{max-width:960px}}@media (min-width:1200px){.container,.container-lg,.container-md,.container-sm,.container-xl{max-width:1140px}}.row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.col,.col-1,.col-10,.col-11,.col-12,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-auto,.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-auto,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-auto,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-auto{position:relative;width:100%;padding-right:15px;padding-left:15px}.col{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;min-width:0;max-width:100%}.row-cols-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-first{-ms-flex-order:-1;order:-1}.order-last{-ms-flex-order:13;order:13}.order-0{-ms-flex-order:0;order:0}.order-1{-ms-flex-order:1;order:1}.order-2{-ms-flex-order:2;order:2}.order-3{-ms-flex-order:3;order:3}.order-4{-ms-flex-order:4;order:4}.order-5{-ms-flex-order:5;order:5}.order-6{-ms-flex-order:6;order:6}.order-7{-ms-flex-order:7;order:7}.order-8{-ms-flex-order:8;order:8}.order-9{-ms-flex-order:9;order:9}.order-10{-ms-flex-order:10;order:10}.order-11{-ms-flex-order:11;order:11}.order-12{-ms-flex-order:12;order:12}.offset-1{margin-left:8.333333%}.offset-2{margin-left:16.666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.333333%}.offset-5{margin-left:41.666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.333333%}.offset-8{margin-left:66.666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.333333%}.offset-11{margin-left:91.666667%}@media (min-width:576px){.col-sm{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;min-width:0;max-width:100%}.row-cols-sm-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-sm-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-sm-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-sm-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-sm-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-sm-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-sm-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-sm-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-sm-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-sm-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-sm-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-sm-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-sm-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-sm-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-sm-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-sm-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-sm-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-sm-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-sm-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-sm-first{-ms-flex-order:-1;order:-1}.order-sm-last{-ms-flex-order:13;order:13}.order-sm-0{-ms-flex-order:0;order:0}.order-sm-1{-ms-flex-order:1;order:1}.order-sm-2{-ms-flex-order:2;order:2}.order-sm-3{-ms-flex-order:3;order:3}.order-sm-4{-ms-flex-order:4;order:4}.order-sm-5{-ms-flex-order:5;order:5}.order-sm-6{-ms-flex-order:6;order:6}.order-sm-7{-ms-flex-order:7;order:7}.order-sm-8{-ms-flex-order:8;order:8}.order-sm-9{-ms-flex-order:9;order:9}.order-sm-10{-ms-flex-order:10;order:10}.order-sm-11{-ms-flex-order:11;order:11}.order-sm-12{-ms-flex-order:12;order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.333333%}.offset-sm-2{margin-left:16.666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.333333%}.offset-sm-5{margin-left:41.666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.333333%}.offset-sm-8{margin-left:66.666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.333333%}.offset-sm-11{margin-left:91.666667%}}@media (min-width:768px){.col-md{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;min-width:0;max-width:100%}.row-cols-md-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-md-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-md-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-md-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-md-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-md-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-md-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-md-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-md-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-md-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-md-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-md-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-md-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-md-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-md-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-md-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-md-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-md-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-md-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-md-first{-ms-flex-order:-1;order:-1}.order-md-last{-ms-flex-order:13;order:13}.order-md-0{-ms-flex-order:0;order:0}.order-md-1{-ms-flex-order:1;order:1}.order-md-2{-ms-flex-order:2;order:2}.order-md-3{-ms-flex-order:3;order:3}.order-md-4{-ms-flex-order:4;order:4}.order-md-5{-ms-flex-order:5;order:5}.order-md-6{-ms-flex-order:6;order:6}.order-md-7{-ms-flex-order:7;order:7}.order-md-8{-ms-flex-order:8;order:8}.order-md-9{-ms-flex-order:9;order:9}.order-md-10{-ms-flex-order:10;order:10}.order-md-11{-ms-flex-order:11;order:11}.order-md-12{-ms-flex-order:12;order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.333333%}.offset-md-2{margin-left:16.666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.333333%}.offset-md-5{margin-left:41.666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.333333%}.offset-md-8{margin-left:66.666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.333333%}.offset-md-11{margin-left:91.666667%}}@media (min-width:992px){.col-lg{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;min-width:0;max-width:100%}.row-cols-lg-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-lg-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-lg-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-lg-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-lg-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-lg-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-lg-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-lg-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-lg-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-lg-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-lg-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-lg-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-lg-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-lg-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-lg-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-lg-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-lg-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-lg-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-lg-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-lg-first{-ms-flex-order:-1;order:-1}.order-lg-last{-ms-flex-order:13;order:13}.order-lg-0{-ms-flex-order:0;order:0}.order-lg-1{-ms-flex-order:1;order:1}.order-lg-2{-ms-flex-order:2;order:2}.order-lg-3{-ms-flex-order:3;order:3}.order-lg-4{-ms-flex-order:4;order:4}.order-lg-5{-ms-flex-order:5;order:5}.order-lg-6{-ms-flex-order:6;order:6}.order-lg-7{-ms-flex-order:7;order:7}.order-lg-8{-ms-flex-order:8;order:8}.order-lg-9{-ms-flex-order:9;order:9}.order-lg-10{-ms-flex-order:10;order:10}.order-lg-11{-ms-flex-order:11;order:11}.order-lg-12{-ms-flex-order:12;order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.333333%}.offset-lg-2{margin-left:16.666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.333333%}.offset-lg-5{margin-left:41.666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.333333%}.offset-lg-8{margin-left:66.666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.333333%}.offset-lg-11{margin-left:91.666667%}}@media (min-width:1200px){.col-xl{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;min-width:0;max-width:100%}.row-cols-xl-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-xl-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-xl-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-xl-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-xl-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-xl-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-xl-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-xl-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-xl-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-xl-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-xl-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-xl-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-xl-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-xl-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-xl-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-xl-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-xl-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-xl-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-xl-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-xl-first{-ms-flex-order:-1;order:-1}.order-xl-last{-ms-flex-order:13;order:13}.order-xl-0{-ms-flex-order:0;order:0}.order-xl-1{-ms-flex-order:1;order:1}.order-xl-2{-ms-flex-order:2;order:2}.order-xl-3{-ms-flex-order:3;order:3}.order-xl-4{-ms-flex-order:4;order:4}.order-xl-5{-ms-flex-order:5;order:5}.order-xl-6{-ms-flex-order:6;order:6}.order-xl-7{-ms-flex-order:7;order:7}.order-xl-8{-ms-flex-order:8;order:8}.order-xl-9{-ms-flex-order:9;order:9}.order-xl-10{-ms-flex-order:10;order:10}.order-xl-11{-ms-flex-order:11;order:11}.order-xl-12{-ms-flex-order:12;order:12}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.333333%}.offset-xl-2{margin-left:16.666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.333333%}.offset-xl-5{margin-left:41.666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.333333%}.offset-xl-8{margin-left:66.666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.333333%}.offset-xl-11{margin-left:91.666667%}}.table{width:100%;margin-bottom:1rem;color:#212529}.table td,.table th{padding:.75rem;vertical-align:top;border-top:1px solid #dee2e6}.table thead th{vertical-align:bottom;border-bottom:2px solid #dee2e6}.table tbody+tbody{border-top:2px solid #dee2e6}.table-sm td,.table-sm th{padding:.3rem}.table-bordered{border:1px solid #dee2e6}.table-bordered td,.table-bordered th{border:1px solid #dee2e6}.table-bordered thead td,.table-bordered thead th{border-bottom-width:2px}.table-borderless tbody+tbody,.table-borderless td,.table-borderless th,.table-borderless thead th{border:0}.table-striped tbody tr:nth-of-type(odd){background-color:rgba(0,0,0,.05)}.table-hover tbody tr:hover{color:#212529;background-color:rgba(0,0,0,.075)}.table-primary,.table-primary>td,.table-primary>th{background-color:#b8daff}.table-primary tbody+tbody,.table-primary td,.table-primary th,.table-primary thead th{border-color:#7abaff}.table-hover .table-primary:hover{background-color:#9fcdff}.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#9fcdff}.table-secondary,.table-secondary>td,.table-secondary>th{background-color:#d6d8db}.table-secondary tbody+tbody,.table-secondary td,.table-secondary th,.table-secondary thead th{border-color:#b3b7bb}.table-hover .table-secondary:hover{background-color:#c8cbcf}.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#c8cbcf}.table-success,.table-success>td,.table-success>th{background-color:#c3e6cb}.table-success tbody+tbody,.table-success td,.table-success th,.table-success thead th{border-color:#8fd19e}.table-hover .table-success:hover{background-color:#b1dfbb}.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#b1dfbb}.table-info,.table-info>td,.table-info>th{background-color:#bee5eb}.table-info tbody+tbody,.table-info td,.table-info th,.table-info thead th{border-color:#86cfda}.table-hover .table-info:hover{background-color:#abdde5}.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#abdde5}.table-warning,.table-warning>td,.table-warning>th{background-color:#ffeeba}.table-warning tbody+tbody,.table-warning td,.table-warning th,.table-warning thead th{border-color:#ffdf7e}.table-hover .table-warning:hover{background-color:#ffe8a1}.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#ffe8a1}.table-danger,.table-danger>td,.table-danger>th{background-color:#f5c6cb}.table-danger tbody+tbody,.table-danger td,.table-danger th,.table-danger thead th{border-color:#ed969e}.table-hover .table-danger:hover{background-color:#f1b0b7}.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#f1b0b7}.table-light,.table-light>td,.table-light>th{background-color:#fdfdfe}.table-light tbody+tbody,.table-light td,.table-light th,.table-light thead th{border-color:#fbfcfc}.table-hover .table-light:hover{background-color:#ececf6}.table-hover .table-light:hover>td,.table-hover .table-light:hover>th{background-color:#ececf6}.table-dark,.table-dark>td,.table-dark>th{background-color:#c6c8ca}.table-dark tbody+tbody,.table-dark td,.table-dark th,.table-dark thead th{border-color:#95999c}.table-hover .table-dark:hover{background-color:#b9bbbe}.table-hover .table-dark:hover>td,.table-hover .table-dark:hover>th{background-color:#b9bbbe}.table-active,.table-active>td,.table-active>th{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,.075)}.table .thead-dark th{color:#fff;background-color:#343a40;border-color:#454d55}.table .thead-light th{color:#495057;background-color:#e9ecef;border-color:#dee2e6}.table-dark{color:#fff;background-color:#343a40}.table-dark td,.table-dark th,.table-dark thead th{border-color:#454d55}.table-dark.table-bordered{border:0}.table-dark.table-striped tbody tr:nth-of-type(odd){background-color:rgba(255,255,255,.05)}.table-dark.table-hover tbody tr:hover{color:#fff;background-color:rgba(255,255,255,.075)}@media (max-width:575.98px){.table-responsive-sm{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-sm>.table-bordered{border:0}}@media (max-width:767.98px){.table-responsive-md{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-md>.table-bordered{border:0}}@media (max-width:991.98px){.table-responsive-lg{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-lg>.table-bordered{border:0}}@media (max-width:1199.98px){.table-responsive-xl{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-xl>.table-bordered{border:0}}.table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive>.table-bordered{border:0}.form-control{display:block;width:100%;height:calc(1.5em + .75rem + 2px);padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.form-control{transition:none}}.form-control::-ms-expand{background-color:transparent;border:0}.form-control:-moz-focusring{color:transparent;text-shadow:0 0 0 #495057}.form-control:focus{color:#495057;background-color:#fff;border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.form-control::-webkit-input-placeholder{color:#6c757d;opacity:1}.form-control::-moz-placeholder{color:#6c757d;opacity:1}.form-control:-ms-input-placeholder{color:#6c757d;opacity:1}.form-control::-ms-input-placeholder{color:#6c757d;opacity:1}.form-control::placeholder{color:#6c757d;opacity:1}.form-control:disabled,.form-control[readonly]{background-color:#e9ecef;opacity:1}input[type=date].form-control,input[type=datetime-local].form-control,input[type=month].form-control,input[type=time].form-control{-webkit-appearance:none;-moz-appearance:none;appearance:none}select.form-control:focus::-ms-value{color:#495057;background-color:#fff}.form-control-file,.form-control-range{display:block;width:100%}.col-form-label{padding-top:calc(.375rem + 1px);padding-bottom:calc(.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.5}.col-form-label-lg{padding-top:calc(.5rem + 1px);padding-bottom:calc(.5rem + 1px);font-size:1.25rem;line-height:1.5}.col-form-label-sm{padding-top:calc(.25rem + 1px);padding-bottom:calc(.25rem + 1px);font-size:.875rem;line-height:1.5}.form-control-plaintext{display:block;width:100%;padding:.375rem 0;margin-bottom:0;font-size:1rem;line-height:1.5;color:#212529;background-color:transparent;border:solid transparent;border-width:1px 0}.form-control-plaintext.form-control-lg,.form-control-plaintext.form-control-sm{padding-right:0;padding-left:0}.form-control-sm{height:calc(1.5em + .5rem + 2px);padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.form-control-lg{height:calc(1.5em + 1rem + 2px);padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}select.form-control[multiple],select.form-control[size]{height:auto}textarea.form-control{height:auto}.form-group{margin-bottom:1rem}.form-text{display:block;margin-top:.25rem}.form-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-5px;margin-left:-5px}.form-row>.col,.form-row>[class*=col-]{padding-right:5px;padding-left:5px}.form-check{position:relative;display:block;padding-left:1.25rem}.form-check-input{position:absolute;margin-top:.3rem;margin-left:-1.25rem}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{color:#6c757d}.form-check-label{margin-bottom:0}.form-check-inline{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;padding-left:0;margin-right:.75rem}.form-check-inline .form-check-input{position:static;margin-top:0;margin-right:.3125rem;margin-left:0}.valid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#28a745}.valid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;line-height:1.5;color:#fff;background-color:rgba(40,167,69,.9);border-radius:.25rem}.is-valid~.valid-feedback,.is-valid~.valid-tooltip,.was-validated :valid~.valid-feedback,.was-validated :valid~.valid-tooltip{display:block}.form-control.is-valid,.was-validated .form-control:valid{border-color:#28a745;padding-right:calc(1.5em + .75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-valid:focus,.was-validated .form-control:valid:focus{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.was-validated textarea.form-control:valid,textarea.form-control.is-valid{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.custom-select.is-valid,.was-validated .custom-select:valid{border-color:#28a745;padding-right:calc(.75em + 2.3125rem);background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px,url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") #fff no-repeat center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem)}.custom-select.is-valid:focus,.was-validated .custom-select:valid:focus{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.form-check-input.is-valid~.form-check-label,.was-validated .form-check-input:valid~.form-check-label{color:#28a745}.form-check-input.is-valid~.valid-feedback,.form-check-input.is-valid~.valid-tooltip,.was-validated .form-check-input:valid~.valid-feedback,.was-validated .form-check-input:valid~.valid-tooltip{display:block}.custom-control-input.is-valid~.custom-control-label,.was-validated .custom-control-input:valid~.custom-control-label{color:#28a745}.custom-control-input.is-valid~.custom-control-label::before,.was-validated .custom-control-input:valid~.custom-control-label::before{border-color:#28a745}.custom-control-input.is-valid:checked~.custom-control-label::before,.was-validated .custom-control-input:valid:checked~.custom-control-label::before{border-color:#34ce57;background-color:#34ce57}.custom-control-input.is-valid:focus~.custom-control-label::before,.was-validated .custom-control-input:valid:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.custom-control-input.is-valid:focus:not(:checked)~.custom-control-label::before,.was-validated .custom-control-input:valid:focus:not(:checked)~.custom-control-label::before{border-color:#28a745}.custom-file-input.is-valid~.custom-file-label,.was-validated .custom-file-input:valid~.custom-file-label{border-color:#28a745}.custom-file-input.is-valid:focus~.custom-file-label,.was-validated .custom-file-input:valid:focus~.custom-file-label{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.invalid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#dc3545}.invalid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;line-height:1.5;color:#fff;background-color:rgba(220,53,69,.9);border-radius:.25rem}.is-invalid~.invalid-feedback,.is-invalid~.invalid-tooltip,.was-validated :invalid~.invalid-feedback,.was-validated :invalid~.invalid-tooltip{display:block}.form-control.is-invalid,.was-validated .form-control:invalid{border-color:#dc3545;padding-right:calc(1.5em + .75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-invalid:focus,.was-validated .form-control:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.was-validated textarea.form-control:invalid,textarea.form-control.is-invalid{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.custom-select.is-invalid,.was-validated .custom-select:invalid{border-color:#dc3545;padding-right:calc(.75em + 2.3125rem);background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px,url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e") #fff no-repeat center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem)}.custom-select.is-invalid:focus,.was-validated .custom-select:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-check-input.is-invalid~.form-check-label,.was-validated .form-check-input:invalid~.form-check-label{color:#dc3545}.form-check-input.is-invalid~.invalid-feedback,.form-check-input.is-invalid~.invalid-tooltip,.was-validated .form-check-input:invalid~.invalid-feedback,.was-validated .form-check-input:invalid~.invalid-tooltip{display:block}.custom-control-input.is-invalid~.custom-control-label,.was-validated .custom-control-input:invalid~.custom-control-label{color:#dc3545}.custom-control-input.is-invalid~.custom-control-label::before,.was-validated .custom-control-input:invalid~.custom-control-label::before{border-color:#dc3545}.custom-control-input.is-invalid:checked~.custom-control-label::before,.was-validated .custom-control-input:invalid:checked~.custom-control-label::before{border-color:#e4606d;background-color:#e4606d}.custom-control-input.is-invalid:focus~.custom-control-label::before,.was-validated .custom-control-input:invalid:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.custom-control-input.is-invalid:focus:not(:checked)~.custom-control-label::before,.was-validated .custom-control-input:invalid:focus:not(:checked)~.custom-control-label::before{border-color:#dc3545}.custom-file-input.is-invalid~.custom-file-label,.was-validated .custom-file-input:invalid~.custom-file-label{border-color:#dc3545}.custom-file-input.is-invalid:focus~.custom-file-label,.was-validated .custom-file-input:invalid:focus~.custom-file-label{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-inline{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-align:center;align-items:center}.form-inline .form-check{width:100%}@media (min-width:576px){.form-inline label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;margin-bottom:0}.form-inline .form-group{display:-ms-flexbox;display:flex;-ms-flex:0 0 auto;flex:0 0 auto;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-align:center;align-items:center;margin-bottom:0}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-plaintext{display:inline-block}.form-inline .custom-select,.form-inline .input-group{width:auto}.form-inline .form-check{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:auto;padding-left:0}.form-inline .form-check-input{position:relative;-ms-flex-negative:0;flex-shrink:0;margin-top:0;margin-right:.25rem;margin-left:0}.form-inline .custom-control{-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.form-inline .custom-control-label{margin-bottom:0}}.btn{display:inline-block;font-weight:400;color:#212529;text-align:center;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:transparent;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn:hover{color:#212529;text-decoration:none}.btn.focus,.btn:focus{outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.btn.disabled,.btn:disabled{opacity:.65}.btn:not(:disabled):not(.disabled){cursor:pointer}a.btn.disabled,fieldset:disabled a.btn{pointer-events:none}.btn-primary{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:hover{color:#fff;background-color:#0069d9;border-color:#0062cc}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#0069d9;border-color:#0062cc;box-shadow:0 0 0 .2rem rgba(38,143,255,.5)}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#0062cc;border-color:#005cbf}.btn-primary:not(:disabled):not(.disabled).active:focus,.btn-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(38,143,255,.5)}.btn-secondary{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:hover{color:#fff;background-color:#5a6268;border-color:#545b62}.btn-secondary.focus,.btn-secondary:focus{color:#fff;background-color:#5a6268;border-color:#545b62;box-shadow:0 0 0 .2rem rgba(130,138,145,.5)}.btn-secondary.disabled,.btn-secondary:disabled{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:not(:disabled):not(.disabled).active,.btn-secondary:not(:disabled):not(.disabled):active,.show>.btn-secondary.dropdown-toggle{color:#fff;background-color:#545b62;border-color:#4e555b}.btn-secondary:not(:disabled):not(.disabled).active:focus,.btn-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(130,138,145,.5)}.btn-success{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:hover{color:#fff;background-color:#218838;border-color:#1e7e34}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#218838;border-color:#1e7e34;box-shadow:0 0 0 .2rem rgba(72,180,97,.5)}.btn-success.disabled,.btn-success:disabled{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:not(:disabled):not(.disabled).active,.btn-success:not(:disabled):not(.disabled):active,.show>.btn-success.dropdown-toggle{color:#fff;background-color:#1e7e34;border-color:#1c7430}.btn-success:not(:disabled):not(.disabled).active:focus,.btn-success:not(:disabled):not(.disabled):active:focus,.show>.btn-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(72,180,97,.5)}.btn-info{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:hover{color:#fff;background-color:#138496;border-color:#117a8b}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#138496;border-color:#117a8b;box-shadow:0 0 0 .2rem rgba(58,176,195,.5)}.btn-info.disabled,.btn-info:disabled{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:not(:disabled):not(.disabled).active,.btn-info:not(:disabled):not(.disabled):active,.show>.btn-info.dropdown-toggle{color:#fff;background-color:#117a8b;border-color:#10707f}.btn-info:not(:disabled):not(.disabled).active:focus,.btn-info:not(:disabled):not(.disabled):active:focus,.show>.btn-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(58,176,195,.5)}.btn-warning{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:hover{color:#212529;background-color:#e0a800;border-color:#d39e00}.btn-warning.focus,.btn-warning:focus{color:#212529;background-color:#e0a800;border-color:#d39e00;box-shadow:0 0 0 .2rem rgba(222,170,12,.5)}.btn-warning.disabled,.btn-warning:disabled{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:not(:disabled):not(.disabled).active,.btn-warning:not(:disabled):not(.disabled):active,.show>.btn-warning.dropdown-toggle{color:#212529;background-color:#d39e00;border-color:#c69500}.btn-warning:not(:disabled):not(.disabled).active:focus,.btn-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(222,170,12,.5)}.btn-danger{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:hover{color:#fff;background-color:#c82333;border-color:#bd2130}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c82333;border-color:#bd2130;box-shadow:0 0 0 .2rem rgba(225,83,97,.5)}.btn-danger.disabled,.btn-danger:disabled{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:not(:disabled):not(.disabled).active,.btn-danger:not(:disabled):not(.disabled):active,.show>.btn-danger.dropdown-toggle{color:#fff;background-color:#bd2130;border-color:#b21f2d}.btn-danger:not(:disabled):not(.disabled).active:focus,.btn-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(225,83,97,.5)}.btn-light{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:hover{color:#212529;background-color:#e2e6ea;border-color:#dae0e5}.btn-light.focus,.btn-light:focus{color:#212529;background-color:#e2e6ea;border-color:#dae0e5;box-shadow:0 0 0 .2rem rgba(216,217,219,.5)}.btn-light.disabled,.btn-light:disabled{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:not(:disabled):not(.disabled).active,.btn-light:not(:disabled):not(.disabled):active,.show>.btn-light.dropdown-toggle{color:#212529;background-color:#dae0e5;border-color:#d3d9df}.btn-light:not(:disabled):not(.disabled).active:focus,.btn-light:not(:disabled):not(.disabled):active:focus,.show>.btn-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(216,217,219,.5)}.btn-dark{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:hover{color:#fff;background-color:#23272b;border-color:#1d2124}.btn-dark.focus,.btn-dark:focus{color:#fff;background-color:#23272b;border-color:#1d2124;box-shadow:0 0 0 .2rem rgba(82,88,93,.5)}.btn-dark.disabled,.btn-dark:disabled{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:not(:disabled):not(.disabled).active,.btn-dark:not(:disabled):not(.disabled):active,.show>.btn-dark.dropdown-toggle{color:#fff;background-color:#1d2124;border-color:#171a1d}.btn-dark:not(:disabled):not(.disabled).active:focus,.btn-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(82,88,93,.5)}.btn-outline-primary{color:#007bff;border-color:#007bff}.btn-outline-primary:hover{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary.focus,.btn-outline-primary:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#007bff;background-color:transparent}.btn-outline-primary:not(:disabled):not(.disabled).active,.btn-outline-primary:not(:disabled):not(.disabled):active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary:not(:disabled):not(.disabled).active:focus,.btn-outline-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-secondary{color:#6c757d;border-color:#6c757d}.btn-outline-secondary:hover{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary.focus,.btn-outline-secondary:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#6c757d;background-color:transparent}.btn-outline-secondary:not(:disabled):not(.disabled).active,.btn-outline-secondary:not(:disabled):not(.disabled):active,.show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-outline-success{color:#28a745;border-color:#28a745}.btn-outline-success:hover{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success.focus,.btn-outline-success:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#28a745;background-color:transparent}.btn-outline-success:not(:disabled):not(.disabled).active,.btn-outline-success:not(:disabled):not(.disabled):active,.show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success:not(:disabled):not(.disabled).active:focus,.btn-outline-success:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-info{color:#17a2b8;border-color:#17a2b8}.btn-outline-info:hover{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info.focus,.btn-outline-info:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#17a2b8;background-color:transparent}.btn-outline-info:not(:disabled):not(.disabled).active,.btn-outline-info:not(:disabled):not(.disabled):active,.show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info:not(:disabled):not(.disabled).active:focus,.btn-outline-info:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-warning{color:#ffc107;border-color:#ffc107}.btn-outline-warning:hover{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning.focus,.btn-outline-warning:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#ffc107;background-color:transparent}.btn-outline-warning:not(:disabled):not(.disabled).active,.btn-outline-warning:not(:disabled):not(.disabled):active,.show>.btn-outline-warning.dropdown-toggle{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning:not(:disabled):not(.disabled).active:focus,.btn-outline-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-danger{color:#dc3545;border-color:#dc3545}.btn-outline-danger:hover{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger.focus,.btn-outline-danger:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#dc3545;background-color:transparent}.btn-outline-danger:not(:disabled):not(.disabled).active,.btn-outline-danger:not(:disabled):not(.disabled):active,.show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger:not(:disabled):not(.disabled).active:focus,.btn-outline-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-light{color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:hover{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light.focus,.btn-outline-light:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#f8f9fa;background-color:transparent}.btn-outline-light:not(:disabled):not(.disabled).active,.btn-outline-light:not(:disabled):not(.disabled):active,.show>.btn-outline-light.dropdown-toggle{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:not(:disabled):not(.disabled).active:focus,.btn-outline-light:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-dark{color:#343a40;border-color:#343a40}.btn-outline-dark:hover{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark.focus,.btn-outline-dark:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#343a40;background-color:transparent}.btn-outline-dark:not(:disabled):not(.disabled).active,.btn-outline-dark:not(:disabled):not(.disabled):active,.show>.btn-outline-dark.dropdown-toggle{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark:not(:disabled):not(.disabled).active:focus,.btn-outline-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-link{font-weight:400;color:#007bff;text-decoration:none}.btn-link:hover{color:#0056b3;text-decoration:underline}.btn-link.focus,.btn-link:focus{text-decoration:underline}.btn-link.disabled,.btn-link:disabled{color:#6c757d;pointer-events:none}.btn-group-lg>.btn,.btn-lg{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.btn-group-sm>.btn,.btn-sm{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:.5rem}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{transition:opacity .15s linear}@media (prefers-reduced-motion:reduce){.fade{transition:none}}.fade:not(.show){opacity:0}.collapse:not(.show){display:none}.collapsing{position:relative;height:0;overflow:hidden;transition:height .35s ease}@media (prefers-reduced-motion:reduce){.collapsing{transition:none}}.dropdown,.dropleft,.dropright,.dropup{position:relative}.dropdown-toggle{white-space:nowrap}.dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}.dropdown-toggle:empty::after{margin-left:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:.5rem 0;margin:.125rem 0 0;font-size:1rem;color:#212529;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.dropdown-menu-left{right:auto;left:0}.dropdown-menu-right{right:0;left:auto}@media (min-width:576px){.dropdown-menu-sm-left{right:auto;left:0}.dropdown-menu-sm-right{right:0;left:auto}}@media (min-width:768px){.dropdown-menu-md-left{right:auto;left:0}.dropdown-menu-md-right{right:0;left:auto}}@media (min-width:992px){.dropdown-menu-lg-left{right:auto;left:0}.dropdown-menu-lg-right{right:0;left:auto}}@media (min-width:1200px){.dropdown-menu-xl-left{right:auto;left:0}.dropdown-menu-xl-right{right:0;left:auto}}.dropup .dropdown-menu{top:auto;bottom:100%;margin-top:0;margin-bottom:.125rem}.dropup .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:0;border-right:.3em solid transparent;border-bottom:.3em solid;border-left:.3em solid transparent}.dropup .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-menu{top:0;right:auto;left:100%;margin-top:0;margin-left:.125rem}.dropright .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:0;border-bottom:.3em solid transparent;border-left:.3em solid}.dropright .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-toggle::after{vertical-align:0}.dropleft .dropdown-menu{top:0;right:100%;left:auto;margin-top:0;margin-right:.125rem}.dropleft .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:""}.dropleft .dropdown-toggle::after{display:none}.dropleft .dropdown-toggle::before{display:inline-block;margin-right:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:.3em solid;border-bottom:.3em solid transparent}.dropleft .dropdown-toggle:empty::after{margin-left:0}.dropleft .dropdown-toggle::before{vertical-align:0}.dropdown-menu[x-placement^=bottom],.dropdown-menu[x-placement^=left],.dropdown-menu[x-placement^=right],.dropdown-menu[x-placement^=top]{right:auto;bottom:auto}.dropdown-divider{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}.dropdown-item{display:block;width:100%;padding:.25rem 1.5rem;clear:both;font-weight:400;color:#212529;text-align:inherit;white-space:nowrap;background-color:transparent;border:0}.dropdown-item:focus,.dropdown-item:hover{color:#16181b;text-decoration:none;background-color:#f8f9fa}.dropdown-item.active,.dropdown-item:active{color:#fff;text-decoration:none;background-color:#007bff}.dropdown-item.disabled,.dropdown-item:disabled{color:#6c757d;pointer-events:none;background-color:transparent}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:.5rem 1.5rem;margin-bottom:0;font-size:.875rem;color:#6c757d;white-space:nowrap}.dropdown-item-text{display:block;padding:.25rem 1.5rem;color:#212529}.btn-group,.btn-group-vertical{position:relative;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;-ms-flex:1 1 auto;flex:1 1 auto}.btn-group-vertical>.btn:hover,.btn-group>.btn:hover{z-index:1}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus{z-index:1}.btn-toolbar{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:start;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group>.btn-group:not(:first-child),.btn-group>.btn:not(:first-child){margin-left:-1px}.btn-group>.btn-group:not(:last-child)>.btn,.btn-group>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:not(:first-child)>.btn,.btn-group>.btn:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:.5625rem;padding-left:.5625rem}.dropdown-toggle-split::after,.dropright .dropdown-toggle-split::after,.dropup .dropdown-toggle-split::after{margin-left:0}.dropleft .dropdown-toggle-split::before{margin-right:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.375rem;padding-left:.375rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn-group-vertical{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:center;justify-content:center}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group{width:100%}.btn-group-vertical>.btn-group:not(:first-child),.btn-group-vertical>.btn:not(:first-child){margin-top:-1px}.btn-group-vertical>.btn-group:not(:last-child)>.btn,.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child)>.btn,.btn-group-vertical>.btn:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.btn-group-toggle>.btn,.btn-group-toggle>.btn-group>.btn{margin-bottom:0}.btn-group-toggle>.btn input[type=checkbox],.btn-group-toggle>.btn input[type=radio],.btn-group-toggle>.btn-group>.btn input[type=checkbox],.btn-group-toggle>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:stretch;align-items:stretch;width:100%}.input-group>.custom-file,.input-group>.custom-select,.input-group>.form-control,.input-group>.form-control-plaintext{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;width:1%;min-width:0;margin-bottom:0}.input-group>.custom-file+.custom-file,.input-group>.custom-file+.custom-select,.input-group>.custom-file+.form-control,.input-group>.custom-select+.custom-file,.input-group>.custom-select+.custom-select,.input-group>.custom-select+.form-control,.input-group>.form-control+.custom-file,.input-group>.form-control+.custom-select,.input-group>.form-control+.form-control,.input-group>.form-control-plaintext+.custom-file,.input-group>.form-control-plaintext+.custom-select,.input-group>.form-control-plaintext+.form-control{margin-left:-1px}.input-group>.custom-file .custom-file-input:focus~.custom-file-label,.input-group>.custom-select:focus,.input-group>.form-control:focus{z-index:3}.input-group>.custom-file .custom-file-input:focus{z-index:4}.input-group>.custom-select:not(:last-child),.input-group>.form-control:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-select:not(:first-child),.input-group>.form-control:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.custom-file{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.input-group>.custom-file:not(:last-child) .custom-file-label,.input-group>.custom-file:not(:last-child) .custom-file-label::after{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-file:not(:first-child) .custom-file-label{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-append,.input-group-prepend{display:-ms-flexbox;display:flex}.input-group-append .btn,.input-group-prepend .btn{position:relative;z-index:2}.input-group-append .btn:focus,.input-group-prepend .btn:focus{z-index:3}.input-group-append .btn+.btn,.input-group-append .btn+.input-group-text,.input-group-append .input-group-text+.btn,.input-group-append .input-group-text+.input-group-text,.input-group-prepend .btn+.btn,.input-group-prepend .btn+.input-group-text,.input-group-prepend .input-group-text+.btn,.input-group-prepend .input-group-text+.input-group-text{margin-left:-1px}.input-group-prepend{margin-right:-1px}.input-group-append{margin-left:-1px}.input-group-text{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:.375rem .75rem;margin-bottom:0;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;text-align:center;white-space:nowrap;background-color:#e9ecef;border:1px solid #ced4da;border-radius:.25rem}.input-group-text input[type=checkbox],.input-group-text input[type=radio]{margin-top:0}.input-group-lg>.custom-select,.input-group-lg>.form-control:not(textarea){height:calc(1.5em + 1rem + 2px)}.input-group-lg>.custom-select,.input-group-lg>.form-control,.input-group-lg>.input-group-append>.btn,.input-group-lg>.input-group-append>.input-group-text,.input-group-lg>.input-group-prepend>.btn,.input-group-lg>.input-group-prepend>.input-group-text{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.input-group-sm>.custom-select,.input-group-sm>.form-control:not(textarea){height:calc(1.5em + .5rem + 2px)}.input-group-sm>.custom-select,.input-group-sm>.form-control,.input-group-sm>.input-group-append>.btn,.input-group-sm>.input-group-append>.input-group-text,.input-group-sm>.input-group-prepend>.btn,.input-group-sm>.input-group-prepend>.input-group-text{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.input-group-lg>.custom-select,.input-group-sm>.custom-select{padding-right:1.75rem}.input-group>.input-group-append:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group>.input-group-append:last-child>.input-group-text:not(:last-child),.input-group>.input-group-append:not(:last-child)>.btn,.input-group>.input-group-append:not(:last-child)>.input-group-text,.input-group>.input-group-prepend>.btn,.input-group>.input-group-prepend>.input-group-text{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.input-group-append>.btn,.input-group>.input-group-append>.input-group-text,.input-group>.input-group-prepend:first-child>.btn:not(:first-child),.input-group>.input-group-prepend:first-child>.input-group-text:not(:first-child),.input-group>.input-group-prepend:not(:first-child)>.btn,.input-group>.input-group-prepend:not(:first-child)>.input-group-text{border-top-left-radius:0;border-bottom-left-radius:0}.custom-control{position:relative;display:block;min-height:1.5rem;padding-left:1.5rem}.custom-control-inline{display:-ms-inline-flexbox;display:inline-flex;margin-right:1rem}.custom-control-input{position:absolute;left:0;z-index:-1;width:1rem;height:1.25rem;opacity:0}.custom-control-input:checked~.custom-control-label::before{color:#fff;border-color:#007bff;background-color:#007bff}.custom-control-input:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-control-input:focus:not(:checked)~.custom-control-label::before{border-color:#80bdff}.custom-control-input:not(:disabled):active~.custom-control-label::before{color:#fff;background-color:#b3d7ff;border-color:#b3d7ff}.custom-control-input:disabled~.custom-control-label,.custom-control-input[disabled]~.custom-control-label{color:#6c757d}.custom-control-input:disabled~.custom-control-label::before,.custom-control-input[disabled]~.custom-control-label::before{background-color:#e9ecef}.custom-control-label{position:relative;margin-bottom:0;vertical-align:top}.custom-control-label::before{position:absolute;top:.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;pointer-events:none;content:"";background-color:#fff;border:#adb5bd solid 1px}.custom-control-label::after{position:absolute;top:.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;content:"";background:no-repeat 50%/50% 50%}.custom-checkbox .custom-control-label::before{border-radius:.25rem}.custom-checkbox .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::before{border-color:#007bff;background-color:#007bff}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3e%3cpath stroke='%23fff' d='M0 2h4'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-checkbox .custom-control-input:disabled:indeterminate~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-radio .custom-control-label::before{border-radius:50%}.custom-radio .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e")}.custom-radio .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-switch{padding-left:2.25rem}.custom-switch .custom-control-label::before{left:-2.25rem;width:1.75rem;pointer-events:all;border-radius:.5rem}.custom-switch .custom-control-label::after{top:calc(.25rem + 2px);left:calc(-2.25rem + 2px);width:calc(1rem - 4px);height:calc(1rem - 4px);background-color:#adb5bd;border-radius:.5rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-transform .15s ease-in-out;transition:transform .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:transform .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-transform .15s ease-in-out}@media (prefers-reduced-motion:reduce){.custom-switch .custom-control-label::after{transition:none}}.custom-switch .custom-control-input:checked~.custom-control-label::after{background-color:#fff;-webkit-transform:translateX(.75rem);transform:translateX(.75rem)}.custom-switch .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-select{display:inline-block;width:100%;height:calc(1.5em + .75rem + 2px);padding:.375rem 1.75rem .375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;vertical-align:middle;background:#fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px;border:1px solid #ced4da;border-radius:.25rem;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-select:focus{border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-select:focus::-ms-value{color:#495057;background-color:#fff}.custom-select[multiple],.custom-select[size]:not([size="1"]){height:auto;padding-right:.75rem;background-image:none}.custom-select:disabled{color:#6c757d;background-color:#e9ecef}.custom-select::-ms-expand{display:none}.custom-select:-moz-focusring{color:transparent;text-shadow:0 0 0 #495057}.custom-select-sm{height:calc(1.5em + .5rem + 2px);padding-top:.25rem;padding-bottom:.25rem;padding-left:.5rem;font-size:.875rem}.custom-select-lg{height:calc(1.5em + 1rem + 2px);padding-top:.5rem;padding-bottom:.5rem;padding-left:1rem;font-size:1.25rem}.custom-file{position:relative;display:inline-block;width:100%;height:calc(1.5em + .75rem + 2px);margin-bottom:0}.custom-file-input{position:relative;z-index:2;width:100%;height:calc(1.5em + .75rem + 2px);margin:0;opacity:0}.custom-file-input:focus~.custom-file-label{border-color:#80bdff;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-file-input:disabled~.custom-file-label,.custom-file-input[disabled]~.custom-file-label{background-color:#e9ecef}.custom-file-input:lang(en)~.custom-file-label::after{content:"Browse"}.custom-file-input~.custom-file-label[data-browse]::after{content:attr(data-browse)}.custom-file-label{position:absolute;top:0;right:0;left:0;z-index:1;height:calc(1.5em + .75rem + 2px);padding:.375rem .75rem;font-weight:400;line-height:1.5;color:#495057;background-color:#fff;border:1px solid #ced4da;border-radius:.25rem}.custom-file-label::after{position:absolute;top:0;right:0;bottom:0;z-index:3;display:block;height:calc(1.5em + .75rem);padding:.375rem .75rem;line-height:1.5;color:#495057;content:"Browse";background-color:#e9ecef;border-left:inherit;border-radius:0 .25rem .25rem 0}.custom-range{width:100%;height:1.4rem;padding:0;background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-range:focus{outline:0}.custom-range:focus::-webkit-slider-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range:focus::-moz-range-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range:focus::-ms-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range::-moz-focus-outer{border:0}.custom-range::-webkit-slider-thumb{width:1rem;height:1rem;margin-top:-.25rem;background-color:#007bff;border:0;border-radius:1rem;-webkit-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-appearance:none;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-webkit-slider-thumb{-webkit-transition:none;transition:none}}.custom-range::-webkit-slider-thumb:active{background-color:#b3d7ff}.custom-range::-webkit-slider-runnable-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-moz-range-thumb{width:1rem;height:1rem;background-color:#007bff;border:0;border-radius:1rem;-moz-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-moz-appearance:none;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-moz-range-thumb{-moz-transition:none;transition:none}}.custom-range::-moz-range-thumb:active{background-color:#b3d7ff}.custom-range::-moz-range-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-ms-thumb{width:1rem;height:1rem;margin-top:0;margin-right:.2rem;margin-left:.2rem;background-color:#007bff;border:0;border-radius:1rem;-ms-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-ms-thumb{-ms-transition:none;transition:none}}.custom-range::-ms-thumb:active{background-color:#b3d7ff}.custom-range::-ms-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:transparent;border-color:transparent;border-width:.5rem}.custom-range::-ms-fill-lower{background-color:#dee2e6;border-radius:1rem}.custom-range::-ms-fill-upper{margin-right:15px;background-color:#dee2e6;border-radius:1rem}.custom-range:disabled::-webkit-slider-thumb{background-color:#adb5bd}.custom-range:disabled::-webkit-slider-runnable-track{cursor:default}.custom-range:disabled::-moz-range-thumb{background-color:#adb5bd}.custom-range:disabled::-moz-range-track{cursor:default}.custom-range:disabled::-ms-thumb{background-color:#adb5bd}.custom-control-label::before,.custom-file-label,.custom-select{transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.custom-control-label::before,.custom-file-label,.custom-select{transition:none}}.nav{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:.5rem 1rem}.nav-link:focus,.nav-link:hover{text-decoration:none}.nav-link.disabled{color:#6c757d;pointer-events:none;cursor:default}.nav-tabs{border-bottom:1px solid #dee2e6}.nav-tabs .nav-item{margin-bottom:-1px}.nav-tabs .nav-link{border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#e9ecef #e9ecef #dee2e6}.nav-tabs .nav-link.disabled{color:#6c757d;background-color:transparent;border-color:transparent}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{border-radius:.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#007bff}.nav-fill .nav-item{-ms-flex:1 1 auto;flex:1 1 auto;text-align:center}.nav-justified .nav-item{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;text-align:center}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:.5rem 1rem}.navbar .container,.navbar .container-fluid,.navbar .container-lg,.navbar .container-md,.navbar .container-sm,.navbar .container-xl{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:.3125rem;padding-bottom:.3125rem;margin-right:1rem;font-size:1.25rem;line-height:inherit;white-space:nowrap}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-nav{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link{padding-right:0;padding-left:0}.navbar-nav .dropdown-menu{position:static;float:none}.navbar-text{display:inline-block;padding-top:.5rem;padding-bottom:.5rem}.navbar-collapse{-ms-flex-preferred-size:100%;flex-basis:100%;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center}.navbar-toggler{padding:.25rem .75rem;font-size:1.25rem;line-height:1;background-color:transparent;border:1px solid transparent;border-radius:.25rem}.navbar-toggler:focus,.navbar-toggler:hover{text-decoration:none}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;content:"";background:no-repeat center center;background-size:100% 100%}@media (max-width:575.98px){.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid,.navbar-expand-sm>.container-lg,.navbar-expand-sm>.container-md,.navbar-expand-sm>.container-sm,.navbar-expand-sm>.container-xl{padding-right:0;padding-left:0}}@media (min-width:576px){.navbar-expand-sm{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-sm .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid,.navbar-expand-sm>.container-lg,.navbar-expand-sm>.container-md,.navbar-expand-sm>.container-sm,.navbar-expand-sm>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-sm .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}}@media (max-width:767.98px){.navbar-expand-md>.container,.navbar-expand-md>.container-fluid,.navbar-expand-md>.container-lg,.navbar-expand-md>.container-md,.navbar-expand-md>.container-sm,.navbar-expand-md>.container-xl{padding-right:0;padding-left:0}}@media (min-width:768px){.navbar-expand-md{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-md .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-md>.container,.navbar-expand-md>.container-fluid,.navbar-expand-md>.container-lg,.navbar-expand-md>.container-md,.navbar-expand-md>.container-sm,.navbar-expand-md>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-md .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}}@media (max-width:991.98px){.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid,.navbar-expand-lg>.container-lg,.navbar-expand-lg>.container-md,.navbar-expand-lg>.container-sm,.navbar-expand-lg>.container-xl{padding-right:0;padding-left:0}}@media (min-width:992px){.navbar-expand-lg{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-lg .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid,.navbar-expand-lg>.container-lg,.navbar-expand-lg>.container-md,.navbar-expand-lg>.container-sm,.navbar-expand-lg>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-lg .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}}@media (max-width:1199.98px){.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid,.navbar-expand-xl>.container-lg,.navbar-expand-xl>.container-md,.navbar-expand-xl>.container-sm,.navbar-expand-xl>.container-xl{padding-right:0;padding-left:0}}@media (min-width:1200px){.navbar-expand-xl{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-xl .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid,.navbar-expand-xl>.container-lg,.navbar-expand-xl>.container-md,.navbar-expand-xl>.container-sm,.navbar-expand-xl>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-xl .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}}.navbar-expand{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand>.container,.navbar-expand>.container-fluid,.navbar-expand>.container-lg,.navbar-expand>.container-md,.navbar-expand>.container-sm,.navbar-expand>.container-xl{padding-right:0;padding-left:0}.navbar-expand .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand>.container,.navbar-expand>.container-fluid,.navbar-expand>.container-lg,.navbar-expand>.container-md,.navbar-expand>.container-sm,.navbar-expand>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-light .navbar-brand{color:rgba(0,0,0,.9)}.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,.5)}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:rgba(0,0,0,.7)}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(0,0,0,.3)}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link{color:rgba(0,0,0,.9)}.navbar-light .navbar-toggler{color:rgba(0,0,0,.5);border-color:rgba(0,0,0,.1)}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.5%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-light .navbar-text{color:rgba(0,0,0,.5)}.navbar-light .navbar-text a{color:rgba(0,0,0,.9)}.navbar-light .navbar-text a:focus,.navbar-light .navbar-text a:hover{color:rgba(0,0,0,.9)}.navbar-dark .navbar-brand{color:#fff}.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:rgba(255,255,255,.5)}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:rgba(255,255,255,.75)}.navbar-dark .navbar-nav .nav-link.disabled{color:rgba(255,255,255,.25)}.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .show>.nav-link{color:#fff}.navbar-dark .navbar-toggler{color:rgba(255,255,255,.5);border-color:rgba(255,255,255,.1)}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.5%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-dark .navbar-text{color:rgba(255,255,255,.5)}.navbar-dark .navbar-text a{color:#fff}.navbar-dark .navbar-text a:focus,.navbar-dark .navbar-text a:hover{color:#fff}.card{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:0;word-wrap:break-word;background-color:#fff;background-clip:border-box;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}.card>hr{margin-right:0;margin-left:0}.card>.list-group{border-top:inherit;border-bottom:inherit}.card>.list-group:first-child{border-top-width:0;border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card>.list-group:last-child{border-bottom-width:0;border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card-body{-ms-flex:1 1 auto;flex:1 1 auto;min-height:1px;padding:1.25rem}.card-title{margin-bottom:.75rem}.card-subtitle{margin-top:-.375rem;margin-bottom:0}.card-text:last-child{margin-bottom:0}.card-link:hover{text-decoration:none}.card-link+.card-link{margin-left:1.25rem}.card-header{padding:.75rem 1.25rem;margin-bottom:0;background-color:rgba(0,0,0,.03);border-bottom:1px solid rgba(0,0,0,.125)}.card-header:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card-header+.list-group .list-group-item:first-child{border-top:0}.card-footer{padding:.75rem 1.25rem;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.125)}.card-footer:last-child{border-radius:0 0 calc(.25rem - 1px) calc(.25rem - 1px)}.card-header-tabs{margin-right:-.625rem;margin-bottom:-.75rem;margin-left:-.625rem;border-bottom:0}.card-header-pills{margin-right:-.625rem;margin-left:-.625rem}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1.25rem}.card-img,.card-img-bottom,.card-img-top{-ms-flex-negative:0;flex-shrink:0;width:100%}.card-img,.card-img-top{border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card-img,.card-img-bottom{border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card-deck .card{margin-bottom:15px}@media (min-width:576px){.card-deck{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap;margin-right:-15px;margin-left:-15px}.card-deck .card{-ms-flex:1 0 0%;flex:1 0 0%;margin-right:15px;margin-bottom:0;margin-left:15px}}.card-group>.card{margin-bottom:15px}@media (min-width:576px){.card-group{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap}.card-group>.card{-ms-flex:1 0 0%;flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:not(:last-child) .card-header,.card-group>.card:not(:last-child) .card-img-top{border-top-right-radius:0}.card-group>.card:not(:last-child) .card-footer,.card-group>.card:not(:last-child) .card-img-bottom{border-bottom-right-radius:0}.card-group>.card:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:not(:first-child) .card-header,.card-group>.card:not(:first-child) .card-img-top{border-top-left-radius:0}.card-group>.card:not(:first-child) .card-footer,.card-group>.card:not(:first-child) .card-img-bottom{border-bottom-left-radius:0}}.card-columns .card{margin-bottom:.75rem}@media (min-width:576px){.card-columns{-webkit-column-count:3;-moz-column-count:3;column-count:3;-webkit-column-gap:1.25rem;-moz-column-gap:1.25rem;column-gap:1.25rem;orphans:1;widows:1}.card-columns .card{display:inline-block;width:100%}}.accordion>.card{overflow:hidden}.accordion>.card:not(:last-of-type){border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.accordion>.card:not(:first-of-type){border-top-left-radius:0;border-top-right-radius:0}.accordion>.card>.card-header{border-radius:0;margin-bottom:-1px}.breadcrumb{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:.75rem 1rem;margin-bottom:1rem;list-style:none;background-color:#e9ecef;border-radius:.25rem}.breadcrumb-item{display:-ms-flexbox;display:flex}.breadcrumb-item+.breadcrumb-item{padding-left:.5rem}.breadcrumb-item+.breadcrumb-item::before{display:inline-block;padding-right:.5rem;color:#6c757d;content:"/"}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:underline}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:none}.breadcrumb-item.active{color:#6c757d}.pagination{display:-ms-flexbox;display:flex;padding-left:0;list-style:none;border-radius:.25rem}.page-link{position:relative;display:block;padding:.5rem .75rem;margin-left:-1px;line-height:1.25;color:#007bff;background-color:#fff;border:1px solid #dee2e6}.page-link:hover{z-index:2;color:#0056b3;text-decoration:none;background-color:#e9ecef;border-color:#dee2e6}.page-link:focus{z-index:3;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.page-item:first-child .page-link{margin-left:0;border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.page-item:last-child .page-link{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.page-item.active .page-link{z-index:3;color:#fff;background-color:#007bff;border-color:#007bff}.page-item.disabled .page-link{color:#6c757d;pointer-events:none;cursor:auto;background-color:#fff;border-color:#dee2e6}.pagination-lg .page-link{padding:.75rem 1.5rem;font-size:1.25rem;line-height:1.5}.pagination-lg .page-item:first-child .page-link{border-top-left-radius:.3rem;border-bottom-left-radius:.3rem}.pagination-lg .page-item:last-child .page-link{border-top-right-radius:.3rem;border-bottom-right-radius:.3rem}.pagination-sm .page-link{padding:.25rem .5rem;font-size:.875rem;line-height:1.5}.pagination-sm .page-item:first-child .page-link{border-top-left-radius:.2rem;border-bottom-left-radius:.2rem}.pagination-sm .page-item:last-child .page-link{border-top-right-radius:.2rem;border-bottom-right-radius:.2rem}.badge{display:inline-block;padding:.25em .4em;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.badge{transition:none}}a.badge:focus,a.badge:hover{text-decoration:none}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.badge-pill{padding-right:.6em;padding-left:.6em;border-radius:10rem}.badge-primary{color:#fff;background-color:#007bff}a.badge-primary:focus,a.badge-primary:hover{color:#fff;background-color:#0062cc}a.badge-primary.focus,a.badge-primary:focus{outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.badge-secondary{color:#fff;background-color:#6c757d}a.badge-secondary:focus,a.badge-secondary:hover{color:#fff;background-color:#545b62}a.badge-secondary.focus,a.badge-secondary:focus{outline:0;box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.badge-success{color:#fff;background-color:#28a745}a.badge-success:focus,a.badge-success:hover{color:#fff;background-color:#1e7e34}a.badge-success.focus,a.badge-success:focus{outline:0;box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.badge-info{color:#fff;background-color:#17a2b8}a.badge-info:focus,a.badge-info:hover{color:#fff;background-color:#117a8b}a.badge-info.focus,a.badge-info:focus{outline:0;box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.badge-warning{color:#212529;background-color:#ffc107}a.badge-warning:focus,a.badge-warning:hover{color:#212529;background-color:#d39e00}a.badge-warning.focus,a.badge-warning:focus{outline:0;box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.badge-danger{color:#fff;background-color:#dc3545}a.badge-danger:focus,a.badge-danger:hover{color:#fff;background-color:#bd2130}a.badge-danger.focus,a.badge-danger:focus{outline:0;box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.badge-light{color:#212529;background-color:#f8f9fa}a.badge-light:focus,a.badge-light:hover{color:#212529;background-color:#dae0e5}a.badge-light.focus,a.badge-light:focus{outline:0;box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.badge-dark{color:#fff;background-color:#343a40}a.badge-dark:focus,a.badge-dark:hover{color:#fff;background-color:#1d2124}a.badge-dark.focus,a.badge-dark:focus{outline:0;box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.jumbotron{padding:2rem 1rem;margin-bottom:2rem;background-color:#e9ecef;border-radius:.3rem}@media (min-width:576px){.jumbotron{padding:4rem 2rem}}.jumbotron-fluid{padding-right:0;padding-left:0;border-radius:0}.alert{position:relative;padding:.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:.25rem}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible{padding-right:4rem}.alert-dismissible .close{position:absolute;top:0;right:0;padding:.75rem 1.25rem;color:inherit}.alert-primary{color:#004085;background-color:#cce5ff;border-color:#b8daff}.alert-primary hr{border-top-color:#9fcdff}.alert-primary .alert-link{color:#002752}.alert-secondary{color:#383d41;background-color:#e2e3e5;border-color:#d6d8db}.alert-secondary hr{border-top-color:#c8cbcf}.alert-secondary .alert-link{color:#202326}.alert-success{color:#155724;background-color:#d4edda;border-color:#c3e6cb}.alert-success hr{border-top-color:#b1dfbb}.alert-success .alert-link{color:#0b2e13}.alert-info{color:#0c5460;background-color:#d1ecf1;border-color:#bee5eb}.alert-info hr{border-top-color:#abdde5}.alert-info .alert-link{color:#062c33}.alert-warning{color:#856404;background-color:#fff3cd;border-color:#ffeeba}.alert-warning hr{border-top-color:#ffe8a1}.alert-warning .alert-link{color:#533f03}.alert-danger{color:#721c24;background-color:#f8d7da;border-color:#f5c6cb}.alert-danger hr{border-top-color:#f1b0b7}.alert-danger .alert-link{color:#491217}.alert-light{color:#818182;background-color:#fefefe;border-color:#fdfdfe}.alert-light hr{border-top-color:#ececf6}.alert-light .alert-link{color:#686868}.alert-dark{color:#1b1e21;background-color:#d6d8d9;border-color:#c6c8ca}.alert-dark hr{border-top-color:#b9bbbe}.alert-dark .alert-link{color:#040505}@-webkit-keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}.progress{display:-ms-flexbox;display:flex;height:1rem;overflow:hidden;line-height:0;font-size:.75rem;background-color:#e9ecef;border-radius:.25rem}.progress-bar{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;overflow:hidden;color:#fff;text-align:center;white-space:nowrap;background-color:#007bff;transition:width .6s ease}@media (prefers-reduced-motion:reduce){.progress-bar{transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:1rem 1rem}.progress-bar-animated{-webkit-animation:progress-bar-stripes 1s linear infinite;animation:progress-bar-stripes 1s linear infinite}@media (prefers-reduced-motion:reduce){.progress-bar-animated{-webkit-animation:none;animation:none}}.media{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start}.media-body{-ms-flex:1;flex:1}.list-group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0;border-radius:.25rem}.list-group-item-action{width:100%;color:#495057;text-align:inherit}.list-group-item-action:focus,.list-group-item-action:hover{z-index:1;color:#495057;text-decoration:none;background-color:#f8f9fa}.list-group-item-action:active{color:#212529;background-color:#e9ecef}.list-group-item{position:relative;display:block;padding:.75rem 1.25rem;background-color:#fff;border:1px solid rgba(0,0,0,.125)}.list-group-item:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.list-group-item:last-child{border-bottom-right-radius:inherit;border-bottom-left-radius:inherit}.list-group-item.disabled,.list-group-item:disabled{color:#6c757d;pointer-events:none;background-color:#fff}.list-group-item.active{z-index:2;color:#fff;background-color:#007bff;border-color:#007bff}.list-group-item+.list-group-item{border-top-width:0}.list-group-item+.list-group-item.active{margin-top:-1px;border-top-width:1px}.list-group-horizontal{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal>.list-group-item.active{margin-top:0}.list-group-horizontal>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}@media (min-width:576px){.list-group-horizontal-sm{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-sm>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-sm>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-sm>.list-group-item.active{margin-top:0}.list-group-horizontal-sm>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-sm>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:768px){.list-group-horizontal-md{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-md>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-md>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-md>.list-group-item.active{margin-top:0}.list-group-horizontal-md>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-md>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:992px){.list-group-horizontal-lg{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-lg>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-lg>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-lg>.list-group-item.active{margin-top:0}.list-group-horizontal-lg>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-lg>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:1200px){.list-group-horizontal-xl{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-xl>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-xl>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-xl>.list-group-item.active{margin-top:0}.list-group-horizontal-xl>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-xl>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}.list-group-flush{border-radius:0}.list-group-flush>.list-group-item{border-width:0 0 1px}.list-group-flush>.list-group-item:last-child{border-bottom-width:0}.list-group-item-primary{color:#004085;background-color:#b8daff}.list-group-item-primary.list-group-item-action:focus,.list-group-item-primary.list-group-item-action:hover{color:#004085;background-color:#9fcdff}.list-group-item-primary.list-group-item-action.active{color:#fff;background-color:#004085;border-color:#004085}.list-group-item-secondary{color:#383d41;background-color:#d6d8db}.list-group-item-secondary.list-group-item-action:focus,.list-group-item-secondary.list-group-item-action:hover{color:#383d41;background-color:#c8cbcf}.list-group-item-secondary.list-group-item-action.active{color:#fff;background-color:#383d41;border-color:#383d41}.list-group-item-success{color:#155724;background-color:#c3e6cb}.list-group-item-success.list-group-item-action:focus,.list-group-item-success.list-group-item-action:hover{color:#155724;background-color:#b1dfbb}.list-group-item-success.list-group-item-action.active{color:#fff;background-color:#155724;border-color:#155724}.list-group-item-info{color:#0c5460;background-color:#bee5eb}.list-group-item-info.list-group-item-action:focus,.list-group-item-info.list-group-item-action:hover{color:#0c5460;background-color:#abdde5}.list-group-item-info.list-group-item-action.active{color:#fff;background-color:#0c5460;border-color:#0c5460}.list-group-item-warning{color:#856404;background-color:#ffeeba}.list-group-item-warning.list-group-item-action:focus,.list-group-item-warning.list-group-item-action:hover{color:#856404;background-color:#ffe8a1}.list-group-item-warning.list-group-item-action.active{color:#fff;background-color:#856404;border-color:#856404}.list-group-item-danger{color:#721c24;background-color:#f5c6cb}.list-group-item-danger.list-group-item-action:focus,.list-group-item-danger.list-group-item-action:hover{color:#721c24;background-color:#f1b0b7}.list-group-item-danger.list-group-item-action.active{color:#fff;background-color:#721c24;border-color:#721c24}.list-group-item-light{color:#818182;background-color:#fdfdfe}.list-group-item-light.list-group-item-action:focus,.list-group-item-light.list-group-item-action:hover{color:#818182;background-color:#ececf6}.list-group-item-light.list-group-item-action.active{color:#fff;background-color:#818182;border-color:#818182}.list-group-item-dark{color:#1b1e21;background-color:#c6c8ca}.list-group-item-dark.list-group-item-action:focus,.list-group-item-dark.list-group-item-action:hover{color:#1b1e21;background-color:#b9bbbe}.list-group-item-dark.list-group-item-action.active{color:#fff;background-color:#1b1e21;border-color:#1b1e21}.close{float:right;font-size:1.5rem;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.5}.close:hover{color:#000;text-decoration:none}.close:not(:disabled):not(.disabled):focus,.close:not(:disabled):not(.disabled):hover{opacity:.75}button.close{padding:0;background-color:transparent;border:0}a.close.disabled{pointer-events:none}.toast{max-width:350px;overflow:hidden;font-size:.875rem;background-color:rgba(255,255,255,.85);background-clip:padding-box;border:1px solid rgba(0,0,0,.1);box-shadow:0 .25rem .75rem rgba(0,0,0,.1);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);opacity:0;border-radius:.25rem}.toast:not(:last-child){margin-bottom:.75rem}.toast.showing{opacity:1}.toast.show{display:block;opacity:1}.toast.hide{display:none}.toast-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:.25rem .75rem;color:#6c757d;background-color:rgba(255,255,255,.85);background-clip:padding-box;border-bottom:1px solid rgba(0,0,0,.05)}.toast-body{padding:.75rem}.modal-open{overflow:hidden}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal{position:fixed;top:0;left:0;z-index:1050;display:none;width:100%;height:100%;overflow:hidden;outline:0}.modal-dialog{position:relative;width:auto;margin:.5rem;pointer-events:none}.modal.fade .modal-dialog{transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out;-webkit-transform:translate(0,-50px);transform:translate(0,-50px)}@media (prefers-reduced-motion:reduce){.modal.fade .modal-dialog{transition:none}}.modal.show .modal-dialog{-webkit-transform:none;transform:none}.modal.modal-static .modal-dialog{-webkit-transform:scale(1.02);transform:scale(1.02)}.modal-dialog-scrollable{display:-ms-flexbox;display:flex;max-height:calc(100% - 1rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 1rem);overflow:hidden}.modal-dialog-scrollable .modal-footer,.modal-dialog-scrollable .modal-header{-ms-flex-negative:0;flex-shrink:0}.modal-dialog-scrollable .modal-body{overflow-y:auto}.modal-dialog-centered{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:calc(100% - 1rem)}.modal-dialog-centered::before{display:block;height:calc(100vh - 1rem);height:-webkit-min-content;height:-moz-min-content;height:min-content;content:""}.modal-dialog-centered.modal-dialog-scrollable{-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;height:100%}.modal-dialog-centered.modal-dialog-scrollable .modal-content{max-height:none}.modal-dialog-centered.modal-dialog-scrollable::before{content:none}.modal-content{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:100%;pointer-events:auto;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem;outline:0}.modal-backdrop{position:fixed;top:0;left:0;z-index:1040;width:100vw;height:100vh;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:.5}.modal-header{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:justify;justify-content:space-between;padding:1rem 1rem;border-bottom:1px solid #dee2e6;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.modal-header .close{padding:1rem 1rem;margin:-1rem -1rem -1rem auto}.modal-title{margin-bottom:0;line-height:1.5}.modal-body{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem}.modal-footer{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end;padding:.75rem;border-top:1px solid #dee2e6;border-bottom-right-radius:calc(.3rem - 1px);border-bottom-left-radius:calc(.3rem - 1px)}.modal-footer>*{margin:.25rem}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:576px){.modal-dialog{max-width:500px;margin:1.75rem auto}.modal-dialog-scrollable{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 3.5rem)}.modal-dialog-centered{min-height:calc(100% - 3.5rem)}.modal-dialog-centered::before{height:calc(100vh - 3.5rem);height:-webkit-min-content;height:-moz-min-content;height:min-content}.modal-sm{max-width:300px}}@media (min-width:992px){.modal-lg,.modal-xl{max-width:800px}}@media (min-width:1200px){.modal-xl{max-width:1140px}}.tooltip{position:absolute;z-index:1070;display:block;margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;opacity:0}.tooltip.show{opacity:.9}.tooltip .arrow{position:absolute;display:block;width:.8rem;height:.4rem}.tooltip .arrow::before{position:absolute;content:"";border-color:transparent;border-style:solid}.bs-tooltip-auto[x-placement^=top],.bs-tooltip-top{padding:.4rem 0}.bs-tooltip-auto[x-placement^=top] .arrow,.bs-tooltip-top .arrow{bottom:0}.bs-tooltip-auto[x-placement^=top] .arrow::before,.bs-tooltip-top .arrow::before{top:0;border-width:.4rem .4rem 0;border-top-color:#000}.bs-tooltip-auto[x-placement^=right],.bs-tooltip-right{padding:0 .4rem}.bs-tooltip-auto[x-placement^=right] .arrow,.bs-tooltip-right .arrow{left:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=right] .arrow::before,.bs-tooltip-right .arrow::before{right:0;border-width:.4rem .4rem .4rem 0;border-right-color:#000}.bs-tooltip-auto[x-placement^=bottom],.bs-tooltip-bottom{padding:.4rem 0}.bs-tooltip-auto[x-placement^=bottom] .arrow,.bs-tooltip-bottom .arrow{top:0}.bs-tooltip-auto[x-placement^=bottom] .arrow::before,.bs-tooltip-bottom .arrow::before{bottom:0;border-width:0 .4rem .4rem;border-bottom-color:#000}.bs-tooltip-auto[x-placement^=left],.bs-tooltip-left{padding:0 .4rem}.bs-tooltip-auto[x-placement^=left] .arrow,.bs-tooltip-left .arrow{right:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=left] .arrow::before,.bs-tooltip-left .arrow::before{left:0;border-width:.4rem 0 .4rem .4rem;border-left-color:#000}.tooltip-inner{max-width:200px;padding:.25rem .5rem;color:#fff;text-align:center;background-color:#000;border-radius:.25rem}.popover{position:absolute;top:0;left:0;z-index:1060;display:block;max-width:276px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem}.popover .arrow{position:absolute;display:block;width:1rem;height:.5rem;margin:0 .3rem}.popover .arrow::after,.popover .arrow::before{position:absolute;display:block;content:"";border-color:transparent;border-style:solid}.bs-popover-auto[x-placement^=top],.bs-popover-top{margin-bottom:.5rem}.bs-popover-auto[x-placement^=top]>.arrow,.bs-popover-top>.arrow{bottom:calc(-.5rem - 1px)}.bs-popover-auto[x-placement^=top]>.arrow::before,.bs-popover-top>.arrow::before{bottom:0;border-width:.5rem .5rem 0;border-top-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=top]>.arrow::after,.bs-popover-top>.arrow::after{bottom:1px;border-width:.5rem .5rem 0;border-top-color:#fff}.bs-popover-auto[x-placement^=right],.bs-popover-right{margin-left:.5rem}.bs-popover-auto[x-placement^=right]>.arrow,.bs-popover-right>.arrow{left:calc(-.5rem - 1px);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=right]>.arrow::before,.bs-popover-right>.arrow::before{left:0;border-width:.5rem .5rem .5rem 0;border-right-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=right]>.arrow::after,.bs-popover-right>.arrow::after{left:1px;border-width:.5rem .5rem .5rem 0;border-right-color:#fff}.bs-popover-auto[x-placement^=bottom],.bs-popover-bottom{margin-top:.5rem}.bs-popover-auto[x-placement^=bottom]>.arrow,.bs-popover-bottom>.arrow{top:calc(-.5rem - 1px)}.bs-popover-auto[x-placement^=bottom]>.arrow::before,.bs-popover-bottom>.arrow::before{top:0;border-width:0 .5rem .5rem .5rem;border-bottom-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=bottom]>.arrow::after,.bs-popover-bottom>.arrow::after{top:1px;border-width:0 .5rem .5rem .5rem;border-bottom-color:#fff}.bs-popover-auto[x-placement^=bottom] .popover-header::before,.bs-popover-bottom .popover-header::before{position:absolute;top:0;left:50%;display:block;width:1rem;margin-left:-.5rem;content:"";border-bottom:1px solid #f7f7f7}.bs-popover-auto[x-placement^=left],.bs-popover-left{margin-right:.5rem}.bs-popover-auto[x-placement^=left]>.arrow,.bs-popover-left>.arrow{right:calc(-.5rem - 1px);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=left]>.arrow::before,.bs-popover-left>.arrow::before{right:0;border-width:.5rem 0 .5rem .5rem;border-left-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=left]>.arrow::after,.bs-popover-left>.arrow::after{right:1px;border-width:.5rem 0 .5rem .5rem;border-left-color:#fff}.popover-header{padding:.5rem .75rem;margin-bottom:0;font-size:1rem;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.popover-header:empty{display:none}.popover-body{padding:.5rem .75rem;color:#212529}.carousel{position:relative}.carousel.pointer-event{-ms-touch-action:pan-y;touch-action:pan-y}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner::after{display:block;clear:both;content:""}.carousel-item{position:relative;display:none;float:left;width:100%;margin-right:-100%;-webkit-backface-visibility:hidden;backface-visibility:hidden;transition:-webkit-transform .6s ease-in-out;transition:transform .6s ease-in-out;transition:transform .6s ease-in-out,-webkit-transform .6s ease-in-out}@media (prefers-reduced-motion:reduce){.carousel-item{transition:none}}.carousel-item-next,.carousel-item-prev,.carousel-item.active{display:block}.active.carousel-item-right,.carousel-item-next:not(.carousel-item-left){-webkit-transform:translateX(100%);transform:translateX(100%)}.active.carousel-item-left,.carousel-item-prev:not(.carousel-item-right){-webkit-transform:translateX(-100%);transform:translateX(-100%)}.carousel-fade .carousel-item{opacity:0;transition-property:opacity;-webkit-transform:none;transform:none}.carousel-fade .carousel-item-next.carousel-item-left,.carousel-fade .carousel-item-prev.carousel-item-right,.carousel-fade .carousel-item.active{z-index:1;opacity:1}.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{z-index:0;opacity:0;transition:opacity 0s .6s}@media (prefers-reduced-motion:reduce){.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{transition:none}}.carousel-control-next,.carousel-control-prev{position:absolute;top:0;bottom:0;z-index:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:15%;color:#fff;text-align:center;opacity:.5;transition:opacity .15s ease}@media (prefers-reduced-motion:reduce){.carousel-control-next,.carousel-control-prev{transition:none}}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-next-icon,.carousel-control-prev-icon{display:inline-block;width:20px;height:20px;background:no-repeat 50%/100% 100%}.carousel-control-prev-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M5.25 0l-4 4 4 4 1.5-1.5L4.25 4l2.5-2.5L5.25 0z'/%3e%3c/svg%3e")}.carousel-control-next-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M2.75 0l-1.5 1.5L3.75 4l-2.5 2.5L2.75 8l4-4-4-4z'/%3e%3c/svg%3e")}.carousel-indicators{position:absolute;right:0;bottom:0;left:0;z-index:15;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;padding-left:0;margin-right:15%;margin-left:15%;list-style:none}.carousel-indicators li{box-sizing:content-box;-ms-flex:0 1 auto;flex:0 1 auto;width:30px;height:3px;margin-right:3px;margin-left:3px;text-indent:-999px;cursor:pointer;background-color:#fff;background-clip:padding-box;border-top:10px solid transparent;border-bottom:10px solid transparent;opacity:.5;transition:opacity .6s ease}@media (prefers-reduced-motion:reduce){.carousel-indicators li{transition:none}}.carousel-indicators .active{opacity:1}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center}@-webkit-keyframes spinner-border{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spinner-border{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.spinner-border{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;border:.25em solid currentColor;border-right-color:transparent;border-radius:50%;-webkit-animation:spinner-border .75s linear infinite;animation:spinner-border .75s linear infinite}.spinner-border-sm{width:1rem;height:1rem;border-width:.2em}@-webkit-keyframes spinner-grow{0%{-webkit-transform:scale(0);transform:scale(0)}50%{opacity:1;-webkit-transform:none;transform:none}}@keyframes spinner-grow{0%{-webkit-transform:scale(0);transform:scale(0)}50%{opacity:1;-webkit-transform:none;transform:none}}.spinner-grow{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;background-color:currentColor;border-radius:50%;opacity:0;-webkit-animation:spinner-grow .75s linear infinite;animation:spinner-grow .75s linear infinite}.spinner-grow-sm{width:1rem;height:1rem}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.bg-primary{background-color:#007bff!important}a.bg-primary:focus,a.bg-primary:hover,button.bg-primary:focus,button.bg-primary:hover{background-color:#0062cc!important}.bg-secondary{background-color:#6c757d!important}a.bg-secondary:focus,a.bg-secondary:hover,button.bg-secondary:focus,button.bg-secondary:hover{background-color:#545b62!important}.bg-success{background-color:#28a745!important}a.bg-success:focus,a.bg-success:hover,button.bg-success:focus,button.bg-success:hover{background-color:#1e7e34!important}.bg-info{background-color:#17a2b8!important}a.bg-info:focus,a.bg-info:hover,button.bg-info:focus,button.bg-info:hover{background-color:#117a8b!important}.bg-warning{background-color:#ffc107!important}a.bg-warning:focus,a.bg-warning:hover,button.bg-warning:focus,button.bg-warning:hover{background-color:#d39e00!important}.bg-danger{background-color:#dc3545!important}a.bg-danger:focus,a.bg-danger:hover,button.bg-danger:focus,button.bg-danger:hover{background-color:#bd2130!important}.bg-light{background-color:#f8f9fa!important}a.bg-light:focus,a.bg-light:hover,button.bg-light:focus,button.bg-light:hover{background-color:#dae0e5!important}.bg-dark{background-color:#343a40!important}a.bg-dark:focus,a.bg-dark:hover,button.bg-dark:focus,button.bg-dark:hover{background-color:#1d2124!important}.bg-white{background-color:#fff!important}.bg-transparent{background-color:transparent!important}.border{border:1px solid #dee2e6!important}.border-top{border-top:1px solid #dee2e6!important}.border-right{border-right:1px solid #dee2e6!important}.border-bottom{border-bottom:1px solid #dee2e6!important}.border-left{border-left:1px solid #dee2e6!important}.border-0{border:0!important}.border-top-0{border-top:0!important}.border-right-0{border-right:0!important}.border-bottom-0{border-bottom:0!important}.border-left-0{border-left:0!important}.border-primary{border-color:#007bff!important}.border-secondary{border-color:#6c757d!important}.border-success{border-color:#28a745!important}.border-info{border-color:#17a2b8!important}.border-warning{border-color:#ffc107!important}.border-danger{border-color:#dc3545!important}.border-light{border-color:#f8f9fa!important}.border-dark{border-color:#343a40!important}.border-white{border-color:#fff!important}.rounded-sm{border-radius:.2rem!important}.rounded{border-radius:.25rem!important}.rounded-top{border-top-left-radius:.25rem!important;border-top-right-radius:.25rem!important}.rounded-right{border-top-right-radius:.25rem!important;border-bottom-right-radius:.25rem!important}.rounded-bottom{border-bottom-right-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-left{border-top-left-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-lg{border-radius:.3rem!important}.rounded-circle{border-radius:50%!important}.rounded-pill{border-radius:50rem!important}.rounded-0{border-radius:0!important}.clearfix::after{display:block;clear:both;content:""}.d-none{display:none!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:-ms-flexbox!important;display:flex!important}.d-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}@media (min-width:576px){.d-sm-none{display:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:-ms-flexbox!important;display:flex!important}.d-sm-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:768px){.d-md-none{display:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:-ms-flexbox!important;display:flex!important}.d-md-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:992px){.d-lg-none{display:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:-ms-flexbox!important;display:flex!important}.d-lg-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:1200px){.d-xl-none{display:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:-ms-flexbox!important;display:flex!important}.d-xl-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media print{.d-print-none{display:none!important}.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:-ms-flexbox!important;display:flex!important}.d-print-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}.embed-responsive{position:relative;display:block;width:100%;padding:0;overflow:hidden}.embed-responsive::before{display:block;content:""}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-21by9::before{padding-top:42.857143%}.embed-responsive-16by9::before{padding-top:56.25%}.embed-responsive-4by3::before{padding-top:75%}.embed-responsive-1by1::before{padding-top:100%}.flex-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-center{-ms-flex-align:center!important;align-items:center!important}.align-items-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}@media (min-width:576px){.flex-sm-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-sm-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-sm-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-sm-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-sm-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-sm-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-sm-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-sm-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-sm-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-sm-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-sm-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-sm-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-sm-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-sm-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-sm-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-sm-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-sm-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-sm-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-sm-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-sm-center{-ms-flex-align:center!important;align-items:center!important}.align-items-sm-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-sm-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-sm-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-sm-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-sm-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-sm-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-sm-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-sm-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-sm-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-sm-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-sm-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-sm-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-sm-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-sm-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:768px){.flex-md-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-md-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-md-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-md-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-md-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-md-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-md-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-md-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-md-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-md-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-md-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-md-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-md-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-md-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-md-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-md-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-md-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-md-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-md-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-md-center{-ms-flex-align:center!important;align-items:center!important}.align-items-md-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-md-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-md-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-md-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-md-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-md-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-md-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-md-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-md-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-md-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-md-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-md-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-md-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-md-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:992px){.flex-lg-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-lg-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-lg-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-lg-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-lg-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-lg-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-lg-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-lg-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-lg-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-lg-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-lg-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-lg-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-lg-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-lg-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-lg-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-lg-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-lg-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-lg-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-lg-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-lg-center{-ms-flex-align:center!important;align-items:center!important}.align-items-lg-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-lg-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-lg-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-lg-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-lg-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-lg-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-lg-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-lg-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-lg-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-lg-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-lg-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-lg-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-lg-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-lg-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:1200px){.flex-xl-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-xl-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-xl-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-xl-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-xl-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-xl-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-xl-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-xl-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-xl-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-xl-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-xl-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-xl-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-xl-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-xl-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-xl-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-xl-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-xl-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-xl-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-xl-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-xl-center{-ms-flex-align:center!important;align-items:center!important}.align-items-xl-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-xl-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-xl-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-xl-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-xl-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-xl-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-xl-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-xl-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-xl-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-xl-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-xl-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-xl-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-xl-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-xl-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}.float-left{float:left!important}.float-right{float:right!important}.float-none{float:none!important}@media (min-width:576px){.float-sm-left{float:left!important}.float-sm-right{float:right!important}.float-sm-none{float:none!important}}@media (min-width:768px){.float-md-left{float:left!important}.float-md-right{float:right!important}.float-md-none{float:none!important}}@media (min-width:992px){.float-lg-left{float:left!important}.float-lg-right{float:right!important}.float-lg-none{float:none!important}}@media (min-width:1200px){.float-xl-left{float:left!important}.float-xl-right{float:right!important}.float-xl-none{float:none!important}}.user-select-all{-webkit-user-select:all!important;-moz-user-select:all!important;-ms-user-select:all!important;user-select:all!important}.user-select-auto{-webkit-user-select:auto!important;-moz-user-select:auto!important;-ms-user-select:auto!important;user-select:auto!important}.user-select-none{-webkit-user-select:none!important;-moz-user-select:none!important;-ms-user-select:none!important;user-select:none!important}.overflow-auto{overflow:auto!important}.overflow-hidden{overflow:hidden!important}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:-webkit-sticky!important;position:sticky!important}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}@supports ((position:-webkit-sticky) or (position:sticky)){.sticky-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal}.shadow-sm{box-shadow:0 .125rem .25rem rgba(0,0,0,.075)!important}.shadow{box-shadow:0 .5rem 1rem rgba(0,0,0,.15)!important}.shadow-lg{box-shadow:0 1rem 3rem rgba(0,0,0,.175)!important}.shadow-none{box-shadow:none!important}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.w-auto{width:auto!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.h-auto{height:auto!important}.mw-100{max-width:100%!important}.mh-100{max-height:100%!important}.min-vw-100{min-width:100vw!important}.min-vh-100{min-height:100vh!important}.vw-100{width:100vw!important}.vh-100{height:100vh!important}.m-0{margin:0!important}.mt-0,.my-0{margin-top:0!important}.mr-0,.mx-0{margin-right:0!important}.mb-0,.my-0{margin-bottom:0!important}.ml-0,.mx-0{margin-left:0!important}.m-1{margin:.25rem!important}.mt-1,.my-1{margin-top:.25rem!important}.mr-1,.mx-1{margin-right:.25rem!important}.mb-1,.my-1{margin-bottom:.25rem!important}.ml-1,.mx-1{margin-left:.25rem!important}.m-2{margin:.5rem!important}.mt-2,.my-2{margin-top:.5rem!important}.mr-2,.mx-2{margin-right:.5rem!important}.mb-2,.my-2{margin-bottom:.5rem!important}.ml-2,.mx-2{margin-left:.5rem!important}.m-3{margin:1rem!important}.mt-3,.my-3{margin-top:1rem!important}.mr-3,.mx-3{margin-right:1rem!important}.mb-3,.my-3{margin-bottom:1rem!important}.ml-3,.mx-3{margin-left:1rem!important}.m-4{margin:1.5rem!important}.mt-4,.my-4{margin-top:1.5rem!important}.mr-4,.mx-4{margin-right:1.5rem!important}.mb-4,.my-4{margin-bottom:1.5rem!important}.ml-4,.mx-4{margin-left:1.5rem!important}.m-5{margin:3rem!important}.mt-5,.my-5{margin-top:3rem!important}.mr-5,.mx-5{margin-right:3rem!important}.mb-5,.my-5{margin-bottom:3rem!important}.ml-5,.mx-5{margin-left:3rem!important}.p-0{padding:0!important}.pt-0,.py-0{padding-top:0!important}.pr-0,.px-0{padding-right:0!important}.pb-0,.py-0{padding-bottom:0!important}.pl-0,.px-0{padding-left:0!important}.p-1{padding:.25rem!important}.pt-1,.py-1{padding-top:.25rem!important}.pr-1,.px-1{padding-right:.25rem!important}.pb-1,.py-1{padding-bottom:.25rem!important}.pl-1,.px-1{padding-left:.25rem!important}.p-2{padding:.5rem!important}.pt-2,.py-2{padding-top:.5rem!important}.pr-2,.px-2{padding-right:.5rem!important}.pb-2,.py-2{padding-bottom:.5rem!important}.pl-2,.px-2{padding-left:.5rem!important}.p-3{padding:1rem!important}.pt-3,.py-3{padding-top:1rem!important}.pr-3,.px-3{padding-right:1rem!important}.pb-3,.py-3{padding-bottom:1rem!important}.pl-3,.px-3{padding-left:1rem!important}.p-4{padding:1.5rem!important}.pt-4,.py-4{padding-top:1.5rem!important}.pr-4,.px-4{padding-right:1.5rem!important}.pb-4,.py-4{padding-bottom:1.5rem!important}.pl-4,.px-4{padding-left:1.5rem!important}.p-5{padding:3rem!important}.pt-5,.py-5{padding-top:3rem!important}.pr-5,.px-5{padding-right:3rem!important}.pb-5,.py-5{padding-bottom:3rem!important}.pl-5,.px-5{padding-left:3rem!important}.m-n1{margin:-.25rem!important}.mt-n1,.my-n1{margin-top:-.25rem!important}.mr-n1,.mx-n1{margin-right:-.25rem!important}.mb-n1,.my-n1{margin-bottom:-.25rem!important}.ml-n1,.mx-n1{margin-left:-.25rem!important}.m-n2{margin:-.5rem!important}.mt-n2,.my-n2{margin-top:-.5rem!important}.mr-n2,.mx-n2{margin-right:-.5rem!important}.mb-n2,.my-n2{margin-bottom:-.5rem!important}.ml-n2,.mx-n2{margin-left:-.5rem!important}.m-n3{margin:-1rem!important}.mt-n3,.my-n3{margin-top:-1rem!important}.mr-n3,.mx-n3{margin-right:-1rem!important}.mb-n3,.my-n3{margin-bottom:-1rem!important}.ml-n3,.mx-n3{margin-left:-1rem!important}.m-n4{margin:-1.5rem!important}.mt-n4,.my-n4{margin-top:-1.5rem!important}.mr-n4,.mx-n4{margin-right:-1.5rem!important}.mb-n4,.my-n4{margin-bottom:-1.5rem!important}.ml-n4,.mx-n4{margin-left:-1.5rem!important}.m-n5{margin:-3rem!important}.mt-n5,.my-n5{margin-top:-3rem!important}.mr-n5,.mx-n5{margin-right:-3rem!important}.mb-n5,.my-n5{margin-bottom:-3rem!important}.ml-n5,.mx-n5{margin-left:-3rem!important}.m-auto{margin:auto!important}.mt-auto,.my-auto{margin-top:auto!important}.mr-auto,.mx-auto{margin-right:auto!important}.mb-auto,.my-auto{margin-bottom:auto!important}.ml-auto,.mx-auto{margin-left:auto!important}@media (min-width:576px){.m-sm-0{margin:0!important}.mt-sm-0,.my-sm-0{margin-top:0!important}.mr-sm-0,.mx-sm-0{margin-right:0!important}.mb-sm-0,.my-sm-0{margin-bottom:0!important}.ml-sm-0,.mx-sm-0{margin-left:0!important}.m-sm-1{margin:.25rem!important}.mt-sm-1,.my-sm-1{margin-top:.25rem!important}.mr-sm-1,.mx-sm-1{margin-right:.25rem!important}.mb-sm-1,.my-sm-1{margin-bottom:.25rem!important}.ml-sm-1,.mx-sm-1{margin-left:.25rem!important}.m-sm-2{margin:.5rem!important}.mt-sm-2,.my-sm-2{margin-top:.5rem!important}.mr-sm-2,.mx-sm-2{margin-right:.5rem!important}.mb-sm-2,.my-sm-2{margin-bottom:.5rem!important}.ml-sm-2,.mx-sm-2{margin-left:.5rem!important}.m-sm-3{margin:1rem!important}.mt-sm-3,.my-sm-3{margin-top:1rem!important}.mr-sm-3,.mx-sm-3{margin-right:1rem!important}.mb-sm-3,.my-sm-3{margin-bottom:1rem!important}.ml-sm-3,.mx-sm-3{margin-left:1rem!important}.m-sm-4{margin:1.5rem!important}.mt-sm-4,.my-sm-4{margin-top:1.5rem!important}.mr-sm-4,.mx-sm-4{margin-right:1.5rem!important}.mb-sm-4,.my-sm-4{margin-bottom:1.5rem!important}.ml-sm-4,.mx-sm-4{margin-left:1.5rem!important}.m-sm-5{margin:3rem!important}.mt-sm-5,.my-sm-5{margin-top:3rem!important}.mr-sm-5,.mx-sm-5{margin-right:3rem!important}.mb-sm-5,.my-sm-5{margin-bottom:3rem!important}.ml-sm-5,.mx-sm-5{margin-left:3rem!important}.p-sm-0{padding:0!important}.pt-sm-0,.py-sm-0{padding-top:0!important}.pr-sm-0,.px-sm-0{padding-right:0!important}.pb-sm-0,.py-sm-0{padding-bottom:0!important}.pl-sm-0,.px-sm-0{padding-left:0!important}.p-sm-1{padding:.25rem!important}.pt-sm-1,.py-sm-1{padding-top:.25rem!important}.pr-sm-1,.px-sm-1{padding-right:.25rem!important}.pb-sm-1,.py-sm-1{padding-bottom:.25rem!important}.pl-sm-1,.px-sm-1{padding-left:.25rem!important}.p-sm-2{padding:.5rem!important}.pt-sm-2,.py-sm-2{padding-top:.5rem!important}.pr-sm-2,.px-sm-2{padding-right:.5rem!important}.pb-sm-2,.py-sm-2{padding-bottom:.5rem!important}.pl-sm-2,.px-sm-2{padding-left:.5rem!important}.p-sm-3{padding:1rem!important}.pt-sm-3,.py-sm-3{padding-top:1rem!important}.pr-sm-3,.px-sm-3{padding-right:1rem!important}.pb-sm-3,.py-sm-3{padding-bottom:1rem!important}.pl-sm-3,.px-sm-3{padding-left:1rem!important}.p-sm-4{padding:1.5rem!important}.pt-sm-4,.py-sm-4{padding-top:1.5rem!important}.pr-sm-4,.px-sm-4{padding-right:1.5rem!important}.pb-sm-4,.py-sm-4{padding-bottom:1.5rem!important}.pl-sm-4,.px-sm-4{padding-left:1.5rem!important}.p-sm-5{padding:3rem!important}.pt-sm-5,.py-sm-5{padding-top:3rem!important}.pr-sm-5,.px-sm-5{padding-right:3rem!important}.pb-sm-5,.py-sm-5{padding-bottom:3rem!important}.pl-sm-5,.px-sm-5{padding-left:3rem!important}.m-sm-n1{margin:-.25rem!important}.mt-sm-n1,.my-sm-n1{margin-top:-.25rem!important}.mr-sm-n1,.mx-sm-n1{margin-right:-.25rem!important}.mb-sm-n1,.my-sm-n1{margin-bottom:-.25rem!important}.ml-sm-n1,.mx-sm-n1{margin-left:-.25rem!important}.m-sm-n2{margin:-.5rem!important}.mt-sm-n2,.my-sm-n2{margin-top:-.5rem!important}.mr-sm-n2,.mx-sm-n2{margin-right:-.5rem!important}.mb-sm-n2,.my-sm-n2{margin-bottom:-.5rem!important}.ml-sm-n2,.mx-sm-n2{margin-left:-.5rem!important}.m-sm-n3{margin:-1rem!important}.mt-sm-n3,.my-sm-n3{margin-top:-1rem!important}.mr-sm-n3,.mx-sm-n3{margin-right:-1rem!important}.mb-sm-n3,.my-sm-n3{margin-bottom:-1rem!important}.ml-sm-n3,.mx-sm-n3{margin-left:-1rem!important}.m-sm-n4{margin:-1.5rem!important}.mt-sm-n4,.my-sm-n4{margin-top:-1.5rem!important}.mr-sm-n4,.mx-sm-n4{margin-right:-1.5rem!important}.mb-sm-n4,.my-sm-n4{margin-bottom:-1.5rem!important}.ml-sm-n4,.mx-sm-n4{margin-left:-1.5rem!important}.m-sm-n5{margin:-3rem!important}.mt-sm-n5,.my-sm-n5{margin-top:-3rem!important}.mr-sm-n5,.mx-sm-n5{margin-right:-3rem!important}.mb-sm-n5,.my-sm-n5{margin-bottom:-3rem!important}.ml-sm-n5,.mx-sm-n5{margin-left:-3rem!important}.m-sm-auto{margin:auto!important}.mt-sm-auto,.my-sm-auto{margin-top:auto!important}.mr-sm-auto,.mx-sm-auto{margin-right:auto!important}.mb-sm-auto,.my-sm-auto{margin-bottom:auto!important}.ml-sm-auto,.mx-sm-auto{margin-left:auto!important}}@media (min-width:768px){.m-md-0{margin:0!important}.mt-md-0,.my-md-0{margin-top:0!important}.mr-md-0,.mx-md-0{margin-right:0!important}.mb-md-0,.my-md-0{margin-bottom:0!important}.ml-md-0,.mx-md-0{margin-left:0!important}.m-md-1{margin:.25rem!important}.mt-md-1,.my-md-1{margin-top:.25rem!important}.mr-md-1,.mx-md-1{margin-right:.25rem!important}.mb-md-1,.my-md-1{margin-bottom:.25rem!important}.ml-md-1,.mx-md-1{margin-left:.25rem!important}.m-md-2{margin:.5rem!important}.mt-md-2,.my-md-2{margin-top:.5rem!important}.mr-md-2,.mx-md-2{margin-right:.5rem!important}.mb-md-2,.my-md-2{margin-bottom:.5rem!important}.ml-md-2,.mx-md-2{margin-left:.5rem!important}.m-md-3{margin:1rem!important}.mt-md-3,.my-md-3{margin-top:1rem!important}.mr-md-3,.mx-md-3{margin-right:1rem!important}.mb-md-3,.my-md-3{margin-bottom:1rem!important}.ml-md-3,.mx-md-3{margin-left:1rem!important}.m-md-4{margin:1.5rem!important}.mt-md-4,.my-md-4{margin-top:1.5rem!important}.mr-md-4,.mx-md-4{margin-right:1.5rem!important}.mb-md-4,.my-md-4{margin-bottom:1.5rem!important}.ml-md-4,.mx-md-4{margin-left:1.5rem!important}.m-md-5{margin:3rem!important}.mt-md-5,.my-md-5{margin-top:3rem!important}.mr-md-5,.mx-md-5{margin-right:3rem!important}.mb-md-5,.my-md-5{margin-bottom:3rem!important}.ml-md-5,.mx-md-5{margin-left:3rem!important}.p-md-0{padding:0!important}.pt-md-0,.py-md-0{padding-top:0!important}.pr-md-0,.px-md-0{padding-right:0!important}.pb-md-0,.py-md-0{padding-bottom:0!important}.pl-md-0,.px-md-0{padding-left:0!important}.p-md-1{padding:.25rem!important}.pt-md-1,.py-md-1{padding-top:.25rem!important}.pr-md-1,.px-md-1{padding-right:.25rem!important}.pb-md-1,.py-md-1{padding-bottom:.25rem!important}.pl-md-1,.px-md-1{padding-left:.25rem!important}.p-md-2{padding:.5rem!important}.pt-md-2,.py-md-2{padding-top:.5rem!important}.pr-md-2,.px-md-2{padding-right:.5rem!important}.pb-md-2,.py-md-2{padding-bottom:.5rem!important}.pl-md-2,.px-md-2{padding-left:.5rem!important}.p-md-3{padding:1rem!important}.pt-md-3,.py-md-3{padding-top:1rem!important}.pr-md-3,.px-md-3{padding-right:1rem!important}.pb-md-3,.py-md-3{padding-bottom:1rem!important}.pl-md-3,.px-md-3{padding-left:1rem!important}.p-md-4{padding:1.5rem!important}.pt-md-4,.py-md-4{padding-top:1.5rem!important}.pr-md-4,.px-md-4{padding-right:1.5rem!important}.pb-md-4,.py-md-4{padding-bottom:1.5rem!important}.pl-md-4,.px-md-4{padding-left:1.5rem!important}.p-md-5{padding:3rem!important}.pt-md-5,.py-md-5{padding-top:3rem!important}.pr-md-5,.px-md-5{padding-right:3rem!important}.pb-md-5,.py-md-5{padding-bottom:3rem!important}.pl-md-5,.px-md-5{padding-left:3rem!important}.m-md-n1{margin:-.25rem!important}.mt-md-n1,.my-md-n1{margin-top:-.25rem!important}.mr-md-n1,.mx-md-n1{margin-right:-.25rem!important}.mb-md-n1,.my-md-n1{margin-bottom:-.25rem!important}.ml-md-n1,.mx-md-n1{margin-left:-.25rem!important}.m-md-n2{margin:-.5rem!important}.mt-md-n2,.my-md-n2{margin-top:-.5rem!important}.mr-md-n2,.mx-md-n2{margin-right:-.5rem!important}.mb-md-n2,.my-md-n2{margin-bottom:-.5rem!important}.ml-md-n2,.mx-md-n2{margin-left:-.5rem!important}.m-md-n3{margin:-1rem!important}.mt-md-n3,.my-md-n3{margin-top:-1rem!important}.mr-md-n3,.mx-md-n3{margin-right:-1rem!important}.mb-md-n3,.my-md-n3{margin-bottom:-1rem!important}.ml-md-n3,.mx-md-n3{margin-left:-1rem!important}.m-md-n4{margin:-1.5rem!important}.mt-md-n4,.my-md-n4{margin-top:-1.5rem!important}.mr-md-n4,.mx-md-n4{margin-right:-1.5rem!important}.mb-md-n4,.my-md-n4{margin-bottom:-1.5rem!important}.ml-md-n4,.mx-md-n4{margin-left:-1.5rem!important}.m-md-n5{margin:-3rem!important}.mt-md-n5,.my-md-n5{margin-top:-3rem!important}.mr-md-n5,.mx-md-n5{margin-right:-3rem!important}.mb-md-n5,.my-md-n5{margin-bottom:-3rem!important}.ml-md-n5,.mx-md-n5{margin-left:-3rem!important}.m-md-auto{margin:auto!important}.mt-md-auto,.my-md-auto{margin-top:auto!important}.mr-md-auto,.mx-md-auto{margin-right:auto!important}.mb-md-auto,.my-md-auto{margin-bottom:auto!important}.ml-md-auto,.mx-md-auto{margin-left:auto!important}}@media (min-width:992px){.m-lg-0{margin:0!important}.mt-lg-0,.my-lg-0{margin-top:0!important}.mr-lg-0,.mx-lg-0{margin-right:0!important}.mb-lg-0,.my-lg-0{margin-bottom:0!important}.ml-lg-0,.mx-lg-0{margin-left:0!important}.m-lg-1{margin:.25rem!important}.mt-lg-1,.my-lg-1{margin-top:.25rem!important}.mr-lg-1,.mx-lg-1{margin-right:.25rem!important}.mb-lg-1,.my-lg-1{margin-bottom:.25rem!important}.ml-lg-1,.mx-lg-1{margin-left:.25rem!important}.m-lg-2{margin:.5rem!important}.mt-lg-2,.my-lg-2{margin-top:.5rem!important}.mr-lg-2,.mx-lg-2{margin-right:.5rem!important}.mb-lg-2,.my-lg-2{margin-bottom:.5rem!important}.ml-lg-2,.mx-lg-2{margin-left:.5rem!important}.m-lg-3{margin:1rem!important}.mt-lg-3,.my-lg-3{margin-top:1rem!important}.mr-lg-3,.mx-lg-3{margin-right:1rem!important}.mb-lg-3,.my-lg-3{margin-bottom:1rem!important}.ml-lg-3,.mx-lg-3{margin-left:1rem!important}.m-lg-4{margin:1.5rem!important}.mt-lg-4,.my-lg-4{margin-top:1.5rem!important}.mr-lg-4,.mx-lg-4{margin-right:1.5rem!important}.mb-lg-4,.my-lg-4{margin-bottom:1.5rem!important}.ml-lg-4,.mx-lg-4{margin-left:1.5rem!important}.m-lg-5{margin:3rem!important}.mt-lg-5,.my-lg-5{margin-top:3rem!important}.mr-lg-5,.mx-lg-5{margin-right:3rem!important}.mb-lg-5,.my-lg-5{margin-bottom:3rem!important}.ml-lg-5,.mx-lg-5{margin-left:3rem!important}.p-lg-0{padding:0!important}.pt-lg-0,.py-lg-0{padding-top:0!important}.pr-lg-0,.px-lg-0{padding-right:0!important}.pb-lg-0,.py-lg-0{padding-bottom:0!important}.pl-lg-0,.px-lg-0{padding-left:0!important}.p-lg-1{padding:.25rem!important}.pt-lg-1,.py-lg-1{padding-top:.25rem!important}.pr-lg-1,.px-lg-1{padding-right:.25rem!important}.pb-lg-1,.py-lg-1{padding-bottom:.25rem!important}.pl-lg-1,.px-lg-1{padding-left:.25rem!important}.p-lg-2{padding:.5rem!important}.pt-lg-2,.py-lg-2{padding-top:.5rem!important}.pr-lg-2,.px-lg-2{padding-right:.5rem!important}.pb-lg-2,.py-lg-2{padding-bottom:.5rem!important}.pl-lg-2,.px-lg-2{padding-left:.5rem!important}.p-lg-3{padding:1rem!important}.pt-lg-3,.py-lg-3{padding-top:1rem!important}.pr-lg-3,.px-lg-3{padding-right:1rem!important}.pb-lg-3,.py-lg-3{padding-bottom:1rem!important}.pl-lg-3,.px-lg-3{padding-left:1rem!important}.p-lg-4{padding:1.5rem!important}.pt-lg-4,.py-lg-4{padding-top:1.5rem!important}.pr-lg-4,.px-lg-4{padding-right:1.5rem!important}.pb-lg-4,.py-lg-4{padding-bottom:1.5rem!important}.pl-lg-4,.px-lg-4{padding-left:1.5rem!important}.p-lg-5{padding:3rem!important}.pt-lg-5,.py-lg-5{padding-top:3rem!important}.pr-lg-5,.px-lg-5{padding-right:3rem!important}.pb-lg-5,.py-lg-5{padding-bottom:3rem!important}.pl-lg-5,.px-lg-5{padding-left:3rem!important}.m-lg-n1{margin:-.25rem!important}.mt-lg-n1,.my-lg-n1{margin-top:-.25rem!important}.mr-lg-n1,.mx-lg-n1{margin-right:-.25rem!important}.mb-lg-n1,.my-lg-n1{margin-bottom:-.25rem!important}.ml-lg-n1,.mx-lg-n1{margin-left:-.25rem!important}.m-lg-n2{margin:-.5rem!important}.mt-lg-n2,.my-lg-n2{margin-top:-.5rem!important}.mr-lg-n2,.mx-lg-n2{margin-right:-.5rem!important}.mb-lg-n2,.my-lg-n2{margin-bottom:-.5rem!important}.ml-lg-n2,.mx-lg-n2{margin-left:-.5rem!important}.m-lg-n3{margin:-1rem!important}.mt-lg-n3,.my-lg-n3{margin-top:-1rem!important}.mr-lg-n3,.mx-lg-n3{margin-right:-1rem!important}.mb-lg-n3,.my-lg-n3{margin-bottom:-1rem!important}.ml-lg-n3,.mx-lg-n3{margin-left:-1rem!important}.m-lg-n4{margin:-1.5rem!important}.mt-lg-n4,.my-lg-n4{margin-top:-1.5rem!important}.mr-lg-n4,.mx-lg-n4{margin-right:-1.5rem!important}.mb-lg-n4,.my-lg-n4{margin-bottom:-1.5rem!important}.ml-lg-n4,.mx-lg-n4{margin-left:-1.5rem!important}.m-lg-n5{margin:-3rem!important}.mt-lg-n5,.my-lg-n5{margin-top:-3rem!important}.mr-lg-n5,.mx-lg-n5{margin-right:-3rem!important}.mb-lg-n5,.my-lg-n5{margin-bottom:-3rem!important}.ml-lg-n5,.mx-lg-n5{margin-left:-3rem!important}.m-lg-auto{margin:auto!important}.mt-lg-auto,.my-lg-auto{margin-top:auto!important}.mr-lg-auto,.mx-lg-auto{margin-right:auto!important}.mb-lg-auto,.my-lg-auto{margin-bottom:auto!important}.ml-lg-auto,.mx-lg-auto{margin-left:auto!important}}@media (min-width:1200px){.m-xl-0{margin:0!important}.mt-xl-0,.my-xl-0{margin-top:0!important}.mr-xl-0,.mx-xl-0{margin-right:0!important}.mb-xl-0,.my-xl-0{margin-bottom:0!important}.ml-xl-0,.mx-xl-0{margin-left:0!important}.m-xl-1{margin:.25rem!important}.mt-xl-1,.my-xl-1{margin-top:.25rem!important}.mr-xl-1,.mx-xl-1{margin-right:.25rem!important}.mb-xl-1,.my-xl-1{margin-bottom:.25rem!important}.ml-xl-1,.mx-xl-1{margin-left:.25rem!important}.m-xl-2{margin:.5rem!important}.mt-xl-2,.my-xl-2{margin-top:.5rem!important}.mr-xl-2,.mx-xl-2{margin-right:.5rem!important}.mb-xl-2,.my-xl-2{margin-bottom:.5rem!important}.ml-xl-2,.mx-xl-2{margin-left:.5rem!important}.m-xl-3{margin:1rem!important}.mt-xl-3,.my-xl-3{margin-top:1rem!important}.mr-xl-3,.mx-xl-3{margin-right:1rem!important}.mb-xl-3,.my-xl-3{margin-bottom:1rem!important}.ml-xl-3,.mx-xl-3{margin-left:1rem!important}.m-xl-4{margin:1.5rem!important}.mt-xl-4,.my-xl-4{margin-top:1.5rem!important}.mr-xl-4,.mx-xl-4{margin-right:1.5rem!important}.mb-xl-4,.my-xl-4{margin-bottom:1.5rem!important}.ml-xl-4,.mx-xl-4{margin-left:1.5rem!important}.m-xl-5{margin:3rem!important}.mt-xl-5,.my-xl-5{margin-top:3rem!important}.mr-xl-5,.mx-xl-5{margin-right:3rem!important}.mb-xl-5,.my-xl-5{margin-bottom:3rem!important}.ml-xl-5,.mx-xl-5{margin-left:3rem!important}.p-xl-0{padding:0!important}.pt-xl-0,.py-xl-0{padding-top:0!important}.pr-xl-0,.px-xl-0{padding-right:0!important}.pb-xl-0,.py-xl-0{padding-bottom:0!important}.pl-xl-0,.px-xl-0{padding-left:0!important}.p-xl-1{padding:.25rem!important}.pt-xl-1,.py-xl-1{padding-top:.25rem!important}.pr-xl-1,.px-xl-1{padding-right:.25rem!important}.pb-xl-1,.py-xl-1{padding-bottom:.25rem!important}.pl-xl-1,.px-xl-1{padding-left:.25rem!important}.p-xl-2{padding:.5rem!important}.pt-xl-2,.py-xl-2{padding-top:.5rem!important}.pr-xl-2,.px-xl-2{padding-right:.5rem!important}.pb-xl-2,.py-xl-2{padding-bottom:.5rem!important}.pl-xl-2,.px-xl-2{padding-left:.5rem!important}.p-xl-3{padding:1rem!important}.pt-xl-3,.py-xl-3{padding-top:1rem!important}.pr-xl-3,.px-xl-3{padding-right:1rem!important}.pb-xl-3,.py-xl-3{padding-bottom:1rem!important}.pl-xl-3,.px-xl-3{padding-left:1rem!important}.p-xl-4{padding:1.5rem!important}.pt-xl-4,.py-xl-4{padding-top:1.5rem!important}.pr-xl-4,.px-xl-4{padding-right:1.5rem!important}.pb-xl-4,.py-xl-4{padding-bottom:1.5rem!important}.pl-xl-4,.px-xl-4{padding-left:1.5rem!important}.p-xl-5{padding:3rem!important}.pt-xl-5,.py-xl-5{padding-top:3rem!important}.pr-xl-5,.px-xl-5{padding-right:3rem!important}.pb-xl-5,.py-xl-5{padding-bottom:3rem!important}.pl-xl-5,.px-xl-5{padding-left:3rem!important}.m-xl-n1{margin:-.25rem!important}.mt-xl-n1,.my-xl-n1{margin-top:-.25rem!important}.mr-xl-n1,.mx-xl-n1{margin-right:-.25rem!important}.mb-xl-n1,.my-xl-n1{margin-bottom:-.25rem!important}.ml-xl-n1,.mx-xl-n1{margin-left:-.25rem!important}.m-xl-n2{margin:-.5rem!important}.mt-xl-n2,.my-xl-n2{margin-top:-.5rem!important}.mr-xl-n2,.mx-xl-n2{margin-right:-.5rem!important}.mb-xl-n2,.my-xl-n2{margin-bottom:-.5rem!important}.ml-xl-n2,.mx-xl-n2{margin-left:-.5rem!important}.m-xl-n3{margin:-1rem!important}.mt-xl-n3,.my-xl-n3{margin-top:-1rem!important}.mr-xl-n3,.mx-xl-n3{margin-right:-1rem!important}.mb-xl-n3,.my-xl-n3{margin-bottom:-1rem!important}.ml-xl-n3,.mx-xl-n3{margin-left:-1rem!important}.m-xl-n4{margin:-1.5rem!important}.mt-xl-n4,.my-xl-n4{margin-top:-1.5rem!important}.mr-xl-n4,.mx-xl-n4{margin-right:-1.5rem!important}.mb-xl-n4,.my-xl-n4{margin-bottom:-1.5rem!important}.ml-xl-n4,.mx-xl-n4{margin-left:-1.5rem!important}.m-xl-n5{margin:-3rem!important}.mt-xl-n5,.my-xl-n5{margin-top:-3rem!important}.mr-xl-n5,.mx-xl-n5{margin-right:-3rem!important}.mb-xl-n5,.my-xl-n5{margin-bottom:-3rem!important}.ml-xl-n5,.mx-xl-n5{margin-left:-3rem!important}.m-xl-auto{margin:auto!important}.mt-xl-auto,.my-xl-auto{margin-top:auto!important}.mr-xl-auto,.mx-xl-auto{margin-right:auto!important}.mb-xl-auto,.my-xl-auto{margin-bottom:auto!important}.ml-xl-auto,.mx-xl-auto{margin-left:auto!important}}.stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;pointer-events:auto;content:"";background-color:rgba(0,0,0,0)}.text-monospace{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace!important}.text-justify{text-align:justify!important}.text-wrap{white-space:normal!important}.text-nowrap{white-space:nowrap!important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-left{text-align:left!important}.text-right{text-align:right!important}.text-center{text-align:center!important}@media (min-width:576px){.text-sm-left{text-align:left!important}.text-sm-right{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width:768px){.text-md-left{text-align:left!important}.text-md-right{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width:992px){.text-lg-left{text-align:left!important}.text-lg-right{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width:1200px){.text-xl-left{text-align:left!important}.text-xl-right{text-align:right!important}.text-xl-center{text-align:center!important}}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.font-weight-light{font-weight:300!important}.font-weight-lighter{font-weight:lighter!important}.font-weight-normal{font-weight:400!important}.font-weight-bold{font-weight:700!important}.font-weight-bolder{font-weight:bolder!important}.font-italic{font-style:italic!important}.text-white{color:#fff!important}.text-primary{color:#007bff!important}a.text-primary:focus,a.text-primary:hover{color:#0056b3!important}.text-secondary{color:#6c757d!important}a.text-secondary:focus,a.text-secondary:hover{color:#494f54!important}.text-success{color:#28a745!important}a.text-success:focus,a.text-success:hover{color:#19692c!important}.text-info{color:#17a2b8!important}a.text-info:focus,a.text-info:hover{color:#0f6674!important}.text-warning{color:#ffc107!important}a.text-warning:focus,a.text-warning:hover{color:#ba8b00!important}.text-danger{color:#dc3545!important}a.text-danger:focus,a.text-danger:hover{color:#a71d2a!important}.text-light{color:#f8f9fa!important}a.text-light:focus,a.text-light:hover{color:#cbd3da!important}.text-dark{color:#343a40!important}a.text-dark:focus,a.text-dark:hover{color:#121416!important}.text-body{color:#212529!important}.text-muted{color:#6c757d!important}.text-black-50{color:rgba(0,0,0,.5)!important}.text-white-50{color:rgba(255,255,255,.5)!important}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.text-decoration-none{text-decoration:none!important}.text-break{word-wrap:break-word!important}.text-reset{color:inherit!important}.visible{visibility:visible!important}.invisible{visibility:hidden!important}@media print{*,::after,::before{text-shadow:none!important;box-shadow:none!important}a:not(.btn){text-decoration:underline}abbr[title]::after{content:" (" attr(title) ")"}pre{white-space:pre-wrap!important}blockquote,pre{border:1px solid #adb5bd;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}@page{size:a3}body{min-width:992px!important}.container{min-width:992px!important}.navbar{display:none}.badge{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #dee2e6!important}.table-dark{color:inherit}.table-dark tbody+tbody,.table-dark td,.table-dark th,.table-dark thead th{border-color:#dee2e6}.table .thead-dark th{color:inherit;border-color:#dee2e6}}
46320/*# sourceMappingURL=bootstrap.min.css.map */body {
46321 padding-top: 10px;
46322}
46323
46324.popover {
46325 max-width: none;
46326}
46327
46328.octicon {
46329 margin-right:.25em;
46330}
46331
46332.table-bordered>thead>tr>td {
46333 border-bottom-width: 1px;
46334}
46335
46336.table tbody>tr>td, .table thead>tr>td {
46337 padding-top: 3px;
46338 padding-bottom: 3px;
46339}
46340
46341.table-condensed tbody>tr>td {
46342 padding-top: 0;
46343 padding-bottom: 0;
46344}
46345
46346.table .progress {
46347 margin-bottom: inherit;
46348}
46349
46350.table-borderless th, .table-borderless td {
46351 border: 0 !important;
46352}
46353
46354.table tbody tr.covered-by-large-tests, li.covered-by-large-tests, tr.success, td.success, li.success, span.success {
46355 background-color: #dff0d8;
46356}
46357
46358.table tbody tr.covered-by-medium-tests, li.covered-by-medium-tests {
46359 background-color: #c3e3b5;
46360}
46361
46362.table tbody tr.covered-by-small-tests, li.covered-by-small-tests {
46363 background-color: #99cb84;
46364}
46365
46366.table tbody tr.danger, .table tbody td.danger, li.danger, span.danger {
46367 background-color: #f2dede;
46368}
46369
46370.table tbody tr.warning, .table tbody td.warning, li.warning, span.warning {
46371 background-color: #fcf8e3;
46372}
46373
46374.table tbody td.info {
46375 background-color: #d9edf7;
46376}
46377
46378td.big {
46379 width: 117px;
46380}
46381
46382td.small {
46383}
46384
46385td.codeLine {
46386 font-family: "Source Code Pro", "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
46387 white-space: pre-wrap;
46388}
46389
46390td span.comment {
46391 color: #888a85;
46392}
46393
46394td span.default {
46395 color: #2e3436;
46396}
46397
46398td span.html {
46399 color: #888a85;
46400}
46401
46402td span.keyword {
46403 color: #2e3436;
46404 font-weight: bold;
46405}
46406
46407pre span.string {
46408 color: #2e3436;
46409}
46410
46411span.success, span.warning, span.danger {
46412 margin-right: 2px;
46413 padding-left: 10px;
46414 padding-right: 10px;
46415 text-align: center;
46416}
46417
46418#classCoverageDistribution, #classComplexity {
46419 height: 200px;
46420 width: 475px;
46421}
46422
46423#toplink {
46424 position: fixed;
46425 left: 5px;
46426 bottom: 5px;
46427 outline: 0;
46428}
46429
46430svg text {
46431 font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif;
46432 font-size: 11px;
46433 color: #666;
46434 fill: #666;
46435}
46436
46437.scrollbox {
46438 height:245px;
46439 overflow-x:hidden;
46440 overflow-y:scroll;
46441}
46442
46443table + .structure-heading {
46444 border-top: 1px solid lightgrey;
46445 padding-top: 0.5em;
46446}
46447.octicon {
46448  display: inline-block;
46449  vertical-align: text-top;
46450  fill: currentColor;
46451}
46452.nvd3 .nv-axis{pointer-events:none;opacity:1}.nvd3 .nv-axis path{fill:none;stroke:#000;stroke-opacity:.75;shape-rendering:crispEdges}.nvd3 .nv-axis path.domain{stroke-opacity:.75}.nvd3 .nv-axis.nv-x path.domain{stroke-opacity:0}.nvd3 .nv-axis line{fill:none;stroke:#e5e5e5;shape-rendering:crispEdges}.nvd3 .nv-axis .zero line,.nvd3 .nv-axis line.zero{stroke-opacity:.75}.nvd3 .nv-axis .nv-axisMaxMin text{font-weight:700}.nvd3 .x .nv-axis .nv-axisMaxMin text,.nvd3 .x2 .nv-axis .nv-axisMaxMin text,.nvd3 .x3 .nv-axis .nv-axisMaxMin text{text-anchor:middle}.nvd3 .nv-axis.nv-disabled{opacity:0}.nvd3 .nv-bars rect{fill-opacity:.75;transition:fill-opacity 250ms linear;-moz-transition:fill-opacity 250ms linear;-webkit-transition:fill-opacity 250ms linear}.nvd3 .nv-bars rect.hover{fill-opacity:1}.nvd3 .nv-bars .hover rect{fill:#add8e6}.nvd3 .nv-bars text{fill:rgba(0,0,0,0)}.nvd3 .nv-bars .hover text{fill:rgba(0,0,0,1)}.nvd3 .nv-multibar .nv-groups rect,.nvd3 .nv-multibarHorizontal .nv-groups rect,.nvd3 .nv-discretebar .nv-groups rect{stroke-opacity:0;transition:fill-opacity 250ms linear;-moz-transition:fill-opacity 250ms linear;-webkit-transition:fill-opacity 250ms linear}.nvd3 .nv-multibar .nv-groups rect:hover,.nvd3 .nv-multibarHorizontal .nv-groups rect:hover,.nvd3 .nv-candlestickBar .nv-ticks rect:hover,.nvd3 .nv-discretebar .nv-groups rect:hover{fill-opacity:1}.nvd3 .nv-discretebar .nv-groups text,.nvd3 .nv-multibarHorizontal .nv-groups text{font-weight:700;fill:rgba(0,0,0,1);stroke:rgba(0,0,0,0)}.nvd3 .nv-boxplot circle{fill-opacity:.5}.nvd3 .nv-boxplot circle:hover{fill-opacity:1}.nvd3 .nv-boxplot rect:hover{fill-opacity:1}.nvd3 line.nv-boxplot-median{stroke:#000}.nv-boxplot-tick:hover{stroke-width:2.5px}.nvd3.nv-bullet{font:10px sans-serif}.nvd3.nv-bullet .nv-measure{fill-opacity:.8}.nvd3.nv-bullet .nv-measure:hover{fill-opacity:1}.nvd3.nv-bullet .nv-marker{stroke:#000;stroke-width:2px}.nvd3.nv-bullet .nv-markerTriangle{stroke:#000;fill:#fff;stroke-width:1.5px}.nvd3.nv-bullet .nv-tick line{stroke:#666;stroke-width:.5px}.nvd3.nv-bullet .nv-range.nv-s0{fill:#eee}.nvd3.nv-bullet .nv-range.nv-s1{fill:#ddd}.nvd3.nv-bullet .nv-range.nv-s2{fill:#ccc}.nvd3.nv-bullet .nv-title{font-size:14px;font-weight:700}.nvd3.nv-bullet .nv-subtitle{fill:#999}.nvd3.nv-bullet .nv-range{fill:#bababa;fill-opacity:.4}.nvd3.nv-bullet .nv-range:hover{fill-opacity:.7}.nvd3.nv-candlestickBar .nv-ticks .nv-tick{stroke-width:1px}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.hover{stroke-width:2px}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.positive rect{stroke:#2ca02c;fill:#2ca02c}.nvd3.nv-candlestickBar .nv-ticks .nv-tick.negative rect{stroke:#d62728;fill:#d62728}.with-transitions .nv-candlestickBar .nv-ticks .nv-tick{transition:stroke-width 250ms linear,stroke-opacity 250ms linear;-moz-transition:stroke-width 250ms linear,stroke-opacity 250ms linear;-webkit-transition:stroke-width 250ms linear,stroke-opacity 250ms linear}.nvd3.nv-candlestickBar .nv-ticks line{stroke:#333}.nvd3 .nv-legend .nv-disabled rect{}.nvd3 .nv-check-box .nv-box{fill-opacity:0;stroke-width:2}.nvd3 .nv-check-box .nv-check{fill-opacity:0;stroke-width:4}.nvd3 .nv-series.nv-disabled .nv-check-box .nv-check{fill-opacity:0;stroke-opacity:0}.nvd3 .nv-controlsWrap .nv-legend .nv-check-box .nv-check{opacity:0}.nvd3.nv-linePlusBar .nv-bar rect{fill-opacity:.75}.nvd3.nv-linePlusBar .nv-bar rect:hover{fill-opacity:1}.nvd3 .nv-groups path.nv-line{fill:none}.nvd3 .nv-groups path.nv-area{stroke:none}.nvd3.nv-line .nvd3.nv-scatter .nv-groups .nv-point{fill-opacity:0;stroke-opacity:0}.nvd3.nv-scatter.nv-single-point .nv-groups .nv-point{fill-opacity:.5!important;stroke-opacity:.5!important}.with-transitions .nvd3 .nv-groups .nv-point{transition:stroke-width 250ms linear,stroke-opacity 250ms linear;-moz-transition:stroke-width 250ms linear,stroke-opacity 250ms linear;-webkit-transition:stroke-width 250ms linear,stroke-opacity 250ms linear}.nvd3.nv-scatter .nv-groups .nv-point.hover,.nvd3 .nv-groups .nv-point.hover{stroke-width:7px;fill-opacity:.95!important;stroke-opacity:.95!important}.nvd3 .nv-point-paths path{stroke:#aaa;stroke-opacity:0;fill:#eee;fill-opacity:0}.nvd3 .nv-indexLine{cursor:ew-resize}svg.nvd3-svg{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-ms-user-select:none;-moz-user-select:none;user-select:none;display:block;width:100%;height:100%}.nvtooltip.with-3d-shadow,.with-3d-shadow .nvtooltip{-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.nvd3 text{font:400 12px Arial}.nvd3 .title{font:700 14px Arial}.nvd3 .nv-background{fill:#fff;fill-opacity:0}.nvd3.nv-noData{font-size:18px;font-weight:700}.nv-brush .extent{fill-opacity:.125;shape-rendering:crispEdges}.nv-brush .resize path{fill:#eee;stroke:#666}.nvd3 .nv-legend .nv-series{cursor:pointer}.nvd3 .nv-legend .nv-disabled circle{fill-opacity:0}.nvd3 .nv-brush .extent{fill-opacity:0!important}.nvd3 .nv-brushBackground rect{stroke:#000;stroke-width:.4;fill:#fff;fill-opacity:.7}.nvd3.nv-ohlcBar .nv-ticks .nv-tick{stroke-width:1px}.nvd3.nv-ohlcBar .nv-ticks .nv-tick.hover{stroke-width:2px}.nvd3.nv-ohlcBar .nv-ticks .nv-tick.positive{stroke:#2ca02c}.nvd3.nv-ohlcBar .nv-ticks .nv-tick.negative{stroke:#d62728}.nvd3 .background path{fill:none;stroke:#EEE;stroke-opacity:.4;shape-rendering:crispEdges}.nvd3 .foreground path{fill:none;stroke-opacity:.7}.nvd3 .nv-parallelCoordinates-brush .extent{fill:#fff;fill-opacity:.6;stroke:gray;shape-rendering:crispEdges}.nvd3 .nv-parallelCoordinates .hover{fill-opacity:1;stroke-width:3px}.nvd3 .missingValuesline line{fill:none;stroke:#000;stroke-width:1;stroke-opacity:1;stroke-dasharray:5,5}.nvd3.nv-pie path{stroke-opacity:0;transition:fill-opacity 250ms linear,stroke-width 250ms linear,stroke-opacity 250ms linear;-moz-transition:fill-opacity 250ms linear,stroke-width 250ms linear,stroke-opacity 250ms linear;-webkit-transition:fill-opacity 250ms linear,stroke-width 250ms linear,stroke-opacity 250ms linear}.nvd3.nv-pie .nv-pie-title{font-size:24px;fill:rgba(19,196,249,.59)}.nvd3.nv-pie .nv-slice text{stroke:#000;stroke-width:0}.nvd3.nv-pie path{stroke:#fff;stroke-width:1px;stroke-opacity:1}.nvd3.nv-pie .hover path{fill-opacity:.7}.nvd3.nv-pie .nv-label{pointer-events:none}.nvd3.nv-pie .nv-label rect{fill-opacity:0;stroke-opacity:0}.nvd3 .nv-groups .nv-point.hover{stroke-width:20px;stroke-opacity:.5}.nvd3 .nv-scatter .nv-point.hover{fill-opacity:1}.nv-noninteractive{pointer-events:none}.nv-distx,.nv-disty{pointer-events:none}.nvd3.nv-sparkline path{fill:none}.nvd3.nv-sparklineplus g.nv-hoverValue{pointer-events:none}.nvd3.nv-sparklineplus .nv-hoverValue line{stroke:#333;stroke-width:1.5px}.nvd3.nv-sparklineplus,.nvd3.nv-sparklineplus g{pointer-events:all}.nvd3 .nv-hoverArea{fill-opacity:0;stroke-opacity:0}.nvd3.nv-sparklineplus .nv-xValue,.nvd3.nv-sparklineplus .nv-yValue{stroke-width:0;font-size:.9em;font-weight:400}.nvd3.nv-sparklineplus .nv-yValue{stroke:#f66}.nvd3.nv-sparklineplus .nv-maxValue{stroke:#2ca02c;fill:#2ca02c}.nvd3.nv-sparklineplus .nv-minValue{stroke:#d62728;fill:#d62728}.nvd3.nv-sparklineplus .nv-currentValue{font-weight:700;font-size:1.1em}.nvd3.nv-stackedarea path.nv-area{fill-opacity:.7;stroke-opacity:0;transition:fill-opacity 250ms linear,stroke-opacity 250ms linear;-moz-transition:fill-opacity 250ms linear,stroke-opacity 250ms linear;-webkit-transition:fill-opacity 250ms linear,stroke-opacity 250ms linear}.nvd3.nv-stackedarea path.nv-area.hover{fill-opacity:.9}.nvd3.nv-stackedarea .nv-groups .nv-point{stroke-opacity:0;fill-opacity:0}.nvtooltip{position:absolute;background-color:rgba(255,255,255,1);color:rgba(0,0,0,1);padding:1px;border:1px solid rgba(0,0,0,.2);z-index:10000;display:block;font-family:Arial;font-size:13px;text-align:left;pointer-events:none;white-space:nowrap;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.nvtooltip{background:rgba(255,255,255,.8);border:1px solid rgba(0,0,0,.5);border-radius:4px}.nvtooltip.with-transitions,.with-transitions .nvtooltip{transition:opacity 50ms linear;-moz-transition:opacity 50ms linear;-webkit-transition:opacity 50ms linear;transition-delay:200ms;-moz-transition-delay:200ms;-webkit-transition-delay:200ms}.nvtooltip.x-nvtooltip,.nvtooltip.y-nvtooltip{padding:8px}.nvtooltip h3{margin:0;padding:4px 14px;line-height:18px;font-weight:400;background-color:rgba(247,247,247,.75);color:rgba(0,0,0,1);text-align:center;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.nvtooltip p{margin:0;padding:5px 14px;text-align:center}.nvtooltip span{display:inline-block;margin:2px 0}.nvtooltip table{margin:6px;border-spacing:0}.nvtooltip table td{padding:2px 9px 2px 0;vertical-align:middle}.nvtooltip table td.key{font-weight:400}.nvtooltip table td.value{text-align:right;font-weight:700}.nvtooltip table tr.highlight td{padding:1px 9px 1px 0;border-bottom-style:solid;border-bottom-width:1px;border-top-style:solid;border-top-width:1px}.nvtooltip table td.legend-color-guide div{width:8px;height:8px;vertical-align:middle}.nvtooltip table td.legend-color-guide div{width:12px;height:12px;border:1px solid #999}.nvtooltip .footer{padding:3px;text-align:center}.nvtooltip-pending-removal{pointer-events:none;display:none}.nvd3 .nv-interactiveGuideLine{pointer-events:none}.nvd3 line.nv-guideline{stroke:#ccc}<!DOCTYPE html>
46453<html lang="en">
46454 <head>
46455  <meta charset="UTF-8">
46456  <title>Code Coverage for {{full_path}}</title>
46457  <meta name="viewport" content="width=device-width, initial-scale=1.0">
46458  <link href="{{path_to_root}}_css/bootstrap.min.css" rel="stylesheet" type="text/css">
46459  <link href="{{path_to_root}}_css/octicons.css" rel="stylesheet" type="text/css">
46460  <link href="{{path_to_root}}_css/style.css" rel="stylesheet" type="text/css">
46461  <link href="{{path_to_root}}_css/custom.css" rel="stylesheet" type="text/css">
46462 </head>
46463 <body>
46464  <header>
46465   <div class="container-fluid">
46466    <div class="row">
46467     <div class="col-md-12">
46468      <nav aria-label="breadcrumb">
46469       <ol class="breadcrumb">
46470{{breadcrumbs}}
46471       </ol>
46472      </nav>
46473     </div>
46474    </div>
46475   </div>
46476  </header>
46477  <div class="container-fluid">
46478   <div class="table-responsive">
46479    <table class="table table-bordered">
46480     <thead>
46481      <tr>
46482       <td>&nbsp;</td>
46483       <td colspan="15"><div align="center"><strong>Code Coverage</strong></div></td>
46484      </tr>
46485      <tr>
46486       <td>&nbsp;</td>
46487       <td colspan="3"><div align="center"><strong>Lines</strong></div></td>
46488       <td colspan="3"><div align="center"><strong>Branches</strong></div></td>
46489       <td colspan="3"><div align="center"><strong>Paths</strong></div></td>
46490       <td colspan="3"><div align="center"><strong>Functions and Methods</strong></div></td>
46491       <td colspan="3"><div align="center"><strong>Classes and Traits</strong></div></td>
46492      </tr>
46493     </thead>
46494     <tbody>
46495{{items}}
46496     </tbody>
46497    </table>
46498   </div>
46499   <footer>
46500    <hr/>
46501    <h4>Legend</h4>
46502    <p>
46503     <span class="danger"><strong>Low</strong>: 0% to {{low_upper_bound}}%</span>
46504     <span class="warning"><strong>Medium</strong>: {{low_upper_bound}}% to {{high_lower_bound}}%</span>
46505     <span class="success"><strong>High</strong>: {{high_lower_bound}}% to 100%</span>
46506    </p>
46507    <p>
46508     <small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage {{version}}</a> using {{runtime}}{{generator}} at {{date}}.</small>
46509    </p>
46510   </footer>
46511  </div>
46512 </body>
46513</html>
46514<hr/>
46515<h4>Branches</h4>
46516<p>
46517    Below are the source code lines that represent each code branch as identified by Xdebug. Please note a branch is not
46518    necessarily coterminous with a line, a line may contain multiple branches and therefore show up more than once.
46519    Please also be aware that some branches may be implicit rather than explicit, e.g. an <code>if</code> statement
46520    <i>always</i> has an <code>else</code> as part of its logical flow even if you didn't write one.
46521</p>
46522{{branches}}
46523      <tr>
46524       <td class="{{classes_level}}">{{name}}</td>
46525       <td class="{{classes_level}} big">{{classes_bar}}</td>
46526       <td class="{{classes_level}} small"><div align="right">{{classes_tested_percent}}</div></td>
46527       <td class="{{classes_level}} small"><div align="right">{{classes_number}}</div></td>
46528       <td class="{{methods_level}} big">{{methods_bar}}</td>
46529       <td class="{{methods_level}} small"><div align="right">{{methods_tested_percent}}</div></td>
46530       <td class="{{methods_level}} small"><div align="right">{{methods_number}}</div></td>
46531       <td class="{{methods_level}} small">{{crap}}</td>
46532       <td class="{{lines_level}} big">{{lines_bar}}</td>
46533       <td class="{{lines_level}} small"><div align="right">{{lines_executed_percent}}</div></td>
46534       <td class="{{lines_level}} small"><div align="right">{{lines_number}}</div></td>
46535      </tr>
46536
46537      <tr>
46538       <td class="{{lines_level}}">{{icon}}{{name}}</td>
46539       <td class="{{lines_level}} big">{{lines_bar}}</td>
46540       <td class="{{lines_level}} small"><div align="right">{{lines_executed_percent}}</div></td>
46541       <td class="{{lines_level}} small"><div align="right">{{lines_number}}</div></td>
46542       <td class="{{branches_level}} big">{{branches_bar}}</td>
46543       <td class="{{branches_level}} small"><div align="right">{{branches_executed_percent}}</div></td>
46544       <td class="{{branches_level}} small"><div align="right">{{branches_number}}</div></td>
46545       <td class="{{paths_level}} big">{{paths_bar}}</td>
46546       <td class="{{paths_level}} small"><div align="right">{{paths_executed_percent}}</div></td>
46547       <td class="{{paths_level}} small"><div align="right">{{paths_number}}</div></td>
46548       <td class="{{methods_level}} big">{{methods_bar}}</td>
46549       <td class="{{methods_level}} small"><div align="right">{{methods_tested_percent}}</div></td>
46550       <td class="{{methods_level}} small"><div align="right">{{methods_number}}</div></td>
46551       <td class="{{classes_level}} big">{{classes_bar}}</td>
46552       <td class="{{classes_level}} small"><div align="right">{{classes_tested_percent}}</div></td>
46553       <td class="{{classes_level}} small"><div align="right">{{classes_number}}</div></td>
46554      </tr>
46555
46556<!DOCTYPE html>
46557<html lang="en">
46558 <head>
46559  <meta charset="UTF-8">
46560  <title>Dashboard for {{full_path}}</title>
46561  <meta name="viewport" content="width=device-width, initial-scale=1.0">
46562  <link href="{{path_to_root}}_css/bootstrap.min.css" rel="stylesheet" type="text/css">
46563  <link href="{{path_to_root}}_css/nv.d3.min.css" rel="stylesheet" type="text/css">
46564  <link href="{{path_to_root}}_css/style.css" rel="stylesheet" type="text/css">
46565  <link href="{{path_to_root}}_css/custom.css" rel="stylesheet" type="text/css">
46566 </head>
46567 <body>
46568  <header>
46569   <div class="container-fluid">
46570    <div class="row">
46571     <div class="col-md-12">
46572      <nav aria-label="breadcrumb">
46573       <ol class="breadcrumb">
46574{{breadcrumbs}}
46575       </ol>
46576      </nav>
46577     </div>
46578    </div>
46579   </div>
46580  </header>
46581  <div class="container-fluid">
46582   <div class="row">
46583    <div class="col-md-12">
46584     <h2>Classes</h2>
46585    </div>
46586   </div>
46587   <div class="row">
46588    <div class="col-md-6">
46589     <h3>Coverage Distribution</h3>
46590     <div id="classCoverageDistribution" style="height: 300px;">
46591       <svg></svg>
46592     </div>
46593    </div>
46594    <div class="col-md-6">
46595     <h3>Complexity</h3>
46596     <div id="classComplexity" style="height: 300px;">
46597       <svg></svg>
46598     </div>
46599    </div>
46600   </div>
46601   <div class="row">
46602    <div class="col-md-6">
46603     <h3>Insufficient Coverage</h3>
46604     <div class="scrollbox">
46605      <table class="table">
46606       <thead>
46607        <tr>
46608         <th>Class</th>
46609         <th class="text-right">Coverage</th>
46610        </tr>
46611       </thead>
46612       <tbody>
46613{{insufficient_coverage_classes}}
46614       </tbody>
46615      </table>
46616     </div>
46617    </div>
46618    <div class="col-md-6">
46619     <h3>Project Risks</h3>
46620     <div class="scrollbox">
46621      <table class="table">
46622       <thead>
46623        <tr>
46624         <th>Class</th>
46625         <th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
46626        </tr>
46627       </thead>
46628       <tbody>
46629{{project_risks_classes}}
46630       </tbody>
46631      </table>
46632     </div>
46633    </div>
46634   </div>
46635   <div class="row">
46636    <div class="col-md-12">
46637     <h2>Methods</h2>
46638    </div>
46639   </div>
46640   <div class="row">
46641    <div class="col-md-6">
46642     <h3>Coverage Distribution</h3>
46643     <div id="methodCoverageDistribution" style="height: 300px;">
46644       <svg></svg>
46645     </div>
46646    </div>
46647    <div class="col-md-6">
46648     <h3>Complexity</h3>
46649     <div id="methodComplexity" style="height: 300px;">
46650       <svg></svg>
46651     </div>
46652    </div>
46653   </div>
46654   <div class="row">
46655    <div class="col-md-6">
46656     <h3>Insufficient Coverage</h3>
46657     <div class="scrollbox">
46658      <table class="table">
46659       <thead>
46660        <tr>
46661         <th>Method</th>
46662         <th class="text-right">Coverage</th>
46663        </tr>
46664       </thead>
46665       <tbody>
46666{{insufficient_coverage_methods}}
46667       </tbody>
46668      </table>
46669     </div>
46670    </div>
46671    <div class="col-md-6">
46672     <h3>Project Risks</h3>
46673     <div class="scrollbox">
46674      <table class="table">
46675       <thead>
46676        <tr>
46677         <th>Method</th>
46678         <th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
46679        </tr>
46680       </thead>
46681       <tbody>
46682{{project_risks_methods}}
46683       </tbody>
46684      </table>
46685     </div>
46686    </div>
46687   </div>
46688   <footer>
46689    <hr/>
46690    <p>
46691     <small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage {{version}}</a> using {{runtime}}{{generator}} at {{date}}.</small>
46692    </p>
46693   </footer>
46694  </div>
46695  <script src="{{path_to_root}}_js/jquery.min.js" type="text/javascript"></script>
46696  <script src="{{path_to_root}}_js/d3.min.js" type="text/javascript"></script>
46697  <script src="{{path_to_root}}_js/nv.d3.min.js" type="text/javascript"></script>
46698  <script type="text/javascript">
46699$(document).ready(function() {
46700  nv.addGraph(function() {
46701    var chart = nv.models.multiBarChart();
46702    chart.tooltips(false)
46703      .showControls(false)
46704      .showLegend(false)
46705      .reduceXTicks(false)
46706      .staggerLabels(true)
46707      .yAxis.tickFormat(d3.format('d'));
46708
46709    d3.select('#classCoverageDistribution svg')
46710      .datum(getCoverageDistributionData({{class_coverage_distribution}}, "Class Coverage"))
46711      .transition().duration(500).call(chart);
46712
46713    nv.utils.windowResize(chart.update);
46714
46715    return chart;
46716  });
46717
46718  nv.addGraph(function() {
46719    var chart = nv.models.multiBarChart();
46720    chart.tooltips(false)
46721      .showControls(false)
46722      .showLegend(false)
46723      .reduceXTicks(false)
46724      .staggerLabels(true)
46725      .yAxis.tickFormat(d3.format('d'));
46726
46727    d3.select('#methodCoverageDistribution svg')
46728      .datum(getCoverageDistributionData({{method_coverage_distribution}}, "Method Coverage"))
46729      .transition().duration(500).call(chart);
46730
46731    nv.utils.windowResize(chart.update);
46732
46733    return chart;
46734  });
46735
46736  function getCoverageDistributionData(data, label) {
46737    var labels = [
46738      '0%',
46739      '0-10%',
46740      '10-20%',
46741      '20-30%',
46742      '30-40%',
46743      '40-50%',
46744      '50-60%',
46745      '60-70%',
46746      '70-80%',
46747      '80-90%',
46748      '90-100%',
46749      '100%'
46750    ];
46751    var values = [];
46752    $.each(labels, function(key) {
46753      values.push({x: labels[key], y: data[key]});
46754    });
46755
46756    return [
46757      {
46758        key: label,
46759        values: values,
46760        color: "#4572A7"
46761      }
46762    ];
46763  }
46764  nv.addGraph(function() {
46765    var chart = nv.models.scatterChart()
46766      .showDistX(true)
46767      .showDistY(true)
46768      .showLegend(false)
46769      .forceX([0, 100]);
46770    chart.tooltipContent(function(graph) {
46771      return '<p>' + graph.point.class + '</p>';
46772    });
46773
46774    chart.xAxis.axisLabel('Code Coverage (in percent)');
46775    chart.yAxis.axisLabel('Cyclomatic Complexity');
46776
46777    d3.select('#classComplexity svg')
46778      .datum(getComplexityData({{complexity_class}}, 'Class Complexity'))
46779      .transition()
46780      .duration(500)
46781      .call(chart);
46782
46783    nv.utils.windowResize(chart.update);
46784
46785    return chart;
46786  });
46787
46788  nv.addGraph(function() {
46789    var chart = nv.models.scatterChart()
46790      .showDistX(true)
46791      .showDistY(true)
46792      .showLegend(false)
46793      .forceX([0, 100]);
46794    chart.tooltipContent(function(graph) {
46795      return '<p>' + graph.point.class + '</p>';
46796    });
46797
46798    chart.xAxis.axisLabel('Code Coverage (in percent)');
46799    chart.yAxis.axisLabel('Method Complexity');
46800
46801    d3.select('#methodComplexity svg')
46802      .datum(getComplexityData({{complexity_method}}, 'Method Complexity'))
46803      .transition()
46804      .duration(500)
46805      .call(chart);
46806
46807    nv.utils.windowResize(chart.update);
46808
46809    return chart;
46810  });
46811
46812  function getComplexityData(data, label) {
46813    var values = [];
46814    $.each(data, function(key) {
46815      var value = Math.round(data[key][0]*100) / 100;
46816      values.push({
46817        x: value,
46818        y: data[key][1],
46819        class: data[key][2],
46820        size: 0.05,
46821        shape: 'diamond'
46822      });
46823    });
46824
46825    return [
46826      {
46827        key: label,
46828        values: values,
46829        color: "#4572A7"
46830      }
46831    ];
46832  }
46833});
46834  </script>
46835 </body>
46836</html>
46837<svg xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewBox="0 0 12 16"><path fill-rule="evenodd" d="M8.5 1H1c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h10c.55 0 1-.45 1-1V4.5L8.5 1zM11 14H1V2h7l3 3v9zM5 6.98L3.5 8.5 5 10l-.5 1L2 8.5 4.5 6l.5.98zM7.5 6L10 8.5 7.5 11l-.5-.98L8.5 8.5 7 7l.5-1z"/></svg><svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M13 4H7V3c0-.66-.31-1-1-1H1c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V5c0-.55-.45-1-1-1zM6 4H1V3h5v1z"/></svg><?php
46838
46839declare (strict_types=1);
46840/*
46841 * This file is part of phpunit/php-code-coverage.
46842 *
46843 * (c) Sebastian Bergmann <sebastian@phpunit.de>
46844 *
46845 * For the full copyright and license information, please view the LICENSE
46846 * file that was distributed with this source code.
46847 */
46848namespace PHPUnit\SebastianBergmann\CodeCoverage\Report\Html;
46849
46850use const ENT_COMPAT;
46851use const ENT_HTML401;
46852use const ENT_SUBSTITUTE;
46853use const T_ABSTRACT;
46854use const T_ARRAY;
46855use const T_AS;
46856use const T_BREAK;
46857use const T_CALLABLE;
46858use const T_CASE;
46859use const T_CATCH;
46860use const T_CLASS;
46861use const T_CLONE;
46862use const T_COMMENT;
46863use const T_CONST;
46864use const T_CONTINUE;
46865use const T_DECLARE;
46866use const T_DEFAULT;
46867use const T_DO;
46868use const T_DOC_COMMENT;
46869use const T_ECHO;
46870use const T_ELSE;
46871use const T_ELSEIF;
46872use const T_EMPTY;
46873use const T_ENDDECLARE;
46874use const T_ENDFOR;
46875use const T_ENDFOREACH;
46876use const T_ENDIF;
46877use const T_ENDSWITCH;
46878use const T_ENDWHILE;
46879use const T_EVAL;
46880use const T_EXIT;
46881use const T_EXTENDS;
46882use const T_FINAL;
46883use const T_FINALLY;
46884use const T_FOR;
46885use const T_FOREACH;
46886use const T_FUNCTION;
46887use const T_GLOBAL;
46888use const T_GOTO;
46889use const T_HALT_COMPILER;
46890use const T_IF;
46891use const T_IMPLEMENTS;
46892use const T_INCLUDE;
46893use const T_INCLUDE_ONCE;
46894use const T_INLINE_HTML;
46895use const T_INSTANCEOF;
46896use const T_INSTEADOF;
46897use const T_INTERFACE;
46898use const T_ISSET;
46899use const T_LIST;
46900use const T_NAMESPACE;
46901use const T_NEW;
46902use const T_PRINT;
46903use const T_PRIVATE;
46904use const T_PROTECTED;
46905use const T_PUBLIC;
46906use const T_REQUIRE;
46907use const T_REQUIRE_ONCE;
46908use const T_RETURN;
46909use const T_STATIC;
46910use const T_SWITCH;
46911use const T_THROW;
46912use const T_TRAIT;
46913use const T_TRY;
46914use const T_UNSET;
46915use const T_USE;
46916use const T_VAR;
46917use const T_WHILE;
46918use const T_YIELD;
46919use const T_YIELD_FROM;
46920use function array_key_exists;
46921use function array_pop;
46922use function array_unique;
46923use function constant;
46924use function count;
46925use function defined;
46926use function explode;
46927use function file_get_contents;
46928use function htmlspecialchars;
46929use function is_string;
46930use function sprintf;
46931use function str_replace;
46932use function substr;
46933use function token_get_all;
46934use function trim;
46935use PHPUnit\Runner\BaseTestRunner;
46936use PHPUnit\SebastianBergmann\CodeCoverage\Node\File as FileNode;
46937use PHPUnit\SebastianBergmann\CodeCoverage\Percentage;
46938use PHPUnit\SebastianBergmann\Template\Template;
46939/**
46940 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
46941 */
46942final class File extends Renderer
46943{
46944    /**
46945     * @psalm-var array<int,true>
46946     */
46947    private static $keywordTokens = [];
46948    /**
46949     * @var array
46950     */
46951    private static $formattedSourceCache = [];
46952    /**
46953     * @var int
46954     */
46955    private $htmlSpecialCharsFlags = \ENT_COMPAT | \ENT_HTML401 | \ENT_SUBSTITUTE;
46956    public function render(FileNode $node, string $file) : void
46957    {
46958        $templateName = $this->templatePath . ($this->hasBranchCoverage ? 'file_branch.html' : 'file.html');
46959        $template = new Template($templateName, '{{', '}}');
46960        $this->setCommonTemplateVariables($template, $node);
46961        $template->setVar(['items' => $this->renderItems($node), 'lines' => $this->renderSourceWithLineCoverage($node), 'legend' => '<p><span class="success"><strong>Executed</strong></span><span class="danger"><strong>Not Executed</strong></span><span class="warning"><strong>Dead Code</strong></span></p>', 'structure' => '']);
46962        $template->renderTo($file . '.html');
46963        if ($this->hasBranchCoverage) {
46964            $template->setVar(['items' => $this->renderItems($node), 'lines' => $this->renderSourceWithBranchCoverage($node), 'legend' => '<p><span class="success"><strong>Fully covered</strong></span><span class="warning"><strong>Partially covered</strong></span><span class="danger"><strong>Not covered</strong></span></p>', 'structure' => $this->renderBranchStructure($node)]);
46965            $template->renderTo($file . '_branch.html');
46966            $template->setVar(['items' => $this->renderItems($node), 'lines' => $this->renderSourceWithPathCoverage($node), 'legend' => '<p><span class="success"><strong>Fully covered</strong></span><span class="warning"><strong>Partially covered</strong></span><span class="danger"><strong>Not covered</strong></span></p>', 'structure' => $this->renderPathStructure($node)]);
46967            $template->renderTo($file . '_path.html');
46968        }
46969    }
46970    private function renderItems(FileNode $node) : string
46971    {
46972        $templateName = $this->templatePath . ($this->hasBranchCoverage ? 'file_item_branch.html' : 'file_item.html');
46973        $template = new Template($templateName, '{{', '}}');
46974        $methodTemplateName = $this->templatePath . ($this->hasBranchCoverage ? 'method_item_branch.html' : 'method_item.html');
46975        $methodItemTemplate = new Template($methodTemplateName, '{{', '}}');
46976        $items = $this->renderItemTemplate($template, ['name' => 'Total', 'numClasses' => $node->numberOfClassesAndTraits(), 'numTestedClasses' => $node->numberOfTestedClassesAndTraits(), 'numMethods' => $node->numberOfFunctionsAndMethods(), 'numTestedMethods' => $node->numberOfTestedFunctionsAndMethods(), 'linesExecutedPercent' => $node->percentageOfExecutedLines()->asFloat(), 'linesExecutedPercentAsString' => $node->percentageOfExecutedLines()->asString(), 'numExecutedLines' => $node->numberOfExecutedLines(), 'numExecutableLines' => $node->numberOfExecutableLines(), 'branchesExecutedPercent' => $node->percentageOfExecutedBranches()->asFloat(), 'branchesExecutedPercentAsString' => $node->percentageOfExecutedBranches()->asString(), 'numExecutedBranches' => $node->numberOfExecutedBranches(), 'numExecutableBranches' => $node->numberOfExecutableBranches(), 'pathsExecutedPercent' => $node->percentageOfExecutedPaths()->asFloat(), 'pathsExecutedPercentAsString' => $node->percentageOfExecutedPaths()->asString(), 'numExecutedPaths' => $node->numberOfExecutedPaths(), 'numExecutablePaths' => $node->numberOfExecutablePaths(), 'testedMethodsPercent' => $node->percentageOfTestedFunctionsAndMethods()->asFloat(), 'testedMethodsPercentAsString' => $node->percentageOfTestedFunctionsAndMethods()->asString(), 'testedClassesPercent' => $node->percentageOfTestedClassesAndTraits()->asFloat(), 'testedClassesPercentAsString' => $node->percentageOfTestedClassesAndTraits()->asString(), 'crap' => '<abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr>']);
46977        $items .= $this->renderFunctionItems($node->functions(), $methodItemTemplate);
46978        $items .= $this->renderTraitOrClassItems($node->traits(), $template, $methodItemTemplate);
46979        $items .= $this->renderTraitOrClassItems($node->classes(), $template, $methodItemTemplate);
46980        return $items;
46981    }
46982    private function renderTraitOrClassItems(array $items, Template $template, Template $methodItemTemplate) : string
46983    {
46984        $buffer = '';
46985        if (empty($items)) {
46986            return $buffer;
46987        }
46988        foreach ($items as $name => $item) {
46989            $numMethods = 0;
46990            $numTestedMethods = 0;
46991            foreach ($item['methods'] as $method) {
46992                if ($method['executableLines'] > 0) {
46993                    $numMethods++;
46994                    if ($method['executedLines'] === $method['executableLines']) {
46995                        $numTestedMethods++;
46996                    }
46997                }
46998            }
46999            if ($item['executableLines'] > 0) {
47000                $numClasses = 1;
47001                $numTestedClasses = $numTestedMethods === $numMethods ? 1 : 0;
47002                $linesExecutedPercentAsString = Percentage::fromFractionAndTotal($item['executedLines'], $item['executableLines'])->asString();
47003                $branchesExecutedPercentAsString = Percentage::fromFractionAndTotal($item['executedBranches'], $item['executableBranches'])->asString();
47004                $pathsExecutedPercentAsString = Percentage::fromFractionAndTotal($item['executedPaths'], $item['executablePaths'])->asString();
47005            } else {
47006                $numClasses = 0;
47007                $numTestedClasses = 0;
47008                $linesExecutedPercentAsString = 'n/a';
47009                $branchesExecutedPercentAsString = 'n/a';
47010                $pathsExecutedPercentAsString = 'n/a';
47011            }
47012            $testedMethodsPercentage = Percentage::fromFractionAndTotal($numTestedMethods, $numMethods);
47013            $testedClassesPercentage = Percentage::fromFractionAndTotal($numTestedMethods === $numMethods ? 1 : 0, 1);
47014            $buffer .= $this->renderItemTemplate($template, ['name' => $this->abbreviateClassName($name), 'numClasses' => $numClasses, 'numTestedClasses' => $numTestedClasses, 'numMethods' => $numMethods, 'numTestedMethods' => $numTestedMethods, 'linesExecutedPercent' => Percentage::fromFractionAndTotal($item['executedLines'], $item['executableLines'])->asFloat(), 'linesExecutedPercentAsString' => $linesExecutedPercentAsString, 'numExecutedLines' => $item['executedLines'], 'numExecutableLines' => $item['executableLines'], 'branchesExecutedPercent' => Percentage::fromFractionAndTotal($item['executedBranches'], $item['executableBranches'])->asFloat(), 'branchesExecutedPercentAsString' => $branchesExecutedPercentAsString, 'numExecutedBranches' => $item['executedBranches'], 'numExecutableBranches' => $item['executableBranches'], 'pathsExecutedPercent' => Percentage::fromFractionAndTotal($item['executedPaths'], $item['executablePaths'])->asFloat(), 'pathsExecutedPercentAsString' => $pathsExecutedPercentAsString, 'numExecutedPaths' => $item['executedPaths'], 'numExecutablePaths' => $item['executablePaths'], 'testedMethodsPercent' => $testedMethodsPercentage->asFloat(), 'testedMethodsPercentAsString' => $testedMethodsPercentage->asString(), 'testedClassesPercent' => $testedClassesPercentage->asFloat(), 'testedClassesPercentAsString' => $testedClassesPercentage->asString(), 'crap' => $item['crap']]);
47015            foreach ($item['methods'] as $method) {
47016                $buffer .= $this->renderFunctionOrMethodItem($methodItemTemplate, $method, '&nbsp;');
47017            }
47018        }
47019        return $buffer;
47020    }
47021    private function renderFunctionItems(array $functions, Template $template) : string
47022    {
47023        if (empty($functions)) {
47024            return '';
47025        }
47026        $buffer = '';
47027        foreach ($functions as $function) {
47028            $buffer .= $this->renderFunctionOrMethodItem($template, $function);
47029        }
47030        return $buffer;
47031    }
47032    private function renderFunctionOrMethodItem(Template $template, array $item, string $indent = '') : string
47033    {
47034        $numMethods = 0;
47035        $numTestedMethods = 0;
47036        if ($item['executableLines'] > 0) {
47037            $numMethods = 1;
47038            if ($item['executedLines'] === $item['executableLines']) {
47039                $numTestedMethods = 1;
47040            }
47041        }
47042        $executedLinesPercentage = Percentage::fromFractionAndTotal($item['executedLines'], $item['executableLines']);
47043        $executedBranchesPercentage = Percentage::fromFractionAndTotal($item['executedBranches'], $item['executableBranches']);
47044        $executedPathsPercentage = Percentage::fromFractionAndTotal($item['executedPaths'], $item['executablePaths']);
47045        $testedMethodsPercentage = Percentage::fromFractionAndTotal($numTestedMethods, 1);
47046        return $this->renderItemTemplate($template, ['name' => sprintf('%s<a href="#%d"><abbr title="%s">%s</abbr></a>', $indent, $item['startLine'], htmlspecialchars($item['signature'], $this->htmlSpecialCharsFlags), $item['functionName'] ?? $item['methodName']), 'numMethods' => $numMethods, 'numTestedMethods' => $numTestedMethods, 'linesExecutedPercent' => $executedLinesPercentage->asFloat(), 'linesExecutedPercentAsString' => $executedLinesPercentage->asString(), 'numExecutedLines' => $item['executedLines'], 'numExecutableLines' => $item['executableLines'], 'branchesExecutedPercent' => $executedBranchesPercentage->asFloat(), 'branchesExecutedPercentAsString' => $executedBranchesPercentage->asString(), 'numExecutedBranches' => $item['executedBranches'], 'numExecutableBranches' => $item['executableBranches'], 'pathsExecutedPercent' => $executedPathsPercentage->asFloat(), 'pathsExecutedPercentAsString' => $executedPathsPercentage->asString(), 'numExecutedPaths' => $item['executedPaths'], 'numExecutablePaths' => $item['executablePaths'], 'testedMethodsPercent' => $testedMethodsPercentage->asFloat(), 'testedMethodsPercentAsString' => $testedMethodsPercentage->asString(), 'crap' => $item['crap']]);
47047    }
47048    private function renderSourceWithLineCoverage(FileNode $node) : string
47049    {
47050        $linesTemplate = new Template($this->templatePath . 'lines.html.dist', '{{', '}}');
47051        $singleLineTemplate = new Template($this->templatePath . 'line.html.dist', '{{', '}}');
47052        $coverageData = $node->lineCoverageData();
47053        $testData = $node->testData();
47054        $codeLines = $this->loadFile($node->pathAsString());
47055        $lines = '';
47056        $i = 1;
47057        foreach ($codeLines as $line) {
47058            $trClass = '';
47059            $popoverContent = '';
47060            $popoverTitle = '';
47061            if (array_key_exists($i, $coverageData)) {
47062                $numTests = $coverageData[$i] ? count($coverageData[$i]) : 0;
47063                if ($coverageData[$i] === null) {
47064                    $trClass = 'warning';
47065                } elseif ($numTests === 0) {
47066                    $trClass = 'danger';
47067                } else {
47068                    if ($numTests > 1) {
47069                        $popoverTitle = $numTests . ' tests cover line ' . $i;
47070                    } else {
47071                        $popoverTitle = '1 test covers line ' . $i;
47072                    }
47073                    $lineCss = 'covered-by-large-tests';
47074                    $popoverContent = '<ul>';
47075                    foreach ($coverageData[$i] as $test) {
47076                        if ($lineCss === 'covered-by-large-tests' && $testData[$test]['size'] === 'medium') {
47077                            $lineCss = 'covered-by-medium-tests';
47078                        } elseif ($testData[$test]['size'] === 'small') {
47079                            $lineCss = 'covered-by-small-tests';
47080                        }
47081                        $popoverContent .= $this->createPopoverContentForTest($test, $testData[$test]);
47082                    }
47083                    $popoverContent .= '</ul>';
47084                    $trClass = $lineCss . ' popin';
47085                }
47086            }
47087            $popover = '';
47088            if (!empty($popoverTitle)) {
47089                $popover = sprintf(' data-title="%s" data-content="%s" data-placement="top" data-html="true"', $popoverTitle, htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags));
47090            }
47091            $lines .= $this->renderLine($singleLineTemplate, $i, $line, $trClass, $popover);
47092            $i++;
47093        }
47094        $linesTemplate->setVar(['lines' => $lines]);
47095        return $linesTemplate->render();
47096    }
47097    private function renderSourceWithBranchCoverage(FileNode $node) : string
47098    {
47099        $linesTemplate = new Template($this->templatePath . 'lines.html.dist', '{{', '}}');
47100        $singleLineTemplate = new Template($this->templatePath . 'line.html.dist', '{{', '}}');
47101        $functionCoverageData = $node->functionCoverageData();
47102        $testData = $node->testData();
47103        $codeLines = $this->loadFile($node->pathAsString());
47104        $lineData = [];
47105        /** @var int $line */
47106        foreach (\array_keys($codeLines) as $line) {
47107            $lineData[$line + 1] = ['includedInBranches' => 0, 'includedInHitBranches' => 0, 'tests' => []];
47108        }
47109        foreach ($functionCoverageData as $method) {
47110            foreach ($method['branches'] as $branch) {
47111                foreach (\range($branch['line_start'], $branch['line_end']) as $line) {
47112                    if (!isset($lineData[$line])) {
47113                        // blank line at end of file is sometimes included here
47114                        continue;
47115                    }
47116                    $lineData[$line]['includedInBranches']++;
47117                    if ($branch['hit']) {
47118                        $lineData[$line]['includedInHitBranches']++;
47119                        $lineData[$line]['tests'] = array_unique(\array_merge($lineData[$line]['tests'], $branch['hit']));
47120                    }
47121                }
47122            }
47123        }
47124        $lines = '';
47125        $i = 1;
47126        /** @var string $line */
47127        foreach ($codeLines as $line) {
47128            $trClass = '';
47129            $popover = '';
47130            if ($lineData[$i]['includedInBranches'] > 0) {
47131                $lineCss = 'success';
47132                if ($lineData[$i]['includedInHitBranches'] === 0) {
47133                    $lineCss = 'danger';
47134                } elseif ($lineData[$i]['includedInHitBranches'] !== $lineData[$i]['includedInBranches']) {
47135                    $lineCss = 'warning';
47136                }
47137                $popoverContent = '<ul>';
47138                if (count($lineData[$i]['tests']) === 1) {
47139                    $popoverTitle = '1 test covers line ' . $i;
47140                } else {
47141                    $popoverTitle = count($lineData[$i]['tests']) . ' tests cover line ' . $i;
47142                }
47143                $popoverTitle .= '. These are covering ' . $lineData[$i]['includedInHitBranches'] . ' out of the ' . $lineData[$i]['includedInBranches'] . ' code branches.';
47144                foreach ($lineData[$i]['tests'] as $test) {
47145                    $popoverContent .= $this->createPopoverContentForTest($test, $testData[$test]);
47146                }
47147                $popoverContent .= '</ul>';
47148                $trClass = $lineCss . ' popin';
47149                $popover = sprintf(' data-title="%s" data-content="%s" data-placement="top" data-html="true"', $popoverTitle, htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags));
47150            }
47151            $lines .= $this->renderLine($singleLineTemplate, $i, $line, $trClass, $popover);
47152            $i++;
47153        }
47154        $linesTemplate->setVar(['lines' => $lines]);
47155        return $linesTemplate->render();
47156    }
47157    private function renderSourceWithPathCoverage(FileNode $node) : string
47158    {
47159        $linesTemplate = new Template($this->templatePath . 'lines.html.dist', '{{', '}}');
47160        $singleLineTemplate = new Template($this->templatePath . 'line.html.dist', '{{', '}}');
47161        $functionCoverageData = $node->functionCoverageData();
47162        $testData = $node->testData();
47163        $codeLines = $this->loadFile($node->pathAsString());
47164        $lineData = [];
47165        /** @var int $line */
47166        foreach (\array_keys($codeLines) as $line) {
47167            $lineData[$line + 1] = ['includedInPaths' => [], 'includedInHitPaths' => [], 'tests' => []];
47168        }
47169        foreach ($functionCoverageData as $method) {
47170            foreach ($method['paths'] as $pathId => $path) {
47171                foreach ($path['path'] as $branchTaken) {
47172                    foreach (\range($method['branches'][$branchTaken]['line_start'], $method['branches'][$branchTaken]['line_end']) as $line) {
47173                        if (!isset($lineData[$line])) {
47174                            continue;
47175                        }
47176                        $lineData[$line]['includedInPaths'][] = $pathId;
47177                        if ($path['hit']) {
47178                            $lineData[$line]['includedInHitPaths'][] = $pathId;
47179                            $lineData[$line]['tests'] = array_unique(\array_merge($lineData[$line]['tests'], $path['hit']));
47180                        }
47181                    }
47182                }
47183            }
47184        }
47185        $lines = '';
47186        $i = 1;
47187        /** @var string $line */
47188        foreach ($codeLines as $line) {
47189            $trClass = '';
47190            $popover = '';
47191            $includedInPathsCount = count(array_unique($lineData[$i]['includedInPaths']));
47192            $includedInHitPathsCount = count(array_unique($lineData[$i]['includedInHitPaths']));
47193            if ($includedInPathsCount > 0) {
47194                $lineCss = 'success';
47195                if ($includedInHitPathsCount === 0) {
47196                    $lineCss = 'danger';
47197                } elseif ($includedInHitPathsCount !== $includedInPathsCount) {
47198                    $lineCss = 'warning';
47199                }
47200                $popoverContent = '<ul>';
47201                if (count($lineData[$i]['tests']) === 1) {
47202                    $popoverTitle = '1 test covers line ' . $i;
47203                } else {
47204                    $popoverTitle = count($lineData[$i]['tests']) . ' tests cover line ' . $i;
47205                }
47206                $popoverTitle .= '. These are covering ' . $includedInHitPathsCount . ' out of the ' . $includedInPathsCount . ' code paths.';
47207                foreach ($lineData[$i]['tests'] as $test) {
47208                    $popoverContent .= $this->createPopoverContentForTest($test, $testData[$test]);
47209                }
47210                $popoverContent .= '</ul>';
47211                $trClass = $lineCss . ' popin';
47212                $popover = sprintf(' data-title="%s" data-content="%s" data-placement="top" data-html="true"', $popoverTitle, htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags));
47213            }
47214            $lines .= $this->renderLine($singleLineTemplate, $i, $line, $trClass, $popover);
47215            $i++;
47216        }
47217        $linesTemplate->setVar(['lines' => $lines]);
47218        return $linesTemplate->render();
47219    }
47220    private function renderBranchStructure(FileNode $node) : string
47221    {
47222        $branchesTemplate = new Template($this->templatePath . 'branches.html.dist', '{{', '}}');
47223        $coverageData = $node->functionCoverageData();
47224        $testData = $node->testData();
47225        $codeLines = $this->loadFile($node->pathAsString());
47226        $branches = '';
47227        \ksort($coverageData);
47228        foreach ($coverageData as $methodName => $methodData) {
47229            if (!$methodData['branches']) {
47230                continue;
47231            }
47232            $branchStructure = '';
47233            foreach ($methodData['branches'] as $branch) {
47234                $branchStructure .= $this->renderBranchLines($branch, $codeLines, $testData);
47235            }
47236            if ($branchStructure !== '') {
47237                // don't show empty branches
47238                $branches .= '<h5 class="structure-heading"><a name="' . htmlspecialchars($methodName, $this->htmlSpecialCharsFlags) . '">' . $this->abbreviateMethodName($methodName) . '</a></h5>' . "\n";
47239                $branches .= $branchStructure;
47240            }
47241        }
47242        $branchesTemplate->setVar(['branches' => $branches]);
47243        return $branchesTemplate->render();
47244    }
47245    private function renderBranchLines(array $branch, array $codeLines, array $testData) : string
47246    {
47247        $linesTemplate = new Template($this->templatePath . 'lines.html.dist', '{{', '}}');
47248        $singleLineTemplate = new Template($this->templatePath . 'line.html.dist', '{{', '}}');
47249        $lines = '';
47250        $branchLines = \range($branch['line_start'], $branch['line_end']);
47251        \sort($branchLines);
47252        // sometimes end_line < start_line
47253        /** @var int $line */
47254        foreach ($branchLines as $line) {
47255            if (!isset($codeLines[$line])) {
47256                // blank line at end of file is sometimes included here
47257                continue;
47258            }
47259            $popoverContent = '';
47260            $popoverTitle = '';
47261            $numTests = count($branch['hit']);
47262            if ($numTests === 0) {
47263                $trClass = 'danger';
47264            } else {
47265                $lineCss = 'covered-by-large-tests';
47266                $popoverContent = '<ul>';
47267                if ($numTests > 1) {
47268                    $popoverTitle = $numTests . ' tests cover this branch';
47269                } else {
47270                    $popoverTitle = '1 test covers this branch';
47271                }
47272                foreach ($branch['hit'] as $test) {
47273                    if ($lineCss === 'covered-by-large-tests' && $testData[$test]['size'] === 'medium') {
47274                        $lineCss = 'covered-by-medium-tests';
47275                    } elseif ($testData[$test]['size'] === 'small') {
47276                        $lineCss = 'covered-by-small-tests';
47277                    }
47278                    $popoverContent .= $this->createPopoverContentForTest($test, $testData[$test]);
47279                }
47280                $trClass = $lineCss . ' popin';
47281            }
47282            $popover = '';
47283            if (!empty($popoverTitle)) {
47284                $popover = sprintf(' data-title="%s" data-content="%s" data-placement="top" data-html="true"', $popoverTitle, htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags));
47285            }
47286            $lines .= $this->renderLine($singleLineTemplate, $line, $codeLines[$line - 1], $trClass, $popover);
47287        }
47288        if ($lines === '') {
47289            return '';
47290        }
47291        $linesTemplate->setVar(['lines' => $lines]);
47292        return $linesTemplate->render();
47293    }
47294    private function renderPathStructure(FileNode $node) : string
47295    {
47296        $pathsTemplate = new Template($this->templatePath . 'paths.html.dist', '{{', '}}');
47297        $coverageData = $node->functionCoverageData();
47298        $testData = $node->testData();
47299        $codeLines = $this->loadFile($node->pathAsString());
47300        $paths = '';
47301        \ksort($coverageData);
47302        foreach ($coverageData as $methodName => $methodData) {
47303            if (!$methodData['paths']) {
47304                continue;
47305            }
47306            $pathStructure = '';
47307            if (count($methodData['paths']) > 100) {
47308                $pathStructure .= '<p>' . count($methodData['paths']) . ' is too many paths to sensibly render, consider refactoring your code to bring this number down.</p>';
47309                continue;
47310            }
47311            foreach ($methodData['paths'] as $path) {
47312                $pathStructure .= $this->renderPathLines($path, $methodData['branches'], $codeLines, $testData);
47313            }
47314            if ($pathStructure !== '') {
47315                $paths .= '<h5 class="structure-heading"><a name="' . htmlspecialchars($methodName, $this->htmlSpecialCharsFlags) . '">' . $this->abbreviateMethodName($methodName) . '</a></h5>' . "\n";
47316                $paths .= $pathStructure;
47317            }
47318        }
47319        $pathsTemplate->setVar(['paths' => $paths]);
47320        return $pathsTemplate->render();
47321    }
47322    private function renderPathLines(array $path, array $branches, array $codeLines, array $testData) : string
47323    {
47324        $linesTemplate = new Template($this->templatePath . 'lines.html.dist', '{{', '}}');
47325        $singleLineTemplate = new Template($this->templatePath . 'line.html.dist', '{{', '}}');
47326        $lines = '';
47327        foreach ($path['path'] as $branchId) {
47328            $branchLines = \range($branches[$branchId]['line_start'], $branches[$branchId]['line_end']);
47329            \sort($branchLines);
47330            // sometimes end_line < start_line
47331            /** @var int $line */
47332            foreach ($branchLines as $line) {
47333                if (!isset($codeLines[$line])) {
47334                    // blank line at end of file is sometimes included here
47335                    continue;
47336                }
47337                $popoverContent = '';
47338                $popoverTitle = '';
47339                $numTests = count($path['hit']);
47340                if ($numTests === 0) {
47341                    $trClass = 'danger';
47342                } else {
47343                    $lineCss = 'covered-by-large-tests';
47344                    $popoverContent = '<ul>';
47345                    if ($numTests > 1) {
47346                        $popoverTitle = $numTests . ' tests cover this path';
47347                    } else {
47348                        $popoverTitle = '1 test covers this path';
47349                    }
47350                    foreach ($path['hit'] as $test) {
47351                        if ($lineCss === 'covered-by-large-tests' && $testData[$test]['size'] === 'medium') {
47352                            $lineCss = 'covered-by-medium-tests';
47353                        } elseif ($testData[$test]['size'] === 'small') {
47354                            $lineCss = 'covered-by-small-tests';
47355                        }
47356                        $popoverContent .= $this->createPopoverContentForTest($test, $testData[$test]);
47357                    }
47358                    $trClass = $lineCss . ' popin';
47359                }
47360                $popover = '';
47361                if (!empty($popoverTitle)) {
47362                    $popover = sprintf(' data-title="%s" data-content="%s" data-placement="top" data-html="true"', $popoverTitle, htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags));
47363                }
47364                $lines .= $this->renderLine($singleLineTemplate, $line, $codeLines[$line - 1], $trClass, $popover);
47365            }
47366        }
47367        if ($lines === '') {
47368            return '';
47369        }
47370        $linesTemplate->setVar(['lines' => $lines]);
47371        return $linesTemplate->render();
47372    }
47373    private function renderLine(Template $template, int $lineNumber, string $lineContent, string $class, string $popover) : string
47374    {
47375        $template->setVar(['lineNumber' => $lineNumber, 'lineContent' => $lineContent, 'class' => $class, 'popover' => $popover]);
47376        return $template->render();
47377    }
47378    private function loadFile(string $file) : array
47379    {
47380        if (isset(self::$formattedSourceCache[$file])) {
47381            return self::$formattedSourceCache[$file];
47382        }
47383        $buffer = file_get_contents($file);
47384        $tokens = token_get_all($buffer);
47385        $result = [''];
47386        $i = 0;
47387        $stringFlag = \false;
47388        $fileEndsWithNewLine = substr($buffer, -1) === "\n";
47389        unset($buffer);
47390        foreach ($tokens as $j => $token) {
47391            if (is_string($token)) {
47392                if ($token === '"' && $tokens[$j - 1] !== '\\') {
47393                    $result[$i] .= sprintf('<span class="string">%s</span>', htmlspecialchars($token, $this->htmlSpecialCharsFlags));
47394                    $stringFlag = !$stringFlag;
47395                } else {
47396                    $result[$i] .= sprintf('<span class="keyword">%s</span>', htmlspecialchars($token, $this->htmlSpecialCharsFlags));
47397                }
47398                continue;
47399            }
47400            [$token, $value] = $token;
47401            $value = str_replace(["\t", ' '], ['&nbsp;&nbsp;&nbsp;&nbsp;', '&nbsp;'], htmlspecialchars($value, $this->htmlSpecialCharsFlags));
47402            if ($value === "\n") {
47403                $result[++$i] = '';
47404            } else {
47405                $lines = explode("\n", $value);
47406                foreach ($lines as $jj => $line) {
47407                    $line = trim($line);
47408                    if ($line !== '') {
47409                        if ($stringFlag) {
47410                            $colour = 'string';
47411                        } else {
47412                            $colour = 'default';
47413                            if ($this->isInlineHtml($token)) {
47414                                $colour = 'html';
47415                            } elseif ($this->isComment($token)) {
47416                                $colour = 'comment';
47417                            } elseif ($this->isKeyword($token)) {
47418                                $colour = 'keyword';
47419                            }
47420                        }
47421                        $result[$i] .= sprintf('<span class="%s">%s</span>', $colour, $line);
47422                    }
47423                    if (isset($lines[$jj + 1])) {
47424                        $result[++$i] = '';
47425                    }
47426                }
47427            }
47428        }
47429        if ($fileEndsWithNewLine) {
47430            unset($result[count($result) - 1]);
47431        }
47432        self::$formattedSourceCache[$file] = $result;
47433        return $result;
47434    }
47435    private function abbreviateClassName(string $className) : string
47436    {
47437        $tmp = explode('\\', $className);
47438        if (count($tmp) > 1) {
47439            $className = sprintf('<abbr title="%s">%s</abbr>', $className, array_pop($tmp));
47440        }
47441        return $className;
47442    }
47443    private function abbreviateMethodName(string $methodName) : string
47444    {
47445        $parts = explode('->', $methodName);
47446        if (count($parts) === 2) {
47447            return $this->abbreviateClassName($parts[0]) . '->' . $parts[1];
47448        }
47449        return $methodName;
47450    }
47451    private function createPopoverContentForTest(string $test, array $testData) : string
47452    {
47453        $testCSS = '';
47454        if ($testData['fromTestcase']) {
47455            switch ($testData['status']) {
47456                case BaseTestRunner::STATUS_PASSED:
47457                    switch ($testData['size']) {
47458                        case 'small':
47459                            $testCSS = ' class="covered-by-small-tests"';
47460                            break;
47461                        case 'medium':
47462                            $testCSS = ' class="covered-by-medium-tests"';
47463                            break;
47464                        default:
47465                            $testCSS = ' class="covered-by-large-tests"';
47466                            break;
47467                    }
47468                    break;
47469                case BaseTestRunner::STATUS_SKIPPED:
47470                case BaseTestRunner::STATUS_INCOMPLETE:
47471                case BaseTestRunner::STATUS_RISKY:
47472                case BaseTestRunner::STATUS_WARNING:
47473                    $testCSS = ' class="warning"';
47474                    break;
47475                case BaseTestRunner::STATUS_FAILURE:
47476                case BaseTestRunner::STATUS_ERROR:
47477                    $testCSS = ' class="danger"';
47478                    break;
47479            }
47480        }
47481        return sprintf('<li%s>%s</li>', $testCSS, htmlspecialchars($test, $this->htmlSpecialCharsFlags));
47482    }
47483    private function isComment(int $token) : bool
47484    {
47485        return $token === \T_COMMENT || $token === \T_DOC_COMMENT;
47486    }
47487    private function isInlineHtml(int $token) : bool
47488    {
47489        return $token === \T_INLINE_HTML;
47490    }
47491    private function isKeyword(int $token) : bool
47492    {
47493        return isset(self::keywordTokens()[$token]);
47494    }
47495    /**
47496     * @psalm-return array<int,true>
47497     */
47498    private static function keywordTokens() : array
47499    {
47500        if (self::$keywordTokens !== []) {
47501            return self::$keywordTokens;
47502        }
47503        self::$keywordTokens = [\T_ABSTRACT => \true, \T_ARRAY => \true, \T_AS => \true, \T_BREAK => \true, \T_CALLABLE => \true, \T_CASE => \true, \T_CATCH => \true, \T_CLASS => \true, \T_CLONE => \true, \T_CONST => \true, \T_CONTINUE => \true, \T_DECLARE => \true, \T_DEFAULT => \true, \T_DO => \true, \T_ECHO => \true, \T_ELSE => \true, \T_ELSEIF => \true, \T_EMPTY => \true, \T_ENDDECLARE => \true, \T_ENDFOR => \true, \T_ENDFOREACH => \true, \T_ENDIF => \true, \T_ENDSWITCH => \true, \T_ENDWHILE => \true, \T_EVAL => \true, \T_EXIT => \true, \T_EXTENDS => \true, \T_FINAL => \true, \T_FINALLY => \true, \T_FOR => \true, \T_FOREACH => \true, \T_FUNCTION => \true, \T_GLOBAL => \true, \T_GOTO => \true, \T_HALT_COMPILER => \true, \T_IF => \true, \T_IMPLEMENTS => \true, \T_INCLUDE => \true, \T_INCLUDE_ONCE => \true, \T_INSTANCEOF => \true, \T_INSTEADOF => \true, \T_INTERFACE => \true, \T_ISSET => \true, \T_LIST => \true, \T_NAMESPACE => \true, \T_NEW => \true, \T_PRINT => \true, \T_PRIVATE => \true, \T_PROTECTED => \true, \T_PUBLIC => \true, \T_REQUIRE => \true, \T_REQUIRE_ONCE => \true, \T_RETURN => \true, \T_STATIC => \true, \T_SWITCH => \true, \T_THROW => \true, \T_TRAIT => \true, \T_TRY => \true, \T_UNSET => \true, \T_USE => \true, \T_VAR => \true, \T_WHILE => \true, \T_YIELD => \true, \T_YIELD_FROM => \true];
47504        if (defined('T_FN')) {
47505            self::$keywordTokens[constant('T_FN')] = \true;
47506        }
47507        if (defined('T_MATCH')) {
47508            self::$keywordTokens[constant('T_MATCH')] = \true;
47509        }
47510        if (defined('T_ENUM')) {
47511            self::$keywordTokens[constant('T_ENUM')] = \true;
47512        }
47513        if (defined('T_READONLY')) {
47514            self::$keywordTokens[constant('T_READONLY')] = \true;
47515        }
47516        return self::$keywordTokens;
47517    }
47518}
47519<?php
47520
47521declare (strict_types=1);
47522/*
47523 * This file is part of phpunit/php-code-coverage.
47524 *
47525 * (c) Sebastian Bergmann <sebastian@phpunit.de>
47526 *
47527 * For the full copyright and license information, please view the LICENSE
47528 * file that was distributed with this source code.
47529 */
47530namespace PHPUnit\SebastianBergmann\CodeCoverage\Report\Html;
47531
47532use function array_values;
47533use function arsort;
47534use function asort;
47535use function count;
47536use function explode;
47537use function floor;
47538use function json_encode;
47539use function sprintf;
47540use function str_replace;
47541use PHPUnit\SebastianBergmann\CodeCoverage\Node\AbstractNode;
47542use PHPUnit\SebastianBergmann\CodeCoverage\Node\Directory as DirectoryNode;
47543use PHPUnit\SebastianBergmann\Template\Template;
47544/**
47545 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
47546 */
47547final class Dashboard extends Renderer
47548{
47549    public function render(DirectoryNode $node, string $file) : void
47550    {
47551        $classes = $node->classesAndTraits();
47552        $templateName = $this->templatePath . ($this->hasBranchCoverage ? 'dashboard_branch.html' : 'dashboard.html');
47553        $template = new Template($templateName, '{{', '}}');
47554        $this->setCommonTemplateVariables($template, $node);
47555        $baseLink = $node->id() . '/';
47556        $complexity = $this->complexity($classes, $baseLink);
47557        $coverageDistribution = $this->coverageDistribution($classes);
47558        $insufficientCoverage = $this->insufficientCoverage($classes, $baseLink);
47559        $projectRisks = $this->projectRisks($classes, $baseLink);
47560        $template->setVar(['insufficient_coverage_classes' => $insufficientCoverage['class'], 'insufficient_coverage_methods' => $insufficientCoverage['method'], 'project_risks_classes' => $projectRisks['class'], 'project_risks_methods' => $projectRisks['method'], 'complexity_class' => $complexity['class'], 'complexity_method' => $complexity['method'], 'class_coverage_distribution' => $coverageDistribution['class'], 'method_coverage_distribution' => $coverageDistribution['method']]);
47561        $template->renderTo($file);
47562    }
47563    protected function activeBreadcrumb(AbstractNode $node) : string
47564    {
47565        return sprintf('         <li class="breadcrumb-item"><a href="index.html">%s</a></li>' . "\n" . '         <li class="breadcrumb-item active">(Dashboard)</li>' . "\n", $node->name());
47566    }
47567    /**
47568     * Returns the data for the Class/Method Complexity charts.
47569     */
47570    private function complexity(array $classes, string $baseLink) : array
47571    {
47572        $result = ['class' => [], 'method' => []];
47573        foreach ($classes as $className => $class) {
47574            foreach ($class['methods'] as $methodName => $method) {
47575                if ($className !== '*') {
47576                    $methodName = $className . '::' . $methodName;
47577                }
47578                $result['method'][] = [$method['coverage'], $method['ccn'], sprintf('<a href="%s">%s</a>', str_replace($baseLink, '', $method['link']), $methodName)];
47579            }
47580            $result['class'][] = [$class['coverage'], $class['ccn'], sprintf('<a href="%s">%s</a>', str_replace($baseLink, '', $class['link']), $className)];
47581        }
47582        return ['class' => json_encode($result['class']), 'method' => json_encode($result['method'])];
47583    }
47584    /**
47585     * Returns the data for the Class / Method Coverage Distribution chart.
47586     */
47587    private function coverageDistribution(array $classes) : array
47588    {
47589        $result = ['class' => ['0%' => 0, '0-10%' => 0, '10-20%' => 0, '20-30%' => 0, '30-40%' => 0, '40-50%' => 0, '50-60%' => 0, '60-70%' => 0, '70-80%' => 0, '80-90%' => 0, '90-100%' => 0, '100%' => 0], 'method' => ['0%' => 0, '0-10%' => 0, '10-20%' => 0, '20-30%' => 0, '30-40%' => 0, '40-50%' => 0, '50-60%' => 0, '60-70%' => 0, '70-80%' => 0, '80-90%' => 0, '90-100%' => 0, '100%' => 0]];
47590        foreach ($classes as $class) {
47591            foreach ($class['methods'] as $methodName => $method) {
47592                if ($method['coverage'] === 0) {
47593                    $result['method']['0%']++;
47594                } elseif ($method['coverage'] === 100) {
47595                    $result['method']['100%']++;
47596                } else {
47597                    $key = floor($method['coverage'] / 10) * 10;
47598                    $key = $key . '-' . ($key + 10) . '%';
47599                    $result['method'][$key]++;
47600                }
47601            }
47602            if ($class['coverage'] === 0) {
47603                $result['class']['0%']++;
47604            } elseif ($class['coverage'] === 100) {
47605                $result['class']['100%']++;
47606            } else {
47607                $key = floor($class['coverage'] / 10) * 10;
47608                $key = $key . '-' . ($key + 10) . '%';
47609                $result['class'][$key]++;
47610            }
47611        }
47612        return ['class' => json_encode(array_values($result['class'])), 'method' => json_encode(array_values($result['method']))];
47613    }
47614    /**
47615     * Returns the classes / methods with insufficient coverage.
47616     */
47617    private function insufficientCoverage(array $classes, string $baseLink) : array
47618    {
47619        $leastTestedClasses = [];
47620        $leastTestedMethods = [];
47621        $result = ['class' => '', 'method' => ''];
47622        foreach ($classes as $className => $class) {
47623            foreach ($class['methods'] as $methodName => $method) {
47624                if ($method['coverage'] < $this->highLowerBound) {
47625                    $key = $methodName;
47626                    if ($className !== '*') {
47627                        $key = $className . '::' . $methodName;
47628                    }
47629                    $leastTestedMethods[$key] = $method['coverage'];
47630                }
47631            }
47632            if ($class['coverage'] < $this->highLowerBound) {
47633                $leastTestedClasses[$className] = $class['coverage'];
47634            }
47635        }
47636        asort($leastTestedClasses);
47637        asort($leastTestedMethods);
47638        foreach ($leastTestedClasses as $className => $coverage) {
47639            $result['class'] .= sprintf('       <tr><td><a href="%s">%s</a></td><td class="text-right">%d%%</td></tr>' . "\n", str_replace($baseLink, '', $classes[$className]['link']), $className, $coverage);
47640        }
47641        foreach ($leastTestedMethods as $methodName => $coverage) {
47642            [$class, $method] = explode('::', $methodName);
47643            $result['method'] .= sprintf('       <tr><td><a href="%s"><abbr title="%s">%s</abbr></a></td><td class="text-right">%d%%</td></tr>' . "\n", str_replace($baseLink, '', $classes[$class]['methods'][$method]['link']), $methodName, $method, $coverage);
47644        }
47645        return $result;
47646    }
47647    /**
47648     * Returns the project risks according to the CRAP index.
47649     */
47650    private function projectRisks(array $classes, string $baseLink) : array
47651    {
47652        $classRisks = [];
47653        $methodRisks = [];
47654        $result = ['class' => '', 'method' => ''];
47655        foreach ($classes as $className => $class) {
47656            foreach ($class['methods'] as $methodName => $method) {
47657                if ($method['coverage'] < $this->highLowerBound && $method['ccn'] > 1) {
47658                    $key = $methodName;
47659                    if ($className !== '*') {
47660                        $key = $className . '::' . $methodName;
47661                    }
47662                    $methodRisks[$key] = $method['crap'];
47663                }
47664            }
47665            if ($class['coverage'] < $this->highLowerBound && $class['ccn'] > count($class['methods'])) {
47666                $classRisks[$className] = $class['crap'];
47667            }
47668        }
47669        arsort($classRisks);
47670        arsort($methodRisks);
47671        foreach ($classRisks as $className => $crap) {
47672            $result['class'] .= sprintf('       <tr><td><a href="%s">%s</a></td><td class="text-right">%d</td></tr>' . "\n", str_replace($baseLink, '', $classes[$className]['link']), $className, $crap);
47673        }
47674        foreach ($methodRisks as $methodName => $crap) {
47675            [$class, $method] = explode('::', $methodName);
47676            $result['method'] .= sprintf('       <tr><td><a href="%s"><abbr title="%s">%s</abbr></a></td><td class="text-right">%d</td></tr>' . "\n", str_replace($baseLink, '', $classes[$class]['methods'][$method]['link']), $methodName, $method, $crap);
47677        }
47678        return $result;
47679    }
47680}
47681<?php
47682
47683declare (strict_types=1);
47684/*
47685 * This file is part of phpunit/php-code-coverage.
47686 *
47687 * (c) Sebastian Bergmann <sebastian@phpunit.de>
47688 *
47689 * For the full copyright and license information, please view the LICENSE
47690 * file that was distributed with this source code.
47691 */
47692namespace PHPUnit\SebastianBergmann\CodeCoverage\Report\Html;
47693
47694use function count;
47695use function sprintf;
47696use function str_repeat;
47697use PHPUnit\SebastianBergmann\CodeCoverage\Node\AbstractNode as Node;
47698use PHPUnit\SebastianBergmann\CodeCoverage\Node\Directory as DirectoryNode;
47699use PHPUnit\SebastianBergmann\Template\Template;
47700/**
47701 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
47702 */
47703final class Directory extends Renderer
47704{
47705    public function render(DirectoryNode $node, string $file) : void
47706    {
47707        $templateName = $this->templatePath . ($this->hasBranchCoverage ? 'directory_branch.html' : 'directory.html');
47708        $template = new Template($templateName, '{{', '}}');
47709        $this->setCommonTemplateVariables($template, $node);
47710        $items = $this->renderItem($node, \true);
47711        foreach ($node->directories() as $item) {
47712            $items .= $this->renderItem($item);
47713        }
47714        foreach ($node->files() as $item) {
47715            $items .= $this->renderItem($item);
47716        }
47717        $template->setVar(['id' => $node->id(), 'items' => $items]);
47718        $template->renderTo($file);
47719    }
47720    private function renderItem(Node $node, bool $total = \false) : string
47721    {
47722        $data = ['numClasses' => $node->numberOfClassesAndTraits(), 'numTestedClasses' => $node->numberOfTestedClassesAndTraits(), 'numMethods' => $node->numberOfFunctionsAndMethods(), 'numTestedMethods' => $node->numberOfTestedFunctionsAndMethods(), 'linesExecutedPercent' => $node->percentageOfExecutedLines()->asFloat(), 'linesExecutedPercentAsString' => $node->percentageOfExecutedLines()->asString(), 'numExecutedLines' => $node->numberOfExecutedLines(), 'numExecutableLines' => $node->numberOfExecutableLines(), 'branchesExecutedPercent' => $node->percentageOfExecutedBranches()->asFloat(), 'branchesExecutedPercentAsString' => $node->percentageOfExecutedBranches()->asString(), 'numExecutedBranches' => $node->numberOfExecutedBranches(), 'numExecutableBranches' => $node->numberOfExecutableBranches(), 'pathsExecutedPercent' => $node->percentageOfExecutedPaths()->asFloat(), 'pathsExecutedPercentAsString' => $node->percentageOfExecutedPaths()->asString(), 'numExecutedPaths' => $node->numberOfExecutedPaths(), 'numExecutablePaths' => $node->numberOfExecutablePaths(), 'testedMethodsPercent' => $node->percentageOfTestedFunctionsAndMethods()->asFloat(), 'testedMethodsPercentAsString' => $node->percentageOfTestedFunctionsAndMethods()->asString(), 'testedClassesPercent' => $node->percentageOfTestedClassesAndTraits()->asFloat(), 'testedClassesPercentAsString' => $node->percentageOfTestedClassesAndTraits()->asString()];
47723        if ($total) {
47724            $data['name'] = 'Total';
47725        } else {
47726            $up = str_repeat('../', count($node->pathAsArray()) - 2);
47727            $data['icon'] = sprintf('<img src="%s_icons/file-code.svg" class="octicon" />', $up);
47728            if ($node instanceof DirectoryNode) {
47729                $data['name'] = sprintf('<a href="%s/index.html">%s</a>', $node->name(), $node->name());
47730                $data['icon'] = sprintf('<img src="%s_icons/file-directory.svg" class="octicon" />', $up);
47731            } elseif ($this->hasBranchCoverage) {
47732                $data['name'] = sprintf('%s <a class="small" href="%s.html">[line]</a> <a class="small" href="%s_branch.html">[branch]</a> <a class="small" href="%s_path.html">[path]</a>', $node->name(), $node->name(), $node->name(), $node->name());
47733            } else {
47734                $data['name'] = sprintf('<a href="%s.html">%s</a>', $node->name(), $node->name());
47735            }
47736        }
47737        $templateName = $this->templatePath . ($this->hasBranchCoverage ? 'directory_item_branch.html' : 'directory_item.html');
47738        return $this->renderItemTemplate(new Template($templateName, '{{', '}}'), $data);
47739    }
47740}
47741<?php
47742
47743declare (strict_types=1);
47744/*
47745 * This file is part of phpunit/php-code-coverage.
47746 *
47747 * (c) Sebastian Bergmann <sebastian@phpunit.de>
47748 *
47749 * For the full copyright and license information, please view the LICENSE
47750 * file that was distributed with this source code.
47751 */
47752namespace PHPUnit\SebastianBergmann\CodeCoverage\Report;
47753
47754use function dirname;
47755use function file_put_contents;
47756use function serialize;
47757use function sprintf;
47758use PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage;
47759use PHPUnit\SebastianBergmann\CodeCoverage\Directory;
47760use PHPUnit\SebastianBergmann\CodeCoverage\Driver\WriteOperationFailedException;
47761final class PHP
47762{
47763    public function process(CodeCoverage $coverage, ?string $target = null) : string
47764    {
47765        $buffer = sprintf("<?php\nreturn \\unserialize(<<<'END_OF_COVERAGE_SERIALIZATION'%s%s%sEND_OF_COVERAGE_SERIALIZATION%s);", \PHP_EOL, serialize($coverage), \PHP_EOL, \PHP_EOL);
47766        if ($target !== null) {
47767            Directory::create(dirname($target));
47768            if (@file_put_contents($target, $buffer) === \false) {
47769                throw new WriteOperationFailedException($target);
47770            }
47771        }
47772        return $buffer;
47773    }
47774}
47775<?php
47776
47777declare (strict_types=1);
47778/*
47779 * This file is part of phpunit/php-code-coverage.
47780 *
47781 * (c) Sebastian Bergmann <sebastian@phpunit.de>
47782 *
47783 * For the full copyright and license information, please view the LICENSE
47784 * file that was distributed with this source code.
47785 */
47786namespace PHPUnit\SebastianBergmann\CodeCoverage\Report\Xml;
47787
47788use function constant;
47789use function phpversion;
47790use DateTimeImmutable;
47791use DOMElement;
47792use PHPUnit\SebastianBergmann\Environment\Runtime;
47793/**
47794 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
47795 */
47796final class BuildInformation
47797{
47798    /**
47799     * @var DOMElement
47800     */
47801    private $contextNode;
47802    public function __construct(DOMElement $contextNode)
47803    {
47804        $this->contextNode = $contextNode;
47805    }
47806    public function setRuntimeInformation(Runtime $runtime) : void
47807    {
47808        $runtimeNode = $this->nodeByName('runtime');
47809        $runtimeNode->setAttribute('name', $runtime->getName());
47810        $runtimeNode->setAttribute('version', $runtime->getVersion());
47811        $runtimeNode->setAttribute('url', $runtime->getVendorUrl());
47812        $driverNode = $this->nodeByName('driver');
47813        if ($runtime->hasPHPDBGCodeCoverage()) {
47814            $driverNode->setAttribute('name', 'phpdbg');
47815            $driverNode->setAttribute('version', constant('PHPDBG_VERSION'));
47816        }
47817        if ($runtime->hasXdebug()) {
47818            $driverNode->setAttribute('name', 'xdebug');
47819            $driverNode->setAttribute('version', phpversion('xdebug'));
47820        }
47821        if ($runtime->hasPCOV()) {
47822            $driverNode->setAttribute('name', 'pcov');
47823            $driverNode->setAttribute('version', phpversion('pcov'));
47824        }
47825    }
47826    public function setBuildTime(DateTimeImmutable $date) : void
47827    {
47828        $this->contextNode->setAttribute('time', $date->format('D M j G:i:s T Y'));
47829    }
47830    public function setGeneratorVersions(string $phpUnitVersion, string $coverageVersion) : void
47831    {
47832        $this->contextNode->setAttribute('phpunit', $phpUnitVersion);
47833        $this->contextNode->setAttribute('coverage', $coverageVersion);
47834    }
47835    private function nodeByName(string $name) : DOMElement
47836    {
47837        $node = $this->contextNode->getElementsByTagNameNS('https://schema.phpunit.de/coverage/1.0', $name)->item(0);
47838        if (!$node) {
47839            $node = $this->contextNode->appendChild($this->contextNode->ownerDocument->createElementNS('https://schema.phpunit.de/coverage/1.0', $name));
47840        }
47841        return $node;
47842    }
47843}
47844<?php
47845
47846declare (strict_types=1);
47847/*
47848 * This file is part of phpunit/php-code-coverage.
47849 *
47850 * (c) Sebastian Bergmann <sebastian@phpunit.de>
47851 *
47852 * For the full copyright and license information, please view the LICENSE
47853 * file that was distributed with this source code.
47854 */
47855namespace PHPUnit\SebastianBergmann\CodeCoverage\Report\Xml;
47856
47857use DOMElement;
47858use PHPUnit\TheSeer\Tokenizer\NamespaceUri;
47859use PHPUnit\TheSeer\Tokenizer\Tokenizer;
47860use PHPUnit\TheSeer\Tokenizer\XMLSerializer;
47861/**
47862 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
47863 */
47864final class Source
47865{
47866    /** @var DOMElement */
47867    private $context;
47868    public function __construct(DOMElement $context)
47869    {
47870        $this->context = $context;
47871    }
47872    public function setSourceCode(string $source) : void
47873    {
47874        $context = $this->context;
47875        $tokens = (new Tokenizer())->parse($source);
47876        $srcDom = (new XMLSerializer(new NamespaceUri($context->namespaceURI)))->toDom($tokens);
47877        $context->parentNode->replaceChild($context->ownerDocument->importNode($srcDom->documentElement, \true), $context);
47878    }
47879}
47880<?php
47881
47882declare (strict_types=1);
47883/*
47884 * This file is part of phpunit/php-code-coverage.
47885 *
47886 * (c) Sebastian Bergmann <sebastian@phpunit.de>
47887 *
47888 * For the full copyright and license information, please view the LICENSE
47889 * file that was distributed with this source code.
47890 */
47891namespace PHPUnit\SebastianBergmann\CodeCoverage\Report\Xml;
47892
47893use const DIRECTORY_SEPARATOR;
47894use const PHP_EOL;
47895use function count;
47896use function dirname;
47897use function file_get_contents;
47898use function file_put_contents;
47899use function is_array;
47900use function is_dir;
47901use function is_file;
47902use function is_writable;
47903use function libxml_clear_errors;
47904use function libxml_get_errors;
47905use function libxml_use_internal_errors;
47906use function sprintf;
47907use function strlen;
47908use function substr;
47909use DateTimeImmutable;
47910use DOMDocument;
47911use PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage;
47912use PHPUnit\SebastianBergmann\CodeCoverage\Directory as DirectoryUtil;
47913use PHPUnit\SebastianBergmann\CodeCoverage\Driver\PathExistsButIsNotDirectoryException;
47914use PHPUnit\SebastianBergmann\CodeCoverage\Driver\WriteOperationFailedException;
47915use PHPUnit\SebastianBergmann\CodeCoverage\Node\AbstractNode;
47916use PHPUnit\SebastianBergmann\CodeCoverage\Node\Directory as DirectoryNode;
47917use PHPUnit\SebastianBergmann\CodeCoverage\Node\File as FileNode;
47918use PHPUnit\SebastianBergmann\CodeCoverage\Version;
47919use PHPUnit\SebastianBergmann\CodeCoverage\XmlException;
47920use PHPUnit\SebastianBergmann\Environment\Runtime;
47921final class Facade
47922{
47923    /**
47924     * @var string
47925     */
47926    private $target;
47927    /**
47928     * @var Project
47929     */
47930    private $project;
47931    /**
47932     * @var string
47933     */
47934    private $phpUnitVersion;
47935    public function __construct(string $version)
47936    {
47937        $this->phpUnitVersion = $version;
47938    }
47939    /**
47940     * @throws XmlException
47941     */
47942    public function process(CodeCoverage $coverage, string $target) : void
47943    {
47944        if (substr($target, -1, 1) !== \DIRECTORY_SEPARATOR) {
47945            $target .= \DIRECTORY_SEPARATOR;
47946        }
47947        $this->target = $target;
47948        $this->initTargetDirectory($target);
47949        $report = $coverage->getReport();
47950        $this->project = new Project($coverage->getReport()->name());
47951        $this->setBuildInformation();
47952        $this->processTests($coverage->getTests());
47953        $this->processDirectory($report, $this->project);
47954        $this->saveDocument($this->project->asDom(), 'index');
47955    }
47956    private function setBuildInformation() : void
47957    {
47958        $buildNode = $this->project->buildInformation();
47959        $buildNode->setRuntimeInformation(new Runtime());
47960        $buildNode->setBuildTime(new DateTimeImmutable());
47961        $buildNode->setGeneratorVersions($this->phpUnitVersion, Version::id());
47962    }
47963    /**
47964     * @throws PathExistsButIsNotDirectoryException
47965     * @throws WriteOperationFailedException
47966     */
47967    private function initTargetDirectory(string $directory) : void
47968    {
47969        if (is_file($directory)) {
47970            if (!is_dir($directory)) {
47971                throw new PathExistsButIsNotDirectoryException($directory);
47972            }
47973            if (!is_writable($directory)) {
47974                throw new WriteOperationFailedException($directory);
47975            }
47976        }
47977        DirectoryUtil::create($directory);
47978    }
47979    /**
47980     * @throws XmlException
47981     */
47982    private function processDirectory(DirectoryNode $directory, Node $context) : void
47983    {
47984        $directoryName = $directory->name();
47985        if ($this->project->projectSourceDirectory() === $directoryName) {
47986            $directoryName = '/';
47987        }
47988        $directoryObject = $context->addDirectory($directoryName);
47989        $this->setTotals($directory, $directoryObject->totals());
47990        foreach ($directory->directories() as $node) {
47991            $this->processDirectory($node, $directoryObject);
47992        }
47993        foreach ($directory->files() as $node) {
47994            $this->processFile($node, $directoryObject);
47995        }
47996    }
47997    /**
47998     * @throws XmlException
47999     */
48000    private function processFile(FileNode $file, Directory $context) : void
48001    {
48002        $fileObject = $context->addFile($file->name(), $file->id() . '.xml');
48003        $this->setTotals($file, $fileObject->totals());
48004        $path = substr($file->pathAsString(), strlen($this->project->projectSourceDirectory()));
48005        $fileReport = new Report($path);
48006        $this->setTotals($file, $fileReport->totals());
48007        foreach ($file->classesAndTraits() as $unit) {
48008            $this->processUnit($unit, $fileReport);
48009        }
48010        foreach ($file->functions() as $function) {
48011            $this->processFunction($function, $fileReport);
48012        }
48013        foreach ($file->lineCoverageData() as $line => $tests) {
48014            if (!is_array($tests) || count($tests) === 0) {
48015                continue;
48016            }
48017            $coverage = $fileReport->lineCoverage((string) $line);
48018            foreach ($tests as $test) {
48019                $coverage->addTest($test);
48020            }
48021            $coverage->finalize();
48022        }
48023        $fileReport->source()->setSourceCode(file_get_contents($file->pathAsString()));
48024        $this->saveDocument($fileReport->asDom(), $file->id());
48025    }
48026    private function processUnit(array $unit, Report $report) : void
48027    {
48028        if (isset($unit['className'])) {
48029            $unitObject = $report->classObject($unit['className']);
48030        } else {
48031            $unitObject = $report->traitObject($unit['traitName']);
48032        }
48033        $unitObject->setLines($unit['startLine'], $unit['executableLines'], $unit['executedLines']);
48034        $unitObject->setCrap((float) $unit['crap']);
48035        $unitObject->setNamespace($unit['namespace']);
48036        foreach ($unit['methods'] as $method) {
48037            $methodObject = $unitObject->addMethod($method['methodName']);
48038            $methodObject->setSignature($method['signature']);
48039            $methodObject->setLines((string) $method['startLine'], (string) $method['endLine']);
48040            $methodObject->setCrap($method['crap']);
48041            $methodObject->setTotals((string) $method['executableLines'], (string) $method['executedLines'], (string) $method['coverage']);
48042        }
48043    }
48044    private function processFunction(array $function, Report $report) : void
48045    {
48046        $functionObject = $report->functionObject($function['functionName']);
48047        $functionObject->setSignature($function['signature']);
48048        $functionObject->setLines((string) $function['startLine']);
48049        $functionObject->setCrap($function['crap']);
48050        $functionObject->setTotals((string) $function['executableLines'], (string) $function['executedLines'], (string) $function['coverage']);
48051    }
48052    private function processTests(array $tests) : void
48053    {
48054        $testsObject = $this->project->tests();
48055        foreach ($tests as $test => $result) {
48056            $testsObject->addTest($test, $result);
48057        }
48058    }
48059    private function setTotals(AbstractNode $node, Totals $totals) : void
48060    {
48061        $loc = $node->linesOfCode();
48062        $totals->setNumLines($loc->linesOfCode(), $loc->commentLinesOfCode(), $loc->nonCommentLinesOfCode(), $node->numberOfExecutableLines(), $node->numberOfExecutedLines());
48063        $totals->setNumClasses($node->numberOfClasses(), $node->numberOfTestedClasses());
48064        $totals->setNumTraits($node->numberOfTraits(), $node->numberOfTestedTraits());
48065        $totals->setNumMethods($node->numberOfMethods(), $node->numberOfTestedMethods());
48066        $totals->setNumFunctions($node->numberOfFunctions(), $node->numberOfTestedFunctions());
48067    }
48068    private function targetDirectory() : string
48069    {
48070        return $this->target;
48071    }
48072    /**
48073     * @throws XmlException
48074     */
48075    private function saveDocument(DOMDocument $document, string $name) : void
48076    {
48077        $filename = sprintf('%s/%s.xml', $this->targetDirectory(), $name);
48078        $document->formatOutput = \true;
48079        $document->preserveWhiteSpace = \false;
48080        $this->initTargetDirectory(dirname($filename));
48081        file_put_contents($filename, $this->documentAsString($document));
48082    }
48083    /**
48084     * @throws XmlException
48085     *
48086     * @see https://bugs.php.net/bug.php?id=79191
48087     */
48088    private function documentAsString(DOMDocument $document) : string
48089    {
48090        $xmlErrorHandling = libxml_use_internal_errors(\true);
48091        $xml = $document->saveXML();
48092        if ($xml === \false) {
48093            $message = 'Unable to generate the XML';
48094            foreach (libxml_get_errors() as $error) {
48095                $message .= \PHP_EOL . $error->message;
48096            }
48097            throw new XmlException($message);
48098        }
48099        libxml_clear_errors();
48100        libxml_use_internal_errors($xmlErrorHandling);
48101        return $xml;
48102    }
48103}
48104<?php
48105
48106declare (strict_types=1);
48107/*
48108 * This file is part of phpunit/php-code-coverage.
48109 *
48110 * (c) Sebastian Bergmann <sebastian@phpunit.de>
48111 *
48112 * For the full copyright and license information, please view the LICENSE
48113 * file that was distributed with this source code.
48114 */
48115namespace PHPUnit\SebastianBergmann\CodeCoverage\Report\Xml;
48116
48117use DOMElement;
48118/**
48119 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
48120 */
48121final class Method
48122{
48123    /**
48124     * @var DOMElement
48125     */
48126    private $contextNode;
48127    public function __construct(DOMElement $context, string $name)
48128    {
48129        $this->contextNode = $context;
48130        $this->setName($name);
48131    }
48132    public function setSignature(string $signature) : void
48133    {
48134        $this->contextNode->setAttribute('signature', $signature);
48135    }
48136    public function setLines(string $start, ?string $end = null) : void
48137    {
48138        $this->contextNode->setAttribute('start', $start);
48139        if ($end !== null) {
48140            $this->contextNode->setAttribute('end', $end);
48141        }
48142    }
48143    public function setTotals(string $executable, string $executed, string $coverage) : void
48144    {
48145        $this->contextNode->setAttribute('executable', $executable);
48146        $this->contextNode->setAttribute('executed', $executed);
48147        $this->contextNode->setAttribute('coverage', $coverage);
48148    }
48149    public function setCrap(string $crap) : void
48150    {
48151        $this->contextNode->setAttribute('crap', $crap);
48152    }
48153    private function setName(string $name) : void
48154    {
48155        $this->contextNode->setAttribute('name', $name);
48156    }
48157}
48158<?php
48159
48160declare (strict_types=1);
48161/*
48162 * This file is part of phpunit/php-code-coverage.
48163 *
48164 * (c) Sebastian Bergmann <sebastian@phpunit.de>
48165 *
48166 * For the full copyright and license information, please view the LICENSE
48167 * file that was distributed with this source code.
48168 */
48169namespace PHPUnit\SebastianBergmann\CodeCoverage\Report\Xml;
48170
48171use function basename;
48172use function dirname;
48173use DOMDocument;
48174/**
48175 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
48176 */
48177final class Report extends File
48178{
48179    public function __construct(string $name)
48180    {
48181        $dom = new DOMDocument();
48182        $dom->loadXML('<?xml version="1.0" ?><phpunit xmlns="https://schema.phpunit.de/coverage/1.0"><file /></phpunit>');
48183        $contextNode = $dom->getElementsByTagNameNS('https://schema.phpunit.de/coverage/1.0', 'file')->item(0);
48184        parent::__construct($contextNode);
48185        $this->setName($name);
48186    }
48187    public function asDom() : DOMDocument
48188    {
48189        return $this->dom();
48190    }
48191    public function functionObject($name) : Method
48192    {
48193        $node = $this->contextNode()->appendChild($this->dom()->createElementNS('https://schema.phpunit.de/coverage/1.0', 'function'));
48194        return new Method($node, $name);
48195    }
48196    public function classObject($name) : Unit
48197    {
48198        return $this->unitObject('class', $name);
48199    }
48200    public function traitObject($name) : Unit
48201    {
48202        return $this->unitObject('trait', $name);
48203    }
48204    public function source() : Source
48205    {
48206        $source = $this->contextNode()->getElementsByTagNameNS('https://schema.phpunit.de/coverage/1.0', 'source')->item(0);
48207        if (!$source) {
48208            $source = $this->contextNode()->appendChild($this->dom()->createElementNS('https://schema.phpunit.de/coverage/1.0', 'source'));
48209        }
48210        return new Source($source);
48211    }
48212    private function setName(string $name) : void
48213    {
48214        $this->contextNode()->setAttribute('name', basename($name));
48215        $this->contextNode()->setAttribute('path', dirname($name));
48216    }
48217    private function unitObject(string $tagName, $name) : Unit
48218    {
48219        $node = $this->contextNode()->appendChild($this->dom()->createElementNS('https://schema.phpunit.de/coverage/1.0', $tagName));
48220        return new Unit($node, $name);
48221    }
48222}
48223<?php
48224
48225declare (strict_types=1);
48226/*
48227 * This file is part of phpunit/php-code-coverage.
48228 *
48229 * (c) Sebastian Bergmann <sebastian@phpunit.de>
48230 *
48231 * For the full copyright and license information, please view the LICENSE
48232 * file that was distributed with this source code.
48233 */
48234namespace PHPUnit\SebastianBergmann\CodeCoverage\Report\Xml;
48235
48236use DOMDocument;
48237use DOMElement;
48238/**
48239 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
48240 */
48241class File
48242{
48243    /**
48244     * @var DOMDocument
48245     */
48246    private $dom;
48247    /**
48248     * @var DOMElement
48249     */
48250    private $contextNode;
48251    public function __construct(DOMElement $context)
48252    {
48253        $this->dom = $context->ownerDocument;
48254        $this->contextNode = $context;
48255    }
48256    public function totals() : Totals
48257    {
48258        $totalsContainer = $this->contextNode->firstChild;
48259        if (!$totalsContainer) {
48260            $totalsContainer = $this->contextNode->appendChild($this->dom->createElementNS('https://schema.phpunit.de/coverage/1.0', 'totals'));
48261        }
48262        return new Totals($totalsContainer);
48263    }
48264    public function lineCoverage(string $line) : Coverage
48265    {
48266        $coverage = $this->contextNode->getElementsByTagNameNS('https://schema.phpunit.de/coverage/1.0', 'coverage')->item(0);
48267        if (!$coverage) {
48268            $coverage = $this->contextNode->appendChild($this->dom->createElementNS('https://schema.phpunit.de/coverage/1.0', 'coverage'));
48269        }
48270        $lineNode = $coverage->appendChild($this->dom->createElementNS('https://schema.phpunit.de/coverage/1.0', 'line'));
48271        return new Coverage($lineNode, $line);
48272    }
48273    protected function contextNode() : DOMElement
48274    {
48275        return $this->contextNode;
48276    }
48277    protected function dom() : DOMDocument
48278    {
48279        return $this->dom;
48280    }
48281}
48282<?php
48283
48284declare (strict_types=1);
48285/*
48286 * This file is part of phpunit/php-code-coverage.
48287 *
48288 * (c) Sebastian Bergmann <sebastian@phpunit.de>
48289 *
48290 * For the full copyright and license information, please view the LICENSE
48291 * file that was distributed with this source code.
48292 */
48293namespace PHPUnit\SebastianBergmann\CodeCoverage\Report\Xml;
48294
48295use function sprintf;
48296use DOMElement;
48297use DOMNode;
48298use PHPUnit\SebastianBergmann\CodeCoverage\Percentage;
48299/**
48300 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
48301 */
48302final class Totals
48303{
48304    /**
48305     * @var DOMNode
48306     */
48307    private $container;
48308    /**
48309     * @var DOMElement
48310     */
48311    private $linesNode;
48312    /**
48313     * @var DOMElement
48314     */
48315    private $methodsNode;
48316    /**
48317     * @var DOMElement
48318     */
48319    private $functionsNode;
48320    /**
48321     * @var DOMElement
48322     */
48323    private $classesNode;
48324    /**
48325     * @var DOMElement
48326     */
48327    private $traitsNode;
48328    public function __construct(DOMElement $container)
48329    {
48330        $this->container = $container;
48331        $dom = $container->ownerDocument;
48332        $this->linesNode = $dom->createElementNS('https://schema.phpunit.de/coverage/1.0', 'lines');
48333        $this->methodsNode = $dom->createElementNS('https://schema.phpunit.de/coverage/1.0', 'methods');
48334        $this->functionsNode = $dom->createElementNS('https://schema.phpunit.de/coverage/1.0', 'functions');
48335        $this->classesNode = $dom->createElementNS('https://schema.phpunit.de/coverage/1.0', 'classes');
48336        $this->traitsNode = $dom->createElementNS('https://schema.phpunit.de/coverage/1.0', 'traits');
48337        $container->appendChild($this->linesNode);
48338        $container->appendChild($this->methodsNode);
48339        $container->appendChild($this->functionsNode);
48340        $container->appendChild($this->classesNode);
48341        $container->appendChild($this->traitsNode);
48342    }
48343    public function container() : DOMNode
48344    {
48345        return $this->container;
48346    }
48347    public function setNumLines(int $loc, int $cloc, int $ncloc, int $executable, int $executed) : void
48348    {
48349        $this->linesNode->setAttribute('total', (string) $loc);
48350        $this->linesNode->setAttribute('comments', (string) $cloc);
48351        $this->linesNode->setAttribute('code', (string) $ncloc);
48352        $this->linesNode->setAttribute('executable', (string) $executable);
48353        $this->linesNode->setAttribute('executed', (string) $executed);
48354        $this->linesNode->setAttribute('percent', $executable === 0 ? '0' : sprintf('%01.2F', Percentage::fromFractionAndTotal($executed, $executable)->asFloat()));
48355    }
48356    public function setNumClasses(int $count, int $tested) : void
48357    {
48358        $this->classesNode->setAttribute('count', (string) $count);
48359        $this->classesNode->setAttribute('tested', (string) $tested);
48360        $this->classesNode->setAttribute('percent', $count === 0 ? '0' : sprintf('%01.2F', Percentage::fromFractionAndTotal($tested, $count)->asFloat()));
48361    }
48362    public function setNumTraits(int $count, int $tested) : void
48363    {
48364        $this->traitsNode->setAttribute('count', (string) $count);
48365        $this->traitsNode->setAttribute('tested', (string) $tested);
48366        $this->traitsNode->setAttribute('percent', $count === 0 ? '0' : sprintf('%01.2F', Percentage::fromFractionAndTotal($tested, $count)->asFloat()));
48367    }
48368    public function setNumMethods(int $count, int $tested) : void
48369    {
48370        $this->methodsNode->setAttribute('count', (string) $count);
48371        $this->methodsNode->setAttribute('tested', (string) $tested);
48372        $this->methodsNode->setAttribute('percent', $count === 0 ? '0' : sprintf('%01.2F', Percentage::fromFractionAndTotal($tested, $count)->asFloat()));
48373    }
48374    public function setNumFunctions(int $count, int $tested) : void
48375    {
48376        $this->functionsNode->setAttribute('count', (string) $count);
48377        $this->functionsNode->setAttribute('tested', (string) $tested);
48378        $this->functionsNode->setAttribute('percent', $count === 0 ? '0' : sprintf('%01.2F', Percentage::fromFractionAndTotal($tested, $count)->asFloat()));
48379    }
48380}
48381<?php
48382
48383declare (strict_types=1);
48384/*
48385 * This file is part of phpunit/php-code-coverage.
48386 *
48387 * (c) Sebastian Bergmann <sebastian@phpunit.de>
48388 *
48389 * For the full copyright and license information, please view the LICENSE
48390 * file that was distributed with this source code.
48391 */
48392namespace PHPUnit\SebastianBergmann\CodeCoverage\Report\Xml;
48393
48394use DOMElement;
48395/**
48396 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
48397 */
48398final class Tests
48399{
48400    private $contextNode;
48401    private $codeMap = [
48402        -1 => 'UNKNOWN',
48403        // PHPUnit_Runner_BaseTestRunner::STATUS_UNKNOWN
48404        0 => 'PASSED',
48405        // PHPUnit_Runner_BaseTestRunner::STATUS_PASSED
48406        1 => 'SKIPPED',
48407        // PHPUnit_Runner_BaseTestRunner::STATUS_SKIPPED
48408        2 => 'INCOMPLETE',
48409        // PHPUnit_Runner_BaseTestRunner::STATUS_INCOMPLETE
48410        3 => 'FAILURE',
48411        // PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE
48412        4 => 'ERROR',
48413        // PHPUnit_Runner_BaseTestRunner::STATUS_ERROR
48414        5 => 'RISKY',
48415        // PHPUnit_Runner_BaseTestRunner::STATUS_RISKY
48416        6 => 'WARNING',
48417    ];
48418    public function __construct(DOMElement $context)
48419    {
48420        $this->contextNode = $context;
48421    }
48422    public function addTest(string $test, array $result) : void
48423    {
48424        $node = $this->contextNode->appendChild($this->contextNode->ownerDocument->createElementNS('https://schema.phpunit.de/coverage/1.0', 'test'));
48425        $node->setAttribute('name', $test);
48426        $node->setAttribute('size', $result['size']);
48427        $node->setAttribute('result', (string) $result['status']);
48428        $node->setAttribute('status', $this->codeMap[(int) $result['status']]);
48429    }
48430}
48431<?php
48432
48433declare (strict_types=1);
48434/*
48435 * This file is part of phpunit/php-code-coverage.
48436 *
48437 * (c) Sebastian Bergmann <sebastian@phpunit.de>
48438 *
48439 * For the full copyright and license information, please view the LICENSE
48440 * file that was distributed with this source code.
48441 */
48442namespace PHPUnit\SebastianBergmann\CodeCoverage\Report\Xml;
48443
48444use DOMDocument;
48445use DOMElement;
48446/**
48447 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
48448 */
48449abstract class Node
48450{
48451    /**
48452     * @var DOMDocument
48453     */
48454    private $dom;
48455    /**
48456     * @var DOMElement
48457     */
48458    private $contextNode;
48459    public function __construct(DOMElement $context)
48460    {
48461        $this->setContextNode($context);
48462    }
48463    public function dom() : DOMDocument
48464    {
48465        return $this->dom;
48466    }
48467    public function totals() : Totals
48468    {
48469        $totalsContainer = $this->contextNode()->firstChild;
48470        if (!$totalsContainer) {
48471            $totalsContainer = $this->contextNode()->appendChild($this->dom->createElementNS('https://schema.phpunit.de/coverage/1.0', 'totals'));
48472        }
48473        return new Totals($totalsContainer);
48474    }
48475    public function addDirectory(string $name) : Directory
48476    {
48477        $dirNode = $this->dom()->createElementNS('https://schema.phpunit.de/coverage/1.0', 'directory');
48478        $dirNode->setAttribute('name', $name);
48479        $this->contextNode()->appendChild($dirNode);
48480        return new Directory($dirNode);
48481    }
48482    public function addFile(string $name, string $href) : File
48483    {
48484        $fileNode = $this->dom()->createElementNS('https://schema.phpunit.de/coverage/1.0', 'file');
48485        $fileNode->setAttribute('name', $name);
48486        $fileNode->setAttribute('href', $href);
48487        $this->contextNode()->appendChild($fileNode);
48488        return new File($fileNode);
48489    }
48490    protected function setContextNode(DOMElement $context) : void
48491    {
48492        $this->dom = $context->ownerDocument;
48493        $this->contextNode = $context;
48494    }
48495    protected function contextNode() : DOMElement
48496    {
48497        return $this->contextNode;
48498    }
48499}
48500<?php
48501
48502declare (strict_types=1);
48503/*
48504 * This file is part of phpunit/php-code-coverage.
48505 *
48506 * (c) Sebastian Bergmann <sebastian@phpunit.de>
48507 *
48508 * For the full copyright and license information, please view the LICENSE
48509 * file that was distributed with this source code.
48510 */
48511namespace PHPUnit\SebastianBergmann\CodeCoverage\Report\Xml;
48512
48513use DOMDocument;
48514/**
48515 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
48516 */
48517final class Project extends Node
48518{
48519    public function __construct(string $directory)
48520    {
48521        $this->init();
48522        $this->setProjectSourceDirectory($directory);
48523    }
48524    public function projectSourceDirectory() : string
48525    {
48526        return $this->contextNode()->getAttribute('source');
48527    }
48528    public function buildInformation() : BuildInformation
48529    {
48530        $buildNode = $this->dom()->getElementsByTagNameNS('https://schema.phpunit.de/coverage/1.0', 'build')->item(0);
48531        if (!$buildNode) {
48532            $buildNode = $this->dom()->documentElement->appendChild($this->dom()->createElementNS('https://schema.phpunit.de/coverage/1.0', 'build'));
48533        }
48534        return new BuildInformation($buildNode);
48535    }
48536    public function tests() : Tests
48537    {
48538        $testsNode = $this->contextNode()->getElementsByTagNameNS('https://schema.phpunit.de/coverage/1.0', 'tests')->item(0);
48539        if (!$testsNode) {
48540            $testsNode = $this->contextNode()->appendChild($this->dom()->createElementNS('https://schema.phpunit.de/coverage/1.0', 'tests'));
48541        }
48542        return new Tests($testsNode);
48543    }
48544    public function asDom() : DOMDocument
48545    {
48546        return $this->dom();
48547    }
48548    private function init() : void
48549    {
48550        $dom = new DOMDocument();
48551        $dom->loadXML('<?xml version="1.0" ?><phpunit xmlns="https://schema.phpunit.de/coverage/1.0"><build/><project/></phpunit>');
48552        $this->setContextNode($dom->getElementsByTagNameNS('https://schema.phpunit.de/coverage/1.0', 'project')->item(0));
48553    }
48554    private function setProjectSourceDirectory(string $name) : void
48555    {
48556        $this->contextNode()->setAttribute('source', $name);
48557    }
48558}
48559<?php
48560
48561declare (strict_types=1);
48562/*
48563 * This file is part of phpunit/php-code-coverage.
48564 *
48565 * (c) Sebastian Bergmann <sebastian@phpunit.de>
48566 *
48567 * For the full copyright and license information, please view the LICENSE
48568 * file that was distributed with this source code.
48569 */
48570namespace PHPUnit\SebastianBergmann\CodeCoverage\Report\Xml;
48571
48572use DOMElement;
48573use PHPUnit\SebastianBergmann\CodeCoverage\ReportAlreadyFinalizedException;
48574use XMLWriter;
48575/**
48576 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
48577 */
48578final class Coverage
48579{
48580    /**
48581     * @var XMLWriter
48582     */
48583    private $writer;
48584    /**
48585     * @var DOMElement
48586     */
48587    private $contextNode;
48588    /**
48589     * @var bool
48590     */
48591    private $finalized = \false;
48592    public function __construct(DOMElement $context, string $line)
48593    {
48594        $this->contextNode = $context;
48595        $this->writer = new XMLWriter();
48596        $this->writer->openMemory();
48597        $this->writer->startElementNS(null, $context->nodeName, 'https://schema.phpunit.de/coverage/1.0');
48598        $this->writer->writeAttribute('nr', $line);
48599    }
48600    /**
48601     * @throws ReportAlreadyFinalizedException
48602     */
48603    public function addTest(string $test) : void
48604    {
48605        if ($this->finalized) {
48606            throw new ReportAlreadyFinalizedException();
48607        }
48608        $this->writer->startElement('covered');
48609        $this->writer->writeAttribute('by', $test);
48610        $this->writer->endElement();
48611    }
48612    public function finalize() : void
48613    {
48614        $this->writer->endElement();
48615        $fragment = $this->contextNode->ownerDocument->createDocumentFragment();
48616        $fragment->appendXML($this->writer->outputMemory());
48617        $this->contextNode->parentNode->replaceChild($fragment, $this->contextNode);
48618        $this->finalized = \true;
48619    }
48620}
48621<?php
48622
48623declare (strict_types=1);
48624/*
48625 * This file is part of phpunit/php-code-coverage.
48626 *
48627 * (c) Sebastian Bergmann <sebastian@phpunit.de>
48628 *
48629 * For the full copyright and license information, please view the LICENSE
48630 * file that was distributed with this source code.
48631 */
48632namespace PHPUnit\SebastianBergmann\CodeCoverage\Report\Xml;
48633
48634/**
48635 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
48636 */
48637final class Directory extends Node
48638{
48639}
48640<?php
48641
48642declare (strict_types=1);
48643/*
48644 * This file is part of phpunit/php-code-coverage.
48645 *
48646 * (c) Sebastian Bergmann <sebastian@phpunit.de>
48647 *
48648 * For the full copyright and license information, please view the LICENSE
48649 * file that was distributed with this source code.
48650 */
48651namespace PHPUnit\SebastianBergmann\CodeCoverage\Report\Xml;
48652
48653use DOMElement;
48654/**
48655 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
48656 */
48657final class Unit
48658{
48659    /**
48660     * @var DOMElement
48661     */
48662    private $contextNode;
48663    public function __construct(DOMElement $context, string $name)
48664    {
48665        $this->contextNode = $context;
48666        $this->setName($name);
48667    }
48668    public function setLines(int $start, int $executable, int $executed) : void
48669    {
48670        $this->contextNode->setAttribute('start', (string) $start);
48671        $this->contextNode->setAttribute('executable', (string) $executable);
48672        $this->contextNode->setAttribute('executed', (string) $executed);
48673    }
48674    public function setCrap(float $crap) : void
48675    {
48676        $this->contextNode->setAttribute('crap', (string) $crap);
48677    }
48678    public function setNamespace(string $namespace) : void
48679    {
48680        $node = $this->contextNode->getElementsByTagNameNS('https://schema.phpunit.de/coverage/1.0', 'namespace')->item(0);
48681        if (!$node) {
48682            $node = $this->contextNode->appendChild($this->contextNode->ownerDocument->createElementNS('https://schema.phpunit.de/coverage/1.0', 'namespace'));
48683        }
48684        $node->setAttribute('name', $namespace);
48685    }
48686    public function addMethod(string $name) : Method
48687    {
48688        $node = $this->contextNode->appendChild($this->contextNode->ownerDocument->createElementNS('https://schema.phpunit.de/coverage/1.0', 'method'));
48689        return new Method($node, $name);
48690    }
48691    private function setName(string $name) : void
48692    {
48693        $this->contextNode->setAttribute('name', $name);
48694    }
48695}
48696<?php
48697
48698declare (strict_types=1);
48699/*
48700 * This file is part of phpunit/php-code-coverage.
48701 *
48702 * (c) Sebastian Bergmann <sebastian@phpunit.de>
48703 *
48704 * For the full copyright and license information, please view the LICENSE
48705 * file that was distributed with this source code.
48706 */
48707namespace PHPUnit\SebastianBergmann\CodeCoverage\Report;
48708
48709use function count;
48710use function dirname;
48711use function file_put_contents;
48712use function is_string;
48713use function ksort;
48714use function max;
48715use function range;
48716use function time;
48717use DOMDocument;
48718use PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage;
48719use PHPUnit\SebastianBergmann\CodeCoverage\Directory;
48720use PHPUnit\SebastianBergmann\CodeCoverage\Driver\WriteOperationFailedException;
48721use PHPUnit\SebastianBergmann\CodeCoverage\Node\File;
48722final class Clover
48723{
48724    /**
48725     * @throws WriteOperationFailedException
48726     */
48727    public function process(CodeCoverage $coverage, ?string $target = null, ?string $name = null) : string
48728    {
48729        $time = (string) time();
48730        $xmlDocument = new DOMDocument('1.0', 'UTF-8');
48731        $xmlDocument->formatOutput = \true;
48732        $xmlCoverage = $xmlDocument->createElement('coverage');
48733        $xmlCoverage->setAttribute('generated', $time);
48734        $xmlDocument->appendChild($xmlCoverage);
48735        $xmlProject = $xmlDocument->createElement('project');
48736        $xmlProject->setAttribute('timestamp', $time);
48737        if (is_string($name)) {
48738            $xmlProject->setAttribute('name', $name);
48739        }
48740        $xmlCoverage->appendChild($xmlProject);
48741        $packages = [];
48742        $report = $coverage->getReport();
48743        foreach ($report as $item) {
48744            if (!$item instanceof File) {
48745                continue;
48746            }
48747            /* @var File $item */
48748            $xmlFile = $xmlDocument->createElement('file');
48749            $xmlFile->setAttribute('name', $item->pathAsString());
48750            $classes = $item->classesAndTraits();
48751            $coverageData = $item->lineCoverageData();
48752            $lines = [];
48753            $namespace = 'global';
48754            foreach ($classes as $className => $class) {
48755                $classStatements = 0;
48756                $coveredClassStatements = 0;
48757                $coveredMethods = 0;
48758                $classMethods = 0;
48759                foreach ($class['methods'] as $methodName => $method) {
48760                    if ($method['executableLines'] == 0) {
48761                        continue;
48762                    }
48763                    $classMethods++;
48764                    $classStatements += $method['executableLines'];
48765                    $coveredClassStatements += $method['executedLines'];
48766                    if ($method['coverage'] == 100) {
48767                        $coveredMethods++;
48768                    }
48769                    $methodCount = 0;
48770                    foreach (range($method['startLine'], $method['endLine']) as $line) {
48771                        if (isset($coverageData[$line]) && $coverageData[$line] !== null) {
48772                            $methodCount = max($methodCount, count($coverageData[$line]));
48773                        }
48774                    }
48775                    $lines[$method['startLine']] = ['ccn' => $method['ccn'], 'count' => $methodCount, 'crap' => $method['crap'], 'type' => 'method', 'visibility' => $method['visibility'], 'name' => $methodName];
48776                }
48777                if (!empty($class['package']['namespace'])) {
48778                    $namespace = $class['package']['namespace'];
48779                }
48780                $xmlClass = $xmlDocument->createElement('class');
48781                $xmlClass->setAttribute('name', $className);
48782                $xmlClass->setAttribute('namespace', $namespace);
48783                if (!empty($class['package']['fullPackage'])) {
48784                    $xmlClass->setAttribute('fullPackage', $class['package']['fullPackage']);
48785                }
48786                if (!empty($class['package']['category'])) {
48787                    $xmlClass->setAttribute('category', $class['package']['category']);
48788                }
48789                if (!empty($class['package']['package'])) {
48790                    $xmlClass->setAttribute('package', $class['package']['package']);
48791                }
48792                if (!empty($class['package']['subpackage'])) {
48793                    $xmlClass->setAttribute('subpackage', $class['package']['subpackage']);
48794                }
48795                $xmlFile->appendChild($xmlClass);
48796                $xmlMetrics = $xmlDocument->createElement('metrics');
48797                $xmlMetrics->setAttribute('complexity', (string) $class['ccn']);
48798                $xmlMetrics->setAttribute('methods', (string) $classMethods);
48799                $xmlMetrics->setAttribute('coveredmethods', (string) $coveredMethods);
48800                $xmlMetrics->setAttribute('conditionals', (string) $class['executableBranches']);
48801                $xmlMetrics->setAttribute('coveredconditionals', (string) $class['executedBranches']);
48802                $xmlMetrics->setAttribute('statements', (string) $classStatements);
48803                $xmlMetrics->setAttribute('coveredstatements', (string) $coveredClassStatements);
48804                $xmlMetrics->setAttribute('elements', (string) ($classMethods + $classStatements + $class['executableBranches']));
48805                $xmlMetrics->setAttribute('coveredelements', (string) ($coveredMethods + $coveredClassStatements + $class['executedBranches']));
48806                $xmlClass->appendChild($xmlMetrics);
48807            }
48808            foreach ($coverageData as $line => $data) {
48809                if ($data === null || isset($lines[$line])) {
48810                    continue;
48811                }
48812                $lines[$line] = ['count' => count($data), 'type' => 'stmt'];
48813            }
48814            ksort($lines);
48815            foreach ($lines as $line => $data) {
48816                $xmlLine = $xmlDocument->createElement('line');
48817                $xmlLine->setAttribute('num', (string) $line);
48818                $xmlLine->setAttribute('type', $data['type']);
48819                if (isset($data['name'])) {
48820                    $xmlLine->setAttribute('name', $data['name']);
48821                }
48822                if (isset($data['visibility'])) {
48823                    $xmlLine->setAttribute('visibility', $data['visibility']);
48824                }
48825                if (isset($data['ccn'])) {
48826                    $xmlLine->setAttribute('complexity', (string) $data['ccn']);
48827                }
48828                if (isset($data['crap'])) {
48829                    $xmlLine->setAttribute('crap', (string) $data['crap']);
48830                }
48831                $xmlLine->setAttribute('count', (string) $data['count']);
48832                $xmlFile->appendChild($xmlLine);
48833            }
48834            $linesOfCode = $item->linesOfCode();
48835            $xmlMetrics = $xmlDocument->createElement('metrics');
48836            $xmlMetrics->setAttribute('loc', (string) $linesOfCode->linesOfCode());
48837            $xmlMetrics->setAttribute('ncloc', (string) $linesOfCode->nonCommentLinesOfCode());
48838            $xmlMetrics->setAttribute('classes', (string) $item->numberOfClassesAndTraits());
48839            $xmlMetrics->setAttribute('methods', (string) $item->numberOfMethods());
48840            $xmlMetrics->setAttribute('coveredmethods', (string) $item->numberOfTestedMethods());
48841            $xmlMetrics->setAttribute('conditionals', (string) $item->numberOfExecutableBranches());
48842            $xmlMetrics->setAttribute('coveredconditionals', (string) $item->numberOfExecutedBranches());
48843            $xmlMetrics->setAttribute('statements', (string) $item->numberOfExecutableLines());
48844            $xmlMetrics->setAttribute('coveredstatements', (string) $item->numberOfExecutedLines());
48845            $xmlMetrics->setAttribute('elements', (string) ($item->numberOfMethods() + $item->numberOfExecutableLines() + $item->numberOfExecutableBranches()));
48846            $xmlMetrics->setAttribute('coveredelements', (string) ($item->numberOfTestedMethods() + $item->numberOfExecutedLines() + $item->numberOfExecutedBranches()));
48847            $xmlFile->appendChild($xmlMetrics);
48848            if ($namespace === 'global') {
48849                $xmlProject->appendChild($xmlFile);
48850            } else {
48851                if (!isset($packages[$namespace])) {
48852                    $packages[$namespace] = $xmlDocument->createElement('package');
48853                    $packages[$namespace]->setAttribute('name', $namespace);
48854                    $xmlProject->appendChild($packages[$namespace]);
48855                }
48856                $packages[$namespace]->appendChild($xmlFile);
48857            }
48858        }
48859        $linesOfCode = $report->linesOfCode();
48860        $xmlMetrics = $xmlDocument->createElement('metrics');
48861        $xmlMetrics->setAttribute('files', (string) count($report));
48862        $xmlMetrics->setAttribute('loc', (string) $linesOfCode->linesOfCode());
48863        $xmlMetrics->setAttribute('ncloc', (string) $linesOfCode->nonCommentLinesOfCode());
48864        $xmlMetrics->setAttribute('classes', (string) $report->numberOfClassesAndTraits());
48865        $xmlMetrics->setAttribute('methods', (string) $report->numberOfMethods());
48866        $xmlMetrics->setAttribute('coveredmethods', (string) $report->numberOfTestedMethods());
48867        $xmlMetrics->setAttribute('conditionals', (string) $report->numberOfExecutableBranches());
48868        $xmlMetrics->setAttribute('coveredconditionals', (string) $report->numberOfExecutedBranches());
48869        $xmlMetrics->setAttribute('statements', (string) $report->numberOfExecutableLines());
48870        $xmlMetrics->setAttribute('coveredstatements', (string) $report->numberOfExecutedLines());
48871        $xmlMetrics->setAttribute('elements', (string) ($report->numberOfMethods() + $report->numberOfExecutableLines() + $report->numberOfExecutableBranches()));
48872        $xmlMetrics->setAttribute('coveredelements', (string) ($report->numberOfTestedMethods() + $report->numberOfExecutedLines() + $report->numberOfExecutedBranches()));
48873        $xmlProject->appendChild($xmlMetrics);
48874        $buffer = $xmlDocument->saveXML();
48875        if ($target !== null) {
48876            Directory::create(dirname($target));
48877            if (@file_put_contents($target, $buffer) === \false) {
48878                throw new WriteOperationFailedException($target);
48879            }
48880        }
48881        return $buffer;
48882    }
48883}
48884<?php
48885
48886declare (strict_types=1);
48887/*
48888 * This file is part of phpunit/php-code-coverage.
48889 *
48890 * (c) Sebastian Bergmann <sebastian@phpunit.de>
48891 *
48892 * For the full copyright and license information, please view the LICENSE
48893 * file that was distributed with this source code.
48894 */
48895namespace PHPUnit\SebastianBergmann\CodeCoverage\Report;
48896
48897use function count;
48898use function dirname;
48899use function file_put_contents;
48900use function range;
48901use function time;
48902use DOMImplementation;
48903use PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage;
48904use PHPUnit\SebastianBergmann\CodeCoverage\Directory;
48905use PHPUnit\SebastianBergmann\CodeCoverage\Driver\WriteOperationFailedException;
48906use PHPUnit\SebastianBergmann\CodeCoverage\Node\File;
48907final class Cobertura
48908{
48909    /**
48910     * @throws WriteOperationFailedException
48911     */
48912    public function process(CodeCoverage $coverage, ?string $target = null, ?string $name = null) : string
48913    {
48914        $time = (string) time();
48915        $report = $coverage->getReport();
48916        $implementation = new DOMImplementation();
48917        $documentType = $implementation->createDocumentType('coverage', '', 'http://cobertura.sourceforge.net/xml/coverage-04.dtd');
48918        $document = $implementation->createDocument('', '', $documentType);
48919        $document->xmlVersion = '1.0';
48920        $document->encoding = 'UTF-8';
48921        $document->formatOutput = \true;
48922        $coverageElement = $document->createElement('coverage');
48923        $linesValid = $report->numberOfExecutableLines();
48924        $linesCovered = $report->numberOfExecutedLines();
48925        $lineRate = $linesValid === 0 ? 0 : $linesCovered / $linesValid;
48926        $coverageElement->setAttribute('line-rate', (string) $lineRate);
48927        $branchesValid = $report->numberOfExecutableBranches();
48928        $branchesCovered = $report->numberOfExecutedBranches();
48929        $branchRate = $branchesValid === 0 ? 0 : $branchesCovered / $branchesValid;
48930        $coverageElement->setAttribute('branch-rate', (string) $branchRate);
48931        $coverageElement->setAttribute('lines-covered', (string) $report->numberOfExecutedLines());
48932        $coverageElement->setAttribute('lines-valid', (string) $report->numberOfExecutableLines());
48933        $coverageElement->setAttribute('branches-covered', (string) $report->numberOfExecutedBranches());
48934        $coverageElement->setAttribute('branches-valid', (string) $report->numberOfExecutableBranches());
48935        $coverageElement->setAttribute('complexity', '');
48936        $coverageElement->setAttribute('version', '0.4');
48937        $coverageElement->setAttribute('timestamp', $time);
48938        $document->appendChild($coverageElement);
48939        $sourcesElement = $document->createElement('sources');
48940        $coverageElement->appendChild($sourcesElement);
48941        $sourceElement = $document->createElement('source', $report->pathAsString());
48942        $sourcesElement->appendChild($sourceElement);
48943        $packagesElement = $document->createElement('packages');
48944        $coverageElement->appendChild($packagesElement);
48945        $complexity = 0;
48946        foreach ($report as $item) {
48947            if (!$item instanceof File) {
48948                continue;
48949            }
48950            $packageElement = $document->createElement('package');
48951            $packageComplexity = 0;
48952            $packageName = $name ?? '';
48953            $packageElement->setAttribute('name', $packageName);
48954            $linesValid = $item->numberOfExecutableLines();
48955            $linesCovered = $item->numberOfExecutedLines();
48956            $lineRate = $linesValid === 0 ? 0 : $linesCovered / $linesValid;
48957            $packageElement->setAttribute('line-rate', (string) $lineRate);
48958            $branchesValid = $item->numberOfExecutableBranches();
48959            $branchesCovered = $item->numberOfExecutedBranches();
48960            $branchRate = $branchesValid === 0 ? 0 : $branchesCovered / $branchesValid;
48961            $packageElement->setAttribute('branch-rate', (string) $branchRate);
48962            $packageElement->setAttribute('complexity', '');
48963            $packagesElement->appendChild($packageElement);
48964            $classesElement = $document->createElement('classes');
48965            $packageElement->appendChild($classesElement);
48966            $classes = $item->classesAndTraits();
48967            $coverageData = $item->lineCoverageData();
48968            foreach ($classes as $className => $class) {
48969                $complexity += $class['ccn'];
48970                $packageComplexity += $class['ccn'];
48971                if (!empty($class['package']['namespace'])) {
48972                    $className = $class['package']['namespace'] . '\\' . $className;
48973                }
48974                $linesValid = $class['executableLines'];
48975                $linesCovered = $class['executedLines'];
48976                $lineRate = $linesValid === 0 ? 0 : $linesCovered / $linesValid;
48977                $branchesValid = $class['executableBranches'];
48978                $branchesCovered = $class['executedBranches'];
48979                $branchRate = $branchesValid === 0 ? 0 : $branchesCovered / $branchesValid;
48980                $classElement = $document->createElement('class');
48981                $classElement->setAttribute('name', $className);
48982                $classElement->setAttribute('filename', \str_replace($report->pathAsString() . \DIRECTORY_SEPARATOR, '', $item->pathAsString()));
48983                $classElement->setAttribute('line-rate', (string) $lineRate);
48984                $classElement->setAttribute('branch-rate', (string) $branchRate);
48985                $classElement->setAttribute('complexity', (string) $class['ccn']);
48986                $classesElement->appendChild($classElement);
48987                $methodsElement = $document->createElement('methods');
48988                $classElement->appendChild($methodsElement);
48989                $classLinesElement = $document->createElement('lines');
48990                $classElement->appendChild($classLinesElement);
48991                foreach ($class['methods'] as $methodName => $method) {
48992                    if ($method['executableLines'] === 0) {
48993                        continue;
48994                    }
48995                    \preg_match("/\\((.*?)\\)/", $method['signature'], $signature);
48996                    $linesValid = $method['executableLines'];
48997                    $linesCovered = $method['executedLines'];
48998                    $lineRate = $linesValid === 0 ? 0 : $linesCovered / $linesValid;
48999                    $branchesValid = $method['executableBranches'];
49000                    $branchesCovered = $method['executedBranches'];
49001                    $branchRate = $branchesValid === 0 ? 0 : $branchesCovered / $branchesValid;
49002                    $methodElement = $document->createElement('method');
49003                    $methodElement->setAttribute('name', $methodName);
49004                    $methodElement->setAttribute('signature', $signature[1]);
49005                    $methodElement->setAttribute('line-rate', (string) $lineRate);
49006                    $methodElement->setAttribute('branch-rate', (string) $branchRate);
49007                    $methodElement->setAttribute('complexity', (string) $method['ccn']);
49008                    $methodLinesElement = $document->createElement('lines');
49009                    $methodElement->appendChild($methodLinesElement);
49010                    foreach (range($method['startLine'], $method['endLine']) as $line) {
49011                        if (!isset($coverageData[$line]) || $coverageData[$line] === null) {
49012                            continue;
49013                        }
49014                        $methodLineElement = $document->createElement('line');
49015                        $methodLineElement->setAttribute('number', (string) $line);
49016                        $methodLineElement->setAttribute('hits', (string) count($coverageData[$line]));
49017                        $methodLinesElement->appendChild($methodLineElement);
49018                        $classLineElement = $methodLineElement->cloneNode();
49019                        $classLinesElement->appendChild($classLineElement);
49020                    }
49021                    $methodsElement->appendChild($methodElement);
49022                }
49023            }
49024            if ($report->numberOfFunctions() === 0) {
49025                $packageElement->setAttribute('complexity', (string) $packageComplexity);
49026                continue;
49027            }
49028            $functionsComplexity = 0;
49029            $functionsLinesValid = 0;
49030            $functionsLinesCovered = 0;
49031            $functionsBranchesValid = 0;
49032            $functionsBranchesCovered = 0;
49033            $classElement = $document->createElement('class');
49034            $classElement->setAttribute('name', \basename($item->pathAsString()));
49035            $classElement->setAttribute('filename', \str_replace($report->pathAsString() . \DIRECTORY_SEPARATOR, '', $item->pathAsString()));
49036            $methodsElement = $document->createElement('methods');
49037            $classElement->appendChild($methodsElement);
49038            $classLinesElement = $document->createElement('lines');
49039            $classElement->appendChild($classLinesElement);
49040            $functions = $report->functions();
49041            foreach ($functions as $functionName => $function) {
49042                if ($function['executableLines'] === 0) {
49043                    continue;
49044                }
49045                $complexity += $function['ccn'];
49046                $packageComplexity += $function['ccn'];
49047                $functionsComplexity += $function['ccn'];
49048                $linesValid = $function['executableLines'];
49049                $linesCovered = $function['executedLines'];
49050                $lineRate = $linesValid === 0 ? 0 : $linesCovered / $linesValid;
49051                $functionsLinesValid += $linesValid;
49052                $functionsLinesCovered += $linesCovered;
49053                $branchesValid = $function['executableBranches'];
49054                $branchesCovered = $function['executedBranches'];
49055                $branchRate = $branchesValid === 0 ? 0 : $branchesCovered / $branchesValid;
49056                $functionsBranchesValid += $branchesValid;
49057                $functionsBranchesCovered += $branchesValid;
49058                $methodElement = $document->createElement('method');
49059                $methodElement->setAttribute('name', $functionName);
49060                $methodElement->setAttribute('signature', $function['signature']);
49061                $methodElement->setAttribute('line-rate', (string) $lineRate);
49062                $methodElement->setAttribute('branch-rate', (string) $branchRate);
49063                $methodElement->setAttribute('complexity', (string) $function['ccn']);
49064                $methodLinesElement = $document->createElement('lines');
49065                $methodElement->appendChild($methodLinesElement);
49066                foreach (range($function['startLine'], $function['endLine']) as $line) {
49067                    if (!isset($coverageData[$line]) || $coverageData[$line] === null) {
49068                        continue;
49069                    }
49070                    $methodLineElement = $document->createElement('line');
49071                    $methodLineElement->setAttribute('number', (string) $line);
49072                    $methodLineElement->setAttribute('hits', (string) count($coverageData[$line]));
49073                    $methodLinesElement->appendChild($methodLineElement);
49074                    $classLineElement = $methodLineElement->cloneNode();
49075                    $classLinesElement->appendChild($classLineElement);
49076                }
49077                $methodsElement->appendChild($methodElement);
49078            }
49079            $packageElement->setAttribute('complexity', (string) $packageComplexity);
49080            if ($functionsLinesValid === 0) {
49081                continue;
49082            }
49083            $lineRate = $functionsLinesCovered / $functionsLinesValid;
49084            $branchRate = $functionsBranchesValid === 0 ? 0 : $functionsBranchesCovered / $functionsBranchesValid;
49085            $classElement->setAttribute('line-rate', (string) $lineRate);
49086            $classElement->setAttribute('branch-rate', (string) $branchRate);
49087            $classElement->setAttribute('complexity', (string) $functionsComplexity);
49088            $classesElement->appendChild($classElement);
49089        }
49090        $coverageElement->setAttribute('complexity', (string) $complexity);
49091        $buffer = $document->saveXML();
49092        if ($target !== null) {
49093            Directory::create(dirname($target));
49094            if (@file_put_contents($target, $buffer) === \false) {
49095                throw new WriteOperationFailedException($target);
49096            }
49097        }
49098        return $buffer;
49099    }
49100}
49101<?php
49102
49103declare (strict_types=1);
49104/*
49105 * This file is part of phpunit/php-code-coverage.
49106 *
49107 * (c) Sebastian Bergmann <sebastian@phpunit.de>
49108 *
49109 * For the full copyright and license information, please view the LICENSE
49110 * file that was distributed with this source code.
49111 */
49112namespace PHPUnit\SebastianBergmann\CodeCoverage;
49113
49114use function array_diff;
49115use function array_diff_key;
49116use function array_flip;
49117use function array_intersect;
49118use function array_intersect_key;
49119use function count;
49120use function file;
49121use function in_array;
49122use function range;
49123use PHPUnit\SebastianBergmann\CodeCoverage\Driver\Driver;
49124use PHPUnit\SebastianBergmann\CodeCoverage\StaticAnalysis\UncoveredFileAnalyser;
49125/**
49126 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
49127 */
49128final class RawCodeCoverageData
49129{
49130    /**
49131     * @var array<string, array<int>>
49132     */
49133    private static $emptyLineCache = [];
49134    /**
49135     * @var array
49136     *
49137     * @see https://xdebug.org/docs/code_coverage for format
49138     */
49139    private $lineCoverage;
49140    /**
49141     * @var array
49142     *
49143     * @see https://xdebug.org/docs/code_coverage for format
49144     */
49145    private $functionCoverage;
49146    public static function fromXdebugWithoutPathCoverage(array $rawCoverage) : self
49147    {
49148        return new self($rawCoverage, []);
49149    }
49150    public static function fromXdebugWithPathCoverage(array $rawCoverage) : self
49151    {
49152        $lineCoverage = [];
49153        $functionCoverage = [];
49154        foreach ($rawCoverage as $file => $fileCoverageData) {
49155            $lineCoverage[$file] = $fileCoverageData['lines'];
49156            $functionCoverage[$file] = $fileCoverageData['functions'];
49157        }
49158        return new self($lineCoverage, $functionCoverage);
49159    }
49160    public static function fromXdebugWithMixedCoverage(array $rawCoverage) : self
49161    {
49162        $lineCoverage = [];
49163        $functionCoverage = [];
49164        foreach ($rawCoverage as $file => $fileCoverageData) {
49165            if (!isset($fileCoverageData['functions'])) {
49166                // Current file does not have functions, so line coverage
49167                // is stored in $fileCoverageData, not in $fileCoverageData['lines']
49168                $lineCoverage[$file] = $fileCoverageData;
49169                continue;
49170            }
49171            $lineCoverage[$file] = $fileCoverageData['lines'];
49172            $functionCoverage[$file] = $fileCoverageData['functions'];
49173        }
49174        return new self($lineCoverage, $functionCoverage);
49175    }
49176    public static function fromUncoveredFile(string $filename, UncoveredFileAnalyser $uncoveredFileAnalyser) : self
49177    {
49178        $lineCoverage = [];
49179        foreach ($uncoveredFileAnalyser->executableLinesIn($filename) as $line) {
49180            $lineCoverage[$line] = Driver::LINE_NOT_EXECUTED;
49181        }
49182        return new self([$filename => $lineCoverage], []);
49183    }
49184    private function __construct(array $lineCoverage, array $functionCoverage)
49185    {
49186        $this->lineCoverage = $lineCoverage;
49187        $this->functionCoverage = $functionCoverage;
49188        $this->skipEmptyLines();
49189    }
49190    public function clear() : void
49191    {
49192        $this->lineCoverage = $this->functionCoverage = [];
49193    }
49194    public function lineCoverage() : array
49195    {
49196        return $this->lineCoverage;
49197    }
49198    public function functionCoverage() : array
49199    {
49200        return $this->functionCoverage;
49201    }
49202    public function removeCoverageDataForFile(string $filename) : void
49203    {
49204        unset($this->lineCoverage[$filename], $this->functionCoverage[$filename]);
49205    }
49206    /**
49207     * @param int[] $lines
49208     */
49209    public function keepCoverageDataOnlyForLines(string $filename, array $lines) : void
49210    {
49211        if (!isset($this->lineCoverage[$filename])) {
49212            return;
49213        }
49214        $this->lineCoverage[$filename] = array_intersect_key($this->lineCoverage[$filename], array_flip($lines));
49215        if (isset($this->functionCoverage[$filename])) {
49216            foreach ($this->functionCoverage[$filename] as $functionName => $functionData) {
49217                foreach ($functionData['branches'] as $branchId => $branch) {
49218                    if (count(array_diff(range($branch['line_start'], $branch['line_end']), $lines)) > 0) {
49219                        unset($this->functionCoverage[$filename][$functionName]['branches'][$branchId]);
49220                        foreach ($functionData['paths'] as $pathId => $path) {
49221                            if (in_array($branchId, $path['path'], \true)) {
49222                                unset($this->functionCoverage[$filename][$functionName]['paths'][$pathId]);
49223                            }
49224                        }
49225                    }
49226                }
49227            }
49228        }
49229    }
49230    /**
49231     * @param int[] $lines
49232     */
49233    public function removeCoverageDataForLines(string $filename, array $lines) : void
49234    {
49235        if (empty($lines)) {
49236            return;
49237        }
49238        if (!isset($this->lineCoverage[$filename])) {
49239            return;
49240        }
49241        $this->lineCoverage[$filename] = array_diff_key($this->lineCoverage[$filename], array_flip($lines));
49242        if (isset($this->functionCoverage[$filename])) {
49243            foreach ($this->functionCoverage[$filename] as $functionName => $functionData) {
49244                foreach ($functionData['branches'] as $branchId => $branch) {
49245                    if (count(array_intersect($lines, range($branch['line_start'], $branch['line_end']))) > 0) {
49246                        unset($this->functionCoverage[$filename][$functionName]['branches'][$branchId]);
49247                        foreach ($functionData['paths'] as $pathId => $path) {
49248                            if (in_array($branchId, $path['path'], \true)) {
49249                                unset($this->functionCoverage[$filename][$functionName]['paths'][$pathId]);
49250                            }
49251                        }
49252                    }
49253                }
49254            }
49255        }
49256    }
49257    /**
49258     * At the end of a file, the PHP interpreter always sees an implicit return. Where this occurs in a file that has
49259     * e.g. a class definition, that line cannot be invoked from a test and results in confusing coverage. This engine
49260     * implementation detail therefore needs to be masked which is done here by simply ensuring that all empty lines
49261     * are skipped over for coverage purposes.
49262     *
49263     * @see https://github.com/sebastianbergmann/php-code-coverage/issues/799
49264     */
49265    private function skipEmptyLines() : void
49266    {
49267        foreach ($this->lineCoverage as $filename => $coverage) {
49268            foreach ($this->getEmptyLinesForFile($filename) as $emptyLine) {
49269                unset($this->lineCoverage[$filename][$emptyLine]);
49270            }
49271        }
49272    }
49273    private function getEmptyLinesForFile(string $filename) : array
49274    {
49275        if (!isset(self::$emptyLineCache[$filename])) {
49276            self::$emptyLineCache[$filename] = [];
49277            if (\is_file($filename)) {
49278                $sourceLines = \explode("\n", \file_get_contents($filename));
49279                foreach ($sourceLines as $line => $source) {
49280                    if (\trim($source) === '') {
49281                        self::$emptyLineCache[$filename][] = $line + 1;
49282                    }
49283                }
49284            }
49285        }
49286        return self::$emptyLineCache[$filename];
49287    }
49288}
49289<?php
49290
49291declare (strict_types=1);
49292/*
49293 * This file is part of phpunit/php-code-coverage.
49294 *
49295 * (c) Sebastian Bergmann <sebastian@phpunit.de>
49296 *
49297 * For the full copyright and license information, please view the LICENSE
49298 * file that was distributed with this source code.
49299 */
49300namespace PHPUnit\SebastianBergmann\CodeCoverage;
49301
49302use function sprintf;
49303/**
49304 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
49305 */
49306final class CrapIndex
49307{
49308    /**
49309     * @var int
49310     */
49311    private $cyclomaticComplexity;
49312    /**
49313     * @var float
49314     */
49315    private $codeCoverage;
49316    public static function fromCyclomaticComplexityAndCoveragePercentage(int $cyclomaticComplexity, float $codeCoverage) : self
49317    {
49318        return new self($cyclomaticComplexity, $codeCoverage);
49319    }
49320    public function __construct(int $cyclomaticComplexity, float $codeCoverage)
49321    {
49322        $this->cyclomaticComplexity = $cyclomaticComplexity;
49323        $this->codeCoverage = $codeCoverage;
49324    }
49325    public function asString() : string
49326    {
49327        if ($this->codeCoverage === 0.0) {
49328            return (string) ($this->cyclomaticComplexity ** 2 + $this->cyclomaticComplexity);
49329        }
49330        if ($this->codeCoverage >= 95) {
49331            return (string) $this->cyclomaticComplexity;
49332        }
49333        return sprintf('%01.2F', $this->cyclomaticComplexity ** 2 * (1 - $this->codeCoverage / 100) ** 3 + $this->cyclomaticComplexity);
49334    }
49335}
49336<?php
49337
49338declare (strict_types=1);
49339/*
49340 * This file is part of phpunit/php-code-coverage.
49341 *
49342 * (c) Sebastian Bergmann <sebastian@phpunit.de>
49343 *
49344 * For the full copyright and license information, please view the LICENSE
49345 * file that was distributed with this source code.
49346 */
49347namespace PHPUnit\SebastianBergmann\CodeCoverage\Node;
49348
49349use function array_filter;
49350use function count;
49351use function range;
49352use PHPUnit\SebastianBergmann\CodeCoverage\CrapIndex;
49353use PHPUnit\SebastianBergmann\LinesOfCode\LinesOfCode;
49354/**
49355 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
49356 */
49357final class File extends AbstractNode
49358{
49359    /**
49360     * @var array
49361     */
49362    private $lineCoverageData;
49363    /**
49364     * @var array
49365     */
49366    private $functionCoverageData;
49367    /**
49368     * @var array
49369     */
49370    private $testData;
49371    /**
49372     * @var int
49373     */
49374    private $numExecutableLines = 0;
49375    /**
49376     * @var int
49377     */
49378    private $numExecutedLines = 0;
49379    /**
49380     * @var int
49381     */
49382    private $numExecutableBranches = 0;
49383    /**
49384     * @var int
49385     */
49386    private $numExecutedBranches = 0;
49387    /**
49388     * @var int
49389     */
49390    private $numExecutablePaths = 0;
49391    /**
49392     * @var int
49393     */
49394    private $numExecutedPaths = 0;
49395    /**
49396     * @var array
49397     */
49398    private $classes = [];
49399    /**
49400     * @var array
49401     */
49402    private $traits = [];
49403    /**
49404     * @var array
49405     */
49406    private $functions = [];
49407    /**
49408     * @var LinesOfCode
49409     */
49410    private $linesOfCode;
49411    /**
49412     * @var int
49413     */
49414    private $numClasses;
49415    /**
49416     * @var int
49417     */
49418    private $numTestedClasses = 0;
49419    /**
49420     * @var int
49421     */
49422    private $numTraits;
49423    /**
49424     * @var int
49425     */
49426    private $numTestedTraits = 0;
49427    /**
49428     * @var int
49429     */
49430    private $numMethods;
49431    /**
49432     * @var int
49433     */
49434    private $numTestedMethods;
49435    /**
49436     * @var int
49437     */
49438    private $numTestedFunctions;
49439    /**
49440     * @var array
49441     */
49442    private $codeUnitsByLine = [];
49443    public function __construct(string $name, AbstractNode $parent, array $lineCoverageData, array $functionCoverageData, array $testData, array $classes, array $traits, array $functions, LinesOfCode $linesOfCode)
49444    {
49445        parent::__construct($name, $parent);
49446        $this->lineCoverageData = $lineCoverageData;
49447        $this->functionCoverageData = $functionCoverageData;
49448        $this->testData = $testData;
49449        $this->linesOfCode = $linesOfCode;
49450        $this->calculateStatistics($classes, $traits, $functions);
49451    }
49452    public function count() : int
49453    {
49454        return 1;
49455    }
49456    public function lineCoverageData() : array
49457    {
49458        return $this->lineCoverageData;
49459    }
49460    public function functionCoverageData() : array
49461    {
49462        return $this->functionCoverageData;
49463    }
49464    public function testData() : array
49465    {
49466        return $this->testData;
49467    }
49468    public function classes() : array
49469    {
49470        return $this->classes;
49471    }
49472    public function traits() : array
49473    {
49474        return $this->traits;
49475    }
49476    public function functions() : array
49477    {
49478        return $this->functions;
49479    }
49480    public function linesOfCode() : LinesOfCode
49481    {
49482        return $this->linesOfCode;
49483    }
49484    public function numberOfExecutableLines() : int
49485    {
49486        return $this->numExecutableLines;
49487    }
49488    public function numberOfExecutedLines() : int
49489    {
49490        return $this->numExecutedLines;
49491    }
49492    public function numberOfExecutableBranches() : int
49493    {
49494        return $this->numExecutableBranches;
49495    }
49496    public function numberOfExecutedBranches() : int
49497    {
49498        return $this->numExecutedBranches;
49499    }
49500    public function numberOfExecutablePaths() : int
49501    {
49502        return $this->numExecutablePaths;
49503    }
49504    public function numberOfExecutedPaths() : int
49505    {
49506        return $this->numExecutedPaths;
49507    }
49508    public function numberOfClasses() : int
49509    {
49510        if ($this->numClasses === null) {
49511            $this->numClasses = 0;
49512            foreach ($this->classes as $class) {
49513                foreach ($class['methods'] as $method) {
49514                    if ($method['executableLines'] > 0) {
49515                        $this->numClasses++;
49516                        continue 2;
49517                    }
49518                }
49519            }
49520        }
49521        return $this->numClasses;
49522    }
49523    public function numberOfTestedClasses() : int
49524    {
49525        return $this->numTestedClasses;
49526    }
49527    public function numberOfTraits() : int
49528    {
49529        if ($this->numTraits === null) {
49530            $this->numTraits = 0;
49531            foreach ($this->traits as $trait) {
49532                foreach ($trait['methods'] as $method) {
49533                    if ($method['executableLines'] > 0) {
49534                        $this->numTraits++;
49535                        continue 2;
49536                    }
49537                }
49538            }
49539        }
49540        return $this->numTraits;
49541    }
49542    public function numberOfTestedTraits() : int
49543    {
49544        return $this->numTestedTraits;
49545    }
49546    public function numberOfMethods() : int
49547    {
49548        if ($this->numMethods === null) {
49549            $this->numMethods = 0;
49550            foreach ($this->classes as $class) {
49551                foreach ($class['methods'] as $method) {
49552                    if ($method['executableLines'] > 0) {
49553                        $this->numMethods++;
49554                    }
49555                }
49556            }
49557            foreach ($this->traits as $trait) {
49558                foreach ($trait['methods'] as $method) {
49559                    if ($method['executableLines'] > 0) {
49560                        $this->numMethods++;
49561                    }
49562                }
49563            }
49564        }
49565        return $this->numMethods;
49566    }
49567    public function numberOfTestedMethods() : int
49568    {
49569        if ($this->numTestedMethods === null) {
49570            $this->numTestedMethods = 0;
49571            foreach ($this->classes as $class) {
49572                foreach ($class['methods'] as $method) {
49573                    if ($method['executableLines'] > 0 && $method['coverage'] === 100) {
49574                        $this->numTestedMethods++;
49575                    }
49576                }
49577            }
49578            foreach ($this->traits as $trait) {
49579                foreach ($trait['methods'] as $method) {
49580                    if ($method['executableLines'] > 0 && $method['coverage'] === 100) {
49581                        $this->numTestedMethods++;
49582                    }
49583                }
49584            }
49585        }
49586        return $this->numTestedMethods;
49587    }
49588    public function numberOfFunctions() : int
49589    {
49590        return count($this->functions);
49591    }
49592    public function numberOfTestedFunctions() : int
49593    {
49594        if ($this->numTestedFunctions === null) {
49595            $this->numTestedFunctions = 0;
49596            foreach ($this->functions as $function) {
49597                if ($function['executableLines'] > 0 && $function['coverage'] === 100) {
49598                    $this->numTestedFunctions++;
49599                }
49600            }
49601        }
49602        return $this->numTestedFunctions;
49603    }
49604    private function calculateStatistics(array $classes, array $traits, array $functions) : void
49605    {
49606        foreach (range(1, $this->linesOfCode->linesOfCode()) as $lineNumber) {
49607            $this->codeUnitsByLine[$lineNumber] = [];
49608        }
49609        $this->processClasses($classes);
49610        $this->processTraits($traits);
49611        $this->processFunctions($functions);
49612        foreach (range(1, $this->linesOfCode->linesOfCode()) as $lineNumber) {
49613            if (isset($this->lineCoverageData[$lineNumber])) {
49614                foreach ($this->codeUnitsByLine[$lineNumber] as &$codeUnit) {
49615                    $codeUnit['executableLines']++;
49616                }
49617                unset($codeUnit);
49618                $this->numExecutableLines++;
49619                if (count($this->lineCoverageData[$lineNumber]) > 0) {
49620                    foreach ($this->codeUnitsByLine[$lineNumber] as &$codeUnit) {
49621                        $codeUnit['executedLines']++;
49622                    }
49623                    unset($codeUnit);
49624                    $this->numExecutedLines++;
49625                }
49626            }
49627        }
49628        foreach ($this->traits as &$trait) {
49629            foreach ($trait['methods'] as &$method) {
49630                $methodLineCoverage = $method['executableLines'] ? $method['executedLines'] / $method['executableLines'] * 100 : 100;
49631                $methodBranchCoverage = $method['executableBranches'] ? $method['executedBranches'] / $method['executableBranches'] * 100 : 0;
49632                $methodPathCoverage = $method['executablePaths'] ? $method['executedPaths'] / $method['executablePaths'] * 100 : 0;
49633                $method['coverage'] = $methodBranchCoverage ?: $methodLineCoverage;
49634                $method['crap'] = (new CrapIndex($method['ccn'], $methodPathCoverage ?: $methodLineCoverage))->asString();
49635                $trait['ccn'] += $method['ccn'];
49636            }
49637            unset($method);
49638            $traitLineCoverage = $trait['executableLines'] ? $trait['executedLines'] / $trait['executableLines'] * 100 : 100;
49639            $traitBranchCoverage = $trait['executableBranches'] ? $trait['executedBranches'] / $trait['executableBranches'] * 100 : 0;
49640            $traitPathCoverage = $trait['executablePaths'] ? $trait['executedPaths'] / $trait['executablePaths'] * 100 : 0;
49641            $trait['coverage'] = $traitBranchCoverage ?: $traitLineCoverage;
49642            $trait['crap'] = (new CrapIndex($trait['ccn'], $traitPathCoverage ?: $traitLineCoverage))->asString();
49643            if ($trait['executableLines'] > 0 && $trait['coverage'] === 100) {
49644                $this->numTestedClasses++;
49645            }
49646        }
49647        unset($trait);
49648        foreach ($this->classes as &$class) {
49649            foreach ($class['methods'] as &$method) {
49650                $methodLineCoverage = $method['executableLines'] ? $method['executedLines'] / $method['executableLines'] * 100 : 100;
49651                $methodBranchCoverage = $method['executableBranches'] ? $method['executedBranches'] / $method['executableBranches'] * 100 : 0;
49652                $methodPathCoverage = $method['executablePaths'] ? $method['executedPaths'] / $method['executablePaths'] * 100 : 0;
49653                $method['coverage'] = $methodBranchCoverage ?: $methodLineCoverage;
49654                $method['crap'] = (new CrapIndex($method['ccn'], $methodPathCoverage ?: $methodLineCoverage))->asString();
49655                $class['ccn'] += $method['ccn'];
49656            }
49657            unset($method);
49658            $classLineCoverage = $class['executableLines'] ? $class['executedLines'] / $class['executableLines'] * 100 : 100;
49659            $classBranchCoverage = $class['executableBranches'] ? $class['executedBranches'] / $class['executableBranches'] * 100 : 0;
49660            $classPathCoverage = $class['executablePaths'] ? $class['executedPaths'] / $class['executablePaths'] * 100 : 0;
49661            $class['coverage'] = $classBranchCoverage ?: $classLineCoverage;
49662            $class['crap'] = (new CrapIndex($class['ccn'], $classPathCoverage ?: $classLineCoverage))->asString();
49663            if ($class['executableLines'] > 0 && $class['coverage'] === 100) {
49664                $this->numTestedClasses++;
49665            }
49666        }
49667        unset($class);
49668        foreach ($this->functions as &$function) {
49669            $functionLineCoverage = $function['executableLines'] ? $function['executedLines'] / $function['executableLines'] * 100 : 100;
49670            $functionBranchCoverage = $function['executableBranches'] ? $function['executedBranches'] / $function['executableBranches'] * 100 : 0;
49671            $functionPathCoverage = $function['executablePaths'] ? $function['executedPaths'] / $function['executablePaths'] * 100 : 0;
49672            $function['coverage'] = $functionBranchCoverage ?: $functionLineCoverage;
49673            $function['crap'] = (new CrapIndex($function['ccn'], $functionPathCoverage ?: $functionLineCoverage))->asString();
49674            if ($function['coverage'] === 100) {
49675                $this->numTestedFunctions++;
49676            }
49677        }
49678    }
49679    private function processClasses(array $classes) : void
49680    {
49681        $link = $this->id() . '.html#';
49682        foreach ($classes as $className => $class) {
49683            $this->classes[$className] = ['className' => $className, 'namespace' => $class['namespace'], 'methods' => [], 'startLine' => $class['startLine'], 'executableLines' => 0, 'executedLines' => 0, 'executableBranches' => 0, 'executedBranches' => 0, 'executablePaths' => 0, 'executedPaths' => 0, 'ccn' => 0, 'coverage' => 0, 'crap' => 0, 'link' => $link . $class['startLine']];
49684            foreach ($class['methods'] as $methodName => $method) {
49685                $methodData = $this->newMethod($className, $methodName, $method, $link);
49686                $this->classes[$className]['methods'][$methodName] = $methodData;
49687                $this->classes[$className]['executableBranches'] += $methodData['executableBranches'];
49688                $this->classes[$className]['executedBranches'] += $methodData['executedBranches'];
49689                $this->classes[$className]['executablePaths'] += $methodData['executablePaths'];
49690                $this->classes[$className]['executedPaths'] += $methodData['executedPaths'];
49691                $this->numExecutableBranches += $methodData['executableBranches'];
49692                $this->numExecutedBranches += $methodData['executedBranches'];
49693                $this->numExecutablePaths += $methodData['executablePaths'];
49694                $this->numExecutedPaths += $methodData['executedPaths'];
49695                foreach (range($method['startLine'], $method['endLine']) as $lineNumber) {
49696                    $this->codeUnitsByLine[$lineNumber] = [&$this->classes[$className], &$this->classes[$className]['methods'][$methodName]];
49697                }
49698            }
49699        }
49700    }
49701    private function processTraits(array $traits) : void
49702    {
49703        $link = $this->id() . '.html#';
49704        foreach ($traits as $traitName => $trait) {
49705            $this->traits[$traitName] = ['traitName' => $traitName, 'namespace' => $trait['namespace'], 'methods' => [], 'startLine' => $trait['startLine'], 'executableLines' => 0, 'executedLines' => 0, 'executableBranches' => 0, 'executedBranches' => 0, 'executablePaths' => 0, 'executedPaths' => 0, 'ccn' => 0, 'coverage' => 0, 'crap' => 0, 'link' => $link . $trait['startLine']];
49706            foreach ($trait['methods'] as $methodName => $method) {
49707                $methodData = $this->newMethod($traitName, $methodName, $method, $link);
49708                $this->traits[$traitName]['methods'][$methodName] = $methodData;
49709                $this->traits[$traitName]['executableBranches'] += $methodData['executableBranches'];
49710                $this->traits[$traitName]['executedBranches'] += $methodData['executedBranches'];
49711                $this->traits[$traitName]['executablePaths'] += $methodData['executablePaths'];
49712                $this->traits[$traitName]['executedPaths'] += $methodData['executedPaths'];
49713                $this->numExecutableBranches += $methodData['executableBranches'];
49714                $this->numExecutedBranches += $methodData['executedBranches'];
49715                $this->numExecutablePaths += $methodData['executablePaths'];
49716                $this->numExecutedPaths += $methodData['executedPaths'];
49717                foreach (range($method['startLine'], $method['endLine']) as $lineNumber) {
49718                    $this->codeUnitsByLine[$lineNumber] = [&$this->traits[$traitName], &$this->traits[$traitName]['methods'][$methodName]];
49719                }
49720            }
49721        }
49722    }
49723    private function processFunctions(array $functions) : void
49724    {
49725        $link = $this->id() . '.html#';
49726        foreach ($functions as $functionName => $function) {
49727            $this->functions[$functionName] = ['functionName' => $functionName, 'namespace' => $function['namespace'], 'signature' => $function['signature'], 'startLine' => $function['startLine'], 'endLine' => $function['endLine'], 'executableLines' => 0, 'executedLines' => 0, 'executableBranches' => 0, 'executedBranches' => 0, 'executablePaths' => 0, 'executedPaths' => 0, 'ccn' => $function['ccn'], 'coverage' => 0, 'crap' => 0, 'link' => $link . $function['startLine']];
49728            foreach (range($function['startLine'], $function['endLine']) as $lineNumber) {
49729                $this->codeUnitsByLine[$lineNumber] = [&$this->functions[$functionName]];
49730            }
49731            if (isset($this->functionCoverageData[$functionName]['branches'])) {
49732                $this->functions[$functionName]['executableBranches'] = count($this->functionCoverageData[$functionName]['branches']);
49733                $this->functions[$functionName]['executedBranches'] = count(array_filter($this->functionCoverageData[$functionName]['branches'], static function (array $branch) {
49734                    return (bool) $branch['hit'];
49735                }));
49736            }
49737            if (isset($this->functionCoverageData[$functionName]['paths'])) {
49738                $this->functions[$functionName]['executablePaths'] = count($this->functionCoverageData[$functionName]['paths']);
49739                $this->functions[$functionName]['executedPaths'] = count(array_filter($this->functionCoverageData[$functionName]['paths'], static function (array $path) {
49740                    return (bool) $path['hit'];
49741                }));
49742            }
49743            $this->numExecutableBranches += $this->functions[$functionName]['executableBranches'];
49744            $this->numExecutedBranches += $this->functions[$functionName]['executedBranches'];
49745            $this->numExecutablePaths += $this->functions[$functionName]['executablePaths'];
49746            $this->numExecutedPaths += $this->functions[$functionName]['executedPaths'];
49747        }
49748    }
49749    private function newMethod(string $className, string $methodName, array $method, string $link) : array
49750    {
49751        $methodData = ['methodName' => $methodName, 'visibility' => $method['visibility'], 'signature' => $method['signature'], 'startLine' => $method['startLine'], 'endLine' => $method['endLine'], 'executableLines' => 0, 'executedLines' => 0, 'executableBranches' => 0, 'executedBranches' => 0, 'executablePaths' => 0, 'executedPaths' => 0, 'ccn' => $method['ccn'], 'coverage' => 0, 'crap' => 0, 'link' => $link . $method['startLine']];
49752        $key = $className . '->' . $methodName;
49753        if (isset($this->functionCoverageData[$key]['branches'])) {
49754            $methodData['executableBranches'] = count($this->functionCoverageData[$key]['branches']);
49755            $methodData['executedBranches'] = count(array_filter($this->functionCoverageData[$key]['branches'], static function (array $branch) {
49756                return (bool) $branch['hit'];
49757            }));
49758        }
49759        if (isset($this->functionCoverageData[$key]['paths'])) {
49760            $methodData['executablePaths'] = count($this->functionCoverageData[$key]['paths']);
49761            $methodData['executedPaths'] = count(array_filter($this->functionCoverageData[$key]['paths'], static function (array $path) {
49762                return (bool) $path['hit'];
49763            }));
49764        }
49765        return $methodData;
49766    }
49767}
49768<?php
49769
49770declare (strict_types=1);
49771/*
49772 * This file is part of phpunit/php-code-coverage.
49773 *
49774 * (c) Sebastian Bergmann <sebastian@phpunit.de>
49775 *
49776 * For the full copyright and license information, please view the LICENSE
49777 * file that was distributed with this source code.
49778 */
49779namespace PHPUnit\SebastianBergmann\CodeCoverage\Node;
49780
49781use const DIRECTORY_SEPARATOR;
49782use function array_shift;
49783use function basename;
49784use function count;
49785use function dirname;
49786use function explode;
49787use function implode;
49788use function is_file;
49789use function str_replace;
49790use function strpos;
49791use function substr;
49792use PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage;
49793use PHPUnit\SebastianBergmann\CodeCoverage\ProcessedCodeCoverageData;
49794use PHPUnit\SebastianBergmann\CodeCoverage\StaticAnalysis\CoveredFileAnalyser;
49795/**
49796 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
49797 */
49798final class Builder
49799{
49800    /**
49801     * @var CoveredFileAnalyser
49802     */
49803    private $coveredFileAnalyser;
49804    public function __construct(CoveredFileAnalyser $coveredFileAnalyser)
49805    {
49806        $this->coveredFileAnalyser = $coveredFileAnalyser;
49807    }
49808    public function build(CodeCoverage $coverage) : Directory
49809    {
49810        $data = clone $coverage->getData();
49811        // clone because path munging is destructive to the original data
49812        $commonPath = $this->reducePaths($data);
49813        $root = new Directory($commonPath, null);
49814        $this->addItems($root, $this->buildDirectoryStructure($data), $coverage->getTests());
49815        return $root;
49816    }
49817    private function addItems(Directory $root, array $items, array $tests) : void
49818    {
49819        foreach ($items as $key => $value) {
49820            $key = (string) $key;
49821            if (substr($key, -2) === '/f') {
49822                $key = substr($key, 0, -2);
49823                $filename = $root->pathAsString() . \DIRECTORY_SEPARATOR . $key;
49824                if (is_file($filename)) {
49825                    $root->addFile(new File($key, $root, $value['lineCoverage'], $value['functionCoverage'], $tests, $this->coveredFileAnalyser->classesIn($filename), $this->coveredFileAnalyser->traitsIn($filename), $this->coveredFileAnalyser->functionsIn($filename), $this->coveredFileAnalyser->linesOfCodeFor($filename)));
49826                }
49827            } else {
49828                $child = $root->addDirectory($key);
49829                $this->addItems($child, $value, $tests);
49830            }
49831        }
49832    }
49833    /**
49834     * Builds an array representation of the directory structure.
49835     *
49836     * For instance,
49837     *
49838     * <code>
49839     * Array
49840     * (
49841     *     [Money.php] => Array
49842     *         (
49843     *             ...
49844     *         )
49845     *
49846     *     [MoneyBag.php] => Array
49847     *         (
49848     *             ...
49849     *         )
49850     * )
49851     * </code>
49852     *
49853     * is transformed into
49854     *
49855     * <code>
49856     * Array
49857     * (
49858     *     [.] => Array
49859     *         (
49860     *             [Money.php] => Array
49861     *                 (
49862     *                     ...
49863     *                 )
49864     *
49865     *             [MoneyBag.php] => Array
49866     *                 (
49867     *                     ...
49868     *                 )
49869     *         )
49870     * )
49871     * </code>
49872     */
49873    private function buildDirectoryStructure(ProcessedCodeCoverageData $data) : array
49874    {
49875        $result = [];
49876        foreach ($data->coveredFiles() as $originalPath) {
49877            $path = explode(\DIRECTORY_SEPARATOR, $originalPath);
49878            $pointer =& $result;
49879            $max = count($path);
49880            for ($i = 0; $i < $max; $i++) {
49881                $type = '';
49882                if ($i === $max - 1) {
49883                    $type = '/f';
49884                }
49885                $pointer =& $pointer[$path[$i] . $type];
49886            }
49887            $pointer = ['lineCoverage' => $data->lineCoverage()[$originalPath] ?? [], 'functionCoverage' => $data->functionCoverage()[$originalPath] ?? []];
49888        }
49889        return $result;
49890    }
49891    /**
49892     * Reduces the paths by cutting the longest common start path.
49893     *
49894     * For instance,
49895     *
49896     * <code>
49897     * Array
49898     * (
49899     *     [/home/sb/Money/Money.php] => Array
49900     *         (
49901     *             ...
49902     *         )
49903     *
49904     *     [/home/sb/Money/MoneyBag.php] => Array
49905     *         (
49906     *             ...
49907     *         )
49908     * )
49909     * </code>
49910     *
49911     * is reduced to
49912     *
49913     * <code>
49914     * Array
49915     * (
49916     *     [Money.php] => Array
49917     *         (
49918     *             ...
49919     *         )
49920     *
49921     *     [MoneyBag.php] => Array
49922     *         (
49923     *             ...
49924     *         )
49925     * )
49926     * </code>
49927     */
49928    private function reducePaths(ProcessedCodeCoverageData $coverage) : string
49929    {
49930        if (empty($coverage->coveredFiles())) {
49931            return '.';
49932        }
49933        $commonPath = '';
49934        $paths = $coverage->coveredFiles();
49935        if (count($paths) === 1) {
49936            $commonPath = dirname($paths[0]) . \DIRECTORY_SEPARATOR;
49937            $coverage->renameFile($paths[0], basename($paths[0]));
49938            return $commonPath;
49939        }
49940        $max = count($paths);
49941        for ($i = 0; $i < $max; $i++) {
49942            // strip phar:// prefixes
49943            if (strpos($paths[$i], 'phar://') === 0) {
49944                $paths[$i] = substr($paths[$i], 7);
49945                $paths[$i] = str_replace('/', \DIRECTORY_SEPARATOR, $paths[$i]);
49946            }
49947            $paths[$i] = explode(\DIRECTORY_SEPARATOR, $paths[$i]);
49948            if (empty($paths[$i][0])) {
49949                $paths[$i][0] = \DIRECTORY_SEPARATOR;
49950            }
49951        }
49952        $done = \false;
49953        $max = count($paths);
49954        while (!$done) {
49955            for ($i = 0; $i < $max - 1; $i++) {
49956                if (!isset($paths[$i][0]) || !isset($paths[$i + 1][0]) || $paths[$i][0] !== $paths[$i + 1][0]) {
49957                    $done = \true;
49958                    break;
49959                }
49960            }
49961            if (!$done) {
49962                $commonPath .= $paths[0][0];
49963                if ($paths[0][0] !== \DIRECTORY_SEPARATOR) {
49964                    $commonPath .= \DIRECTORY_SEPARATOR;
49965                }
49966                for ($i = 0; $i < $max; $i++) {
49967                    array_shift($paths[$i]);
49968                }
49969            }
49970        }
49971        $original = $coverage->coveredFiles();
49972        $max = count($original);
49973        for ($i = 0; $i < $max; $i++) {
49974            $coverage->renameFile($original[$i], implode(\DIRECTORY_SEPARATOR, $paths[$i]));
49975        }
49976        return substr($commonPath, 0, -1);
49977    }
49978}
49979<?php
49980
49981declare (strict_types=1);
49982/*
49983 * This file is part of phpunit/php-code-coverage.
49984 *
49985 * (c) Sebastian Bergmann <sebastian@phpunit.de>
49986 *
49987 * For the full copyright and license information, please view the LICENSE
49988 * file that was distributed with this source code.
49989 */
49990namespace PHPUnit\SebastianBergmann\CodeCoverage\Node;
49991
49992use function count;
49993use RecursiveIterator;
49994/**
49995 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
49996 */
49997final class Iterator implements RecursiveIterator
49998{
49999    /**
50000     * @var int
50001     */
50002    private $position;
50003    /**
50004     * @var AbstractNode[]
50005     */
50006    private $nodes;
50007    public function __construct(Directory $node)
50008    {
50009        $this->nodes = $node->children();
50010    }
50011    /**
50012     * Rewinds the Iterator to the first element.
50013     */
50014    public function rewind() : void
50015    {
50016        $this->position = 0;
50017    }
50018    /**
50019     * Checks if there is a current element after calls to rewind() or next().
50020     */
50021    public function valid() : bool
50022    {
50023        return $this->position < count($this->nodes);
50024    }
50025    /**
50026     * Returns the key of the current element.
50027     */
50028    public function key() : int
50029    {
50030        return $this->position;
50031    }
50032    /**
50033     * Returns the current element.
50034     */
50035    public function current() : ?AbstractNode
50036    {
50037        return $this->valid() ? $this->nodes[$this->position] : null;
50038    }
50039    /**
50040     * Moves forward to next element.
50041     */
50042    public function next() : void
50043    {
50044        $this->position++;
50045    }
50046    /**
50047     * Returns the sub iterator for the current element.
50048     *
50049     * @return Iterator
50050     */
50051    public function getChildren() : self
50052    {
50053        return new self($this->nodes[$this->position]);
50054    }
50055    /**
50056     * Checks whether the current element has children.
50057     */
50058    public function hasChildren() : bool
50059    {
50060        return $this->nodes[$this->position] instanceof Directory;
50061    }
50062}
50063<?php
50064
50065declare (strict_types=1);
50066/*
50067 * This file is part of phpunit/php-code-coverage.
50068 *
50069 * (c) Sebastian Bergmann <sebastian@phpunit.de>
50070 *
50071 * For the full copyright and license information, please view the LICENSE
50072 * file that was distributed with this source code.
50073 */
50074namespace PHPUnit\SebastianBergmann\CodeCoverage\Node;
50075
50076use function array_merge;
50077use function count;
50078use IteratorAggregate;
50079use RecursiveIteratorIterator;
50080use PHPUnit\SebastianBergmann\LinesOfCode\LinesOfCode;
50081/**
50082 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
50083 */
50084final class Directory extends AbstractNode implements IteratorAggregate
50085{
50086    /**
50087     * @var AbstractNode[]
50088     */
50089    private $children = [];
50090    /**
50091     * @var Directory[]
50092     */
50093    private $directories = [];
50094    /**
50095     * @var File[]
50096     */
50097    private $files = [];
50098    /**
50099     * @var array
50100     */
50101    private $classes;
50102    /**
50103     * @var array
50104     */
50105    private $traits;
50106    /**
50107     * @var array
50108     */
50109    private $functions;
50110    /**
50111     * @var LinesOfCode
50112     */
50113    private $linesOfCode;
50114    /**
50115     * @var int
50116     */
50117    private $numFiles = -1;
50118    /**
50119     * @var int
50120     */
50121    private $numExecutableLines = -1;
50122    /**
50123     * @var int
50124     */
50125    private $numExecutedLines = -1;
50126    /**
50127     * @var int
50128     */
50129    private $numExecutableBranches = -1;
50130    /**
50131     * @var int
50132     */
50133    private $numExecutedBranches = -1;
50134    /**
50135     * @var int
50136     */
50137    private $numExecutablePaths = -1;
50138    /**
50139     * @var int
50140     */
50141    private $numExecutedPaths = -1;
50142    /**
50143     * @var int
50144     */
50145    private $numClasses = -1;
50146    /**
50147     * @var int
50148     */
50149    private $numTestedClasses = -1;
50150    /**
50151     * @var int
50152     */
50153    private $numTraits = -1;
50154    /**
50155     * @var int
50156     */
50157    private $numTestedTraits = -1;
50158    /**
50159     * @var int
50160     */
50161    private $numMethods = -1;
50162    /**
50163     * @var int
50164     */
50165    private $numTestedMethods = -1;
50166    /**
50167     * @var int
50168     */
50169    private $numFunctions = -1;
50170    /**
50171     * @var int
50172     */
50173    private $numTestedFunctions = -1;
50174    public function count() : int
50175    {
50176        if ($this->numFiles === -1) {
50177            $this->numFiles = 0;
50178            foreach ($this->children as $child) {
50179                $this->numFiles += count($child);
50180            }
50181        }
50182        return $this->numFiles;
50183    }
50184    public function getIterator() : RecursiveIteratorIterator
50185    {
50186        return new RecursiveIteratorIterator(new Iterator($this), RecursiveIteratorIterator::SELF_FIRST);
50187    }
50188    public function addDirectory(string $name) : self
50189    {
50190        $directory = new self($name, $this);
50191        $this->children[] = $directory;
50192        $this->directories[] =& $this->children[count($this->children) - 1];
50193        return $directory;
50194    }
50195    public function addFile(File $file) : void
50196    {
50197        $this->children[] = $file;
50198        $this->files[] =& $this->children[count($this->children) - 1];
50199        $this->numExecutableLines = -1;
50200        $this->numExecutedLines = -1;
50201    }
50202    public function directories() : array
50203    {
50204        return $this->directories;
50205    }
50206    public function files() : array
50207    {
50208        return $this->files;
50209    }
50210    public function children() : array
50211    {
50212        return $this->children;
50213    }
50214    public function classes() : array
50215    {
50216        if ($this->classes === null) {
50217            $this->classes = [];
50218            foreach ($this->children as $child) {
50219                $this->classes = array_merge($this->classes, $child->classes());
50220            }
50221        }
50222        return $this->classes;
50223    }
50224    public function traits() : array
50225    {
50226        if ($this->traits === null) {
50227            $this->traits = [];
50228            foreach ($this->children as $child) {
50229                $this->traits = array_merge($this->traits, $child->traits());
50230            }
50231        }
50232        return $this->traits;
50233    }
50234    public function functions() : array
50235    {
50236        if ($this->functions === null) {
50237            $this->functions = [];
50238            foreach ($this->children as $child) {
50239                $this->functions = array_merge($this->functions, $child->functions());
50240            }
50241        }
50242        return $this->functions;
50243    }
50244    public function linesOfCode() : LinesOfCode
50245    {
50246        if ($this->linesOfCode === null) {
50247            $this->linesOfCode = new LinesOfCode(0, 0, 0, 0);
50248            foreach ($this->children as $child) {
50249                $this->linesOfCode = $this->linesOfCode->plus($child->linesOfCode());
50250            }
50251        }
50252        return $this->linesOfCode;
50253    }
50254    public function numberOfExecutableLines() : int
50255    {
50256        if ($this->numExecutableLines === -1) {
50257            $this->numExecutableLines = 0;
50258            foreach ($this->children as $child) {
50259                $this->numExecutableLines += $child->numberOfExecutableLines();
50260            }
50261        }
50262        return $this->numExecutableLines;
50263    }
50264    public function numberOfExecutedLines() : int
50265    {
50266        if ($this->numExecutedLines === -1) {
50267            $this->numExecutedLines = 0;
50268            foreach ($this->children as $child) {
50269                $this->numExecutedLines += $child->numberOfExecutedLines();
50270            }
50271        }
50272        return $this->numExecutedLines;
50273    }
50274    public function numberOfExecutableBranches() : int
50275    {
50276        if ($this->numExecutableBranches === -1) {
50277            $this->numExecutableBranches = 0;
50278            foreach ($this->children as $child) {
50279                $this->numExecutableBranches += $child->numberOfExecutableBranches();
50280            }
50281        }
50282        return $this->numExecutableBranches;
50283    }
50284    public function numberOfExecutedBranches() : int
50285    {
50286        if ($this->numExecutedBranches === -1) {
50287            $this->numExecutedBranches = 0;
50288            foreach ($this->children as $child) {
50289                $this->numExecutedBranches += $child->numberOfExecutedBranches();
50290            }
50291        }
50292        return $this->numExecutedBranches;
50293    }
50294    public function numberOfExecutablePaths() : int
50295    {
50296        if ($this->numExecutablePaths === -1) {
50297            $this->numExecutablePaths = 0;
50298            foreach ($this->children as $child) {
50299                $this->numExecutablePaths += $child->numberOfExecutablePaths();
50300            }
50301        }
50302        return $this->numExecutablePaths;
50303    }
50304    public function numberOfExecutedPaths() : int
50305    {
50306        if ($this->numExecutedPaths === -1) {
50307            $this->numExecutedPaths = 0;
50308            foreach ($this->children as $child) {
50309                $this->numExecutedPaths += $child->numberOfExecutedPaths();
50310            }
50311        }
50312        return $this->numExecutedPaths;
50313    }
50314    public function numberOfClasses() : int
50315    {
50316        if ($this->numClasses === -1) {
50317            $this->numClasses = 0;
50318            foreach ($this->children as $child) {
50319                $this->numClasses += $child->numberOfClasses();
50320            }
50321        }
50322        return $this->numClasses;
50323    }
50324    public function numberOfTestedClasses() : int
50325    {
50326        if ($this->numTestedClasses === -1) {
50327            $this->numTestedClasses = 0;
50328            foreach ($this->children as $child) {
50329                $this->numTestedClasses += $child->numberOfTestedClasses();
50330            }
50331        }
50332        return $this->numTestedClasses;
50333    }
50334    public function numberOfTraits() : int
50335    {
50336        if ($this->numTraits === -1) {
50337            $this->numTraits = 0;
50338            foreach ($this->children as $child) {
50339                $this->numTraits += $child->numberOfTraits();
50340            }
50341        }
50342        return $this->numTraits;
50343    }
50344    public function numberOfTestedTraits() : int
50345    {
50346        if ($this->numTestedTraits === -1) {
50347            $this->numTestedTraits = 0;
50348            foreach ($this->children as $child) {
50349                $this->numTestedTraits += $child->numberOfTestedTraits();
50350            }
50351        }
50352        return $this->numTestedTraits;
50353    }
50354    public function numberOfMethods() : int
50355    {
50356        if ($this->numMethods === -1) {
50357            $this->numMethods = 0;
50358            foreach ($this->children as $child) {
50359                $this->numMethods += $child->numberOfMethods();
50360            }
50361        }
50362        return $this->numMethods;
50363    }
50364    public function numberOfTestedMethods() : int
50365    {
50366        if ($this->numTestedMethods === -1) {
50367            $this->numTestedMethods = 0;
50368            foreach ($this->children as $child) {
50369                $this->numTestedMethods += $child->numberOfTestedMethods();
50370            }
50371        }
50372        return $this->numTestedMethods;
50373    }
50374    public function numberOfFunctions() : int
50375    {
50376        if ($this->numFunctions === -1) {
50377            $this->numFunctions = 0;
50378            foreach ($this->children as $child) {
50379                $this->numFunctions += $child->numberOfFunctions();
50380            }
50381        }
50382        return $this->numFunctions;
50383    }
50384    public function numberOfTestedFunctions() : int
50385    {
50386        if ($this->numTestedFunctions === -1) {
50387            $this->numTestedFunctions = 0;
50388            foreach ($this->children as $child) {
50389                $this->numTestedFunctions += $child->numberOfTestedFunctions();
50390            }
50391        }
50392        return $this->numTestedFunctions;
50393    }
50394}
50395<?php
50396
50397declare (strict_types=1);
50398/*
50399 * This file is part of phpunit/php-code-coverage.
50400 *
50401 * (c) Sebastian Bergmann <sebastian@phpunit.de>
50402 *
50403 * For the full copyright and license information, please view the LICENSE
50404 * file that was distributed with this source code.
50405 */
50406namespace PHPUnit\SebastianBergmann\CodeCoverage\Node;
50407
50408use const DIRECTORY_SEPARATOR;
50409use function array_merge;
50410use function str_replace;
50411use function substr;
50412use Countable;
50413use PHPUnit\SebastianBergmann\CodeCoverage\Percentage;
50414use PHPUnit\SebastianBergmann\LinesOfCode\LinesOfCode;
50415/**
50416 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
50417 */
50418abstract class AbstractNode implements Countable
50419{
50420    /**
50421     * @var string
50422     */
50423    private $name;
50424    /**
50425     * @var string
50426     */
50427    private $pathAsString;
50428    /**
50429     * @var array
50430     */
50431    private $pathAsArray;
50432    /**
50433     * @var AbstractNode
50434     */
50435    private $parent;
50436    /**
50437     * @var string
50438     */
50439    private $id;
50440    public function __construct(string $name, self $parent = null)
50441    {
50442        if (substr($name, -1) === \DIRECTORY_SEPARATOR) {
50443            $name = substr($name, 0, -1);
50444        }
50445        $this->name = $name;
50446        $this->parent = $parent;
50447    }
50448    public function name() : string
50449    {
50450        return $this->name;
50451    }
50452    public function id() : string
50453    {
50454        if ($this->id === null) {
50455            $parent = $this->parent();
50456            if ($parent === null) {
50457                $this->id = 'index';
50458            } else {
50459                $parentId = $parent->id();
50460                if ($parentId === 'index') {
50461                    $this->id = str_replace(':', '_', $this->name);
50462                } else {
50463                    $this->id = $parentId . '/' . $this->name;
50464                }
50465            }
50466        }
50467        return $this->id;
50468    }
50469    public function pathAsString() : string
50470    {
50471        if ($this->pathAsString === null) {
50472            if ($this->parent === null) {
50473                $this->pathAsString = $this->name;
50474            } else {
50475                $this->pathAsString = $this->parent->pathAsString() . \DIRECTORY_SEPARATOR . $this->name;
50476            }
50477        }
50478        return $this->pathAsString;
50479    }
50480    public function pathAsArray() : array
50481    {
50482        if ($this->pathAsArray === null) {
50483            if ($this->parent === null) {
50484                $this->pathAsArray = [];
50485            } else {
50486                $this->pathAsArray = $this->parent->pathAsArray();
50487            }
50488            $this->pathAsArray[] = $this;
50489        }
50490        return $this->pathAsArray;
50491    }
50492    public function parent() : ?self
50493    {
50494        return $this->parent;
50495    }
50496    public function percentageOfTestedClasses() : Percentage
50497    {
50498        return Percentage::fromFractionAndTotal($this->numberOfTestedClasses(), $this->numberOfClasses());
50499    }
50500    public function percentageOfTestedTraits() : Percentage
50501    {
50502        return Percentage::fromFractionAndTotal($this->numberOfTestedTraits(), $this->numberOfTraits());
50503    }
50504    public function percentageOfTestedClassesAndTraits() : Percentage
50505    {
50506        return Percentage::fromFractionAndTotal($this->numberOfTestedClassesAndTraits(), $this->numberOfClassesAndTraits());
50507    }
50508    public function percentageOfTestedFunctions() : Percentage
50509    {
50510        return Percentage::fromFractionAndTotal($this->numberOfTestedFunctions(), $this->numberOfFunctions());
50511    }
50512    public function percentageOfTestedMethods() : Percentage
50513    {
50514        return Percentage::fromFractionAndTotal($this->numberOfTestedMethods(), $this->numberOfMethods());
50515    }
50516    public function percentageOfTestedFunctionsAndMethods() : Percentage
50517    {
50518        return Percentage::fromFractionAndTotal($this->numberOfTestedFunctionsAndMethods(), $this->numberOfFunctionsAndMethods());
50519    }
50520    public function percentageOfExecutedLines() : Percentage
50521    {
50522        return Percentage::fromFractionAndTotal($this->numberOfExecutedLines(), $this->numberOfExecutableLines());
50523    }
50524    public function percentageOfExecutedBranches() : Percentage
50525    {
50526        return Percentage::fromFractionAndTotal($this->numberOfExecutedBranches(), $this->numberOfExecutableBranches());
50527    }
50528    public function percentageOfExecutedPaths() : Percentage
50529    {
50530        return Percentage::fromFractionAndTotal($this->numberOfExecutedPaths(), $this->numberOfExecutablePaths());
50531    }
50532    public function numberOfClassesAndTraits() : int
50533    {
50534        return $this->numberOfClasses() + $this->numberOfTraits();
50535    }
50536    public function numberOfTestedClassesAndTraits() : int
50537    {
50538        return $this->numberOfTestedClasses() + $this->numberOfTestedTraits();
50539    }
50540    public function classesAndTraits() : array
50541    {
50542        return array_merge($this->classes(), $this->traits());
50543    }
50544    public function numberOfFunctionsAndMethods() : int
50545    {
50546        return $this->numberOfFunctions() + $this->numberOfMethods();
50547    }
50548    public function numberOfTestedFunctionsAndMethods() : int
50549    {
50550        return $this->numberOfTestedFunctions() + $this->numberOfTestedMethods();
50551    }
50552    public abstract function classes() : array;
50553    public abstract function traits() : array;
50554    public abstract function functions() : array;
50555    public abstract function linesOfCode() : LinesOfCode;
50556    public abstract function numberOfExecutableLines() : int;
50557    public abstract function numberOfExecutedLines() : int;
50558    public abstract function numberOfExecutableBranches() : int;
50559    public abstract function numberOfExecutedBranches() : int;
50560    public abstract function numberOfExecutablePaths() : int;
50561    public abstract function numberOfExecutedPaths() : int;
50562    public abstract function numberOfClasses() : int;
50563    public abstract function numberOfTestedClasses() : int;
50564    public abstract function numberOfTraits() : int;
50565    public abstract function numberOfTestedTraits() : int;
50566    public abstract function numberOfMethods() : int;
50567    public abstract function numberOfTestedMethods() : int;
50568    public abstract function numberOfFunctions() : int;
50569    public abstract function numberOfTestedFunctions() : int;
50570}
50571php-code-coverage
50572
50573Copyright (c) 2009-2021, Sebastian Bergmann <sebastian@phpunit.de>.
50574All rights reserved.
50575
50576Redistribution and use in source and binary forms, with or without
50577modification, are permitted provided that the following conditions
50578are met:
50579
50580 * Redistributions of source code must retain the above copyright
50581   notice, this list of conditions and the following disclaimer.
50582
50583 * Redistributions in binary form must reproduce the above copyright
50584   notice, this list of conditions and the following disclaimer in
50585   the documentation and/or other materials provided with the
50586   distribution.
50587
50588 * Neither the name of Sebastian Bergmann nor the names of his
50589   contributors may be used to endorse or promote products derived
50590   from this software without specific prior written permission.
50591
50592THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
50593"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
50594LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
50595FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
50596COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
50597INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
50598BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
50599LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
50600CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
50601LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
50602ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
50603POSSIBILITY OF SUCH DAMAGE.
50604<?php
50605
50606declare (strict_types=1);
50607/*
50608 * This file is part of phpunit/php-code-coverage.
50609 *
50610 * (c) Sebastian Bergmann <sebastian@phpunit.de>
50611 *
50612 * For the full copyright and license information, please view the LICENSE
50613 * file that was distributed with this source code.
50614 */
50615namespace PHPUnit\SebastianBergmann\CodeCoverage;
50616
50617use function is_dir;
50618use function mkdir;
50619use function sprintf;
50620/**
50621 * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
50622 */
50623final class Directory
50624{
50625    /**
50626     * @throws DirectoryCouldNotBeCreatedException
50627     */
50628    public static function create(string $directory) : void
50629    {
50630        $success = !(!is_dir($directory) && !@mkdir($directory, 0777, \true) && !is_dir($directory));
50631        if (!$success) {
50632            throw new DirectoryCouldNotBeCreatedException(sprintf('Directory "%s" could not be created', $directory));
50633        }
50634    }
50635}
50636<?php
50637
50638declare (strict_types=1);
50639/*
50640 * This file is part of PHPUnit.
50641 *
50642 * (c) Sebastian Bergmann <sebastian@phpunit.de>
50643 *
50644 * For the full copyright and license information, please view the LICENSE
50645 * file that was distributed with this source code.
50646 */
50647namespace PHPUnit\Util;
50648
50649use const ENT_QUOTES;
50650use function assert;
50651use function class_exists;
50652use function htmlspecialchars;
50653use function mb_convert_encoding;
50654use function ord;
50655use function preg_replace;
50656use function settype;
50657use function strlen;
50658use DOMCharacterData;
50659use DOMDocument;
50660use DOMElement;
50661use DOMNode;
50662use DOMText;
50663use ReflectionClass;
50664use ReflectionException;
50665/**
50666 * @internal This class is not covered by the backward compatibility promise for PHPUnit
50667 */
50668final class Xml
50669{
50670    /**
50671     * @deprecated Only used by assertEqualXMLStructure()
50672     */
50673    public static function import(DOMElement $element) : DOMElement
50674    {
50675        return (new DOMDocument())->importNode($element, \true);
50676    }
50677    /**
50678     * @deprecated Only used by assertEqualXMLStructure()
50679     */
50680    public static function removeCharacterDataNodes(DOMNode $node) : void
50681    {
50682        if ($node->hasChildNodes()) {
50683            for ($i = $node->childNodes->length - 1; $i >= 0; $i--) {
50684                if (($child = $node->childNodes->item($i)) instanceof DOMCharacterData) {
50685                    $node->removeChild($child);
50686                }
50687            }
50688        }
50689    }
50690    /**
50691     * Escapes a string for the use in XML documents.
50692     *
50693     * Any Unicode character is allowed, excluding the surrogate blocks, FFFE,
50694     * and FFFF (not even as character reference).
50695     *
50696     * @see https://www.w3.org/TR/xml/#charsets
50697     */
50698    public static function prepareString(string $string) : string
50699    {
50700        return preg_replace('/[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]/', '', htmlspecialchars(self::convertToUtf8($string), \ENT_QUOTES));
50701    }
50702    /**
50703     * "Convert" a DOMElement object into a PHP variable.
50704     */
50705    public static function xmlToVariable(DOMElement $element)
50706    {
50707        $variable = null;
50708        switch ($element->tagName) {
50709            case 'array':
50710                $variable = [];
50711                foreach ($element->childNodes as $entry) {
50712                    if (!$entry instanceof DOMElement || $entry->tagName !== 'element') {
50713                        continue;
50714                    }
50715                    $item = $entry->childNodes->item(0);
50716                    if ($item instanceof DOMText) {
50717                        $item = $entry->childNodes->item(1);
50718                    }
50719                    $value = self::xmlToVariable($item);
50720                    if ($entry->hasAttribute('key')) {
50721                        $variable[(string) $entry->getAttribute('key')] = $value;
50722                    } else {
50723                        $variable[] = $value;
50724                    }
50725                }
50726                break;
50727            case 'object':
50728                $className = $element->getAttribute('class');
50729                if ($element->hasChildNodes()) {
50730                    $arguments = $element->childNodes->item(0)->childNodes;
50731                    $constructorArgs = [];
50732                    foreach ($arguments as $argument) {
50733                        if ($argument instanceof DOMElement) {
50734                            $constructorArgs[] = self::xmlToVariable($argument);
50735                        }
50736                    }
50737                    try {
50738                        assert(class_exists($className));
50739                        $variable = (new ReflectionClass($className))->newInstanceArgs($constructorArgs);
50740                        // @codeCoverageIgnoreStart
50741                    } catch (ReflectionException $e) {
50742                        throw new \PHPUnit\Util\Exception($e->getMessage(), (int) $e->getCode(), $e);
50743                    }
50744                    // @codeCoverageIgnoreEnd
50745                } else {
50746                    $variable = new $className();
50747                }
50748                break;
50749            case 'boolean':
50750                $variable = $element->textContent === 'true';
50751                break;
50752            case 'integer':
50753            case 'double':
50754            case 'string':
50755                $variable = $element->textContent;
50756                settype($variable, $element->tagName);
50757                break;
50758        }
50759        return $variable;
50760    }
50761    private static function convertToUtf8(string $string) : string
50762    {
50763        if (!self::isUtf8($string)) {
50764            $string = mb_convert_encoding($string, 'UTF-8');
50765        }
50766        return $string;
50767    }
50768    private static function isUtf8(string $string) : bool
50769    {
50770        $length = strlen($string);
50771        for ($i = 0; $i < $length; $i++) {
50772            if (ord($string[$i]) < 0x80) {
50773                $n = 0;
50774            } elseif ((ord($string[$i]) & 0xe0) === 0xc0) {
50775                $n = 1;
50776            } elseif ((ord($string[$i]) & 0xf0) === 0xe0) {
50777                $n = 2;
50778            } elseif ((ord($string[$i]) & 0xf0) === 0xf0) {
50779                $n = 3;
50780            } else {
50781                return \false;
50782            }
50783            for ($j = 0; $j < $n; $j++) {
50784                if (++$i === $length || (ord($string[$i]) & 0xc0) !== 0x80) {
50785                    return \false;
50786                }
50787            }
50788        }
50789        return \true;
50790    }
50791}
50792<?php
50793
50794declare (strict_types=1);
50795/*
50796 * This file is part of PHPUnit.
50797 *
50798 * (c) Sebastian Bergmann <sebastian@phpunit.de>
50799 *
50800 * For the full copyright and license information, please view the LICENSE
50801 * file that was distributed with this source code.
50802 */
50803namespace PHPUnit\Util;
50804
50805use function array_keys;
50806use function array_reverse;
50807use function defined;
50808use function get_defined_constants;
50809use function get_included_files;
50810use function in_array;
50811use function ini_get_all;
50812use function is_array;
50813use function is_file;
50814use function is_scalar;
50815use function preg_match;
50816use function serialize;
50817use function sprintf;
50818use function strpos;
50819use function var_export;
50820use Closure;
50821/**
50822 * @internal This class is not covered by the backward compatibility promise for PHPUnit
50823 */
50824final class GlobalState
50825{
50826    /**
50827     * @var string[]
50828     */
50829    private const SUPER_GLOBAL_ARRAYS = ['_ENV', '_POST', '_GET', '_COOKIE', '_SERVER', '_FILES', '_REQUEST'];
50830    /**
50831     * @throws Exception
50832     */
50833    public static function getIncludedFilesAsString() : string
50834    {
50835        return self::processIncludedFilesAsString(get_included_files());
50836    }
50837    /**
50838     * @param string[] $files
50839     *
50840     * @throws Exception
50841     */
50842    public static function processIncludedFilesAsString(array $files) : string
50843    {
50844        $excludeList = new \PHPUnit\Util\ExcludeList();
50845        $prefix = \false;
50846        $result = '';
50847        if (defined('__PHPUNIT_PHAR__')) {
50848            $prefix = 'phar://' . __PHPUNIT_PHAR__ . '/';
50849        }
50850        // Do not process bootstrap script
50851        unset($files[0]);
50852        foreach (array_reverse($files) as $file) {
50853            if (!empty($GLOBALS['__PHPUNIT_ISOLATION_EXCLUDE_LIST']) && in_array($file, $GLOBALS['__PHPUNIT_ISOLATION_EXCLUDE_LIST'], \true)) {
50854                continue;
50855            }
50856            if ($prefix !== \false && strpos($file, $prefix) === 0) {
50857                continue;
50858            }
50859            // Skip virtual file system protocols
50860            if (preg_match('/^(vfs|phpvfs[a-z0-9]+):/', $file)) {
50861                continue;
50862            }
50863            if (!$excludeList->isExcluded($file) && is_file($file)) {
50864                $result = 'require_once \'' . $file . "';\n" . $result;
50865            }
50866        }
50867        return $result;
50868    }
50869    public static function getIniSettingsAsString() : string
50870    {
50871        $result = '';
50872        foreach (ini_get_all(null, \false) as $key => $value) {
50873            $result .= sprintf('@ini_set(%s, %s);' . "\n", self::exportVariable($key), self::exportVariable((string) $value));
50874        }
50875        return $result;
50876    }
50877    public static function getConstantsAsString() : string
50878    {
50879        $constants = get_defined_constants(\true);
50880        $result = '';
50881        if (isset($constants['user'])) {
50882            foreach ($constants['user'] as $name => $value) {
50883                $result .= sprintf('if (!defined(\'%s\')) define(\'%s\', %s);' . "\n", $name, $name, self::exportVariable($value));
50884            }
50885        }
50886        return $result;
50887    }
50888    public static function getGlobalsAsString() : string
50889    {
50890        $result = '';
50891        foreach (self::SUPER_GLOBAL_ARRAYS as $superGlobalArray) {
50892            if (isset($GLOBALS[$superGlobalArray]) && is_array($GLOBALS[$superGlobalArray])) {
50893                foreach (array_keys($GLOBALS[$superGlobalArray]) as $key) {
50894                    if ($GLOBALS[$superGlobalArray][$key] instanceof Closure) {
50895                        continue;
50896                    }
50897                    $result .= sprintf('$GLOBALS[\'%s\'][\'%s\'] = %s;' . "\n", $superGlobalArray, $key, self::exportVariable($GLOBALS[$superGlobalArray][$key]));
50898                }
50899            }
50900        }
50901        $excludeList = self::SUPER_GLOBAL_ARRAYS;
50902        $excludeList[] = 'GLOBALS';
50903        foreach (array_keys($GLOBALS) as $key) {
50904            if (!$GLOBALS[$key] instanceof Closure && !in_array($key, $excludeList, \true)) {
50905                $result .= sprintf('$GLOBALS[\'%s\'] = %s;' . "\n", $key, self::exportVariable($GLOBALS[$key]));
50906            }
50907        }
50908        return $result;
50909    }
50910    private static function exportVariable($variable) : string
50911    {
50912        if (is_scalar($variable) || $variable === null || is_array($variable) && self::arrayOnlyContainsScalars($variable)) {
50913            return var_export($variable, \true);
50914        }
50915        return 'unserialize(' . var_export(serialize($variable), \true) . ')';
50916    }
50917    private static function arrayOnlyContainsScalars(array $array) : bool
50918    {
50919        $result = \true;
50920        foreach ($array as $element) {
50921            if (is_array($element)) {
50922                $result = self::arrayOnlyContainsScalars($element);
50923            } elseif (!is_scalar($element) && $element !== null) {
50924                $result = \false;
50925            }
50926            if (!$result) {
50927                break;
50928            }
50929        }
50930        return $result;
50931    }
50932}
50933<?php
50934
50935declare (strict_types=1);
50936/*
50937 * This file is part of PHPUnit.
50938 *
50939 * (c) Sebastian Bergmann <sebastian@phpunit.de>
50940 *
50941 * For the full copyright and license information, please view the LICENSE
50942 * file that was distributed with this source code.
50943 */
50944namespace PHPUnit\Util;
50945
50946use RuntimeException;
50947/**
50948 * @internal This class is not covered by the backward compatibility promise for PHPUnit
50949 */
50950final class InvalidDataSetException extends RuntimeException implements \PHPUnit\Exception
50951{
50952}
50953<?php
50954
50955declare (strict_types=1);
50956/*
50957 * This file is part of PHPUnit.
50958 *
50959 * (c) Sebastian Bergmann <sebastian@phpunit.de>
50960 *
50961 * For the full copyright and license information, please view the LICENSE
50962 * file that was distributed with this source code.
50963 */
50964namespace PHPUnit\Util\Log;
50965
50966use function class_exists;
50967use function get_class;
50968use function method_exists;
50969use function sprintf;
50970use function str_replace;
50971use function trim;
50972use DOMDocument;
50973use DOMElement;
50974use PHPUnit\Framework\AssertionFailedError;
50975use PHPUnit\Framework\ExceptionWrapper;
50976use PHPUnit\Framework\SelfDescribing;
50977use PHPUnit\Framework\Test;
50978use PHPUnit\Framework\TestFailure;
50979use PHPUnit\Framework\TestListener;
50980use PHPUnit\Framework\TestSuite;
50981use PHPUnit\Framework\Warning;
50982use PHPUnit\Util\Exception;
50983use PHPUnit\Util\Filter;
50984use PHPUnit\Util\Printer;
50985use PHPUnit\Util\Xml;
50986use ReflectionClass;
50987use ReflectionException;
50988use Throwable;
50989/**
50990 * @internal This class is not covered by the backward compatibility promise for PHPUnit
50991 */
50992final class JUnit extends Printer implements TestListener
50993{
50994    /**
50995     * @var DOMDocument
50996     */
50997    private $document;
50998    /**
50999     * @var DOMElement
51000     */
51001    private $root;
51002    /**
51003     * @var bool
51004     */
51005    private $reportRiskyTests = \false;
51006    /**
51007     * @var DOMElement[]
51008     */
51009    private $testSuites = [];
51010    /**
51011     * @var int[]
51012     */
51013    private $testSuiteTests = [0];
51014    /**
51015     * @var int[]
51016     */
51017    private $testSuiteAssertions = [0];
51018    /**
51019     * @var int[]
51020     */
51021    private $testSuiteErrors = [0];
51022    /**
51023     * @var int[]
51024     */
51025    private $testSuiteWarnings = [0];
51026    /**
51027     * @var int[]
51028     */
51029    private $testSuiteFailures = [0];
51030    /**
51031     * @var int[]
51032     */
51033    private $testSuiteSkipped = [0];
51034    /**
51035     * @var int[]
51036     */
51037    private $testSuiteTimes = [0];
51038    /**
51039     * @var int
51040     */
51041    private $testSuiteLevel = 0;
51042    /**
51043     * @var DOMElement
51044     */
51045    private $currentTestCase;
51046    /**
51047     * @param null|mixed $out
51048     */
51049    public function __construct($out = null, bool $reportRiskyTests = \false)
51050    {
51051        $this->document = new DOMDocument('1.0', 'UTF-8');
51052        $this->document->formatOutput = \true;
51053        $this->root = $this->document->createElement('testsuites');
51054        $this->document->appendChild($this->root);
51055        parent::__construct($out);
51056        $this->reportRiskyTests = $reportRiskyTests;
51057    }
51058    /**
51059     * Flush buffer and close output.
51060     */
51061    public function flush() : void
51062    {
51063        $this->write($this->getXML());
51064        parent::flush();
51065    }
51066    /**
51067     * An error occurred.
51068     */
51069    public function addError(Test $test, Throwable $t, float $time) : void
51070    {
51071        $this->doAddFault($test, $t, 'error');
51072        $this->testSuiteErrors[$this->testSuiteLevel]++;
51073    }
51074    /**
51075     * A warning occurred.
51076     */
51077    public function addWarning(Test $test, Warning $e, float $time) : void
51078    {
51079        $this->doAddFault($test, $e, 'warning');
51080        $this->testSuiteWarnings[$this->testSuiteLevel]++;
51081    }
51082    /**
51083     * A failure occurred.
51084     */
51085    public function addFailure(Test $test, AssertionFailedError $e, float $time) : void
51086    {
51087        $this->doAddFault($test, $e, 'failure');
51088        $this->testSuiteFailures[$this->testSuiteLevel]++;
51089    }
51090    /**
51091     * Incomplete test.
51092     */
51093    public function addIncompleteTest(Test $test, Throwable $t, float $time) : void
51094    {
51095        $this->doAddSkipped();
51096    }
51097    /**
51098     * Risky test.
51099     */
51100    public function addRiskyTest(Test $test, Throwable $t, float $time) : void
51101    {
51102        if (!$this->reportRiskyTests) {
51103            return;
51104        }
51105        $this->doAddFault($test, $t, 'error');
51106        $this->testSuiteErrors[$this->testSuiteLevel]++;
51107    }
51108    /**
51109     * Skipped test.
51110     */
51111    public function addSkippedTest(Test $test, Throwable $t, float $time) : void
51112    {
51113        $this->doAddSkipped();
51114    }
51115    /**
51116     * A testsuite started.
51117     */
51118    public function startTestSuite(TestSuite $suite) : void
51119    {
51120        $testSuite = $this->document->createElement('testsuite');
51121        $testSuite->setAttribute('name', $suite->getName());
51122        if (class_exists($suite->getName(), \false)) {
51123            try {
51124                $class = new ReflectionClass($suite->getName());
51125                $testSuite->setAttribute('file', $class->getFileName());
51126            } catch (ReflectionException $e) {
51127            }
51128        }
51129        if ($this->testSuiteLevel > 0) {
51130            $this->testSuites[$this->testSuiteLevel]->appendChild($testSuite);
51131        } else {
51132            $this->root->appendChild($testSuite);
51133        }
51134        $this->testSuiteLevel++;
51135        $this->testSuites[$this->testSuiteLevel] = $testSuite;
51136        $this->testSuiteTests[$this->testSuiteLevel] = 0;
51137        $this->testSuiteAssertions[$this->testSuiteLevel] = 0;
51138        $this->testSuiteErrors[$this->testSuiteLevel] = 0;
51139        $this->testSuiteWarnings[$this->testSuiteLevel] = 0;
51140        $this->testSuiteFailures[$this->testSuiteLevel] = 0;
51141        $this->testSuiteSkipped[$this->testSuiteLevel] = 0;
51142        $this->testSuiteTimes[$this->testSuiteLevel] = 0;
51143    }
51144    /**
51145     * A testsuite ended.
51146     */
51147    public function endTestSuite(TestSuite $suite) : void
51148    {
51149        $this->testSuites[$this->testSuiteLevel]->setAttribute('tests', (string) $this->testSuiteTests[$this->testSuiteLevel]);
51150        $this->testSuites[$this->testSuiteLevel]->setAttribute('assertions', (string) $this->testSuiteAssertions[$this->testSuiteLevel]);
51151        $this->testSuites[$this->testSuiteLevel]->setAttribute('errors', (string) $this->testSuiteErrors[$this->testSuiteLevel]);
51152        $this->testSuites[$this->testSuiteLevel]->setAttribute('warnings', (string) $this->testSuiteWarnings[$this->testSuiteLevel]);
51153        $this->testSuites[$this->testSuiteLevel]->setAttribute('failures', (string) $this->testSuiteFailures[$this->testSuiteLevel]);
51154        $this->testSuites[$this->testSuiteLevel]->setAttribute('skipped', (string) $this->testSuiteSkipped[$this->testSuiteLevel]);
51155        $this->testSuites[$this->testSuiteLevel]->setAttribute('time', sprintf('%F', $this->testSuiteTimes[$this->testSuiteLevel]));
51156        if ($this->testSuiteLevel > 1) {
51157            $this->testSuiteTests[$this->testSuiteLevel - 1] += $this->testSuiteTests[$this->testSuiteLevel];
51158            $this->testSuiteAssertions[$this->testSuiteLevel - 1] += $this->testSuiteAssertions[$this->testSuiteLevel];
51159            $this->testSuiteErrors[$this->testSuiteLevel - 1] += $this->testSuiteErrors[$this->testSuiteLevel];
51160            $this->testSuiteWarnings[$this->testSuiteLevel - 1] += $this->testSuiteWarnings[$this->testSuiteLevel];
51161            $this->testSuiteFailures[$this->testSuiteLevel - 1] += $this->testSuiteFailures[$this->testSuiteLevel];
51162            $this->testSuiteSkipped[$this->testSuiteLevel - 1] += $this->testSuiteSkipped[$this->testSuiteLevel];
51163            $this->testSuiteTimes[$this->testSuiteLevel - 1] += $this->testSuiteTimes[$this->testSuiteLevel];
51164        }
51165        $this->testSuiteLevel--;
51166    }
51167    /**
51168     * A test started.
51169     */
51170    public function startTest(Test $test) : void
51171    {
51172        $usesDataprovider = \false;
51173        if (method_exists($test, 'usesDataProvider')) {
51174            $usesDataprovider = $test->usesDataProvider();
51175        }
51176        $testCase = $this->document->createElement('testcase');
51177        $testCase->setAttribute('name', $test->getName());
51178        try {
51179            $class = new ReflectionClass($test);
51180            // @codeCoverageIgnoreStart
51181        } catch (ReflectionException $e) {
51182            throw new Exception($e->getMessage(), (int) $e->getCode(), $e);
51183        }
51184        // @codeCoverageIgnoreEnd
51185        $methodName = $test->getName(!$usesDataprovider);
51186        if ($class->hasMethod($methodName)) {
51187            try {
51188                $method = $class->getMethod($methodName);
51189                // @codeCoverageIgnoreStart
51190            } catch (ReflectionException $e) {
51191                throw new Exception($e->getMessage(), (int) $e->getCode(), $e);
51192            }
51193            // @codeCoverageIgnoreEnd
51194            $testCase->setAttribute('class', $class->getName());
51195            $testCase->setAttribute('classname', str_replace('\\', '.', $class->getName()));
51196            $testCase->setAttribute('file', $class->getFileName());
51197            $testCase->setAttribute('line', (string) $method->getStartLine());
51198        }
51199        $this->currentTestCase = $testCase;
51200    }
51201    /**
51202     * A test ended.
51203     */
51204    public function endTest(Test $test, float $time) : void
51205    {
51206        $numAssertions = 0;
51207        if (method_exists($test, 'getNumAssertions')) {
51208            $numAssertions = $test->getNumAssertions();
51209        }
51210        $this->testSuiteAssertions[$this->testSuiteLevel] += $numAssertions;
51211        $this->currentTestCase->setAttribute('assertions', (string) $numAssertions);
51212        $this->currentTestCase->setAttribute('time', sprintf('%F', $time));
51213        $this->testSuites[$this->testSuiteLevel]->appendChild($this->currentTestCase);
51214        $this->testSuiteTests[$this->testSuiteLevel]++;
51215        $this->testSuiteTimes[$this->testSuiteLevel] += $time;
51216        $testOutput = '';
51217        if (method_exists($test, 'hasOutput') && method_exists($test, 'getActualOutput')) {
51218            $testOutput = $test->hasOutput() ? $test->getActualOutput() : '';
51219        }
51220        if (!empty($testOutput)) {
51221            $systemOut = $this->document->createElement('system-out', Xml::prepareString($testOutput));
51222            $this->currentTestCase->appendChild($systemOut);
51223        }
51224        $this->currentTestCase = null;
51225    }
51226    /**
51227     * Returns the XML as a string.
51228     */
51229    public function getXML() : string
51230    {
51231        return $this->document->saveXML();
51232    }
51233    private function doAddFault(Test $test, Throwable $t, string $type) : void
51234    {
51235        if ($this->currentTestCase === null) {
51236            return;
51237        }
51238        if ($test instanceof SelfDescribing) {
51239            $buffer = $test->toString() . "\n";
51240        } else {
51241            $buffer = '';
51242        }
51243        $buffer .= trim(TestFailure::exceptionToString($t) . "\n" . Filter::getFilteredStacktrace($t));
51244        $fault = $this->document->createElement($type, Xml::prepareString($buffer));
51245        if ($t instanceof ExceptionWrapper) {
51246            $fault->setAttribute('type', $t->getClassName());
51247        } else {
51248            $fault->setAttribute('type', get_class($t));
51249        }
51250        $this->currentTestCase->appendChild($fault);
51251    }
51252    private function doAddSkipped() : void
51253    {
51254        if ($this->currentTestCase === null) {
51255            return;
51256        }
51257        $skipped = $this->document->createElement('skipped');
51258        $this->currentTestCase->appendChild($skipped);
51259        $this->testSuiteSkipped[$this->testSuiteLevel]++;
51260    }
51261}
51262<?php
51263
51264declare (strict_types=1);
51265/*
51266 * This file is part of PHPUnit.
51267 *
51268 * (c) Sebastian Bergmann <sebastian@phpunit.de>
51269 *
51270 * For the full copyright and license information, please view the LICENSE
51271 * file that was distributed with this source code.
51272 */
51273namespace PHPUnit\Util\Log;
51274
51275use function class_exists;
51276use function count;
51277use function explode;
51278use function get_class;
51279use function getmypid;
51280use function ini_get;
51281use function is_bool;
51282use function is_scalar;
51283use function method_exists;
51284use function print_r;
51285use function round;
51286use function str_replace;
51287use function stripos;
51288use PHPUnit\Framework\AssertionFailedError;
51289use PHPUnit\Framework\ExceptionWrapper;
51290use PHPUnit\Framework\ExpectationFailedException;
51291use PHPUnit\Framework\Test;
51292use PHPUnit\Framework\TestCase;
51293use PHPUnit\Framework\TestFailure;
51294use PHPUnit\Framework\TestResult;
51295use PHPUnit\Framework\TestSuite;
51296use PHPUnit\Framework\Warning;
51297use PHPUnit\TextUI\DefaultResultPrinter;
51298use PHPUnit\Util\Exception;
51299use PHPUnit\Util\Filter;
51300use ReflectionClass;
51301use ReflectionException;
51302use PHPUnit\SebastianBergmann\Comparator\ComparisonFailure;
51303use Throwable;
51304/**
51305 * @internal This class is not covered by the backward compatibility promise for PHPUnit
51306 */
51307final class TeamCity extends DefaultResultPrinter
51308{
51309    /**
51310     * @var bool
51311     */
51312    private $isSummaryTestCountPrinted = \false;
51313    /**
51314     * @var string
51315     */
51316    private $startedTestName;
51317    /**
51318     * @var false|int
51319     */
51320    private $flowId;
51321    public function printResult(TestResult $result) : void
51322    {
51323        $this->printHeader($result);
51324        $this->printFooter($result);
51325    }
51326    /**
51327     * An error occurred.
51328     */
51329    public function addError(Test $test, Throwable $t, float $time) : void
51330    {
51331        $this->printEvent('testFailed', ['name' => $test->getName(), 'message' => self::getMessage($t), 'details' => self::getDetails($t), 'duration' => self::toMilliseconds($time)]);
51332    }
51333    /**
51334     * A warning occurred.
51335     */
51336    public function addWarning(Test $test, Warning $e, float $time) : void
51337    {
51338        $this->write(self::getMessage($e) . \PHP_EOL);
51339    }
51340    /**
51341     * A failure occurred.
51342     */
51343    public function addFailure(Test $test, AssertionFailedError $e, float $time) : void
51344    {
51345        $parameters = ['name' => $test->getName(), 'message' => self::getMessage($e), 'details' => self::getDetails($e), 'duration' => self::toMilliseconds($time)];
51346        if ($e instanceof ExpectationFailedException) {
51347            $comparisonFailure = $e->getComparisonFailure();
51348            if ($comparisonFailure instanceof ComparisonFailure) {
51349                $expectedString = $comparisonFailure->getExpectedAsString();
51350                if ($expectedString === null || empty($expectedString)) {
51351                    $expectedString = self::getPrimitiveValueAsString($comparisonFailure->getExpected());
51352                }
51353                $actualString = $comparisonFailure->getActualAsString();
51354                if ($actualString === null || empty($actualString)) {
51355                    $actualString = self::getPrimitiveValueAsString($comparisonFailure->getActual());
51356                }
51357                if ($actualString !== null && $expectedString !== null) {
51358                    $parameters['type'] = 'comparisonFailure';
51359                    $parameters['actual'] = $actualString;
51360                    $parameters['expected'] = $expectedString;
51361                }
51362            }
51363        }
51364        $this->printEvent('testFailed', $parameters);
51365    }
51366    /**
51367     * Incomplete test.
51368     */
51369    public function addIncompleteTest(Test $test, Throwable $t, float $time) : void
51370    {
51371        $this->printIgnoredTest($test->getName(), $t, $time);
51372    }
51373    /**
51374     * Risky test.
51375     */
51376    public function addRiskyTest(Test $test, Throwable $t, float $time) : void
51377    {
51378        $this->addError($test, $t, $time);
51379    }
51380    /**
51381     * Skipped test.
51382     */
51383    public function addSkippedTest(Test $test, Throwable $t, float $time) : void
51384    {
51385        $testName = $test->getName();
51386        if ($this->startedTestName !== $testName) {
51387            $this->startTest($test);
51388            $this->printIgnoredTest($testName, $t, $time);
51389            $this->endTest($test, $time);
51390        } else {
51391            $this->printIgnoredTest($testName, $t, $time);
51392        }
51393    }
51394    public function printIgnoredTest(string $testName, Throwable $t, float $time) : void
51395    {
51396        $this->printEvent('testIgnored', ['name' => $testName, 'message' => self::getMessage($t), 'details' => self::getDetails($t), 'duration' => self::toMilliseconds($time)]);
51397    }
51398    /**
51399     * A testsuite started.
51400     */
51401    public function startTestSuite(TestSuite $suite) : void
51402    {
51403        if (stripos(ini_get('disable_functions'), 'getmypid') === \false) {
51404            $this->flowId = getmypid();
51405        } else {
51406            $this->flowId = \false;
51407        }
51408        if (!$this->isSummaryTestCountPrinted) {
51409            $this->isSummaryTestCountPrinted = \true;
51410            $this->printEvent('testCount', ['count' => count($suite)]);
51411        }
51412        $suiteName = $suite->getName();
51413        if (empty($suiteName)) {
51414            return;
51415        }
51416        $parameters = ['name' => $suiteName];
51417        if (class_exists($suiteName, \false)) {
51418            $fileName = self::getFileName($suiteName);
51419            $parameters['locationHint'] = "php_qn://{$fileName}::\\{$suiteName}";
51420        } else {
51421            $split = explode('::', $suiteName);
51422            if (count($split) === 2 && class_exists($split[0]) && method_exists($split[0], $split[1])) {
51423                $fileName = self::getFileName($split[0]);
51424                $parameters['locationHint'] = "php_qn://{$fileName}::\\{$suiteName}";
51425                $parameters['name'] = $split[1];
51426            }
51427        }
51428        $this->printEvent('testSuiteStarted', $parameters);
51429    }
51430    /**
51431     * A testsuite ended.
51432     */
51433    public function endTestSuite(TestSuite $suite) : void
51434    {
51435        $suiteName = $suite->getName();
51436        if (empty($suiteName)) {
51437            return;
51438        }
51439        $parameters = ['name' => $suiteName];
51440        if (!class_exists($suiteName, \false)) {
51441            $split = explode('::', $suiteName);
51442            if (count($split) === 2 && class_exists($split[0]) && method_exists($split[0], $split[1])) {
51443                $parameters['name'] = $split[1];
51444            }
51445        }
51446        $this->printEvent('testSuiteFinished', $parameters);
51447    }
51448    /**
51449     * A test started.
51450     */
51451    public function startTest(Test $test) : void
51452    {
51453        $testName = $test->getName();
51454        $this->startedTestName = $testName;
51455        $params = ['name' => $testName];
51456        if ($test instanceof TestCase) {
51457            $className = get_class($test);
51458            $fileName = self::getFileName($className);
51459            $params['locationHint'] = "php_qn://{$fileName}::\\{$className}::{$testName}";
51460        }
51461        $this->printEvent('testStarted', $params);
51462    }
51463    /**
51464     * A test ended.
51465     */
51466    public function endTest(Test $test, float $time) : void
51467    {
51468        parent::endTest($test, $time);
51469        $this->printEvent('testFinished', ['name' => $test->getName(), 'duration' => self::toMilliseconds($time)]);
51470    }
51471    protected function writeProgress(string $progress) : void
51472    {
51473    }
51474    private function printEvent(string $eventName, array $params = []) : void
51475    {
51476        $this->write("\n##teamcity[{$eventName}");
51477        if ($this->flowId) {
51478            $params['flowId'] = $this->flowId;
51479        }
51480        foreach ($params as $key => $value) {
51481            $escapedValue = self::escapeValue((string) $value);
51482            $this->write(" {$key}='{$escapedValue}'");
51483        }
51484        $this->write("]\n");
51485    }
51486    private static function getMessage(Throwable $t) : string
51487    {
51488        $message = '';
51489        if ($t instanceof ExceptionWrapper) {
51490            if ($t->getClassName() !== '') {
51491                $message .= $t->getClassName();
51492            }
51493            if ($message !== '' && $t->getMessage() !== '') {
51494                $message .= ' : ';
51495            }
51496        }
51497        return $message . $t->getMessage();
51498    }
51499    private static function getDetails(Throwable $t) : string
51500    {
51501        $stackTrace = Filter::getFilteredStacktrace($t);
51502        $previous = $t instanceof ExceptionWrapper ? $t->getPreviousWrapped() : $t->getPrevious();
51503        while ($previous) {
51504            $stackTrace .= "\nCaused by\n" . TestFailure::exceptionToString($previous) . "\n" . Filter::getFilteredStacktrace($previous);
51505            $previous = $previous instanceof ExceptionWrapper ? $previous->getPreviousWrapped() : $previous->getPrevious();
51506        }
51507        return ' ' . str_replace("\n", "\n ", $stackTrace);
51508    }
51509    private static function getPrimitiveValueAsString($value) : ?string
51510    {
51511        if ($value === null) {
51512            return 'null';
51513        }
51514        if (is_bool($value)) {
51515            return $value ? 'true' : 'false';
51516        }
51517        if (is_scalar($value)) {
51518            return print_r($value, \true);
51519        }
51520        return null;
51521    }
51522    private static function escapeValue(string $text) : string
51523    {
51524        return str_replace(['|', "'", "\n", "\r", ']', '['], ['||', "|'", '|n', '|r', '|]', '|['], $text);
51525    }
51526    /**
51527     * @param string $className
51528     */
51529    private static function getFileName($className) : string
51530    {
51531        try {
51532            return (new ReflectionClass($className))->getFileName();
51533            // @codeCoverageIgnoreStart
51534        } catch (ReflectionException $e) {
51535            throw new Exception($e->getMessage(), (int) $e->getCode(), $e);
51536        }
51537        // @codeCoverageIgnoreEnd
51538    }
51539    /**
51540     * @param float $time microseconds
51541     */
51542    private static function toMilliseconds(float $time) : int
51543    {
51544        return (int) round($time * 1000);
51545    }
51546}
51547<?php
51548
51549declare (strict_types=1);
51550/*
51551 * This file is part of PHPUnit.
51552 *
51553 * (c) Sebastian Bergmann <sebastian@phpunit.de>
51554 *
51555 * For the full copyright and license information, please view the LICENSE
51556 * file that was distributed with this source code.
51557 */
51558namespace PHPUnit\Util;
51559
51560/**
51561 * @deprecated Use ExcludeList instead
51562 *
51563 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
51564 */
51565final class Blacklist
51566{
51567    public static function addDirectory(string $directory) : void
51568    {
51569        \PHPUnit\Util\ExcludeList::addDirectory($directory);
51570    }
51571    /**
51572     * @throws Exception
51573     *
51574     * @return string[]
51575     */
51576    public function getBlacklistedDirectories() : array
51577    {
51578        return (new \PHPUnit\Util\ExcludeList())->getExcludedDirectories();
51579    }
51580    /**
51581     * @throws Exception
51582     */
51583    public function isBlacklisted(string $file) : bool
51584    {
51585        return (new \PHPUnit\Util\ExcludeList())->isExcluded($file);
51586    }
51587}
51588<?php
51589
51590declare (strict_types=1);
51591/*
51592 * This file is part of PHPUnit.
51593 *
51594 * (c) Sebastian Bergmann <sebastian@phpunit.de>
51595 *
51596 * For the full copyright and license information, please view the LICENSE
51597 * file that was distributed with this source code.
51598 */
51599namespace PHPUnit\Util;
51600
51601use function array_unshift;
51602use function defined;
51603use function in_array;
51604use function is_file;
51605use function realpath;
51606use function sprintf;
51607use function strpos;
51608use PHPUnit\Framework\Exception;
51609use PHPUnit\Framework\SyntheticError;
51610use Throwable;
51611/**
51612 * @internal This class is not covered by the backward compatibility promise for PHPUnit
51613 */
51614final class Filter
51615{
51616    /**
51617     * @throws Exception
51618     */
51619    public static function getFilteredStacktrace(Throwable $t) : string
51620    {
51621        $filteredStacktrace = '';
51622        if ($t instanceof SyntheticError) {
51623            $eTrace = $t->getSyntheticTrace();
51624            $eFile = $t->getSyntheticFile();
51625            $eLine = $t->getSyntheticLine();
51626        } elseif ($t instanceof Exception) {
51627            $eTrace = $t->getSerializableTrace();
51628            $eFile = $t->getFile();
51629            $eLine = $t->getLine();
51630        } else {
51631            if ($t->getPrevious()) {
51632                $t = $t->getPrevious();
51633            }
51634            $eTrace = $t->getTrace();
51635            $eFile = $t->getFile();
51636            $eLine = $t->getLine();
51637        }
51638        if (!self::frameExists($eTrace, $eFile, $eLine)) {
51639            array_unshift($eTrace, ['file' => $eFile, 'line' => $eLine]);
51640        }
51641        $prefix = defined('__PHPUNIT_PHAR_ROOT__') ? __PHPUNIT_PHAR_ROOT__ : \false;
51642        $excludeList = new \PHPUnit\Util\ExcludeList();
51643        foreach ($eTrace as $frame) {
51644            if (self::shouldPrintFrame($frame, $prefix, $excludeList)) {
51645                $filteredStacktrace .= sprintf("%s:%s\n", $frame['file'], $frame['line'] ?? '?');
51646            }
51647        }
51648        return $filteredStacktrace;
51649    }
51650    private static function shouldPrintFrame(array $frame, $prefix, \PHPUnit\Util\ExcludeList $excludeList) : bool
51651    {
51652        if (!isset($frame['file'])) {
51653            return \false;
51654        }
51655        $file = $frame['file'];
51656        $fileIsNotPrefixed = $prefix === \false || strpos($file, $prefix) !== 0;
51657        // @see https://github.com/sebastianbergmann/phpunit/issues/4033
51658        if (isset($GLOBALS['_SERVER']['SCRIPT_NAME'])) {
51659            $script = realpath($GLOBALS['_SERVER']['SCRIPT_NAME']);
51660        } else {
51661            $script = '';
51662        }
51663        return is_file($file) && self::fileIsExcluded($file, $excludeList) && $fileIsNotPrefixed && $file !== $script;
51664    }
51665    private static function fileIsExcluded(string $file, \PHPUnit\Util\ExcludeList $excludeList) : bool
51666    {
51667        return (empty($GLOBALS['__PHPUNIT_ISOLATION_EXCLUDE_LIST']) || !in_array($file, $GLOBALS['__PHPUNIT_ISOLATION_EXCLUDE_LIST'], \true)) && !$excludeList->isExcluded($file);
51668    }
51669    private static function frameExists(array $trace, string $file, int $line) : bool
51670    {
51671        foreach ($trace as $frame) {
51672            if (isset($frame['file'], $frame['line']) && $frame['file'] === $file && $frame['line'] === $line) {
51673                return \true;
51674            }
51675        }
51676        return \false;
51677    }
51678}
51679<?php
51680
51681declare (strict_types=1);
51682/*
51683 * This file is part of PHPUnit.
51684 *
51685 * (c) Sebastian Bergmann <sebastian@phpunit.de>
51686 *
51687 * For the full copyright and license information, please view the LICENSE
51688 * file that was distributed with this source code.
51689 */
51690namespace PHPUnit\Util;
51691
51692use const PHP_OS;
51693use const PHP_VERSION;
51694use function addcslashes;
51695use function array_flip;
51696use function array_key_exists;
51697use function array_merge;
51698use function array_unique;
51699use function array_unshift;
51700use function class_exists;
51701use function count;
51702use function explode;
51703use function extension_loaded;
51704use function function_exists;
51705use function get_class;
51706use function ini_get;
51707use function interface_exists;
51708use function is_array;
51709use function is_int;
51710use function method_exists;
51711use function phpversion;
51712use function preg_match;
51713use function preg_replace;
51714use function sprintf;
51715use function strncmp;
51716use function strpos;
51717use function strtolower;
51718use function trim;
51719use function version_compare;
51720use PHPUnit\Framework\Assert;
51721use PHPUnit\Framework\CodeCoverageException;
51722use PHPUnit\Framework\ExecutionOrderDependency;
51723use PHPUnit\Framework\InvalidCoversTargetException;
51724use PHPUnit\Framework\SelfDescribing;
51725use PHPUnit\Framework\TestCase;
51726use PHPUnit\Framework\Warning;
51727use PHPUnit\Runner\Version;
51728use PHPUnit\Util\Annotation\Registry;
51729use ReflectionClass;
51730use ReflectionException;
51731use ReflectionMethod;
51732use PHPUnit\SebastianBergmann\CodeUnit\CodeUnitCollection;
51733use PHPUnit\SebastianBergmann\CodeUnit\InvalidCodeUnitException;
51734use PHPUnit\SebastianBergmann\CodeUnit\Mapper;
51735use PHPUnit\SebastianBergmann\Environment\OperatingSystem;
51736/**
51737 * @internal This class is not covered by the backward compatibility promise for PHPUnit
51738 */
51739final class Test
51740{
51741    /**
51742     * @var int
51743     */
51744    public const UNKNOWN = -1;
51745    /**
51746     * @var int
51747     */
51748    public const SMALL = 0;
51749    /**
51750     * @var int
51751     */
51752    public const MEDIUM = 1;
51753    /**
51754     * @var int
51755     */
51756    public const LARGE = 2;
51757    /**
51758     * @var array
51759     */
51760    private static $hookMethods = [];
51761    /**
51762     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
51763     */
51764    public static function describe(\PHPUnit\Framework\Test $test) : array
51765    {
51766        if ($test instanceof TestCase) {
51767            return [get_class($test), $test->getName()];
51768        }
51769        if ($test instanceof SelfDescribing) {
51770            return ['', $test->toString()];
51771        }
51772        return ['', get_class($test)];
51773    }
51774    public static function describeAsString(\PHPUnit\Framework\Test $test) : string
51775    {
51776        if ($test instanceof SelfDescribing) {
51777            return $test->toString();
51778        }
51779        return get_class($test);
51780    }
51781    /**
51782     * @throws CodeCoverageException
51783     *
51784     * @return array|bool
51785     * @psalm-param class-string $className
51786     */
51787    public static function getLinesToBeCovered(string $className, string $methodName)
51788    {
51789        $annotations = self::parseTestMethodAnnotations($className, $methodName);
51790        if (!self::shouldCoversAnnotationBeUsed($annotations)) {
51791            return \false;
51792        }
51793        return self::getLinesToBeCoveredOrUsed($className, $methodName, 'covers');
51794    }
51795    /**
51796     * Returns lines of code specified with the @uses annotation.
51797     *
51798     * @throws CodeCoverageException
51799     * @psalm-param class-string $className
51800     */
51801    public static function getLinesToBeUsed(string $className, string $methodName) : array
51802    {
51803        return self::getLinesToBeCoveredOrUsed($className, $methodName, 'uses');
51804    }
51805    public static function requiresCodeCoverageDataCollection(TestCase $test) : bool
51806    {
51807        $annotations = self::parseTestMethodAnnotations(get_class($test), $test->getName(\false));
51808        // If there is no @covers annotation but a @coversNothing annotation on
51809        // the test method then code coverage data does not need to be collected
51810        if (isset($annotations['method']['coversNothing'])) {
51811            return \false;
51812        }
51813        // If there is at least one @covers annotation then
51814        // code coverage data needs to be collected
51815        if (isset($annotations['method']['covers'])) {
51816            return \true;
51817        }
51818        // If there is no @covers annotation but a @coversNothing annotation
51819        // then code coverage data does not need to be collected
51820        if (isset($annotations['class']['coversNothing'])) {
51821            return \false;
51822        }
51823        // If there is no @coversNothing annotation then
51824        // code coverage data may be collected
51825        return \true;
51826    }
51827    /**
51828     * @throws Exception
51829     * @psalm-param class-string $className
51830     */
51831    public static function getRequirements(string $className, string $methodName) : array
51832    {
51833        return self::mergeArraysRecursively(Registry::getInstance()->forClassName($className)->requirements(), Registry::getInstance()->forMethod($className, $methodName)->requirements());
51834    }
51835    /**
51836     * Returns the missing requirements for a test.
51837     *
51838     * @throws Exception
51839     * @throws Warning
51840     * @psalm-param class-string $className
51841     */
51842    public static function getMissingRequirements(string $className, string $methodName) : array
51843    {
51844        $required = self::getRequirements($className, $methodName);
51845        $missing = [];
51846        $hint = null;
51847        if (!empty($required['PHP'])) {
51848            $operator = new \PHPUnit\Util\VersionComparisonOperator(empty($required['PHP']['operator']) ? '>=' : $required['PHP']['operator']);
51849            if (!version_compare(\PHP_VERSION, $required['PHP']['version'], $operator->asString())) {
51850                $missing[] = sprintf('PHP %s %s is required.', $operator->asString(), $required['PHP']['version']);
51851                $hint = 'PHP';
51852            }
51853        } elseif (!empty($required['PHP_constraint'])) {
51854            $version = new \PHPUnit\PharIo\Version\Version(self::sanitizeVersionNumber(\PHP_VERSION));
51855            if (!$required['PHP_constraint']['constraint']->complies($version)) {
51856                $missing[] = sprintf('PHP version does not match the required constraint %s.', $required['PHP_constraint']['constraint']->asString());
51857                $hint = 'PHP_constraint';
51858            }
51859        }
51860        if (!empty($required['PHPUnit'])) {
51861            $phpunitVersion = Version::id();
51862            $operator = new \PHPUnit\Util\VersionComparisonOperator(empty($required['PHPUnit']['operator']) ? '>=' : $required['PHPUnit']['operator']);
51863            if (!version_compare($phpunitVersion, $required['PHPUnit']['version'], $operator->asString())) {
51864                $missing[] = sprintf('PHPUnit %s %s is required.', $operator->asString(), $required['PHPUnit']['version']);
51865                $hint = $hint ?? 'PHPUnit';
51866            }
51867        } elseif (!empty($required['PHPUnit_constraint'])) {
51868            $phpunitVersion = new \PHPUnit\PharIo\Version\Version(self::sanitizeVersionNumber(Version::id()));
51869            if (!$required['PHPUnit_constraint']['constraint']->complies($phpunitVersion)) {
51870                $missing[] = sprintf('PHPUnit version does not match the required constraint %s.', $required['PHPUnit_constraint']['constraint']->asString());
51871                $hint = $hint ?? 'PHPUnit_constraint';
51872            }
51873        }
51874        if (!empty($required['OSFAMILY']) && $required['OSFAMILY'] !== (new OperatingSystem())->getFamily()) {
51875            $missing[] = sprintf('Operating system %s is required.', $required['OSFAMILY']);
51876            $hint = $hint ?? 'OSFAMILY';
51877        }
51878        if (!empty($required['OS'])) {
51879            $requiredOsPattern = sprintf('/%s/i', addcslashes($required['OS'], '/'));
51880            if (!preg_match($requiredOsPattern, \PHP_OS)) {
51881                $missing[] = sprintf('Operating system matching %s is required.', $requiredOsPattern);
51882                $hint = $hint ?? 'OS';
51883            }
51884        }
51885        if (!empty($required['functions'])) {
51886            foreach ($required['functions'] as $function) {
51887                $pieces = explode('::', $function);
51888                if (count($pieces) === 2 && class_exists($pieces[0]) && method_exists($pieces[0], $pieces[1])) {
51889                    continue;
51890                }
51891                if (function_exists($function)) {
51892                    continue;
51893                }
51894                $missing[] = sprintf('Function %s is required.', $function);
51895                $hint = $hint ?? 'function_' . $function;
51896            }
51897        }
51898        if (!empty($required['setting'])) {
51899            foreach ($required['setting'] as $setting => $value) {
51900                if (ini_get($setting) !== $value) {
51901                    $missing[] = sprintf('Setting "%s" must be "%s".', $setting, $value);
51902                    $hint = $hint ?? '__SETTING_' . $setting;
51903                }
51904            }
51905        }
51906        if (!empty($required['extensions'])) {
51907            foreach ($required['extensions'] as $extension) {
51908                if (isset($required['extension_versions'][$extension])) {
51909                    continue;
51910                }
51911                if (!extension_loaded($extension)) {
51912                    $missing[] = sprintf('Extension %s is required.', $extension);
51913                    $hint = $hint ?? 'extension_' . $extension;
51914                }
51915            }
51916        }
51917        if (!empty($required['extension_versions'])) {
51918            foreach ($required['extension_versions'] as $extension => $req) {
51919                $actualVersion = phpversion($extension);
51920                $operator = new \PHPUnit\Util\VersionComparisonOperator(empty($req['operator']) ? '>=' : $req['operator']);
51921                if ($actualVersion === \false || !version_compare($actualVersion, $req['version'], $operator->asString())) {
51922                    $missing[] = sprintf('Extension %s %s %s is required.', $extension, $operator->asString(), $req['version']);
51923                    $hint = $hint ?? 'extension_' . $extension;
51924                }
51925            }
51926        }
51927        if ($hint && isset($required['__OFFSET'])) {
51928            array_unshift($missing, '__OFFSET_FILE=' . $required['__OFFSET']['__FILE']);
51929            array_unshift($missing, '__OFFSET_LINE=' . ($required['__OFFSET'][$hint] ?? 1));
51930        }
51931        return $missing;
51932    }
51933    /**
51934     * Returns the provided data for a method.
51935     *
51936     * @throws Exception
51937     * @psalm-param class-string $className
51938     */
51939    public static function getProvidedData(string $className, string $methodName) : ?array
51940    {
51941        return Registry::getInstance()->forMethod($className, $methodName)->getProvidedData();
51942    }
51943    /**
51944     * @psalm-param class-string $className
51945     */
51946    public static function parseTestMethodAnnotations(string $className, ?string $methodName = '') : array
51947    {
51948        $registry = Registry::getInstance();
51949        if ($methodName !== null) {
51950            try {
51951                return ['method' => $registry->forMethod($className, $methodName)->symbolAnnotations(), 'class' => $registry->forClassName($className)->symbolAnnotations()];
51952            } catch (\PHPUnit\Util\Exception $methodNotFound) {
51953                // ignored
51954            }
51955        }
51956        return ['method' => null, 'class' => $registry->forClassName($className)->symbolAnnotations()];
51957    }
51958    /**
51959     * @psalm-param class-string $className
51960     */
51961    public static function getInlineAnnotations(string $className, string $methodName) : array
51962    {
51963        return Registry::getInstance()->forMethod($className, $methodName)->getInlineAnnotations();
51964    }
51965    /** @psalm-param class-string $className */
51966    public static function getBackupSettings(string $className, string $methodName) : array
51967    {
51968        return ['backupGlobals' => self::getBooleanAnnotationSetting($className, $methodName, 'backupGlobals'), 'backupStaticAttributes' => self::getBooleanAnnotationSetting($className, $methodName, 'backupStaticAttributes')];
51969    }
51970    /**
51971     * @psalm-param class-string $className
51972     *
51973     * @return ExecutionOrderDependency[]
51974     */
51975    public static function getDependencies(string $className, string $methodName) : array
51976    {
51977        $annotations = self::parseTestMethodAnnotations($className, $methodName);
51978        $dependsAnnotations = $annotations['class']['depends'] ?? [];
51979        if (isset($annotations['method']['depends'])) {
51980            $dependsAnnotations = array_merge($dependsAnnotations, $annotations['method']['depends']);
51981        }
51982        // Normalize dependency name to className::methodName
51983        $dependencies = [];
51984        foreach ($dependsAnnotations as $value) {
51985            $dependencies[] = ExecutionOrderDependency::createFromDependsAnnotation($className, $value);
51986        }
51987        return array_unique($dependencies);
51988    }
51989    /** @psalm-param class-string $className */
51990    public static function getGroups(string $className, ?string $methodName = '') : array
51991    {
51992        $annotations = self::parseTestMethodAnnotations($className, $methodName);
51993        $groups = [];
51994        if (isset($annotations['method']['author'])) {
51995            $groups[] = $annotations['method']['author'];
51996        } elseif (isset($annotations['class']['author'])) {
51997            $groups[] = $annotations['class']['author'];
51998        }
51999        if (isset($annotations['class']['group'])) {
52000            $groups[] = $annotations['class']['group'];
52001        }
52002        if (isset($annotations['method']['group'])) {
52003            $groups[] = $annotations['method']['group'];
52004        }
52005        if (isset($annotations['class']['ticket'])) {
52006            $groups[] = $annotations['class']['ticket'];
52007        }
52008        if (isset($annotations['method']['ticket'])) {
52009            $groups[] = $annotations['method']['ticket'];
52010        }
52011        foreach (['method', 'class'] as $element) {
52012            foreach (['small', 'medium', 'large'] as $size) {
52013                if (isset($annotations[$element][$size])) {
52014                    $groups[] = [$size];
52015                    break 2;
52016                }
52017            }
52018        }
52019        foreach (['method', 'class'] as $element) {
52020            if (isset($annotations[$element]['covers'])) {
52021                foreach ($annotations[$element]['covers'] as $coversTarget) {
52022                    $groups[] = ['__phpunit_covers_' . self::canonicalizeName($coversTarget)];
52023                }
52024            }
52025            if (isset($annotations[$element]['uses'])) {
52026                foreach ($annotations[$element]['uses'] as $usesTarget) {
52027                    $groups[] = ['__phpunit_uses_' . self::canonicalizeName($usesTarget)];
52028                }
52029            }
52030        }
52031        return array_unique(array_merge([], ...$groups));
52032    }
52033    /** @psalm-param class-string $className */
52034    public static function getSize(string $className, ?string $methodName) : int
52035    {
52036        $groups = array_flip(self::getGroups($className, $methodName));
52037        if (isset($groups['large'])) {
52038            return self::LARGE;
52039        }
52040        if (isset($groups['medium'])) {
52041            return self::MEDIUM;
52042        }
52043        if (isset($groups['small'])) {
52044            return self::SMALL;
52045        }
52046        return self::UNKNOWN;
52047    }
52048    /** @psalm-param class-string $className */
52049    public static function getProcessIsolationSettings(string $className, string $methodName) : bool
52050    {
52051        $annotations = self::parseTestMethodAnnotations($className, $methodName);
52052        return isset($annotations['class']['runTestsInSeparateProcesses']) || isset($annotations['method']['runInSeparateProcess']);
52053    }
52054    /** @psalm-param class-string $className */
52055    public static function getClassProcessIsolationSettings(string $className, string $methodName) : bool
52056    {
52057        $annotations = self::parseTestMethodAnnotations($className, $methodName);
52058        return isset($annotations['class']['runClassInSeparateProcess']);
52059    }
52060    /** @psalm-param class-string $className */
52061    public static function getPreserveGlobalStateSettings(string $className, string $methodName) : ?bool
52062    {
52063        return self::getBooleanAnnotationSetting($className, $methodName, 'preserveGlobalState');
52064    }
52065    /** @psalm-param class-string $className */
52066    public static function getHookMethods(string $className) : array
52067    {
52068        if (!class_exists($className, \false)) {
52069            return self::emptyHookMethodsArray();
52070        }
52071        if (!isset(self::$hookMethods[$className])) {
52072            self::$hookMethods[$className] = self::emptyHookMethodsArray();
52073            try {
52074                foreach ((new ReflectionClass($className))->getMethods() as $method) {
52075                    if ($method->getDeclaringClass()->getName() === Assert::class) {
52076                        continue;
52077                    }
52078                    if ($method->getDeclaringClass()->getName() === TestCase::class) {
52079                        continue;
52080                    }
52081                    $docBlock = Registry::getInstance()->forMethod($className, $method->getName());
52082                    if ($method->isStatic()) {
52083                        if ($docBlock->isHookToBeExecutedBeforeClass()) {
52084                            array_unshift(self::$hookMethods[$className]['beforeClass'], $method->getName());
52085                        }
52086                        if ($docBlock->isHookToBeExecutedAfterClass()) {
52087                            self::$hookMethods[$className]['afterClass'][] = $method->getName();
52088                        }
52089                    }
52090                    if ($docBlock->isToBeExecutedBeforeTest()) {
52091                        array_unshift(self::$hookMethods[$className]['before'], $method->getName());
52092                    }
52093                    if ($docBlock->isToBeExecutedAsPreCondition()) {
52094                        array_unshift(self::$hookMethods[$className]['preCondition'], $method->getName());
52095                    }
52096                    if ($docBlock->isToBeExecutedAsPostCondition()) {
52097                        self::$hookMethods[$className]['postCondition'][] = $method->getName();
52098                    }
52099                    if ($docBlock->isToBeExecutedAfterTest()) {
52100                        self::$hookMethods[$className]['after'][] = $method->getName();
52101                    }
52102                }
52103            } catch (ReflectionException $e) {
52104            }
52105        }
52106        return self::$hookMethods[$className];
52107    }
52108    public static function isTestMethod(ReflectionMethod $method) : bool
52109    {
52110        if (!$method->isPublic()) {
52111            return \false;
52112        }
52113        if (strpos($method->getName(), 'test') === 0) {
52114            return \true;
52115        }
52116        return array_key_exists('test', Registry::getInstance()->forMethod($method->getDeclaringClass()->getName(), $method->getName())->symbolAnnotations());
52117    }
52118    /**
52119     * @throws CodeCoverageException
52120     * @psalm-param class-string $className
52121     */
52122    private static function getLinesToBeCoveredOrUsed(string $className, string $methodName, string $mode) : array
52123    {
52124        $annotations = self::parseTestMethodAnnotations($className, $methodName);
52125        $classShortcut = null;
52126        if (!empty($annotations['class'][$mode . 'DefaultClass'])) {
52127            if (count($annotations['class'][$mode . 'DefaultClass']) > 1) {
52128                throw new CodeCoverageException(sprintf('More than one @%sClass annotation in class or interface "%s".', $mode, $className));
52129            }
52130            $classShortcut = $annotations['class'][$mode . 'DefaultClass'][0];
52131        }
52132        $list = $annotations['class'][$mode] ?? [];
52133        if (isset($annotations['method'][$mode])) {
52134            $list = array_merge($list, $annotations['method'][$mode]);
52135        }
52136        $codeUnits = CodeUnitCollection::fromArray([]);
52137        $mapper = new Mapper();
52138        foreach (array_unique($list) as $element) {
52139            if ($classShortcut && strncmp($element, '::', 2) === 0) {
52140                $element = $classShortcut . $element;
52141            }
52142            $element = preg_replace('/[\\s()]+$/', '', $element);
52143            $element = explode(' ', $element);
52144            $element = $element[0];
52145            if ($mode === 'covers' && interface_exists($element)) {
52146                throw new InvalidCoversTargetException(sprintf('Trying to @cover interface "%s".', $element));
52147            }
52148            try {
52149                $codeUnits = $codeUnits->mergeWith($mapper->stringToCodeUnits($element));
52150            } catch (InvalidCodeUnitException $e) {
52151                throw new InvalidCoversTargetException(sprintf('"@%s %s" is invalid', $mode, $element), (int) $e->getCode(), $e);
52152            }
52153        }
52154        return $mapper->codeUnitsToSourceLines($codeUnits);
52155    }
52156    private static function emptyHookMethodsArray() : array
52157    {
52158        return ['beforeClass' => ['setUpBeforeClass'], 'before' => ['setUp'], 'preCondition' => ['assertPreConditions'], 'postCondition' => ['assertPostConditions'], 'after' => ['tearDown'], 'afterClass' => ['tearDownAfterClass']];
52159    }
52160    /** @psalm-param class-string $className */
52161    private static function getBooleanAnnotationSetting(string $className, ?string $methodName, string $settingName) : ?bool
52162    {
52163        $annotations = self::parseTestMethodAnnotations($className, $methodName);
52164        if (isset($annotations['method'][$settingName])) {
52165            if ($annotations['method'][$settingName][0] === 'enabled') {
52166                return \true;
52167            }
52168            if ($annotations['method'][$settingName][0] === 'disabled') {
52169                return \false;
52170            }
52171        }
52172        if (isset($annotations['class'][$settingName])) {
52173            if ($annotations['class'][$settingName][0] === 'enabled') {
52174                return \true;
52175            }
52176            if ($annotations['class'][$settingName][0] === 'disabled') {
52177                return \false;
52178            }
52179        }
52180        return null;
52181    }
52182    /**
52183     * Trims any extensions from version string that follows after
52184     * the <major>.<minor>[.<patch>] format.
52185     */
52186    private static function sanitizeVersionNumber(string $version)
52187    {
52188        return preg_replace('/^(\\d+\\.\\d+(?:.\\d+)?).*$/', '$1', $version);
52189    }
52190    private static function shouldCoversAnnotationBeUsed(array $annotations) : bool
52191    {
52192        if (isset($annotations['method']['coversNothing'])) {
52193            return \false;
52194        }
52195        if (isset($annotations['method']['covers'])) {
52196            return \true;
52197        }
52198        if (isset($annotations['class']['coversNothing'])) {
52199            return \false;
52200        }
52201        return \true;
52202    }
52203    /**
52204     * Merge two arrays together.
52205     *
52206     * If an integer key exists in both arrays and preserveNumericKeys is false, the value
52207     * from the second array will be appended to the first array. If both values are arrays, they
52208     * are merged together, else the value of the second array overwrites the one of the first array.
52209     *
52210     * This implementation is copied from https://github.com/zendframework/zend-stdlib/blob/76b653c5e99b40eccf5966e3122c90615134ae46/src/ArrayUtils.php
52211     *
52212     * Zend Framework (http://framework.zend.com/)
52213     *
52214     * @see      http://github.com/zendframework/zf2 for the canonical source repository
52215     *
52216     * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
52217     * @license   http://framework.zend.com/license/new-bsd New BSD License
52218     */
52219    private static function mergeArraysRecursively(array $a, array $b) : array
52220    {
52221        foreach ($b as $key => $value) {
52222            if (array_key_exists($key, $a)) {
52223                if (is_int($key)) {
52224                    $a[] = $value;
52225                } elseif (is_array($value) && is_array($a[$key])) {
52226                    $a[$key] = self::mergeArraysRecursively($a[$key], $value);
52227                } else {
52228                    $a[$key] = $value;
52229                }
52230            } else {
52231                $a[$key] = $value;
52232            }
52233        }
52234        return $a;
52235    }
52236    private static function canonicalizeName(string $name) : string
52237    {
52238        return strtolower(trim($name, '\\'));
52239    }
52240}
52241<?php
52242
52243declare (strict_types=1);
52244/*
52245 * This file is part of PHPUnit.
52246 *
52247 * (c) Sebastian Bergmann <sebastian@phpunit.de>
52248 *
52249 * For the full copyright and license information, please view the LICENSE
52250 * file that was distributed with this source code.
52251 */
52252namespace PHPUnit\Util;
52253
52254use const DIRECTORY_SEPARATOR;
52255use function array_diff;
52256use function array_keys;
52257use function fopen;
52258use function get_defined_vars;
52259use function sprintf;
52260use function stream_resolve_include_path;
52261/**
52262 * @internal This class is not covered by the backward compatibility promise for PHPUnit
52263 */
52264final class FileLoader
52265{
52266    /**
52267     * Checks if a PHP sourcecode file is readable. The sourcecode file is loaded through the load() method.
52268     *
52269     * As a fallback, PHP looks in the directory of the file executing the stream_resolve_include_path function.
52270     * We do not want to load the Test.php file here, so skip it if it found that.
52271     * PHP prioritizes the include_path setting, so if the current directory is in there, it will first look in the
52272     * current working directory.
52273     *
52274     * @throws Exception
52275     */
52276    public static function checkAndLoad(string $filename) : string
52277    {
52278        $includePathFilename = stream_resolve_include_path($filename);
52279        $localFile = __DIR__ . \DIRECTORY_SEPARATOR . $filename;
52280        if (!$includePathFilename || $includePathFilename === $localFile || !self::isReadable($includePathFilename)) {
52281            throw new \PHPUnit\Util\Exception(sprintf('Cannot open file "%s".' . "\n", $filename));
52282        }
52283        self::load($includePathFilename);
52284        return $includePathFilename;
52285    }
52286    /**
52287     * Loads a PHP sourcefile.
52288     */
52289    public static function load(string $filename) : void
52290    {
52291        $oldVariableNames = array_keys(get_defined_vars());
52292        /**
52293         * @noinspection PhpIncludeInspection
52294         * @psalm-suppress UnresolvableInclude
52295         */
52296        include_once $filename;
52297        $newVariables = get_defined_vars();
52298        foreach (array_diff(array_keys($newVariables), $oldVariableNames) as $variableName) {
52299            if ($variableName !== 'oldVariableNames') {
52300                $GLOBALS[$variableName] = $newVariables[$variableName];
52301            }
52302        }
52303    }
52304    /**
52305     * @see https://github.com/sebastianbergmann/phpunit/pull/2751
52306     */
52307    private static function isReadable(string $filename) : bool
52308    {
52309        return @fopen($filename, 'r') !== \false;
52310    }
52311}
52312<?php
52313
52314declare (strict_types=1);
52315/*
52316 * This file is part of PHPUnit.
52317 *
52318 * (c) Sebastian Bergmann <sebastian@phpunit.de>
52319 *
52320 * For the full copyright and license information, please view the LICENSE
52321 * file that was distributed with this source code.
52322 */
52323namespace PHPUnit\Util;
52324
52325use function get_class;
52326use function implode;
52327use function str_replace;
52328use PHPUnit\Framework\TestCase;
52329use PHPUnit\Framework\TestSuite;
52330use PHPUnit\Runner\PhptTestCase;
52331use RecursiveIteratorIterator;
52332use XMLWriter;
52333/**
52334 * @internal This class is not covered by the backward compatibility promise for PHPUnit
52335 */
52336final class XmlTestListRenderer
52337{
52338    /**
52339     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
52340     */
52341    public function render(TestSuite $suite) : string
52342    {
52343        $writer = new XMLWriter();
52344        $writer->openMemory();
52345        $writer->setIndent(\true);
52346        $writer->startDocument();
52347        $writer->startElement('tests');
52348        $currentTestCase = null;
52349        foreach (new RecursiveIteratorIterator($suite->getIterator()) as $test) {
52350            if ($test instanceof TestCase) {
52351                if (get_class($test) !== $currentTestCase) {
52352                    if ($currentTestCase !== null) {
52353                        $writer->endElement();
52354                    }
52355                    $writer->startElement('testCaseClass');
52356                    $writer->writeAttribute('name', get_class($test));
52357                    $currentTestCase = get_class($test);
52358                }
52359                $writer->startElement('testCaseMethod');
52360                $writer->writeAttribute('name', $test->getName(\false));
52361                $writer->writeAttribute('groups', implode(',', $test->getGroups()));
52362                if (!empty($test->getDataSetAsString(\false))) {
52363                    $writer->writeAttribute('dataSet', str_replace(' with data set ', '', $test->getDataSetAsString(\false)));
52364                }
52365                $writer->endElement();
52366            } elseif ($test instanceof PhptTestCase) {
52367                if ($currentTestCase !== null) {
52368                    $writer->endElement();
52369                    $currentTestCase = null;
52370                }
52371                $writer->startElement('phptFile');
52372                $writer->writeAttribute('path', $test->getName());
52373                $writer->endElement();
52374            }
52375        }
52376        if ($currentTestCase !== null) {
52377            $writer->endElement();
52378        }
52379        $writer->endElement();
52380        return $writer->outputMemory();
52381    }
52382}
52383<?php
52384
52385declare (strict_types=1);
52386/*
52387 * This file is part of PHPUnit.
52388 *
52389 * (c) Sebastian Bergmann <sebastian@phpunit.de>
52390 *
52391 * For the full copyright and license information, please view the LICENSE
52392 * file that was distributed with this source code.
52393 */
52394namespace PHPUnit\Util;
52395
52396use const DIRECTORY_SEPARATOR;
52397use function addslashes;
52398use function array_map;
52399use function implode;
52400use function is_string;
52401use function realpath;
52402use function sprintf;
52403use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\CodeCoverage as FilterConfiguration;
52404/**
52405 * @internal This class is not covered by the backward compatibility promise for PHPUnit
52406 *
52407 * @deprecated
52408 */
52409final class XdebugFilterScriptGenerator
52410{
52411    public function generate(FilterConfiguration $filter) : string
52412    {
52413        $files = array_map(static function ($item) {
52414            return sprintf("        '%s'", $item);
52415        }, $this->getItems($filter));
52416        $files = implode(",\n", $files);
52417        return <<<EOF
52418<?php declare(strict_types=1);
52419if (!\\function_exists('xdebug_set_filter')) {
52420    return;
52421}
52422
52423\\xdebug_set_filter(
52424    \\XDEBUG_FILTER_CODE_COVERAGE,
52425    \\XDEBUG_PATH_WHITELIST,
52426    [
52427{$files}
52428    ]
52429);
52430
52431EOF;
52432    }
52433    private function getItems(FilterConfiguration $filter) : array
52434    {
52435        $files = [];
52436        foreach ($filter->directories() as $directory) {
52437            $path = realpath($directory->path());
52438            if (is_string($path)) {
52439                $files[] = sprintf(addslashes('%s' . \DIRECTORY_SEPARATOR), $path);
52440            }
52441        }
52442        foreach ($filter->files() as $file) {
52443            $files[] = $file->path();
52444        }
52445        return $files;
52446    }
52447}
52448<?php
52449
52450declare (strict_types=1);
52451/*
52452 * This file is part of PHPUnit.
52453 *
52454 * (c) Sebastian Bergmann <sebastian@phpunit.de>
52455 *
52456 * For the full copyright and license information, please view the LICENSE
52457 * file that was distributed with this source code.
52458 */
52459namespace PHPUnit\Util;
52460
52461use const DIRECTORY_SEPARATOR;
52462use function is_dir;
52463use function mkdir;
52464use function str_replace;
52465/**
52466 * @internal This class is not covered by the backward compatibility promise for PHPUnit
52467 */
52468final class Filesystem
52469{
52470    /**
52471     * Maps class names to source file names.
52472     *
52473     *   - PEAR CS:   Foo_Bar_Baz -> Foo/Bar/Baz.php
52474     *   - Namespace: Foo\Bar\Baz -> Foo/Bar/Baz.php
52475     */
52476    public static function classNameToFilename(string $className) : string
52477    {
52478        return str_replace(['_', '\\'], \DIRECTORY_SEPARATOR, $className) . '.php';
52479    }
52480    public static function createDirectory(string $directory) : bool
52481    {
52482        return !(!is_dir($directory) && !@mkdir($directory, 0777, \true) && !is_dir($directory));
52483    }
52484}
52485<?php
52486
52487declare (strict_types=1);
52488/*
52489 * This file is part of PHPUnit.
52490 *
52491 * (c) Sebastian Bergmann <sebastian@phpunit.de>
52492 *
52493 * For the full copyright and license information, please view the LICENSE
52494 * file that was distributed with this source code.
52495 */
52496namespace PHPUnit\Util;
52497
52498use function in_array;
52499use function sprintf;
52500/**
52501 * @internal This class is not covered by the backward compatibility promise for PHPUnit
52502 * @psalm-immutable
52503 */
52504final class VersionComparisonOperator
52505{
52506    /**
52507     * @psalm-var '<'|'lt'|'<='|'le'|'>'|'gt'|'>='|'ge'|'=='|'='|'eq'|'!='|'<>'|'ne'
52508     */
52509    private $operator;
52510    public function __construct(string $operator)
52511    {
52512        $this->ensureOperatorIsValid($operator);
52513        $this->operator = $operator;
52514    }
52515    /**
52516     * @return '!='|'<'|'<='|'<>'|'='|'=='|'>'|'>='|'eq'|'ge'|'gt'|'le'|'lt'|'ne'
52517     */
52518    public function asString() : string
52519    {
52520        return $this->operator;
52521    }
52522    /**
52523     * @throws Exception
52524     *
52525     * @psalm-assert '<'|'lt'|'<='|'le'|'>'|'gt'|'>='|'ge'|'=='|'='|'eq'|'!='|'<>'|'ne' $operator
52526     */
52527    private function ensureOperatorIsValid(string $operator) : void
52528    {
52529        if (!in_array($operator, ['<', 'lt', '<=', 'le', '>', 'gt', '>=', 'ge', '==', '=', 'eq', '!=', '<>', 'ne'], \true)) {
52530            throw new \PHPUnit\Util\Exception(sprintf('"%s" is not a valid version_compare() operator', $operator));
52531        }
52532    }
52533}
52534<?php
52535
52536declare (strict_types=1);
52537/*
52538 * This file is part of PHPUnit.
52539 *
52540 * (c) Sebastian Bergmann <sebastian@phpunit.de>
52541 *
52542 * For the full copyright and license information, please view the LICENSE
52543 * file that was distributed with this source code.
52544 */
52545namespace PHPUnit\Util;
52546
52547use const DIRECTORY_SEPARATOR;
52548use function array_keys;
52549use function array_map;
52550use function array_values;
52551use function count;
52552use function explode;
52553use function implode;
52554use function min;
52555use function preg_replace;
52556use function preg_replace_callback;
52557use function sprintf;
52558use function strtr;
52559use function trim;
52560/**
52561 * @internal This class is not covered by the backward compatibility promise for PHPUnit
52562 */
52563final class Color
52564{
52565    /**
52566     * @var array<string,string>
52567     */
52568    private const WHITESPACE_MAP = [' ' => '·', "\t" => '⇥'];
52569    /**
52570     * @var array<string,string>
52571     */
52572    private const WHITESPACE_EOL_MAP = [' ' => '·', "\t" => '⇥', "\n" => '↵', "\r" => '⟵'];
52573    /**
52574     * @var array<string,string>
52575     */
52576    private static $ansiCodes = ['reset' => '0', 'bold' => '1', 'dim' => '2', 'dim-reset' => '22', 'underlined' => '4', 'fg-default' => '39', 'fg-black' => '30', 'fg-red' => '31', 'fg-green' => '32', 'fg-yellow' => '33', 'fg-blue' => '34', 'fg-magenta' => '35', 'fg-cyan' => '36', 'fg-white' => '37', 'bg-default' => '49', 'bg-black' => '40', 'bg-red' => '41', 'bg-green' => '42', 'bg-yellow' => '43', 'bg-blue' => '44', 'bg-magenta' => '45', 'bg-cyan' => '46', 'bg-white' => '47'];
52577    public static function colorize(string $color, string $buffer) : string
52578    {
52579        if (trim($buffer) === '') {
52580            return $buffer;
52581        }
52582        $codes = array_map('\\trim', explode(',', $color));
52583        $styles = [];
52584        foreach ($codes as $code) {
52585            if (isset(self::$ansiCodes[$code])) {
52586                $styles[] = self::$ansiCodes[$code] ?? '';
52587            }
52588        }
52589        if (empty($styles)) {
52590            return $buffer;
52591        }
52592        return self::optimizeColor(sprintf("\33[%sm", implode(';', $styles)) . $buffer . "\33[0m");
52593    }
52594    public static function colorizePath(string $path, ?string $prevPath = null, bool $colorizeFilename = \false) : string
52595    {
52596        if ($prevPath === null) {
52597            $prevPath = '';
52598        }
52599        $path = explode(\DIRECTORY_SEPARATOR, $path);
52600        $prevPath = explode(\DIRECTORY_SEPARATOR, $prevPath);
52601        for ($i = 0; $i < min(count($path), count($prevPath)); $i++) {
52602            if ($path[$i] == $prevPath[$i]) {
52603                $path[$i] = self::dim($path[$i]);
52604            }
52605        }
52606        if ($colorizeFilename) {
52607            $last = count($path) - 1;
52608            $path[$last] = preg_replace_callback('/([\\-_\\.]+|phpt$)/', static function ($matches) {
52609                return self::dim($matches[0]);
52610            }, $path[$last]);
52611        }
52612        return self::optimizeColor(implode(self::dim(\DIRECTORY_SEPARATOR), $path));
52613    }
52614    public static function dim(string $buffer) : string
52615    {
52616        if (trim($buffer) === '') {
52617            return $buffer;
52618        }
52619        return "\33[2m{$buffer}\33[22m";
52620    }
52621    public static function visualizeWhitespace(string $buffer, bool $visualizeEOL = \false) : string
52622    {
52623        $replaceMap = $visualizeEOL ? self::WHITESPACE_EOL_MAP : self::WHITESPACE_MAP;
52624        return preg_replace_callback('/\\s+/', static function ($matches) use($replaceMap) {
52625            return self::dim(strtr($matches[0], $replaceMap));
52626        }, $buffer);
52627    }
52628    private static function optimizeColor(string $buffer) : string
52629    {
52630        $patterns = ["/\33\\[22m\33\\[2m/" => '', "/\33\\[([^m]*)m\33\\[([1-9][0-9;]*)m/" => "\33[\$1;\$2m", "/(\33\\[[^m]*m)+(\33\\[0m)/" => '$2'];
52631        return preg_replace(array_keys($patterns), array_values($patterns), $buffer);
52632    }
52633}
52634<?php
52635
52636declare (strict_types=1);
52637/*
52638 * This file is part of PHPUnit.
52639 *
52640 * (c) Sebastian Bergmann <sebastian@phpunit.de>
52641 *
52642 * For the full copyright and license information, please view the LICENSE
52643 * file that was distributed with this source code.
52644 */
52645namespace PHPUnit\Util;
52646
52647use const PHP_EOL;
52648use function get_class;
52649use function sprintf;
52650use function str_replace;
52651use PHPUnit\Framework\TestCase;
52652use PHPUnit\Framework\TestSuite;
52653use PHPUnit\Runner\PhptTestCase;
52654use RecursiveIteratorIterator;
52655/**
52656 * @internal This class is not covered by the backward compatibility promise for PHPUnit
52657 */
52658final class TextTestListRenderer
52659{
52660    /**
52661     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
52662     */
52663    public function render(TestSuite $suite) : string
52664    {
52665        $buffer = 'Available test(s):' . \PHP_EOL;
52666        foreach (new RecursiveIteratorIterator($suite->getIterator()) as $test) {
52667            if ($test instanceof TestCase) {
52668                $name = sprintf('%s::%s', get_class($test), str_replace(' with data set ', '', $test->getName()));
52669            } elseif ($test instanceof PhptTestCase) {
52670                $name = $test->getName();
52671            } else {
52672                continue;
52673            }
52674            $buffer .= sprintf(' - %s' . \PHP_EOL, $name);
52675        }
52676        return $buffer;
52677    }
52678}
52679<?php
52680
52681declare (strict_types=1);
52682/*
52683 * This file is part of PHPUnit.
52684 *
52685 * (c) Sebastian Bergmann <sebastian@phpunit.de>
52686 *
52687 * For the full copyright and license information, please view the LICENSE
52688 * file that was distributed with this source code.
52689 */
52690namespace PHPUnit\Util;
52691
52692use function preg_match;
52693/**
52694 * @internal This class is not covered by the backward compatibility promise for PHPUnit
52695 */
52696final class RegularExpression
52697{
52698    /**
52699     * @return false|int
52700     */
52701    public static function safeMatch(string $pattern, string $subject)
52702    {
52703        return \PHPUnit\Util\ErrorHandler::invokeIgnoringWarnings(static function () use($pattern, $subject) {
52704            return preg_match($pattern, $subject);
52705        });
52706    }
52707}
52708<?php
52709
52710declare (strict_types=1);
52711/*
52712 * This file is part of PHPUnit.
52713 *
52714 * (c) Sebastian Bergmann <sebastian@phpunit.de>
52715 *
52716 * For the full copyright and license information, please view the LICENSE
52717 * file that was distributed with this source code.
52718 */
52719namespace PHPUnit\Util;
52720
52721use const E_DEPRECATED;
52722use const E_NOTICE;
52723use const E_STRICT;
52724use const E_USER_DEPRECATED;
52725use const E_USER_NOTICE;
52726use const E_USER_WARNING;
52727use const E_WARNING;
52728use function error_reporting;
52729use function restore_error_handler;
52730use function set_error_handler;
52731use PHPUnit\Framework\Error\Deprecated;
52732use PHPUnit\Framework\Error\Error;
52733use PHPUnit\Framework\Error\Notice;
52734use PHPUnit\Framework\Error\Warning;
52735/**
52736 * @internal This class is not covered by the backward compatibility promise for PHPUnit
52737 */
52738final class ErrorHandler
52739{
52740    /**
52741     * @var bool
52742     */
52743    private $convertDeprecationsToExceptions;
52744    /**
52745     * @var bool
52746     */
52747    private $convertErrorsToExceptions;
52748    /**
52749     * @var bool
52750     */
52751    private $convertNoticesToExceptions;
52752    /**
52753     * @var bool
52754     */
52755    private $convertWarningsToExceptions;
52756    /**
52757     * @var bool
52758     */
52759    private $registered = \false;
52760    public static function invokeIgnoringWarnings(callable $callable)
52761    {
52762        set_error_handler(static function ($errorNumber, $errorString) {
52763            if ($errorNumber === \E_WARNING) {
52764                return;
52765            }
52766            return \false;
52767        });
52768        $result = $callable();
52769        restore_error_handler();
52770        return $result;
52771    }
52772    public function __construct(bool $convertDeprecationsToExceptions, bool $convertErrorsToExceptions, bool $convertNoticesToExceptions, bool $convertWarningsToExceptions)
52773    {
52774        $this->convertDeprecationsToExceptions = $convertDeprecationsToExceptions;
52775        $this->convertErrorsToExceptions = $convertErrorsToExceptions;
52776        $this->convertNoticesToExceptions = $convertNoticesToExceptions;
52777        $this->convertWarningsToExceptions = $convertWarningsToExceptions;
52778    }
52779    public function __invoke(int $errorNumber, string $errorString, string $errorFile, int $errorLine) : bool
52780    {
52781        /*
52782         * Do not raise an exception when the error suppression operator (@) was used.
52783         *
52784         * @see https://github.com/sebastianbergmann/phpunit/issues/3739
52785         */
52786        if (!($errorNumber & error_reporting())) {
52787            return \false;
52788        }
52789        switch ($errorNumber) {
52790            case \E_NOTICE:
52791            case \E_USER_NOTICE:
52792            case \E_STRICT:
52793                if (!$this->convertNoticesToExceptions) {
52794                    return \false;
52795                }
52796                throw new Notice($errorString, $errorNumber, $errorFile, $errorLine);
52797            case \E_WARNING:
52798            case \E_USER_WARNING:
52799                if (!$this->convertWarningsToExceptions) {
52800                    return \false;
52801                }
52802                throw new Warning($errorString, $errorNumber, $errorFile, $errorLine);
52803            case \E_DEPRECATED:
52804            case \E_USER_DEPRECATED:
52805                if (!$this->convertDeprecationsToExceptions) {
52806                    return \false;
52807                }
52808                throw new Deprecated($errorString, $errorNumber, $errorFile, $errorLine);
52809            default:
52810                if (!$this->convertErrorsToExceptions) {
52811                    return \false;
52812                }
52813                throw new Error($errorString, $errorNumber, $errorFile, $errorLine);
52814        }
52815    }
52816    public function register() : void
52817    {
52818        if ($this->registered) {
52819            return;
52820        }
52821        $oldErrorHandler = set_error_handler($this);
52822        if ($oldErrorHandler !== null) {
52823            restore_error_handler();
52824            return;
52825        }
52826        $this->registered = \true;
52827    }
52828    public function unregister() : void
52829    {
52830        if (!$this->registered) {
52831            return;
52832        }
52833        restore_error_handler();
52834    }
52835}
52836<?php
52837
52838declare (strict_types=1);
52839/*
52840 * This file is part of PHPUnit.
52841 *
52842 * (c) Sebastian Bergmann <sebastian@phpunit.de>
52843 *
52844 * For the full copyright and license information, please view the LICENSE
52845 * file that was distributed with this source code.
52846 */
52847namespace PHPUnit\Util;
52848
52849use RuntimeException;
52850/**
52851 * @internal This class is not covered by the backward compatibility promise for PHPUnit
52852 */
52853final class Exception extends RuntimeException implements \PHPUnit\Exception
52854{
52855}
52856<?php
52857use PHPUnit\Framework\TestCase;
52858use PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage;
52859use PHPUnit\SebastianBergmann\CodeCoverage\Driver\Selector;
52860use PHPUnit\TextUI\XmlConfiguration\Loader;
52861use PHPUnit\TextUI\XmlConfiguration\PhpHandler;
52862
52863if (!defined('STDOUT')) {
52864    // php://stdout does not obey output buffering. Any output would break
52865    // unserialization of child process results in the parent process.
52866    define('STDOUT', fopen('php://temp', 'w+b'));
52867    define('STDERR', fopen('php://stderr', 'wb'));
52868}
52869
52870{iniSettings}
52871ini_set('display_errors', 'stderr');
52872set_include_path('{include_path}');
52873
52874$composerAutoload = {composerAutoload};
52875$phar             = {phar};
52876
52877ob_start();
52878
52879if ($composerAutoload) {
52880    require_once $composerAutoload;
52881    define('PHPUNIT_COMPOSER_INSTALL', $composerAutoload);
52882} else if ($phar) {
52883    require $phar;
52884}
52885
52886function __phpunit_run_isolated_test()
52887{
52888    if (!class_exists('{className}')) {
52889        require_once '{filename}';
52890    }
52891
52892    $result = new PHPUnit\Framework\TestResult;
52893
52894    if ({collectCodeCoverageInformation}) {
52895        $filter = unserialize('{codeCoverageFilter}');
52896
52897        $codeCoverage = new CodeCoverage(
52898            (new Selector)->{driverMethod}($filter),
52899            $filter
52900        );
52901
52902        if ({cachesStaticAnalysis}) {
52903            $codeCoverage->cacheStaticAnalysis(unserialize('{codeCoverageCacheDirectory}'));
52904        }
52905
52906        $result->setCodeCoverage($codeCoverage);
52907    }
52908
52909    $result->beStrictAboutTestsThatDoNotTestAnything({isStrictAboutTestsThatDoNotTestAnything});
52910    $result->beStrictAboutOutputDuringTests({isStrictAboutOutputDuringTests});
52911    $result->enforceTimeLimit({enforcesTimeLimit});
52912    $result->beStrictAboutTodoAnnotatedTests({isStrictAboutTodoAnnotatedTests});
52913    $result->beStrictAboutResourceUsageDuringSmallTests({isStrictAboutResourceUsageDuringSmallTests});
52914
52915    $test = new {className}('{methodName}', unserialize('{data}'), '{dataName}');
52916    \assert($test instanceof TestCase);
52917
52918    $test->setDependencyInput(unserialize('{dependencyInput}'));
52919    $test->setInIsolation(true);
52920
52921    ob_end_clean();
52922    $test->run($result);
52923    $output = '';
52924    if (!$test->hasExpectationOnOutput()) {
52925        $output = $test->getActualOutput();
52926    }
52927
52928    ini_set('xdebug.scream', '0');
52929    @rewind(STDOUT); /* @ as not every STDOUT target stream is rewindable */
52930    if ($stdout = @stream_get_contents(STDOUT)) {
52931        $output = $stdout . $output;
52932        $streamMetaData = stream_get_meta_data(STDOUT);
52933        if (!empty($streamMetaData['stream_type']) && 'STDIO' === $streamMetaData['stream_type']) {
52934            @ftruncate(STDOUT, 0);
52935            @rewind(STDOUT);
52936        }
52937    }
52938
52939    print serialize(
52940      [
52941        'testResult'    => $test->getResult(),
52942        'numAssertions' => $test->getNumAssertions(),
52943        'result'        => $result,
52944        'output'        => $output
52945      ]
52946    );
52947}
52948
52949$configurationFilePath = '{configurationFilePath}';
52950
52951if ('' !== $configurationFilePath) {
52952    $configuration = (new Loader)->load($configurationFilePath);
52953
52954    (new PhpHandler)->handle($configuration->php());
52955
52956    unset($configuration);
52957}
52958
52959function __phpunit_error_handler($errno, $errstr, $errfile, $errline)
52960{
52961   return true;
52962}
52963
52964set_error_handler('__phpunit_error_handler');
52965
52966{constants}
52967{included_files}
52968{globals}
52969
52970restore_error_handler();
52971
52972if (isset($GLOBALS['__PHPUNIT_BOOTSTRAP'])) {
52973    require_once $GLOBALS['__PHPUNIT_BOOTSTRAP'];
52974    unset($GLOBALS['__PHPUNIT_BOOTSTRAP']);
52975}
52976
52977__phpunit_run_isolated_test();
52978<?php
52979use PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage;
52980use PHPUnit\SebastianBergmann\CodeCoverage\Driver\Selector;
52981use PHPUnit\TextUI\XmlConfiguration\Loader;
52982use PHPUnit\TextUI\XmlConfiguration\PhpHandler;
52983
52984if (!defined('STDOUT')) {
52985    // php://stdout does not obey output buffering. Any output would break
52986    // unserialization of child process results in the parent process.
52987    define('STDOUT', fopen('php://temp', 'w+b'));
52988    define('STDERR', fopen('php://stderr', 'wb'));
52989}
52990
52991{iniSettings}
52992ini_set('display_errors', 'stderr');
52993set_include_path('{include_path}');
52994
52995$composerAutoload = {composerAutoload};
52996$phar             = {phar};
52997
52998ob_start();
52999
53000if ($composerAutoload) {
53001    require_once $composerAutoload;
53002    define('PHPUNIT_COMPOSER_INSTALL', $composerAutoload);
53003} else if ($phar) {
53004    require $phar;
53005}
53006
53007function __phpunit_run_isolated_test()
53008{
53009    if (!class_exists('{className}')) {
53010        require_once '{filename}';
53011    }
53012
53013    $result = new PHPUnit\Framework\TestResult;
53014
53015    if ({collectCodeCoverageInformation}) {
53016        $filter = unserialize('{codeCoverageFilter}');
53017
53018        $codeCoverage = new CodeCoverage(
53019            (new Selector)->{driverMethod}($filter),
53020            $filter
53021        );
53022
53023        if ({cachesStaticAnalysis}) {
53024            $codeCoverage->cacheStaticAnalysis(unserialize('{codeCoverageCacheDirectory}'));
53025        }
53026
53027        $result->setCodeCoverage($codeCoverage);
53028    }
53029
53030    $result->beStrictAboutTestsThatDoNotTestAnything({isStrictAboutTestsThatDoNotTestAnything});
53031    $result->beStrictAboutOutputDuringTests({isStrictAboutOutputDuringTests});
53032    $result->enforceTimeLimit({enforcesTimeLimit});
53033    $result->beStrictAboutTodoAnnotatedTests({isStrictAboutTodoAnnotatedTests});
53034    $result->beStrictAboutResourceUsageDuringSmallTests({isStrictAboutResourceUsageDuringSmallTests});
53035
53036    $test = new {className}('{name}', unserialize('{data}'), '{dataName}');
53037    $test->setDependencyInput(unserialize('{dependencyInput}'));
53038    $test->setInIsolation(TRUE);
53039
53040    ob_end_clean();
53041    $test->run($result);
53042    $output = '';
53043    if (!$test->hasExpectationOnOutput()) {
53044        $output = $test->getActualOutput();
53045    }
53046
53047    ini_set('xdebug.scream', '0');
53048    @rewind(STDOUT); /* @ as not every STDOUT target stream is rewindable */
53049    if ($stdout = @stream_get_contents(STDOUT)) {
53050        $output = $stdout . $output;
53051        $streamMetaData = stream_get_meta_data(STDOUT);
53052        if (!empty($streamMetaData['stream_type']) && 'STDIO' === $streamMetaData['stream_type']) {
53053            @ftruncate(STDOUT, 0);
53054            @rewind(STDOUT);
53055        }
53056    }
53057
53058    print serialize(
53059      [
53060        'testResult'    => $test->getResult(),
53061        'numAssertions' => $test->getNumAssertions(),
53062        'result'        => $result,
53063        'output'        => $output
53064      ]
53065    );
53066}
53067
53068$configurationFilePath = '{configurationFilePath}';
53069
53070if ('' !== $configurationFilePath) {
53071    $configuration = (new Loader)->load($configurationFilePath);
53072
53073    (new PhpHandler)->handle($configuration->php());
53074
53075    unset($configuration);
53076}
53077
53078function __phpunit_error_handler($errno, $errstr, $errfile, $errline)
53079{
53080   return true;
53081}
53082
53083set_error_handler('__phpunit_error_handler');
53084
53085{constants}
53086{included_files}
53087{globals}
53088
53089restore_error_handler();
53090
53091if (isset($GLOBALS['__PHPUNIT_BOOTSTRAP'])) {
53092    require_once $GLOBALS['__PHPUNIT_BOOTSTRAP'];
53093    unset($GLOBALS['__PHPUNIT_BOOTSTRAP']);
53094}
53095
53096__phpunit_run_isolated_test();
53097<?php
53098use PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage;
53099use PHPUnit\SebastianBergmann\CodeCoverage\Driver\Selector;
53100use SebastianBergmann\CodeCoverage\Filter;
53101
53102$composerAutoload = {composerAutoload};
53103$phar             = {phar};
53104
53105ob_start();
53106
53107$GLOBALS['__PHPUNIT_ISOLATION_EXCLUDE_LIST'][] = '{job}';
53108
53109if ($composerAutoload) {
53110    require_once $composerAutoload;
53111
53112    define('PHPUNIT_COMPOSER_INSTALL', $composerAutoload);
53113} else if ($phar) {
53114    require $phar;
53115}
53116
53117{globals}
53118$coverage = null;
53119
53120if (isset($GLOBALS['__PHPUNIT_BOOTSTRAP'])) {
53121    require_once $GLOBALS['__PHPUNIT_BOOTSTRAP'];
53122}
53123
53124if (class_exists('PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage')) {
53125    $filter = new Filter;
53126
53127    $coverage = new CodeCoverage(
53128        (new Selector)->{driverMethod}($filter),
53129        $filter
53130    );
53131
53132    if ({codeCoverageCacheDirectory}) {
53133        $coverage->cacheStaticAnalysis({codeCoverageCacheDirectory});
53134    }
53135
53136    $coverage->start(__FILE__);
53137}
53138
53139register_shutdown_function(
53140    function() use ($coverage) {
53141        $output = null;
53142
53143        if ($coverage) {
53144            $output = $coverage->stop();
53145        }
53146
53147        file_put_contents('{coverageFile}', serialize($output));
53148    }
53149);
53150
53151ob_end_clean();
53152
53153require '{job}';
53154<?php
53155
53156declare (strict_types=1);
53157/*
53158 * This file is part of PHPUnit.
53159 *
53160 * (c) Sebastian Bergmann <sebastian@phpunit.de>
53161 *
53162 * For the full copyright and license information, please view the LICENSE
53163 * file that was distributed with this source code.
53164 */
53165namespace PHPUnit\Util\PHP;
53166
53167use const PHP_MAJOR_VERSION;
53168use function tmpfile;
53169use PHPUnit\Framework\Exception;
53170/**
53171 * @internal This class is not covered by the backward compatibility promise for PHPUnit
53172 *
53173 * @see https://bugs.php.net/bug.php?id=51800
53174 */
53175final class WindowsPhpProcess extends \PHPUnit\Util\PHP\DefaultPhpProcess
53176{
53177    public function getCommand(array $settings, string $file = null) : string
53178    {
53179        if (\PHP_MAJOR_VERSION < 8) {
53180            return '"' . parent::getCommand($settings, $file) . '"';
53181        }
53182        return parent::getCommand($settings, $file);
53183    }
53184    /**
53185     * @throws Exception
53186     */
53187    protected function getHandles() : array
53188    {
53189        if (\false === ($stdout_handle = tmpfile())) {
53190            throw new Exception('A temporary file could not be created; verify that your TEMP environment variable is writable');
53191        }
53192        return [1 => $stdout_handle];
53193    }
53194    protected function useTemporaryFile() : bool
53195    {
53196        return \true;
53197    }
53198}
53199<?php
53200
53201declare (strict_types=1);
53202/*
53203 * This file is part of PHPUnit.
53204 *
53205 * (c) Sebastian Bergmann <sebastian@phpunit.de>
53206 *
53207 * For the full copyright and license information, please view the LICENSE
53208 * file that was distributed with this source code.
53209 */
53210namespace PHPUnit\Util\PHP;
53211
53212use function array_merge;
53213use function fclose;
53214use function file_put_contents;
53215use function fread;
53216use function fwrite;
53217use function is_array;
53218use function is_resource;
53219use function proc_close;
53220use function proc_open;
53221use function proc_terminate;
53222use function rewind;
53223use function sprintf;
53224use function stream_get_contents;
53225use function stream_select;
53226use function sys_get_temp_dir;
53227use function tempnam;
53228use function unlink;
53229use PHPUnit\Framework\Exception;
53230/**
53231 * @internal This class is not covered by the backward compatibility promise for PHPUnit
53232 */
53233class DefaultPhpProcess extends \PHPUnit\Util\PHP\AbstractPhpProcess
53234{
53235    /**
53236     * @var string
53237     */
53238    protected $tempFile;
53239    /**
53240     * Runs a single job (PHP code) using a separate PHP process.
53241     *
53242     * @throws Exception
53243     */
53244    public function runJob(string $job, array $settings = []) : array
53245    {
53246        if ($this->stdin || $this->useTemporaryFile()) {
53247            if (!($this->tempFile = tempnam(sys_get_temp_dir(), 'PHPUnit')) || file_put_contents($this->tempFile, $job) === \false) {
53248                throw new Exception('Unable to write temporary file');
53249            }
53250            $job = $this->stdin;
53251        }
53252        return $this->runProcess($job, $settings);
53253    }
53254    /**
53255     * Returns an array of file handles to be used in place of pipes.
53256     */
53257    protected function getHandles() : array
53258    {
53259        return [];
53260    }
53261    /**
53262     * Handles creating the child process and returning the STDOUT and STDERR.
53263     *
53264     * @throws Exception
53265     */
53266    protected function runProcess(string $job, array $settings) : array
53267    {
53268        $handles = $this->getHandles();
53269        $env = null;
53270        if ($this->env) {
53271            $env = $_SERVER ?? [];
53272            unset($env['argv'], $env['argc']);
53273            $env = array_merge($env, $this->env);
53274            foreach ($env as $envKey => $envVar) {
53275                if (is_array($envVar)) {
53276                    unset($env[$envKey]);
53277                }
53278            }
53279        }
53280        $pipeSpec = [0 => $handles[0] ?? ['pipe', 'r'], 1 => $handles[1] ?? ['pipe', 'w'], 2 => $handles[2] ?? ['pipe', 'w']];
53281        $process = proc_open($this->getCommand($settings, $this->tempFile), $pipeSpec, $pipes, null, $env);
53282        if (!is_resource($process)) {
53283            throw new Exception('Unable to spawn worker process');
53284        }
53285        if ($job) {
53286            $this->process($pipes[0], $job);
53287        }
53288        fclose($pipes[0]);
53289        $stderr = $stdout = '';
53290        if ($this->timeout) {
53291            unset($pipes[0]);
53292            while (\true) {
53293                $r = $pipes;
53294                $w = null;
53295                $e = null;
53296                $n = @stream_select($r, $w, $e, $this->timeout);
53297                if ($n === \false) {
53298                    break;
53299                }
53300                if ($n === 0) {
53301                    proc_terminate($process, 9);
53302                    throw new Exception(sprintf('Job execution aborted after %d seconds', $this->timeout));
53303                }
53304                if ($n > 0) {
53305                    foreach ($r as $pipe) {
53306                        $pipeOffset = 0;
53307                        foreach ($pipes as $i => $origPipe) {
53308                            if ($pipe === $origPipe) {
53309                                $pipeOffset = $i;
53310                                break;
53311                            }
53312                        }
53313                        if (!$pipeOffset) {
53314                            break;
53315                        }
53316                        $line = fread($pipe, 8192);
53317                        if ($line === '' || $line === \false) {
53318                            fclose($pipes[$pipeOffset]);
53319                            unset($pipes[$pipeOffset]);
53320                        } elseif ($pipeOffset === 1) {
53321                            $stdout .= $line;
53322                        } else {
53323                            $stderr .= $line;
53324                        }
53325                    }
53326                    if (empty($pipes)) {
53327                        break;
53328                    }
53329                }
53330            }
53331        } else {
53332            if (isset($pipes[1])) {
53333                $stdout = stream_get_contents($pipes[1]);
53334                fclose($pipes[1]);
53335            }
53336            if (isset($pipes[2])) {
53337                $stderr = stream_get_contents($pipes[2]);
53338                fclose($pipes[2]);
53339            }
53340        }
53341        if (isset($handles[1])) {
53342            rewind($handles[1]);
53343            $stdout = stream_get_contents($handles[1]);
53344            fclose($handles[1]);
53345        }
53346        if (isset($handles[2])) {
53347            rewind($handles[2]);
53348            $stderr = stream_get_contents($handles[2]);
53349            fclose($handles[2]);
53350        }
53351        proc_close($process);
53352        $this->cleanup();
53353        return ['stdout' => $stdout, 'stderr' => $stderr];
53354    }
53355    /**
53356     * @param resource $pipe
53357     */
53358    protected function process($pipe, string $job) : void
53359    {
53360        fwrite($pipe, $job);
53361    }
53362    protected function cleanup() : void
53363    {
53364        if ($this->tempFile) {
53365            unlink($this->tempFile);
53366        }
53367    }
53368    protected function useTemporaryFile() : bool
53369    {
53370        return \false;
53371    }
53372}
53373<?php
53374
53375declare (strict_types=1);
53376/*
53377 * This file is part of PHPUnit.
53378 *
53379 * (c) Sebastian Bergmann <sebastian@phpunit.de>
53380 *
53381 * For the full copyright and license information, please view the LICENSE
53382 * file that was distributed with this source code.
53383 */
53384namespace PHPUnit\Util\PHP;
53385
53386use const DIRECTORY_SEPARATOR;
53387use const PHP_SAPI;
53388use function array_keys;
53389use function array_merge;
53390use function assert;
53391use function escapeshellarg;
53392use function ini_get_all;
53393use function restore_error_handler;
53394use function set_error_handler;
53395use function sprintf;
53396use function str_replace;
53397use function strpos;
53398use function strrpos;
53399use function substr;
53400use function trim;
53401use function unserialize;
53402use __PHP_Incomplete_Class;
53403use ErrorException;
53404use PHPUnit\Framework\AssertionFailedError;
53405use PHPUnit\Framework\Exception;
53406use PHPUnit\Framework\SyntheticError;
53407use PHPUnit\Framework\Test;
53408use PHPUnit\Framework\TestCase;
53409use PHPUnit\Framework\TestFailure;
53410use PHPUnit\Framework\TestResult;
53411use PHPUnit\SebastianBergmann\Environment\Runtime;
53412/**
53413 * @internal This class is not covered by the backward compatibility promise for PHPUnit
53414 */
53415abstract class AbstractPhpProcess
53416{
53417    /**
53418     * @var Runtime
53419     */
53420    protected $runtime;
53421    /**
53422     * @var bool
53423     */
53424    protected $stderrRedirection = \false;
53425    /**
53426     * @var string
53427     */
53428    protected $stdin = '';
53429    /**
53430     * @var string
53431     */
53432    protected $args = '';
53433    /**
53434     * @var array<string, string>
53435     */
53436    protected $env = [];
53437    /**
53438     * @var int
53439     */
53440    protected $timeout = 0;
53441    public static function factory() : self
53442    {
53443        if (\DIRECTORY_SEPARATOR === '\\') {
53444            return new \PHPUnit\Util\PHP\WindowsPhpProcess();
53445        }
53446        return new \PHPUnit\Util\PHP\DefaultPhpProcess();
53447    }
53448    public function __construct()
53449    {
53450        $this->runtime = new Runtime();
53451    }
53452    /**
53453     * Defines if should use STDERR redirection or not.
53454     *
53455     * Then $stderrRedirection is TRUE, STDERR is redirected to STDOUT.
53456     */
53457    public function setUseStderrRedirection(bool $stderrRedirection) : void
53458    {
53459        $this->stderrRedirection = $stderrRedirection;
53460    }
53461    /**
53462     * Returns TRUE if uses STDERR redirection or FALSE if not.
53463     */
53464    public function useStderrRedirection() : bool
53465    {
53466        return $this->stderrRedirection;
53467    }
53468    /**
53469     * Sets the input string to be sent via STDIN.
53470     */
53471    public function setStdin(string $stdin) : void
53472    {
53473        $this->stdin = $stdin;
53474    }
53475    /**
53476     * Returns the input string to be sent via STDIN.
53477     */
53478    public function getStdin() : string
53479    {
53480        return $this->stdin;
53481    }
53482    /**
53483     * Sets the string of arguments to pass to the php job.
53484     */
53485    public function setArgs(string $args) : void
53486    {
53487        $this->args = $args;
53488    }
53489    /**
53490     * Returns the string of arguments to pass to the php job.
53491     */
53492    public function getArgs() : string
53493    {
53494        return $this->args;
53495    }
53496    /**
53497     * Sets the array of environment variables to start the child process with.
53498     *
53499     * @param array<string, string> $env
53500     */
53501    public function setEnv(array $env) : void
53502    {
53503        $this->env = $env;
53504    }
53505    /**
53506     * Returns the array of environment variables to start the child process with.
53507     */
53508    public function getEnv() : array
53509    {
53510        return $this->env;
53511    }
53512    /**
53513     * Sets the amount of seconds to wait before timing out.
53514     */
53515    public function setTimeout(int $timeout) : void
53516    {
53517        $this->timeout = $timeout;
53518    }
53519    /**
53520     * Returns the amount of seconds to wait before timing out.
53521     */
53522    public function getTimeout() : int
53523    {
53524        return $this->timeout;
53525    }
53526    /**
53527     * Runs a single test in a separate PHP process.
53528     *
53529     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
53530     */
53531    public function runTestJob(string $job, Test $test, TestResult $result) : void
53532    {
53533        $result->startTest($test);
53534        $_result = $this->runJob($job);
53535        $this->processChildResult($test, $result, $_result['stdout'], $_result['stderr']);
53536    }
53537    /**
53538     * Returns the command based into the configurations.
53539     */
53540    public function getCommand(array $settings, string $file = null) : string
53541    {
53542        $command = $this->runtime->getBinary();
53543        if ($this->runtime->hasPCOV()) {
53544            $settings = array_merge($settings, $this->runtime->getCurrentSettings(array_keys(ini_get_all('pcov'))));
53545        } elseif ($this->runtime->hasXdebug()) {
53546            $settings = array_merge($settings, $this->runtime->getCurrentSettings(array_keys(ini_get_all('xdebug'))));
53547        }
53548        $command .= $this->settingsToParameters($settings);
53549        if (\PHP_SAPI === 'phpdbg') {
53550            $command .= ' -qrr';
53551            if (!$file) {
53552                $command .= 's=';
53553            }
53554        }
53555        if ($file) {
53556            $command .= ' ' . escapeshellarg($file);
53557        }
53558        if ($this->args) {
53559            if (!$file) {
53560                $command .= ' --';
53561            }
53562            $command .= ' ' . $this->args;
53563        }
53564        if ($this->stderrRedirection) {
53565            $command .= ' 2>&1';
53566        }
53567        return $command;
53568    }
53569    /**
53570     * Runs a single job (PHP code) using a separate PHP process.
53571     */
53572    public abstract function runJob(string $job, array $settings = []) : array;
53573    protected function settingsToParameters(array $settings) : string
53574    {
53575        $buffer = '';
53576        foreach ($settings as $setting) {
53577            $buffer .= ' -d ' . escapeshellarg($setting);
53578        }
53579        return $buffer;
53580    }
53581    /**
53582     * Processes the TestResult object from an isolated process.
53583     *
53584     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
53585     */
53586    private function processChildResult(Test $test, TestResult $result, string $stdout, string $stderr) : void
53587    {
53588        $time = 0;
53589        if (!empty($stderr)) {
53590            $result->addError($test, new Exception(trim($stderr)), $time);
53591        } else {
53592            set_error_handler(
53593                /**
53594                 * @throws ErrorException
53595                 */
53596                static function ($errno, $errstr, $errfile, $errline) : void {
53597                    throw new ErrorException($errstr, $errno, $errno, $errfile, $errline);
53598                }
53599            );
53600            try {
53601                if (strpos($stdout, "#!/usr/bin/env php\n") === 0) {
53602                    $stdout = substr($stdout, 19);
53603                }
53604                $childResult = unserialize(str_replace("#!/usr/bin/env php\n", '', $stdout));
53605                restore_error_handler();
53606                if ($childResult === \false) {
53607                    $result->addFailure($test, new AssertionFailedError('Test was run in child process and ended unexpectedly'), $time);
53608                }
53609            } catch (ErrorException $e) {
53610                restore_error_handler();
53611                $childResult = \false;
53612                $result->addError($test, new Exception(trim($stdout), 0, $e), $time);
53613            }
53614            if ($childResult !== \false) {
53615                if (!empty($childResult['output'])) {
53616                    $output = $childResult['output'];
53617                }
53618                /* @var TestCase $test */
53619                $test->setResult($childResult['testResult']);
53620                $test->addToAssertionCount($childResult['numAssertions']);
53621                $childResult = $childResult['result'];
53622                assert($childResult instanceof TestResult);
53623                if ($result->getCollectCodeCoverageInformation()) {
53624                    $result->getCodeCoverage()->merge($childResult->getCodeCoverage());
53625                }
53626                $time = $childResult->time();
53627                $notImplemented = $childResult->notImplemented();
53628                $risky = $childResult->risky();
53629                $skipped = $childResult->skipped();
53630                $errors = $childResult->errors();
53631                $warnings = $childResult->warnings();
53632                $failures = $childResult->failures();
53633                if (!empty($notImplemented)) {
53634                    $result->addError($test, $this->getException($notImplemented[0]), $time);
53635                } elseif (!empty($risky)) {
53636                    $result->addError($test, $this->getException($risky[0]), $time);
53637                } elseif (!empty($skipped)) {
53638                    $result->addError($test, $this->getException($skipped[0]), $time);
53639                } elseif (!empty($errors)) {
53640                    $result->addError($test, $this->getException($errors[0]), $time);
53641                } elseif (!empty($warnings)) {
53642                    $result->addWarning($test, $this->getException($warnings[0]), $time);
53643                } elseif (!empty($failures)) {
53644                    $result->addFailure($test, $this->getException($failures[0]), $time);
53645                }
53646            }
53647        }
53648        $result->endTest($test, $time);
53649        if (!empty($output)) {
53650            print $output;
53651        }
53652    }
53653    /**
53654     * Gets the thrown exception from a PHPUnit\Framework\TestFailure.
53655     *
53656     * @see https://github.com/sebastianbergmann/phpunit/issues/74
53657     */
53658    private function getException(TestFailure $error) : Exception
53659    {
53660        $exception = $error->thrownException();
53661        if ($exception instanceof __PHP_Incomplete_Class) {
53662            $exceptionArray = [];
53663            foreach ((array) $exception as $key => $value) {
53664                $key = substr($key, strrpos($key, "\0") + 1);
53665                $exceptionArray[$key] = $value;
53666            }
53667            $exception = new SyntheticError(sprintf('%s: %s', $exceptionArray['_PHP_Incomplete_Class_Name'], $exceptionArray['message']), $exceptionArray['code'], $exceptionArray['file'], $exceptionArray['line'], $exceptionArray['trace']);
53668        }
53669        return $exception;
53670    }
53671}
53672<?php
53673
53674declare (strict_types=1);
53675/*
53676 * This file is part of PHPUnit.
53677 *
53678 * (c) Sebastian Bergmann <sebastian@phpunit.de>
53679 *
53680 * For the full copyright and license information, please view the LICENSE
53681 * file that was distributed with this source code.
53682 */
53683namespace PHPUnit\Util;
53684
53685use const ENT_COMPAT;
53686use const ENT_SUBSTITUTE;
53687use const PHP_SAPI;
53688use function assert;
53689use function count;
53690use function dirname;
53691use function explode;
53692use function fclose;
53693use function fopen;
53694use function fsockopen;
53695use function fwrite;
53696use function htmlspecialchars;
53697use function is_resource;
53698use function is_string;
53699use function sprintf;
53700use function str_replace;
53701use function strncmp;
53702use function strpos;
53703/**
53704 * @internal This class is not covered by the backward compatibility promise for PHPUnit
53705 */
53706class Printer
53707{
53708    /**
53709     * @psalm-var closed-resource|resource
53710     */
53711    private $stream;
53712    /**
53713     * @var bool
53714     */
53715    private $isPhpStream;
53716    /**
53717     * @param null|resource|string $out
53718     *
53719     * @throws Exception
53720     */
53721    public function __construct($out = null)
53722    {
53723        if (is_resource($out)) {
53724            $this->stream = $out;
53725            return;
53726        }
53727        if (!is_string($out)) {
53728            return;
53729        }
53730        if (strpos($out, 'socket://') === 0) {
53731            $tmp = explode(':', str_replace('socket://', '', $out));
53732            if (count($tmp) !== 2) {
53733                throw new \PHPUnit\Util\Exception(sprintf('"%s" does not match "socket://hostname:port" format', $out));
53734            }
53735            $this->stream = fsockopen($tmp[0], (int) $tmp[1]);
53736            return;
53737        }
53738        if (strpos($out, 'php://') === \false && !\PHPUnit\Util\Filesystem::createDirectory(dirname($out))) {
53739            throw new \PHPUnit\Util\Exception(sprintf('Directory "%s" was not created', dirname($out)));
53740        }
53741        $this->stream = fopen($out, 'wb');
53742        $this->isPhpStream = strncmp($out, 'php://', 6) !== 0;
53743    }
53744    public function write(string $buffer) : void
53745    {
53746        if ($this->stream) {
53747            assert(is_resource($this->stream));
53748            fwrite($this->stream, $buffer);
53749        } else {
53750            if (\PHP_SAPI !== 'cli' && \PHP_SAPI !== 'phpdbg') {
53751                $buffer = htmlspecialchars($buffer, \ENT_COMPAT | \ENT_SUBSTITUTE);
53752            }
53753            print $buffer;
53754        }
53755    }
53756    public function flush() : void
53757    {
53758        if ($this->stream && $this->isPhpStream) {
53759            assert(is_resource($this->stream));
53760            fclose($this->stream);
53761        }
53762    }
53763}
53764<?php
53765
53766declare (strict_types=1);
53767/*
53768 * This file is part of PHPUnit.
53769 *
53770 * (c) Sebastian Bergmann <sebastian@phpunit.de>
53771 *
53772 * For the full copyright and license information, please view the LICENSE
53773 * file that was distributed with this source code.
53774 */
53775namespace PHPUnit\Util;
53776
53777use Throwable;
53778/**
53779 * @internal This class is not covered by the backward compatibility promise for PHPUnit
53780 */
53781final class Type
53782{
53783    public static function isType(string $type) : bool
53784    {
53785        switch ($type) {
53786            case 'numeric':
53787            case 'integer':
53788            case 'int':
53789            case 'iterable':
53790            case 'float':
53791            case 'string':
53792            case 'boolean':
53793            case 'bool':
53794            case 'null':
53795            case 'array':
53796            case 'object':
53797            case 'resource':
53798            case 'scalar':
53799                return \true;
53800            default:
53801                return \false;
53802        }
53803    }
53804    public static function isCloneable(object $object) : bool
53805    {
53806        try {
53807            $clone = clone $object;
53808        } catch (Throwable $t) {
53809            return \false;
53810        }
53811        return $clone instanceof $object;
53812    }
53813}
53814<?php
53815
53816declare (strict_types=1);
53817/*
53818 * This file is part of PHPUnit.
53819 *
53820 * (c) Sebastian Bergmann <sebastian@phpunit.de>
53821 *
53822 * For the full copyright and license information, please view the LICENSE
53823 * file that was distributed with this source code.
53824 */
53825namespace PHPUnit\Util;
53826
53827use const JSON_PRETTY_PRINT;
53828use const JSON_UNESCAPED_SLASHES;
53829use const JSON_UNESCAPED_UNICODE;
53830use function count;
53831use function is_array;
53832use function is_object;
53833use function json_decode;
53834use function json_encode;
53835use function json_last_error;
53836use function ksort;
53837use PHPUnit\Framework\Exception;
53838/**
53839 * @internal This class is not covered by the backward compatibility promise for PHPUnit
53840 */
53841final class Json
53842{
53843    /**
53844     * Prettify json string.
53845     *
53846     * @throws \PHPUnit\Framework\Exception
53847     */
53848    public static function prettify(string $json) : string
53849    {
53850        $decodedJson = json_decode($json, \false);
53851        if (json_last_error()) {
53852            throw new Exception('Cannot prettify invalid json');
53853        }
53854        return json_encode($decodedJson, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE);
53855    }
53856    /**
53857     * To allow comparison of JSON strings, first process them into a consistent
53858     * format so that they can be compared as strings.
53859     *
53860     * @return array ($error, $canonicalized_json)  The $error parameter is used
53861     *               to indicate an error decoding the json. This is used to avoid ambiguity
53862     *               with JSON strings consisting entirely of 'null' or 'false'.
53863     */
53864    public static function canonicalize(string $json) : array
53865    {
53866        $decodedJson = json_decode($json);
53867        if (json_last_error()) {
53868            return [\true, null];
53869        }
53870        self::recursiveSort($decodedJson);
53871        $reencodedJson = json_encode($decodedJson);
53872        return [\false, $reencodedJson];
53873    }
53874    /**
53875     * JSON object keys are unordered while PHP array keys are ordered.
53876     *
53877     * Sort all array keys to ensure both the expected and actual values have
53878     * their keys in the same order.
53879     */
53880    private static function recursiveSort(&$json) : void
53881    {
53882        if (!is_array($json)) {
53883            // If the object is not empty, change it to an associative array
53884            // so we can sort the keys (and we will still re-encode it
53885            // correctly, since PHP encodes associative arrays as JSON objects.)
53886            // But EMPTY objects MUST remain empty objects. (Otherwise we will
53887            // re-encode it as a JSON array rather than a JSON object.)
53888            // See #2919.
53889            if (is_object($json) && count((array) $json) > 0) {
53890                $json = (array) $json;
53891            } else {
53892                return;
53893            }
53894        }
53895        ksort($json);
53896        foreach ($json as $key => &$value) {
53897            self::recursiveSort($value);
53898        }
53899    }
53900}
53901<?php
53902
53903declare (strict_types=1);
53904/*
53905 * This file is part of PHPUnit.
53906 *
53907 * (c) Sebastian Bergmann <sebastian@phpunit.de>
53908 *
53909 * For the full copyright and license information, please view the LICENSE
53910 * file that was distributed with this source code.
53911 */
53912namespace PHPUnit\Util\Annotation;
53913
53914use const JSON_ERROR_NONE;
53915use const PREG_OFFSET_CAPTURE;
53916use function array_filter;
53917use function array_key_exists;
53918use function array_map;
53919use function array_merge;
53920use function array_pop;
53921use function array_slice;
53922use function array_values;
53923use function count;
53924use function explode;
53925use function file;
53926use function implode;
53927use function is_array;
53928use function is_int;
53929use function json_decode;
53930use function json_last_error;
53931use function json_last_error_msg;
53932use function preg_match;
53933use function preg_match_all;
53934use function preg_replace;
53935use function preg_split;
53936use function realpath;
53937use function rtrim;
53938use function sprintf;
53939use function str_replace;
53940use function strlen;
53941use function strpos;
53942use function strtolower;
53943use function substr;
53944use function trim;
53945use PHPUnit\PharIo\Version\VersionConstraintParser;
53946use PHPUnit\Framework\InvalidDataProviderException;
53947use PHPUnit\Framework\SkippedTestError;
53948use PHPUnit\Framework\Warning;
53949use PHPUnit\Util\Exception;
53950use PHPUnit\Util\InvalidDataSetException;
53951use ReflectionClass;
53952use ReflectionException;
53953use ReflectionFunctionAbstract;
53954use ReflectionMethod;
53955use Reflector;
53956use Traversable;
53957/**
53958 * This is an abstraction around a PHPUnit-specific docBlock,
53959 * allowing us to ask meaningful questions about a specific
53960 * reflection symbol.
53961 *
53962 * @internal This class is not covered by the backward compatibility promise for PHPUnit
53963 */
53964final class DocBlock
53965{
53966    /**
53967     * @todo This constant should be private (it's public because of TestTest::testGetProvidedDataRegEx)
53968     */
53969    public const REGEX_DATA_PROVIDER = '/@dataProvider\\s+([a-zA-Z0-9._:-\\\\x7f-\\xff]+)/';
53970    private const REGEX_REQUIRES_VERSION = '/@requires\\s+(?P<name>PHP(?:Unit)?)\\s+(?P<operator>[<>=!]{0,2})\\s*(?P<version>[\\d\\.-]+(dev|(RC|alpha|beta)[\\d\\.])?)[ \\t]*\\r?$/m';
53971    private const REGEX_REQUIRES_VERSION_CONSTRAINT = '/@requires\\s+(?P<name>PHP(?:Unit)?)\\s+(?P<constraint>[\\d\\t \\-.|~^]+)[ \\t]*\\r?$/m';
53972    private const REGEX_REQUIRES_OS = '/@requires\\s+(?P<name>OS(?:FAMILY)?)\\s+(?P<value>.+?)[ \\t]*\\r?$/m';
53973    private const REGEX_REQUIRES_SETTING = '/@requires\\s+(?P<name>setting)\\s+(?P<setting>([^ ]+?))\\s*(?P<value>[\\w\\.-]+[\\w\\.]?)?[ \\t]*\\r?$/m';
53974    private const REGEX_REQUIRES = '/@requires\\s+(?P<name>function|extension)\\s+(?P<value>([^\\s<>=!]+))\\s*(?P<operator>[<>=!]{0,2})\\s*(?P<version>[\\d\\.-]+[\\d\\.]?)?[ \\t]*\\r?$/m';
53975    private const REGEX_TEST_WITH = '/@testWith\\s+/';
53976    /** @var string */
53977    private $docComment;
53978    /** @var bool */
53979    private $isMethod;
53980    /** @var array<string, array<int, string>> pre-parsed annotations indexed by name and occurrence index */
53981    private $symbolAnnotations;
53982    /**
53983     * @var null|array<string, mixed>
53984     *
53985     * @psalm-var null|(array{
53986     *   __OFFSET: array<string, int>&array{__FILE: string},
53987     *   setting?: array<string, string>,
53988     *   extension_versions?: array<string, array{version: string, operator: string}>
53989     * }&array<
53990     *   string,
53991     *   string|array{version: string, operator: string}|array{constraint: string}|array<int|string, string>
53992     * >)
53993     */
53994    private $parsedRequirements;
53995    /** @var int */
53996    private $startLine;
53997    /** @var int */
53998    private $endLine;
53999    /** @var string */
54000    private $fileName;
54001    /** @var string */
54002    private $name;
54003    /**
54004     * @var string
54005     *
54006     * @psalm-var class-string
54007     */
54008    private $className;
54009    public static function ofClass(ReflectionClass $class) : self
54010    {
54011        $className = $class->getName();
54012        return new self((string) $class->getDocComment(), \false, self::extractAnnotationsFromReflector($class), $class->getStartLine(), $class->getEndLine(), $class->getFileName(), $className, $className);
54013    }
54014    /**
54015     * @psalm-param class-string $classNameInHierarchy
54016     */
54017    public static function ofMethod(ReflectionMethod $method, string $classNameInHierarchy) : self
54018    {
54019        return new self((string) $method->getDocComment(), \true, self::extractAnnotationsFromReflector($method), $method->getStartLine(), $method->getEndLine(), $method->getFileName(), $method->getName(), $classNameInHierarchy);
54020    }
54021    /**
54022     * Note: we do not preserve an instance of the reflection object, since it cannot be safely (de-)serialized.
54023     *
54024     * @param array<string, array<int, string>> $symbolAnnotations
54025     *
54026     * @psalm-param class-string $className
54027     */
54028    private function __construct(string $docComment, bool $isMethod, array $symbolAnnotations, int $startLine, int $endLine, string $fileName, string $name, string $className)
54029    {
54030        $this->docComment = $docComment;
54031        $this->isMethod = $isMethod;
54032        $this->symbolAnnotations = $symbolAnnotations;
54033        $this->startLine = $startLine;
54034        $this->endLine = $endLine;
54035        $this->fileName = $fileName;
54036        $this->name = $name;
54037        $this->className = $className;
54038    }
54039    /**
54040     * @psalm-return array{
54041     *   __OFFSET: array<string, int>&array{__FILE: string},
54042     *   setting?: array<string, string>,
54043     *   extension_versions?: array<string, array{version: string, operator: string}>
54044     * }&array<
54045     *   string,
54046     *   string|array{version: string, operator: string}|array{constraint: string}|array<int|string, string>
54047     * >
54048     *
54049     * @throws Warning if the requirements version constraint is not well-formed
54050     */
54051    public function requirements() : array
54052    {
54053        if ($this->parsedRequirements !== null) {
54054            return $this->parsedRequirements;
54055        }
54056        $offset = $this->startLine;
54057        $requires = [];
54058        $recordedSettings = [];
54059        $extensionVersions = [];
54060        $recordedOffsets = ['__FILE' => realpath($this->fileName)];
54061        // Trim docblock markers, split it into lines and rewind offset to start of docblock
54062        $lines = preg_replace(['#^/\\*{2}#', '#\\*/$#'], '', preg_split('/\\r\\n|\\r|\\n/', $this->docComment));
54063        $offset -= count($lines);
54064        foreach ($lines as $line) {
54065            if (preg_match(self::REGEX_REQUIRES_OS, $line, $matches)) {
54066                $requires[$matches['name']] = $matches['value'];
54067                $recordedOffsets[$matches['name']] = $offset;
54068            }
54069            if (preg_match(self::REGEX_REQUIRES_VERSION, $line, $matches)) {
54070                $requires[$matches['name']] = ['version' => $matches['version'], 'operator' => $matches['operator']];
54071                $recordedOffsets[$matches['name']] = $offset;
54072            }
54073            if (preg_match(self::REGEX_REQUIRES_VERSION_CONSTRAINT, $line, $matches)) {
54074                if (!empty($requires[$matches['name']])) {
54075                    $offset++;
54076                    continue;
54077                }
54078                try {
54079                    $versionConstraintParser = new VersionConstraintParser();
54080                    $requires[$matches['name'] . '_constraint'] = ['constraint' => $versionConstraintParser->parse(trim($matches['constraint']))];
54081                    $recordedOffsets[$matches['name'] . '_constraint'] = $offset;
54082                } catch (\PHPUnit\PharIo\Version\Exception $e) {
54083                    throw new Warning($e->getMessage(), $e->getCode(), $e);
54084                }
54085            }
54086            if (preg_match(self::REGEX_REQUIRES_SETTING, $line, $matches)) {
54087                $recordedSettings[$matches['setting']] = $matches['value'];
54088                $recordedOffsets['__SETTING_' . $matches['setting']] = $offset;
54089            }
54090            if (preg_match(self::REGEX_REQUIRES, $line, $matches)) {
54091                $name = $matches['name'] . 's';
54092                if (!isset($requires[$name])) {
54093                    $requires[$name] = [];
54094                }
54095                $requires[$name][] = $matches['value'];
54096                $recordedOffsets[$matches['name'] . '_' . $matches['value']] = $offset;
54097                if ($name === 'extensions' && !empty($matches['version'])) {
54098                    $extensionVersions[$matches['value']] = ['version' => $matches['version'], 'operator' => $matches['operator']];
54099                }
54100            }
54101            $offset++;
54102        }
54103        return $this->parsedRequirements = array_merge($requires, ['__OFFSET' => $recordedOffsets], array_filter(['setting' => $recordedSettings, 'extension_versions' => $extensionVersions]));
54104    }
54105    /**
54106     * Returns the provided data for a method.
54107     *
54108     * @throws Exception
54109     */
54110    public function getProvidedData() : ?array
54111    {
54112        /** @noinspection SuspiciousBinaryOperationInspection */
54113        $data = $this->getDataFromDataProviderAnnotation($this->docComment) ?? $this->getDataFromTestWithAnnotation($this->docComment);
54114        if ($data === null) {
54115            return null;
54116        }
54117        if ($data === []) {
54118            throw new SkippedTestError();
54119        }
54120        foreach ($data as $key => $value) {
54121            if (!is_array($value)) {
54122                throw new InvalidDataSetException(sprintf('Data set %s is invalid.', is_int($key) ? '#' . $key : '"' . $key . '"'));
54123            }
54124        }
54125        return $data;
54126    }
54127    /**
54128     * @psalm-return array<string, array{line: int, value: string}>
54129     */
54130    public function getInlineAnnotations() : array
54131    {
54132        $code = file($this->fileName);
54133        $lineNumber = $this->startLine;
54134        $startLine = $this->startLine - 1;
54135        $endLine = $this->endLine - 1;
54136        $codeLines = array_slice($code, $startLine, $endLine - $startLine + 1);
54137        $annotations = [];
54138        foreach ($codeLines as $line) {
54139            if (preg_match('#/\\*\\*?\\s*@(?P<name>[A-Za-z_-]+)(?:[ \\t]+(?P<value>.*?))?[ \\t]*\\r?\\*/$#m', $line, $matches)) {
54140                $annotations[strtolower($matches['name'])] = ['line' => $lineNumber, 'value' => $matches['value']];
54141            }
54142            $lineNumber++;
54143        }
54144        return $annotations;
54145    }
54146    public function symbolAnnotations() : array
54147    {
54148        return $this->symbolAnnotations;
54149    }
54150    public function isHookToBeExecutedBeforeClass() : bool
54151    {
54152        return $this->isMethod && \false !== strpos($this->docComment, '@beforeClass');
54153    }
54154    public function isHookToBeExecutedAfterClass() : bool
54155    {
54156        return $this->isMethod && \false !== strpos($this->docComment, '@afterClass');
54157    }
54158    public function isToBeExecutedBeforeTest() : bool
54159    {
54160        return 1 === preg_match('/@before\\b/', $this->docComment);
54161    }
54162    public function isToBeExecutedAfterTest() : bool
54163    {
54164        return 1 === preg_match('/@after\\b/', $this->docComment);
54165    }
54166    public function isToBeExecutedAsPreCondition() : bool
54167    {
54168        return 1 === preg_match('/@preCondition\\b/', $this->docComment);
54169    }
54170    public function isToBeExecutedAsPostCondition() : bool
54171    {
54172        return 1 === preg_match('/@postCondition\\b/', $this->docComment);
54173    }
54174    private function getDataFromDataProviderAnnotation(string $docComment) : ?array
54175    {
54176        $methodName = null;
54177        $className = $this->className;
54178        if ($this->isMethod) {
54179            $methodName = $this->name;
54180        }
54181        if (!preg_match_all(self::REGEX_DATA_PROVIDER, $docComment, $matches)) {
54182            return null;
54183        }
54184        $result = [];
54185        foreach ($matches[1] as $match) {
54186            $dataProviderMethodNameNamespace = explode('\\', $match);
54187            $leaf = explode('::', array_pop($dataProviderMethodNameNamespace));
54188            $dataProviderMethodName = array_pop($leaf);
54189            if (empty($dataProviderMethodNameNamespace)) {
54190                $dataProviderMethodNameNamespace = '';
54191            } else {
54192                $dataProviderMethodNameNamespace = implode('\\', $dataProviderMethodNameNamespace) . '\\';
54193            }
54194            if (empty($leaf)) {
54195                $dataProviderClassName = $className;
54196            } else {
54197                /** @psalm-var class-string $dataProviderClassName */
54198                $dataProviderClassName = $dataProviderMethodNameNamespace . array_pop($leaf);
54199            }
54200            try {
54201                $dataProviderClass = new ReflectionClass($dataProviderClassName);
54202                $dataProviderMethod = $dataProviderClass->getMethod($dataProviderMethodName);
54203                // @codeCoverageIgnoreStart
54204            } catch (ReflectionException $e) {
54205                throw new Exception($e->getMessage(), (int) $e->getCode(), $e);
54206                // @codeCoverageIgnoreEnd
54207            }
54208            if ($dataProviderMethod->isStatic()) {
54209                $object = null;
54210            } else {
54211                $object = $dataProviderClass->newInstance();
54212            }
54213            if ($dataProviderMethod->getNumberOfParameters() === 0) {
54214                $data = $dataProviderMethod->invoke($object);
54215            } else {
54216                $data = $dataProviderMethod->invoke($object, $methodName);
54217            }
54218            if ($data instanceof Traversable) {
54219                $origData = $data;
54220                $data = [];
54221                foreach ($origData as $key => $value) {
54222                    if (is_int($key)) {
54223                        $data[] = $value;
54224                    } elseif (array_key_exists($key, $data)) {
54225                        throw new InvalidDataProviderException(sprintf('The key "%s" has already been defined in the data provider "%s".', $key, $match));
54226                    } else {
54227                        $data[$key] = $value;
54228                    }
54229                }
54230            }
54231            if (is_array($data)) {
54232                $result = array_merge($result, $data);
54233            }
54234        }
54235        return $result;
54236    }
54237    /**
54238     * @throws Exception
54239     */
54240    private function getDataFromTestWithAnnotation(string $docComment) : ?array
54241    {
54242        $docComment = $this->cleanUpMultiLineAnnotation($docComment);
54243        if (!preg_match(self::REGEX_TEST_WITH, $docComment, $matches, \PREG_OFFSET_CAPTURE)) {
54244            return null;
54245        }
54246        $offset = strlen($matches[0][0]) + $matches[0][1];
54247        $annotationContent = substr($docComment, $offset);
54248        $data = [];
54249        foreach (explode("\n", $annotationContent) as $candidateRow) {
54250            $candidateRow = trim($candidateRow);
54251            if ($candidateRow[0] !== '[') {
54252                break;
54253            }
54254            $dataSet = json_decode($candidateRow, \true);
54255            if (json_last_error() !== \JSON_ERROR_NONE) {
54256                throw new Exception('The data set for the @testWith annotation cannot be parsed: ' . json_last_error_msg());
54257            }
54258            $data[] = $dataSet;
54259        }
54260        if (!$data) {
54261            throw new Exception('The data set for the @testWith annotation cannot be parsed.');
54262        }
54263        return $data;
54264    }
54265    private function cleanUpMultiLineAnnotation(string $docComment) : string
54266    {
54267        //removing initial '   * ' for docComment
54268        $docComment = str_replace("\r\n", "\n", $docComment);
54269        $docComment = preg_replace('/' . '\\n' . '\\s*' . '\\*' . '\\s?' . '/', "\n", $docComment);
54270        $docComment = (string) substr($docComment, 0, -1);
54271        return rtrim($docComment, "\n");
54272    }
54273    /** @return array<string, array<int, string>> */
54274    private static function parseDocBlock(string $docBlock) : array
54275    {
54276        // Strip away the docblock header and footer to ease parsing of one line annotations
54277        $docBlock = (string) substr($docBlock, 3, -2);
54278        $annotations = [];
54279        if (preg_match_all('/@(?P<name>[A-Za-z_-]+)(?:[ \\t]+(?P<value>.*?))?[ \\t]*\\r?$/m', $docBlock, $matches)) {
54280            $numMatches = count($matches[0]);
54281            for ($i = 0; $i < $numMatches; $i++) {
54282                $annotations[$matches['name'][$i]][] = (string) $matches['value'][$i];
54283            }
54284        }
54285        return $annotations;
54286    }
54287    /** @param ReflectionClass|ReflectionFunctionAbstract $reflector */
54288    private static function extractAnnotationsFromReflector(Reflector $reflector) : array
54289    {
54290        $annotations = [];
54291        if ($reflector instanceof ReflectionClass) {
54292            $annotations = array_merge($annotations, ...array_map(static function (ReflectionClass $trait) : array {
54293                return self::parseDocBlock((string) $trait->getDocComment());
54294            }, array_values($reflector->getTraits())));
54295        }
54296        return array_merge($annotations, self::parseDocBlock((string) $reflector->getDocComment()));
54297    }
54298}
54299<?php
54300
54301declare (strict_types=1);
54302/*
54303 * This file is part of PHPUnit.
54304 *
54305 * (c) Sebastian Bergmann <sebastian@phpunit.de>
54306 *
54307 * For the full copyright and license information, please view the LICENSE
54308 * file that was distributed with this source code.
54309 */
54310namespace PHPUnit\Util\Annotation;
54311
54312use function array_key_exists;
54313use PHPUnit\Util\Exception;
54314use ReflectionClass;
54315use ReflectionException;
54316use ReflectionMethod;
54317/**
54318 * Reflection information, and therefore DocBlock information, is static within
54319 * a single PHP process. It is therefore okay to use a Singleton registry here.
54320 *
54321 * @internal This class is not covered by the backward compatibility promise for PHPUnit
54322 */
54323final class Registry
54324{
54325    /** @var null|self */
54326    private static $instance;
54327    /** @var array<string, DocBlock> indexed by class name */
54328    private $classDocBlocks = [];
54329    /** @var array<string, array<string, DocBlock>> indexed by class name and method name */
54330    private $methodDocBlocks = [];
54331    public static function getInstance() : self
54332    {
54333        return self::$instance ?? (self::$instance = new self());
54334    }
54335    private function __construct()
54336    {
54337    }
54338    /**
54339     * @throws Exception
54340     * @psalm-param class-string $class
54341     */
54342    public function forClassName(string $class) : \PHPUnit\Util\Annotation\DocBlock
54343    {
54344        if (array_key_exists($class, $this->classDocBlocks)) {
54345            return $this->classDocBlocks[$class];
54346        }
54347        try {
54348            $reflection = new ReflectionClass($class);
54349            // @codeCoverageIgnoreStart
54350        } catch (ReflectionException $e) {
54351            throw new Exception($e->getMessage(), (int) $e->getCode(), $e);
54352        }
54353        // @codeCoverageIgnoreEnd
54354        return $this->classDocBlocks[$class] = \PHPUnit\Util\Annotation\DocBlock::ofClass($reflection);
54355    }
54356    /**
54357     * @throws Exception
54358     * @psalm-param class-string $classInHierarchy
54359     */
54360    public function forMethod(string $classInHierarchy, string $method) : \PHPUnit\Util\Annotation\DocBlock
54361    {
54362        if (isset($this->methodDocBlocks[$classInHierarchy][$method])) {
54363            return $this->methodDocBlocks[$classInHierarchy][$method];
54364        }
54365        try {
54366            $reflection = new ReflectionMethod($classInHierarchy, $method);
54367            // @codeCoverageIgnoreStart
54368        } catch (ReflectionException $e) {
54369            throw new Exception($e->getMessage(), (int) $e->getCode(), $e);
54370        }
54371        // @codeCoverageIgnoreEnd
54372        return $this->methodDocBlocks[$classInHierarchy][$method] = \PHPUnit\Util\Annotation\DocBlock::ofMethod($reflection, $classInHierarchy);
54373    }
54374}
54375<?php
54376
54377declare (strict_types=1);
54378/*
54379 * This file is part of PHPUnit.
54380 *
54381 * (c) Sebastian Bergmann <sebastian@phpunit.de>
54382 *
54383 * For the full copyright and license information, please view the LICENSE
54384 * file that was distributed with this source code.
54385 */
54386namespace PHPUnit\Util;
54387
54388use const DIRECTORY_SEPARATOR;
54389use function class_exists;
54390use function defined;
54391use function dirname;
54392use function is_dir;
54393use function realpath;
54394use function sprintf;
54395use function strpos;
54396use function sys_get_temp_dir;
54397use PHPUnit\Composer\Autoload\ClassLoader;
54398use PHPUnit\DeepCopy\DeepCopy;
54399use PHPUnit\Doctrine\Instantiator\Instantiator;
54400use PHPUnit\PharIo\Manifest\Manifest;
54401use PHPUnit\PharIo\Version\Version as PharIoVersion;
54402use PHPUnit\phpDocumentor\Reflection\DocBlock;
54403use PHPUnit\phpDocumentor\Reflection\Project;
54404use PHPUnit\phpDocumentor\Reflection\Type;
54405use PHPUnit\PhpParser\Parser;
54406use PHPUnit\Framework\TestCase;
54407use Prophecy\Prophet;
54408use ReflectionClass;
54409use ReflectionException;
54410use PHPUnit\SebastianBergmann\CliParser\Parser as CliParser;
54411use PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage;
54412use PHPUnit\SebastianBergmann\CodeUnit\CodeUnit;
54413use PHPUnit\SebastianBergmann\CodeUnitReverseLookup\Wizard;
54414use PHPUnit\SebastianBergmann\Comparator\Comparator;
54415use PHPUnit\SebastianBergmann\Complexity\Calculator;
54416use PHPUnit\SebastianBergmann\Diff\Diff;
54417use PHPUnit\SebastianBergmann\Environment\Runtime;
54418use PHPUnit\SebastianBergmann\Exporter\Exporter;
54419use PHPUnit\SebastianBergmann\FileIterator\Facade as FileIteratorFacade;
54420use PHPUnit\SebastianBergmann\GlobalState\Snapshot;
54421use PHPUnit\SebastianBergmann\Invoker\Invoker;
54422use PHPUnit\SebastianBergmann\LinesOfCode\Counter;
54423use PHPUnit\SebastianBergmann\ObjectEnumerator\Enumerator;
54424use PHPUnit\SebastianBergmann\RecursionContext\Context;
54425use PHPUnit\SebastianBergmann\ResourceOperations\ResourceOperations;
54426use PHPUnit\SebastianBergmann\Template\Template;
54427use PHPUnit\SebastianBergmann\Timer\Timer;
54428use PHPUnit\SebastianBergmann\Type\TypeName;
54429use PHPUnit\SebastianBergmann\Version;
54430use PHPUnit\Symfony\Polyfill\Ctype\Ctype;
54431use PHPUnit\TheSeer\Tokenizer\Tokenizer;
54432use PHPUnit\Webmozart\Assert\Assert;
54433/**
54434 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
54435 */
54436final class ExcludeList
54437{
54438    /**
54439     * @var array<string,int>
54440     */
54441    private const EXCLUDED_CLASS_NAMES = [
54442        // composer
54443        ClassLoader::class => 1,
54444        // doctrine/instantiator
54445        Instantiator::class => 1,
54446        // myclabs/deepcopy
54447        DeepCopy::class => 1,
54448        // nikic/php-parser
54449        Parser::class => 1,
54450        // phar-io/manifest
54451        Manifest::class => 1,
54452        // phar-io/version
54453        PharIoVersion::class => 1,
54454        // phpdocumentor/reflection-common
54455        Project::class => 1,
54456        // phpdocumentor/reflection-docblock
54457        DocBlock::class => 1,
54458        // phpdocumentor/type-resolver
54459        Type::class => 1,
54460        // phpspec/prophecy
54461        Prophet::class => 1,
54462        // phpunit/phpunit
54463        TestCase::class => 2,
54464        // phpunit/php-code-coverage
54465        CodeCoverage::class => 1,
54466        // phpunit/php-file-iterator
54467        FileIteratorFacade::class => 1,
54468        // phpunit/php-invoker
54469        Invoker::class => 1,
54470        // phpunit/php-text-template
54471        Template::class => 1,
54472        // phpunit/php-timer
54473        Timer::class => 1,
54474        // sebastian/cli-parser
54475        CliParser::class => 1,
54476        // sebastian/code-unit
54477        CodeUnit::class => 1,
54478        // sebastian/code-unit-reverse-lookup
54479        Wizard::class => 1,
54480        // sebastian/comparator
54481        Comparator::class => 1,
54482        // sebastian/complexity
54483        Calculator::class => 1,
54484        // sebastian/diff
54485        Diff::class => 1,
54486        // sebastian/environment
54487        Runtime::class => 1,
54488        // sebastian/exporter
54489        Exporter::class => 1,
54490        // sebastian/global-state
54491        Snapshot::class => 1,
54492        // sebastian/lines-of-code
54493        Counter::class => 1,
54494        // sebastian/object-enumerator
54495        Enumerator::class => 1,
54496        // sebastian/recursion-context
54497        Context::class => 1,
54498        // sebastian/resource-operations
54499        ResourceOperations::class => 1,
54500        // sebastian/type
54501        TypeName::class => 1,
54502        // sebastian/version
54503        Version::class => 1,
54504        // symfony/polyfill-ctype
54505        Ctype::class => 1,
54506        // theseer/tokenizer
54507        Tokenizer::class => 1,
54508        // webmozart/assert
54509        Assert::class => 1,
54510    ];
54511    /**
54512     * @var string[]
54513     */
54514    private static $directories;
54515    public static function addDirectory(string $directory) : void
54516    {
54517        if (!is_dir($directory)) {
54518            throw new \PHPUnit\Util\Exception(sprintf('"%s" is not a directory', $directory));
54519        }
54520        self::$directories[] = realpath($directory);
54521    }
54522    /**
54523     * @throws Exception
54524     *
54525     * @return string[]
54526     */
54527    public function getExcludedDirectories() : array
54528    {
54529        $this->initialize();
54530        return self::$directories;
54531    }
54532    /**
54533     * @throws Exception
54534     */
54535    public function isExcluded(string $file) : bool
54536    {
54537        if (defined('PHPUNIT_TESTSUITE')) {
54538            return \false;
54539        }
54540        $this->initialize();
54541        foreach (self::$directories as $directory) {
54542            if (strpos($file, $directory) === 0) {
54543                return \true;
54544            }
54545        }
54546        return \false;
54547    }
54548    /**
54549     * @throws Exception
54550     */
54551    private function initialize() : void
54552    {
54553        if (self::$directories === null) {
54554            self::$directories = [];
54555            foreach (self::EXCLUDED_CLASS_NAMES as $className => $parent) {
54556                if (!class_exists($className)) {
54557                    continue;
54558                }
54559                try {
54560                    $directory = (new ReflectionClass($className))->getFileName();
54561                    // @codeCoverageIgnoreStart
54562                } catch (ReflectionException $e) {
54563                    throw new \PHPUnit\Util\Exception($e->getMessage(), (int) $e->getCode(), $e);
54564                }
54565                // @codeCoverageIgnoreEnd
54566                for ($i = 0; $i < $parent; $i++) {
54567                    $directory = dirname($directory);
54568                }
54569                self::$directories[] = $directory;
54570            }
54571            // Hide process isolation workaround on Windows.
54572            if (\DIRECTORY_SEPARATOR === '\\') {
54573                // tempnam() prefix is limited to first 3 chars.
54574                // @see https://php.net/manual/en/function.tempnam.php
54575                self::$directories[] = sys_get_temp_dir() . '\\PHP';
54576            }
54577        }
54578    }
54579}
54580<?php
54581
54582declare (strict_types=1);
54583/*
54584 * This file is part of PHPUnit.
54585 *
54586 * (c) Sebastian Bergmann <sebastian@phpunit.de>
54587 *
54588 * For the full copyright and license information, please view the LICENSE
54589 * file that was distributed with this source code.
54590 */
54591namespace PHPUnit\Util\Xml;
54592
54593use function defined;
54594use function is_file;
54595use function sprintf;
54596use PHPUnit\Runner\Version;
54597/**
54598 * @internal This class is not covered by the backward compatibility promise for PHPUnit
54599 */
54600final class SchemaFinder
54601{
54602    /**
54603     * @throws Exception
54604     */
54605    public function find(string $version) : string
54606    {
54607        if ($version === Version::series()) {
54608            $filename = $this->path() . 'phpunit.xsd';
54609        } else {
54610            $filename = $this->path() . 'schema/' . $version . '.xsd';
54611        }
54612        if (!is_file($filename)) {
54613            throw new \PHPUnit\Util\Xml\Exception(sprintf('Schema for PHPUnit %s is not available', $version));
54614        }
54615        return $filename;
54616    }
54617    private function path() : string
54618    {
54619        if (defined('__PHPUNIT_PHAR_ROOT__')) {
54620            return __PHPUNIT_PHAR_ROOT__ . '/';
54621        }
54622        return __DIR__ . '/../../../';
54623    }
54624}
54625<?php
54626
54627declare (strict_types=1);
54628/*
54629 * This file is part of PHPUnit.
54630 *
54631 * (c) Sebastian Bergmann <sebastian@phpunit.de>
54632 *
54633 * For the full copyright and license information, please view the LICENSE
54634 * file that was distributed with this source code.
54635 */
54636namespace PHPUnit\Util\Xml;
54637
54638use function file_get_contents;
54639use function libxml_clear_errors;
54640use function libxml_get_errors;
54641use function libxml_use_internal_errors;
54642use DOMDocument;
54643/**
54644 * @internal This class is not covered by the backward compatibility promise for PHPUnit
54645 */
54646final class Validator
54647{
54648    public function validate(DOMDocument $document, string $xsdFilename) : \PHPUnit\Util\Xml\ValidationResult
54649    {
54650        $originalErrorHandling = libxml_use_internal_errors(\true);
54651        $document->schemaValidateSource(file_get_contents($xsdFilename));
54652        $errors = libxml_get_errors();
54653        libxml_clear_errors();
54654        libxml_use_internal_errors($originalErrorHandling);
54655        return \PHPUnit\Util\Xml\ValidationResult::fromArray($errors);
54656    }
54657}
54658<?php
54659
54660declare (strict_types=1);
54661/*
54662 * This file is part of PHPUnit.
54663 *
54664 * (c) Sebastian Bergmann <sebastian@phpunit.de>
54665 *
54666 * For the full copyright and license information, please view the LICENSE
54667 * file that was distributed with this source code.
54668 */
54669namespace PHPUnit\Util\Xml;
54670
54671use function chdir;
54672use function dirname;
54673use function error_reporting;
54674use function file_get_contents;
54675use function getcwd;
54676use function libxml_get_errors;
54677use function libxml_use_internal_errors;
54678use function sprintf;
54679use DOMDocument;
54680/**
54681 * @internal This class is not covered by the backward compatibility promise for PHPUnit
54682 */
54683final class Loader
54684{
54685    /**
54686     * @throws Exception
54687     */
54688    public function loadFile(string $filename, bool $isHtml = \false, bool $xinclude = \false, bool $strict = \false) : DOMDocument
54689    {
54690        $reporting = error_reporting(0);
54691        $contents = file_get_contents($filename);
54692        error_reporting($reporting);
54693        if ($contents === \false) {
54694            throw new \PHPUnit\Util\Xml\Exception(sprintf('Could not read "%s".', $filename));
54695        }
54696        return $this->load($contents, $isHtml, $filename, $xinclude, $strict);
54697    }
54698    /**
54699     * @throws Exception
54700     */
54701    public function load(string $actual, bool $isHtml = \false, string $filename = '', bool $xinclude = \false, bool $strict = \false) : DOMDocument
54702    {
54703        if ($actual === '') {
54704            throw new \PHPUnit\Util\Xml\Exception('Could not load XML from empty string');
54705        }
54706        // Required for XInclude on Windows.
54707        if ($xinclude) {
54708            $cwd = getcwd();
54709            @chdir(dirname($filename));
54710        }
54711        $document = new DOMDocument();
54712        $document->preserveWhiteSpace = \false;
54713        $internal = libxml_use_internal_errors(\true);
54714        $message = '';
54715        $reporting = error_reporting(0);
54716        if ($filename !== '') {
54717            // Required for XInclude
54718            $document->documentURI = $filename;
54719        }
54720        if ($isHtml) {
54721            $loaded = $document->loadHTML($actual);
54722        } else {
54723            $loaded = $document->loadXML($actual);
54724        }
54725        if (!$isHtml && $xinclude) {
54726            $document->xinclude();
54727        }
54728        foreach (libxml_get_errors() as $error) {
54729            $message .= "\n" . $error->message;
54730        }
54731        libxml_use_internal_errors($internal);
54732        error_reporting($reporting);
54733        if (isset($cwd)) {
54734            @chdir($cwd);
54735        }
54736        if ($loaded === \false || $strict && $message !== '') {
54737            if ($filename !== '') {
54738                throw new \PHPUnit\Util\Xml\Exception(sprintf('Could not load "%s".%s', $filename, $message !== '' ? "\n" . $message : ''));
54739            }
54740            if ($message === '') {
54741                $message = 'Could not load XML for unknown reason';
54742            }
54743            throw new \PHPUnit\Util\Xml\Exception($message);
54744        }
54745        return $document;
54746    }
54747}
54748<?php
54749
54750declare (strict_types=1);
54751/*
54752 * This file is part of PHPUnit.
54753 *
54754 * (c) Sebastian Bergmann <sebastian@phpunit.de>
54755 *
54756 * For the full copyright and license information, please view the LICENSE
54757 * file that was distributed with this source code.
54758 */
54759namespace PHPUnit\Util\Xml;
54760
54761use function sprintf;
54762use function trim;
54763/**
54764 * @internal This class is not covered by the backward compatibility promise for PHPUnit
54765 *
54766 * @psalm-immutable
54767 */
54768final class ValidationResult
54769{
54770    /**
54771     * @psalm-var array<int,list<string>>
54772     */
54773    private $validationErrors = [];
54774    /**
54775     * @psalm-param array<int,\LibXMLError> $errors
54776     */
54777    public static function fromArray(array $errors) : self
54778    {
54779        $validationErrors = [];
54780        foreach ($errors as $error) {
54781            if (!isset($validationErrors[$error->line])) {
54782                $validationErrors[$error->line] = [];
54783            }
54784            $validationErrors[$error->line][] = trim($error->message);
54785        }
54786        return new self($validationErrors);
54787    }
54788    private function __construct(array $validationErrors)
54789    {
54790        $this->validationErrors = $validationErrors;
54791    }
54792    public function hasValidationErrors() : bool
54793    {
54794        return !empty($this->validationErrors);
54795    }
54796    public function asString() : string
54797    {
54798        $buffer = '';
54799        foreach ($this->validationErrors as $line => $validationErrorsOnLine) {
54800            $buffer .= sprintf(\PHP_EOL . '  Line %d:' . \PHP_EOL, $line);
54801            foreach ($validationErrorsOnLine as $validationError) {
54802                $buffer .= sprintf('  - %s' . \PHP_EOL, $validationError);
54803            }
54804        }
54805        return $buffer;
54806    }
54807}
54808<?php
54809
54810declare (strict_types=1);
54811/*
54812 * This file is part of PHPUnit.
54813 *
54814 * (c) Sebastian Bergmann <sebastian@phpunit.de>
54815 *
54816 * For the full copyright and license information, please view the LICENSE
54817 * file that was distributed with this source code.
54818 */
54819namespace PHPUnit\Util\Xml;
54820
54821use RuntimeException;
54822/**
54823 * @internal This class is not covered by the backward compatibility promise for PHPUnit
54824 */
54825final class Exception extends RuntimeException implements \PHPUnit\Exception
54826{
54827}
54828<?php
54829
54830declare (strict_types=1);
54831/*
54832 * This file is part of PHPUnit.
54833 *
54834 * (c) Sebastian Bergmann <sebastian@phpunit.de>
54835 *
54836 * For the full copyright and license information, please view the LICENSE
54837 * file that was distributed with this source code.
54838 */
54839namespace PHPUnit\Util\Xml;
54840
54841/**
54842 * @internal This class is not covered by the backward compatibility promise for PHPUnit
54843 *
54844 * @psalm-immutable
54845 */
54846final class FailedSchemaDetectionResult extends \PHPUnit\Util\Xml\SchemaDetectionResult
54847{
54848}
54849<?php
54850
54851declare (strict_types=1);
54852/*
54853 * This file is part of PHPUnit.
54854 *
54855 * (c) Sebastian Bergmann <sebastian@phpunit.de>
54856 *
54857 * For the full copyright and license information, please view the LICENSE
54858 * file that was distributed with this source code.
54859 */
54860namespace PHPUnit\Util\Xml;
54861
54862/**
54863 * @internal This class is not covered by the backward compatibility promise for PHPUnit
54864 *
54865 * @psalm-immutable
54866 */
54867abstract class SchemaDetectionResult
54868{
54869    public function detected() : bool
54870    {
54871        return \false;
54872    }
54873    /**
54874     * @throws Exception
54875     */
54876    public function version() : string
54877    {
54878        throw new \PHPUnit\Util\Xml\Exception('No supported schema was detected');
54879    }
54880}
54881<?php
54882
54883declare (strict_types=1);
54884/*
54885 * This file is part of PHPUnit.
54886 *
54887 * (c) Sebastian Bergmann <sebastian@phpunit.de>
54888 *
54889 * For the full copyright and license information, please view the LICENSE
54890 * file that was distributed with this source code.
54891 */
54892namespace PHPUnit\Util\Xml;
54893
54894/**
54895 * @internal This class is not covered by the backward compatibility promise for PHPUnit
54896 */
54897final class SchemaDetector
54898{
54899    /**
54900     * @throws Exception
54901     */
54902    public function detect(string $filename) : \PHPUnit\Util\Xml\SchemaDetectionResult
54903    {
54904        $document = (new \PHPUnit\Util\Xml\Loader())->loadFile($filename, \false, \true, \true);
54905        foreach (['9.2', '8.5'] as $candidate) {
54906            $schema = (new \PHPUnit\Util\Xml\SchemaFinder())->find($candidate);
54907            if (!(new \PHPUnit\Util\Xml\Validator())->validate($document, $schema)->hasValidationErrors()) {
54908                return new \PHPUnit\Util\Xml\SuccessfulSchemaDetectionResult($candidate);
54909            }
54910        }
54911        return new \PHPUnit\Util\Xml\FailedSchemaDetectionResult();
54912    }
54913}
54914<?php
54915
54916declare (strict_types=1);
54917/*
54918 * This file is part of PHPUnit.
54919 *
54920 * (c) Sebastian Bergmann <sebastian@phpunit.de>
54921 *
54922 * For the full copyright and license information, please view the LICENSE
54923 * file that was distributed with this source code.
54924 */
54925namespace PHPUnit\Util\Xml;
54926
54927/**
54928 * @internal This class is not covered by the backward compatibility promise for PHPUnit
54929 *
54930 * @psalm-immutable
54931 */
54932final class SuccessfulSchemaDetectionResult extends \PHPUnit\Util\Xml\SchemaDetectionResult
54933{
54934    /**
54935     * @var string
54936     */
54937    private $version;
54938    public function __construct(string $version)
54939    {
54940        $this->version = $version;
54941    }
54942    public function detected() : bool
54943    {
54944        return \true;
54945    }
54946    public function version() : string
54947    {
54948        return $this->version;
54949    }
54950}
54951<?php
54952
54953declare (strict_types=1);
54954/*
54955 * This file is part of PHPUnit.
54956 *
54957 * (c) Sebastian Bergmann <sebastian@phpunit.de>
54958 *
54959 * For the full copyright and license information, please view the LICENSE
54960 * file that was distributed with this source code.
54961 */
54962namespace PHPUnit\Util\Xml;
54963
54964use ArrayIterator;
54965use Countable;
54966use DOMNode;
54967use DOMNodeList;
54968use IteratorAggregate;
54969/**
54970 * @internal This class is not covered by the backward compatibility promise for PHPUnit
54971 */
54972final class SnapshotNodeList implements Countable, IteratorAggregate
54973{
54974    /**
54975     * @var DOMNode[]
54976     */
54977    private $nodes = [];
54978    public static function fromNodeList(DOMNodeList $list) : self
54979    {
54980        $snapshot = new self();
54981        foreach ($list as $node) {
54982            $snapshot->nodes[] = $node;
54983        }
54984        return $snapshot;
54985    }
54986    public function count() : int
54987    {
54988        return \count($this->nodes);
54989    }
54990    public function getIterator() : ArrayIterator
54991    {
54992        return new ArrayIterator($this->nodes);
54993    }
54994}
54995<?php
54996
54997declare (strict_types=1);
54998/*
54999 * This file is part of PHPUnit.
55000 *
55001 * (c) Sebastian Bergmann <sebastian@phpunit.de>
55002 *
55003 * For the full copyright and license information, please view the LICENSE
55004 * file that was distributed with this source code.
55005 */
55006namespace PHPUnit\Util\TestDox;
55007
55008use PHPUnit\Framework\TestResult;
55009/**
55010 * @internal This class is not covered by the backward compatibility promise for PHPUnit
55011 */
55012final class TextResultPrinter extends \PHPUnit\Util\TestDox\ResultPrinter
55013{
55014    public function printResult(TestResult $result) : void
55015    {
55016    }
55017    /**
55018     * Handler for 'start class' event.
55019     */
55020    protected function startClass(string $name) : void
55021    {
55022        $this->write($this->currentTestClassPrettified . "\n");
55023    }
55024    /**
55025     * Handler for 'on test' event.
55026     */
55027    protected function onTest(string $name, bool $success = \true) : void
55028    {
55029        if ($success) {
55030            $this->write(' [x] ');
55031        } else {
55032            $this->write(' [ ] ');
55033        }
55034        $this->write($name . "\n");
55035    }
55036    /**
55037     * Handler for 'end class' event.
55038     */
55039    protected function endClass(string $name) : void
55040    {
55041        $this->write("\n");
55042    }
55043}
55044<?php
55045
55046declare (strict_types=1);
55047/*
55048 * This file is part of PHPUnit.
55049 *
55050 * (c) Sebastian Bergmann <sebastian@phpunit.de>
55051 *
55052 * For the full copyright and license information, please view the LICENSE
55053 * file that was distributed with this source code.
55054 */
55055namespace PHPUnit\Util\TestDox;
55056
55057use function array_key_exists;
55058use function array_keys;
55059use function array_map;
55060use function array_pop;
55061use function array_values;
55062use function explode;
55063use function get_class;
55064use function gettype;
55065use function implode;
55066use function in_array;
55067use function is_bool;
55068use function is_float;
55069use function is_int;
55070use function is_numeric;
55071use function is_object;
55072use function is_scalar;
55073use function is_string;
55074use function mb_strtolower;
55075use function ord;
55076use function preg_quote;
55077use function preg_replace;
55078use function range;
55079use function sprintf;
55080use function str_replace;
55081use function strlen;
55082use function strpos;
55083use function strtolower;
55084use function strtoupper;
55085use function substr;
55086use function trim;
55087use PHPUnit\Framework\TestCase;
55088use PHPUnit\Util\Color;
55089use PHPUnit\Util\Exception as UtilException;
55090use PHPUnit\Util\Test;
55091use ReflectionException;
55092use ReflectionMethod;
55093use ReflectionObject;
55094use PHPUnit\SebastianBergmann\Exporter\Exporter;
55095/**
55096 * @internal This class is not covered by the backward compatibility promise for PHPUnit
55097 */
55098final class NamePrettifier
55099{
55100    /**
55101     * @var string[]
55102     */
55103    private $strings = [];
55104    /**
55105     * @var bool
55106     */
55107    private $useColor;
55108    public function __construct(bool $useColor = \false)
55109    {
55110        $this->useColor = $useColor;
55111    }
55112    /**
55113     * Prettifies the name of a test class.
55114     *
55115     * @psalm-param class-string $className
55116     */
55117    public function prettifyTestClass(string $className) : string
55118    {
55119        try {
55120            $annotations = Test::parseTestMethodAnnotations($className);
55121            if (isset($annotations['class']['testdox'][0])) {
55122                return $annotations['class']['testdox'][0];
55123            }
55124        } catch (UtilException $e) {
55125            // ignore, determine className by parsing the provided name
55126        }
55127        $parts = explode('\\', $className);
55128        $className = array_pop($parts);
55129        if (substr($className, -1 * strlen('Test')) === 'Test') {
55130            $className = substr($className, 0, strlen($className) - strlen('Test'));
55131        }
55132        if (strpos($className, 'Tests') === 0) {
55133            $className = substr($className, strlen('Tests'));
55134        } elseif (strpos($className, 'Test') === 0) {
55135            $className = substr($className, strlen('Test'));
55136        }
55137        if (empty($className)) {
55138            $className = 'UnnamedTests';
55139        }
55140        if (!empty($parts)) {
55141            $parts[] = $className;
55142            $fullyQualifiedName = implode('\\', $parts);
55143        } else {
55144            $fullyQualifiedName = $className;
55145        }
55146        $result = '';
55147        $wasLowerCase = \false;
55148        foreach (range(0, strlen($className) - 1) as $i) {
55149            $isLowerCase = mb_strtolower($className[$i], 'UTF-8') === $className[$i];
55150            if ($wasLowerCase && !$isLowerCase) {
55151                $result .= ' ';
55152            }
55153            $result .= $className[$i];
55154            if ($isLowerCase) {
55155                $wasLowerCase = \true;
55156            } else {
55157                $wasLowerCase = \false;
55158            }
55159        }
55160        if ($fullyQualifiedName !== $className) {
55161            return $result . ' (' . $fullyQualifiedName . ')';
55162        }
55163        return $result;
55164    }
55165    /**
55166     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
55167     */
55168    public function prettifyTestCase(TestCase $test) : string
55169    {
55170        $annotations = Test::parseTestMethodAnnotations(get_class($test), $test->getName(\false));
55171        $annotationWithPlaceholders = \false;
55172        $callback = static function (string $variable) : string {
55173            return sprintf('/%s(?=\\b)/', preg_quote($variable, '/'));
55174        };
55175        if (isset($annotations['method']['testdox'][0])) {
55176            $result = $annotations['method']['testdox'][0];
55177            if (strpos($result, '$') !== \false) {
55178                $annotation = $annotations['method']['testdox'][0];
55179                $providedData = $this->mapTestMethodParameterNamesToProvidedDataValues($test);
55180                $variables = array_map($callback, array_keys($providedData));
55181                $result = trim(preg_replace($variables, $providedData, $annotation));
55182                $annotationWithPlaceholders = \true;
55183            }
55184        } else {
55185            $result = $this->prettifyTestMethod($test->getName(\false));
55186        }
55187        if (!$annotationWithPlaceholders && $test->usesDataProvider()) {
55188            $result .= $this->prettifyDataSet($test);
55189        }
55190        return $result;
55191    }
55192    public function prettifyDataSet(TestCase $test) : string
55193    {
55194        if (!$this->useColor) {
55195            return $test->getDataSetAsString(\false);
55196        }
55197        if (is_int($test->dataName())) {
55198            $data = Color::dim(' with data set ') . Color::colorize('fg-cyan', (string) $test->dataName());
55199        } else {
55200            $data = Color::dim(' with ') . Color::colorize('fg-cyan', Color::visualizeWhitespace((string) $test->dataName()));
55201        }
55202        return $data;
55203    }
55204    /**
55205     * Prettifies the name of a test method.
55206     */
55207    public function prettifyTestMethod(string $name) : string
55208    {
55209        $buffer = '';
55210        if ($name === '') {
55211            return $buffer;
55212        }
55213        $string = (string) preg_replace('#\\d+$#', '', $name, -1, $count);
55214        if (in_array($string, $this->strings, \true)) {
55215            $name = $string;
55216        } elseif ($count === 0) {
55217            $this->strings[] = $string;
55218        }
55219        if (strpos($name, 'test_') === 0) {
55220            $name = substr($name, 5);
55221        } elseif (strpos($name, 'test') === 0) {
55222            $name = substr($name, 4);
55223        }
55224        if ($name === '') {
55225            return $buffer;
55226        }
55227        $name[0] = strtoupper($name[0]);
55228        if (strpos($name, '_') !== \false) {
55229            return trim(str_replace('_', ' ', $name));
55230        }
55231        $wasNumeric = \false;
55232        foreach (range(0, strlen($name) - 1) as $i) {
55233            if ($i > 0 && ord($name[$i]) >= 65 && ord($name[$i]) <= 90) {
55234                $buffer .= ' ' . strtolower($name[$i]);
55235            } else {
55236                $isNumeric = is_numeric($name[$i]);
55237                if (!$wasNumeric && $isNumeric) {
55238                    $buffer .= ' ';
55239                    $wasNumeric = \true;
55240                }
55241                if ($wasNumeric && !$isNumeric) {
55242                    $wasNumeric = \false;
55243                }
55244                $buffer .= $name[$i];
55245            }
55246        }
55247        return $buffer;
55248    }
55249    /**
55250     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
55251     */
55252    private function mapTestMethodParameterNamesToProvidedDataValues(TestCase $test) : array
55253    {
55254        try {
55255            $reflector = new ReflectionMethod(get_class($test), $test->getName(\false));
55256            // @codeCoverageIgnoreStart
55257        } catch (ReflectionException $e) {
55258            throw new UtilException($e->getMessage(), (int) $e->getCode(), $e);
55259        }
55260        // @codeCoverageIgnoreEnd
55261        $providedData = [];
55262        $providedDataValues = array_values($test->getProvidedData());
55263        $i = 0;
55264        $providedData['$_dataName'] = $test->dataName();
55265        foreach ($reflector->getParameters() as $parameter) {
55266            if (!array_key_exists($i, $providedDataValues) && $parameter->isDefaultValueAvailable()) {
55267                try {
55268                    $providedDataValues[$i] = $parameter->getDefaultValue();
55269                    // @codeCoverageIgnoreStart
55270                } catch (ReflectionException $e) {
55271                    throw new UtilException($e->getMessage(), (int) $e->getCode(), $e);
55272                }
55273                // @codeCoverageIgnoreEnd
55274            }
55275            $value = $providedDataValues[$i++] ?? null;
55276            if (is_object($value)) {
55277                $reflector = new ReflectionObject($value);
55278                if ($reflector->hasMethod('__toString')) {
55279                    $value = (string) $value;
55280                } else {
55281                    $value = get_class($value);
55282                }
55283            }
55284            if (!is_scalar($value)) {
55285                $value = gettype($value);
55286            }
55287            if (is_bool($value) || is_int($value) || is_float($value)) {
55288                $value = (new Exporter())->export($value);
55289            }
55290            if (is_string($value) && $value === '') {
55291                if ($this->useColor) {
55292                    $value = Color::colorize('dim,underlined', 'empty');
55293                } else {
55294                    $value = "''";
55295                }
55296            }
55297            $providedData['$' . $parameter->getName()] = $value;
55298        }
55299        if ($this->useColor) {
55300            $providedData = array_map(static function ($value) {
55301                return Color::colorize('fg-cyan', Color::visualizeWhitespace((string) $value, \true));
55302            }, $providedData);
55303        }
55304        return $providedData;
55305    }
55306}
55307<?php
55308
55309declare (strict_types=1);
55310/*
55311 * This file is part of PHPUnit.
55312 *
55313 * (c) Sebastian Bergmann <sebastian@phpunit.de>
55314 *
55315 * For the full copyright and license information, please view the LICENSE
55316 * file that was distributed with this source code.
55317 */
55318namespace PHPUnit\Util\TestDox;
55319
55320use const PHP_EOL;
55321use function array_map;
55322use function ceil;
55323use function count;
55324use function explode;
55325use function get_class;
55326use function implode;
55327use function preg_match;
55328use function sprintf;
55329use function strlen;
55330use function strpos;
55331use function trim;
55332use PHPUnit\Framework\Test;
55333use PHPUnit\Framework\TestCase;
55334use PHPUnit\Framework\TestResult;
55335use PHPUnit\Runner\BaseTestRunner;
55336use PHPUnit\Runner\PhptTestCase;
55337use PHPUnit\Util\Color;
55338use PHPUnit\SebastianBergmann\Timer\ResourceUsageFormatter;
55339use PHPUnit\SebastianBergmann\Timer\Timer;
55340use Throwable;
55341/**
55342 * @internal This class is not covered by the backward compatibility promise for PHPUnit
55343 */
55344class CliTestDoxPrinter extends \PHPUnit\Util\TestDox\TestDoxPrinter
55345{
55346    /**
55347     * The default Testdox left margin for messages is a vertical line.
55348     */
55349    private const PREFIX_SIMPLE = ['default' => '│', 'start' => '│', 'message' => '│', 'diff' => '│', 'trace' => '│', 'last' => '│'];
55350    /**
55351     * Colored Testdox use box-drawing for a more textured map of the message.
55352     */
55353    private const PREFIX_DECORATED = ['default' => '│', 'start' => '┐', 'message' => '├', 'diff' => '┊', 'trace' => '╵', 'last' => '┴'];
55354    private const SPINNER_ICONS = [" \33[36m◐\33[0m running tests", " \33[36m◓\33[0m running tests", " \33[36m◑\33[0m running tests", " \33[36m◒\33[0m running tests"];
55355    private const STATUS_STYLES = [BaseTestRunner::STATUS_PASSED => ['symbol' => '✔', 'color' => 'fg-green'], BaseTestRunner::STATUS_ERROR => ['symbol' => '✘', 'color' => 'fg-yellow', 'message' => 'bg-yellow,fg-black'], BaseTestRunner::STATUS_FAILURE => ['symbol' => '✘', 'color' => 'fg-red', 'message' => 'bg-red,fg-white'], BaseTestRunner::STATUS_SKIPPED => ['symbol' => '↩', 'color' => 'fg-cyan', 'message' => 'fg-cyan'], BaseTestRunner::STATUS_RISKY => ['symbol' => '☢', 'color' => 'fg-yellow', 'message' => 'fg-yellow'], BaseTestRunner::STATUS_INCOMPLETE => ['symbol' => '∅', 'color' => 'fg-yellow', 'message' => 'fg-yellow'], BaseTestRunner::STATUS_WARNING => ['symbol' => '⚠', 'color' => 'fg-yellow', 'message' => 'fg-yellow'], BaseTestRunner::STATUS_UNKNOWN => ['symbol' => '?', 'color' => 'fg-blue', 'message' => 'fg-white,bg-blue']];
55356    /**
55357     * @var int[]
55358     */
55359    private $nonSuccessfulTestResults = [];
55360    /**
55361     * @var Timer
55362     */
55363    private $timer;
55364    /**
55365     * @param null|resource|string $out
55366     * @param int|string           $numberOfColumns
55367     *
55368     * @throws \PHPUnit\Framework\Exception
55369     */
55370    public function __construct($out = null, bool $verbose = \false, string $colors = self::COLOR_DEFAULT, bool $debug = \false, $numberOfColumns = 80, bool $reverse = \false)
55371    {
55372        parent::__construct($out, $verbose, $colors, $debug, $numberOfColumns, $reverse);
55373        $this->timer = new Timer();
55374        $this->timer->start();
55375    }
55376    public function printResult(TestResult $result) : void
55377    {
55378        $this->printHeader($result);
55379        $this->printNonSuccessfulTestsSummary($result->count());
55380        $this->printFooter($result);
55381    }
55382    protected function printHeader(TestResult $result) : void
55383    {
55384        $this->write("\n" . (new ResourceUsageFormatter())->resourceUsage($this->timer->stop()) . "\n\n");
55385    }
55386    protected function formatClassName(Test $test) : string
55387    {
55388        if ($test instanceof TestCase) {
55389            return $this->prettifier->prettifyTestClass(get_class($test));
55390        }
55391        return get_class($test);
55392    }
55393    /**
55394     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
55395     */
55396    protected function registerTestResult(Test $test, ?Throwable $t, int $status, float $time, bool $verbose) : void
55397    {
55398        if ($status !== BaseTestRunner::STATUS_PASSED) {
55399            $this->nonSuccessfulTestResults[] = $this->testIndex;
55400        }
55401        parent::registerTestResult($test, $t, $status, $time, $verbose);
55402    }
55403    /**
55404     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
55405     */
55406    protected function formatTestName(Test $test) : string
55407    {
55408        if ($test instanceof TestCase) {
55409            return $this->prettifier->prettifyTestCase($test);
55410        }
55411        return parent::formatTestName($test);
55412    }
55413    protected function writeTestResult(array $prevResult, array $result) : void
55414    {
55415        // spacer line for new suite headers and after verbose messages
55416        if ($prevResult['testName'] !== '' && (!empty($prevResult['message']) || $prevResult['className'] !== $result['className'])) {
55417            $this->write(\PHP_EOL);
55418        }
55419        // suite header
55420        if ($prevResult['className'] !== $result['className']) {
55421            $this->write($this->colorizeTextBox('underlined', $result['className']) . \PHP_EOL);
55422        }
55423        // test result line
55424        if ($this->colors && $result['className'] === PhptTestCase::class) {
55425            $testName = Color::colorizePath($result['testName'], $prevResult['testName'], \true);
55426        } else {
55427            $testName = $result['testMethod'];
55428        }
55429        $style = self::STATUS_STYLES[$result['status']];
55430        $line = sprintf(' %s %s%s' . \PHP_EOL, $this->colorizeTextBox($style['color'], $style['symbol']), $testName, $this->verbose ? ' ' . $this->formatRuntime($result['time'], $style['color']) : '');
55431        $this->write($line);
55432        // additional information when verbose
55433        $this->write($result['message']);
55434    }
55435    protected function formatThrowable(Throwable $t, ?int $status = null) : string
55436    {
55437        return trim(\PHPUnit\Framework\TestFailure::exceptionToString($t));
55438    }
55439    protected function colorizeMessageAndDiff(string $style, string $buffer) : array
55440    {
55441        $lines = $buffer ? array_map('\\rtrim', explode(\PHP_EOL, $buffer)) : [];
55442        $message = [];
55443        $diff = [];
55444        $insideDiff = \false;
55445        foreach ($lines as $line) {
55446            if ($line === '--- Expected') {
55447                $insideDiff = \true;
55448            }
55449            if (!$insideDiff) {
55450                $message[] = $line;
55451            } else {
55452                if (strpos($line, '-') === 0) {
55453                    $line = Color::colorize('fg-red', Color::visualizeWhitespace($line, \true));
55454                } elseif (strpos($line, '+') === 0) {
55455                    $line = Color::colorize('fg-green', Color::visualizeWhitespace($line, \true));
55456                } elseif ($line === '@@ @@') {
55457                    $line = Color::colorize('fg-cyan', $line);
55458                }
55459                $diff[] = $line;
55460            }
55461        }
55462        $diff = implode(\PHP_EOL, $diff);
55463        if (!empty($message)) {
55464            $message = $this->colorizeTextBox($style, implode(\PHP_EOL, $message));
55465        }
55466        return [$message, $diff];
55467    }
55468    protected function formatStacktrace(Throwable $t) : string
55469    {
55470        $trace = \PHPUnit\Util\Filter::getFilteredStacktrace($t);
55471        if (!$this->colors) {
55472            return $trace;
55473        }
55474        $lines = [];
55475        $prevPath = '';
55476        foreach (explode(\PHP_EOL, $trace) as $line) {
55477            if (preg_match('/^(.*):(\\d+)$/', $line, $matches)) {
55478                $lines[] = Color::colorizePath($matches[1], $prevPath) . Color::dim(':') . Color::colorize('fg-blue', $matches[2]) . "\n";
55479                $prevPath = $matches[1];
55480            } else {
55481                $lines[] = $line;
55482                $prevPath = '';
55483            }
55484        }
55485        return implode('', $lines);
55486    }
55487    protected function formatTestResultMessage(Throwable $t, array $result, ?string $prefix = null) : string
55488    {
55489        $message = $this->formatThrowable($t, $result['status']);
55490        $diff = '';
55491        if (!($this->verbose || $result['verbose'])) {
55492            return '';
55493        }
55494        if ($message && $this->colors) {
55495            $style = self::STATUS_STYLES[$result['status']]['message'] ?? '';
55496            [$message, $diff] = $this->colorizeMessageAndDiff($style, $message);
55497        }
55498        if ($prefix === null || !$this->colors) {
55499            $prefix = self::PREFIX_SIMPLE;
55500        }
55501        if ($this->colors) {
55502            $color = self::STATUS_STYLES[$result['status']]['color'] ?? '';
55503            $prefix = array_map(static function ($p) use($color) {
55504                return Color::colorize($color, $p);
55505            }, self::PREFIX_DECORATED);
55506        }
55507        $trace = $this->formatStacktrace($t);
55508        $out = $this->prefixLines($prefix['start'], \PHP_EOL) . \PHP_EOL;
55509        if ($message) {
55510            $out .= $this->prefixLines($prefix['message'], $message . \PHP_EOL) . \PHP_EOL;
55511        }
55512        if ($diff) {
55513            $out .= $this->prefixLines($prefix['diff'], $diff . \PHP_EOL) . \PHP_EOL;
55514        }
55515        if ($trace) {
55516            if ($message || $diff) {
55517                $out .= $this->prefixLines($prefix['default'], \PHP_EOL) . \PHP_EOL;
55518            }
55519            $out .= $this->prefixLines($prefix['trace'], $trace . \PHP_EOL) . \PHP_EOL;
55520        }
55521        $out .= $this->prefixLines($prefix['last'], \PHP_EOL) . \PHP_EOL;
55522        return $out;
55523    }
55524    protected function drawSpinner() : void
55525    {
55526        if ($this->colors) {
55527            $id = $this->spinState % count(self::SPINNER_ICONS);
55528            $this->write(self::SPINNER_ICONS[$id]);
55529        }
55530    }
55531    protected function undrawSpinner() : void
55532    {
55533        if ($this->colors) {
55534            $id = $this->spinState % count(self::SPINNER_ICONS);
55535            $this->write("\33[1K\33[" . strlen(self::SPINNER_ICONS[$id]) . 'D');
55536        }
55537    }
55538    private function formatRuntime(float $time, string $color = '') : string
55539    {
55540        if (!$this->colors) {
55541            return sprintf('[%.2f ms]', $time * 1000);
55542        }
55543        if ($time > 1) {
55544            $color = 'fg-magenta';
55545        }
55546        return Color::colorize($color, ' ' . (int) ceil($time * 1000) . ' ' . Color::dim('ms'));
55547    }
55548    private function printNonSuccessfulTestsSummary(int $numberOfExecutedTests) : void
55549    {
55550        if (empty($this->nonSuccessfulTestResults)) {
55551            return;
55552        }
55553        if (count($this->nonSuccessfulTestResults) / $numberOfExecutedTests >= 0.7) {
55554            return;
55555        }
55556        $this->write("Summary of non-successful tests:\n\n");
55557        $prevResult = $this->getEmptyTestResult();
55558        foreach ($this->nonSuccessfulTestResults as $testIndex) {
55559            $result = $this->testResults[$testIndex];
55560            $this->writeTestResult($prevResult, $result);
55561            $prevResult = $result;
55562        }
55563    }
55564}
55565<?php
55566
55567declare (strict_types=1);
55568/*
55569 * This file is part of PHPUnit.
55570 *
55571 * (c) Sebastian Bergmann <sebastian@phpunit.de>
55572 *
55573 * For the full copyright and license information, please view the LICENSE
55574 * file that was distributed with this source code.
55575 */
55576namespace PHPUnit\Util\TestDox;
55577
55578use function get_class;
55579use function in_array;
55580use PHPUnit\Framework\AssertionFailedError;
55581use PHPUnit\Framework\ErrorTestCase;
55582use PHPUnit\Framework\Test;
55583use PHPUnit\Framework\TestCase;
55584use PHPUnit\Framework\TestSuite;
55585use PHPUnit\Framework\Warning;
55586use PHPUnit\Framework\WarningTestCase;
55587use PHPUnit\Runner\BaseTestRunner;
55588use PHPUnit\TextUI\ResultPrinter as ResultPrinterInterface;
55589use PHPUnit\Util\Printer;
55590use Throwable;
55591/**
55592 * @internal This class is not covered by the backward compatibility promise for PHPUnit
55593 */
55594abstract class ResultPrinter extends Printer implements ResultPrinterInterface
55595{
55596    /**
55597     * @var NamePrettifier
55598     */
55599    protected $prettifier;
55600    /**
55601     * @var string
55602     */
55603    protected $testClass = '';
55604    /**
55605     * @var int
55606     */
55607    protected $testStatus;
55608    /**
55609     * @var array
55610     */
55611    protected $tests = [];
55612    /**
55613     * @var int
55614     */
55615    protected $successful = 0;
55616    /**
55617     * @var int
55618     */
55619    protected $warned = 0;
55620    /**
55621     * @var int
55622     */
55623    protected $failed = 0;
55624    /**
55625     * @var int
55626     */
55627    protected $risky = 0;
55628    /**
55629     * @var int
55630     */
55631    protected $skipped = 0;
55632    /**
55633     * @var int
55634     */
55635    protected $incomplete = 0;
55636    /**
55637     * @var null|string
55638     */
55639    protected $currentTestClassPrettified;
55640    /**
55641     * @var null|string
55642     */
55643    protected $currentTestMethodPrettified;
55644    /**
55645     * @var array
55646     */
55647    private $groups;
55648    /**
55649     * @var array
55650     */
55651    private $excludeGroups;
55652    /**
55653     * @param resource $out
55654     *
55655     * @throws \PHPUnit\Framework\Exception
55656     */
55657    public function __construct($out = null, array $groups = [], array $excludeGroups = [])
55658    {
55659        parent::__construct($out);
55660        $this->groups = $groups;
55661        $this->excludeGroups = $excludeGroups;
55662        $this->prettifier = new \PHPUnit\Util\TestDox\NamePrettifier();
55663        $this->startRun();
55664    }
55665    /**
55666     * Flush buffer and close output.
55667     */
55668    public function flush() : void
55669    {
55670        $this->doEndClass();
55671        $this->endRun();
55672        parent::flush();
55673    }
55674    /**
55675     * An error occurred.
55676     */
55677    public function addError(Test $test, Throwable $t, float $time) : void
55678    {
55679        if (!$this->isOfInterest($test)) {
55680            return;
55681        }
55682        $this->testStatus = BaseTestRunner::STATUS_ERROR;
55683        $this->failed++;
55684    }
55685    /**
55686     * A warning occurred.
55687     */
55688    public function addWarning(Test $test, Warning $e, float $time) : void
55689    {
55690        if (!$this->isOfInterest($test)) {
55691            return;
55692        }
55693        $this->testStatus = BaseTestRunner::STATUS_WARNING;
55694        $this->warned++;
55695    }
55696    /**
55697     * A failure occurred.
55698     */
55699    public function addFailure(Test $test, AssertionFailedError $e, float $time) : void
55700    {
55701        if (!$this->isOfInterest($test)) {
55702            return;
55703        }
55704        $this->testStatus = BaseTestRunner::STATUS_FAILURE;
55705        $this->failed++;
55706    }
55707    /**
55708     * Incomplete test.
55709     */
55710    public function addIncompleteTest(Test $test, Throwable $t, float $time) : void
55711    {
55712        if (!$this->isOfInterest($test)) {
55713            return;
55714        }
55715        $this->testStatus = BaseTestRunner::STATUS_INCOMPLETE;
55716        $this->incomplete++;
55717    }
55718    /**
55719     * Risky test.
55720     */
55721    public function addRiskyTest(Test $test, Throwable $t, float $time) : void
55722    {
55723        if (!$this->isOfInterest($test)) {
55724            return;
55725        }
55726        $this->testStatus = BaseTestRunner::STATUS_RISKY;
55727        $this->risky++;
55728    }
55729    /**
55730     * Skipped test.
55731     */
55732    public function addSkippedTest(Test $test, Throwable $t, float $time) : void
55733    {
55734        if (!$this->isOfInterest($test)) {
55735            return;
55736        }
55737        $this->testStatus = BaseTestRunner::STATUS_SKIPPED;
55738        $this->skipped++;
55739    }
55740    /**
55741     * A testsuite started.
55742     */
55743    public function startTestSuite(TestSuite $suite) : void
55744    {
55745    }
55746    /**
55747     * A testsuite ended.
55748     */
55749    public function endTestSuite(TestSuite $suite) : void
55750    {
55751    }
55752    /**
55753     * A test started.
55754     *
55755     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
55756     */
55757    public function startTest(Test $test) : void
55758    {
55759        if (!$this->isOfInterest($test)) {
55760            return;
55761        }
55762        $class = get_class($test);
55763        if ($this->testClass !== $class) {
55764            if ($this->testClass !== '') {
55765                $this->doEndClass();
55766            }
55767            $this->currentTestClassPrettified = $this->prettifier->prettifyTestClass($class);
55768            $this->testClass = $class;
55769            $this->tests = [];
55770            $this->startClass($class);
55771        }
55772        if ($test instanceof TestCase) {
55773            $this->currentTestMethodPrettified = $this->prettifier->prettifyTestCase($test);
55774        }
55775        $this->testStatus = BaseTestRunner::STATUS_PASSED;
55776    }
55777    /**
55778     * A test ended.
55779     */
55780    public function endTest(Test $test, float $time) : void
55781    {
55782        if (!$this->isOfInterest($test)) {
55783            return;
55784        }
55785        $this->tests[] = [$this->currentTestMethodPrettified, $this->testStatus];
55786        $this->currentTestClassPrettified = null;
55787        $this->currentTestMethodPrettified = null;
55788    }
55789    protected function doEndClass() : void
55790    {
55791        foreach ($this->tests as $test) {
55792            $this->onTest($test[0], $test[1] === BaseTestRunner::STATUS_PASSED);
55793        }
55794        $this->endClass($this->testClass);
55795    }
55796    /**
55797     * Handler for 'start run' event.
55798     */
55799    protected function startRun() : void
55800    {
55801    }
55802    /**
55803     * Handler for 'start class' event.
55804     */
55805    protected function startClass(string $name) : void
55806    {
55807    }
55808    /**
55809     * Handler for 'on test' event.
55810     */
55811    protected function onTest(string $name, bool $success = \true) : void
55812    {
55813    }
55814    /**
55815     * Handler for 'end class' event.
55816     */
55817    protected function endClass(string $name) : void
55818    {
55819    }
55820    /**
55821     * Handler for 'end run' event.
55822     */
55823    protected function endRun() : void
55824    {
55825    }
55826    private function isOfInterest(Test $test) : bool
55827    {
55828        if (!$test instanceof TestCase) {
55829            return \false;
55830        }
55831        if ($test instanceof ErrorTestCase || $test instanceof WarningTestCase) {
55832            return \false;
55833        }
55834        if (!empty($this->groups)) {
55835            foreach ($test->getGroups() as $group) {
55836                if (in_array($group, $this->groups, \true)) {
55837                    return \true;
55838                }
55839            }
55840            return \false;
55841        }
55842        if (!empty($this->excludeGroups)) {
55843            foreach ($test->getGroups() as $group) {
55844                if (in_array($group, $this->excludeGroups, \true)) {
55845                    return \false;
55846                }
55847            }
55848            return \true;
55849        }
55850        return \true;
55851    }
55852}
55853<?php
55854
55855declare (strict_types=1);
55856/*
55857 * This file is part of PHPUnit.
55858 *
55859 * (c) Sebastian Bergmann <sebastian@phpunit.de>
55860 *
55861 * For the full copyright and license information, please view the LICENSE
55862 * file that was distributed with this source code.
55863 */
55864namespace PHPUnit\Util\TestDox;
55865
55866use function array_filter;
55867use function get_class;
55868use function implode;
55869use function strpos;
55870use DOMDocument;
55871use DOMElement;
55872use PHPUnit\Framework\AssertionFailedError;
55873use PHPUnit\Framework\Exception;
55874use PHPUnit\Framework\Test;
55875use PHPUnit\Framework\TestCase;
55876use PHPUnit\Framework\TestListener;
55877use PHPUnit\Framework\TestSuite;
55878use PHPUnit\Framework\Warning;
55879use PHPUnit\Framework\WarningTestCase;
55880use PHPUnit\Util\Printer;
55881use PHPUnit\Util\Test as TestUtil;
55882use ReflectionClass;
55883use ReflectionException;
55884use Throwable;
55885/**
55886 * @internal This class is not covered by the backward compatibility promise for PHPUnit
55887 */
55888final class XmlResultPrinter extends Printer implements TestListener
55889{
55890    /**
55891     * @var DOMDocument
55892     */
55893    private $document;
55894    /**
55895     * @var DOMElement
55896     */
55897    private $root;
55898    /**
55899     * @var NamePrettifier
55900     */
55901    private $prettifier;
55902    /**
55903     * @var null|Throwable
55904     */
55905    private $exception;
55906    /**
55907     * @param resource|string $out
55908     *
55909     * @throws Exception
55910     */
55911    public function __construct($out = null)
55912    {
55913        $this->document = new DOMDocument('1.0', 'UTF-8');
55914        $this->document->formatOutput = \true;
55915        $this->root = $this->document->createElement('tests');
55916        $this->document->appendChild($this->root);
55917        $this->prettifier = new \PHPUnit\Util\TestDox\NamePrettifier();
55918        parent::__construct($out);
55919    }
55920    /**
55921     * Flush buffer and close output.
55922     */
55923    public function flush() : void
55924    {
55925        $this->write($this->document->saveXML());
55926        parent::flush();
55927    }
55928    /**
55929     * An error occurred.
55930     */
55931    public function addError(Test $test, Throwable $t, float $time) : void
55932    {
55933        $this->exception = $t;
55934    }
55935    /**
55936     * A warning occurred.
55937     */
55938    public function addWarning(Test $test, Warning $e, float $time) : void
55939    {
55940    }
55941    /**
55942     * A failure occurred.
55943     */
55944    public function addFailure(Test $test, AssertionFailedError $e, float $time) : void
55945    {
55946        $this->exception = $e;
55947    }
55948    /**
55949     * Incomplete test.
55950     */
55951    public function addIncompleteTest(Test $test, Throwable $t, float $time) : void
55952    {
55953    }
55954    /**
55955     * Risky test.
55956     */
55957    public function addRiskyTest(Test $test, Throwable $t, float $time) : void
55958    {
55959    }
55960    /**
55961     * Skipped test.
55962     */
55963    public function addSkippedTest(Test $test, Throwable $t, float $time) : void
55964    {
55965    }
55966    /**
55967     * A test suite started.
55968     */
55969    public function startTestSuite(TestSuite $suite) : void
55970    {
55971    }
55972    /**
55973     * A test suite ended.
55974     */
55975    public function endTestSuite(TestSuite $suite) : void
55976    {
55977    }
55978    /**
55979     * A test started.
55980     */
55981    public function startTest(Test $test) : void
55982    {
55983        $this->exception = null;
55984    }
55985    /**
55986     * A test ended.
55987     *
55988     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
55989     */
55990    public function endTest(Test $test, float $time) : void
55991    {
55992        if (!$test instanceof TestCase || $test instanceof WarningTestCase) {
55993            return;
55994        }
55995        $groups = array_filter($test->getGroups(), static function ($group) {
55996            return !($group === 'small' || $group === 'medium' || $group === 'large' || strpos($group, '__phpunit_') === 0);
55997        });
55998        $testNode = $this->document->createElement('test');
55999        $testNode->setAttribute('className', get_class($test));
56000        $testNode->setAttribute('methodName', $test->getName());
56001        $testNode->setAttribute('prettifiedClassName', $this->prettifier->prettifyTestClass(get_class($test)));
56002        $testNode->setAttribute('prettifiedMethodName', $this->prettifier->prettifyTestCase($test));
56003        $testNode->setAttribute('status', (string) $test->getStatus());
56004        $testNode->setAttribute('time', (string) $time);
56005        $testNode->setAttribute('size', (string) $test->getSize());
56006        $testNode->setAttribute('groups', implode(',', $groups));
56007        foreach ($groups as $group) {
56008            $groupNode = $this->document->createElement('group');
56009            $groupNode->setAttribute('name', $group);
56010            $testNode->appendChild($groupNode);
56011        }
56012        $annotations = TestUtil::parseTestMethodAnnotations(get_class($test), $test->getName(\false));
56013        foreach (['class', 'method'] as $type) {
56014            foreach ($annotations[$type] as $annotation => $values) {
56015                if ($annotation !== 'covers' && $annotation !== 'uses') {
56016                    continue;
56017                }
56018                foreach ($values as $value) {
56019                    $coversNode = $this->document->createElement($annotation);
56020                    $coversNode->setAttribute('target', $value);
56021                    $testNode->appendChild($coversNode);
56022                }
56023            }
56024        }
56025        foreach ($test->doubledTypes() as $doubledType) {
56026            $testDoubleNode = $this->document->createElement('testDouble');
56027            $testDoubleNode->setAttribute('type', $doubledType);
56028            $testNode->appendChild($testDoubleNode);
56029        }
56030        $inlineAnnotations = \PHPUnit\Util\Test::getInlineAnnotations(get_class($test), $test->getName(\false));
56031        if (isset($inlineAnnotations['given'], $inlineAnnotations['when'], $inlineAnnotations['then'])) {
56032            $testNode->setAttribute('given', $inlineAnnotations['given']['value']);
56033            $testNode->setAttribute('givenStartLine', (string) $inlineAnnotations['given']['line']);
56034            $testNode->setAttribute('when', $inlineAnnotations['when']['value']);
56035            $testNode->setAttribute('whenStartLine', (string) $inlineAnnotations['when']['line']);
56036            $testNode->setAttribute('then', $inlineAnnotations['then']['value']);
56037            $testNode->setAttribute('thenStartLine', (string) $inlineAnnotations['then']['line']);
56038        }
56039        if ($this->exception !== null) {
56040            if ($this->exception instanceof Exception) {
56041                $steps = $this->exception->getSerializableTrace();
56042            } else {
56043                $steps = $this->exception->getTrace();
56044            }
56045            try {
56046                $file = (new ReflectionClass($test))->getFileName();
56047                // @codeCoverageIgnoreStart
56048            } catch (ReflectionException $e) {
56049                throw new Exception($e->getMessage(), (int) $e->getCode(), $e);
56050            }
56051            // @codeCoverageIgnoreEnd
56052            foreach ($steps as $step) {
56053                if (isset($step['file']) && $step['file'] === $file) {
56054                    $testNode->setAttribute('exceptionLine', (string) $step['line']);
56055                    break;
56056                }
56057            }
56058            $testNode->setAttribute('exceptionMessage', $this->exception->getMessage());
56059        }
56060        $this->root->appendChild($testNode);
56061    }
56062}
56063<?php
56064
56065declare (strict_types=1);
56066/*
56067 * This file is part of PHPUnit.
56068 *
56069 * (c) Sebastian Bergmann <sebastian@phpunit.de>
56070 *
56071 * For the full copyright and license information, please view the LICENSE
56072 * file that was distributed with this source code.
56073 */
56074namespace PHPUnit\Util\TestDox;
56075
56076use const PHP_EOL;
56077use function array_map;
56078use function get_class;
56079use function implode;
56080use function method_exists;
56081use function preg_split;
56082use function trim;
56083use PHPUnit\Framework\AssertionFailedError;
56084use PHPUnit\Framework\Reorderable;
56085use PHPUnit\Framework\Test;
56086use PHPUnit\Framework\TestCase;
56087use PHPUnit\Framework\TestResult;
56088use PHPUnit\Framework\TestSuite;
56089use PHPUnit\Framework\Warning;
56090use PHPUnit\Runner\BaseTestRunner;
56091use PHPUnit\Runner\PhptTestCase;
56092use PHPUnit\TextUI\DefaultResultPrinter;
56093use Throwable;
56094/**
56095 * @internal This class is not covered by the backward compatibility promise for PHPUnit
56096 */
56097class TestDoxPrinter extends DefaultResultPrinter
56098{
56099    /**
56100     * @var NamePrettifier
56101     */
56102    protected $prettifier;
56103    /**
56104     * @var int The number of test results received from the TestRunner
56105     */
56106    protected $testIndex = 0;
56107    /**
56108     * @var int The number of test results already sent to the output
56109     */
56110    protected $testFlushIndex = 0;
56111    /**
56112     * @var array<int, array> Buffer for test results
56113     */
56114    protected $testResults = [];
56115    /**
56116     * @var array<string, int> Lookup table for testname to testResults[index]
56117     */
56118    protected $testNameResultIndex = [];
56119    /**
56120     * @var bool
56121     */
56122    protected $enableOutputBuffer = \false;
56123    /**
56124     * @var array array<string>
56125     */
56126    protected $originalExecutionOrder = [];
56127    /**
56128     * @var int
56129     */
56130    protected $spinState = 0;
56131    /**
56132     * @var bool
56133     */
56134    protected $showProgress = \true;
56135    /**
56136     * @param null|resource|string $out
56137     * @param int|string           $numberOfColumns
56138     *
56139     * @throws \PHPUnit\Framework\Exception
56140     */
56141    public function __construct($out = null, bool $verbose = \false, string $colors = self::COLOR_DEFAULT, bool $debug = \false, $numberOfColumns = 80, bool $reverse = \false)
56142    {
56143        parent::__construct($out, $verbose, $colors, $debug, $numberOfColumns, $reverse);
56144        $this->prettifier = new \PHPUnit\Util\TestDox\NamePrettifier($this->colors);
56145    }
56146    public function setOriginalExecutionOrder(array $order) : void
56147    {
56148        $this->originalExecutionOrder = $order;
56149        $this->enableOutputBuffer = !empty($order);
56150    }
56151    public function setShowProgressAnimation(bool $showProgress) : void
56152    {
56153        $this->showProgress = $showProgress;
56154    }
56155    public function printResult(TestResult $result) : void
56156    {
56157    }
56158    /**
56159     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
56160     */
56161    public function endTest(Test $test, float $time) : void
56162    {
56163        if (!$test instanceof TestCase && !$test instanceof PhptTestCase && !$test instanceof TestSuite) {
56164            return;
56165        }
56166        if ($this->testHasPassed()) {
56167            $this->registerTestResult($test, null, BaseTestRunner::STATUS_PASSED, $time, \false);
56168        }
56169        if ($test instanceof TestCase || $test instanceof PhptTestCase) {
56170            $this->testIndex++;
56171        }
56172        parent::endTest($test, $time);
56173    }
56174    /**
56175     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
56176     */
56177    public function addError(Test $test, Throwable $t, float $time) : void
56178    {
56179        $this->registerTestResult($test, $t, BaseTestRunner::STATUS_ERROR, $time, \true);
56180    }
56181    /**
56182     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
56183     */
56184    public function addWarning(Test $test, Warning $e, float $time) : void
56185    {
56186        $this->registerTestResult($test, $e, BaseTestRunner::STATUS_WARNING, $time, \true);
56187    }
56188    /**
56189     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
56190     */
56191    public function addFailure(Test $test, AssertionFailedError $e, float $time) : void
56192    {
56193        $this->registerTestResult($test, $e, BaseTestRunner::STATUS_FAILURE, $time, \true);
56194    }
56195    /**
56196     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
56197     */
56198    public function addIncompleteTest(Test $test, Throwable $t, float $time) : void
56199    {
56200        $this->registerTestResult($test, $t, BaseTestRunner::STATUS_INCOMPLETE, $time, \false);
56201    }
56202    /**
56203     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
56204     */
56205    public function addRiskyTest(Test $test, Throwable $t, float $time) : void
56206    {
56207        $this->registerTestResult($test, $t, BaseTestRunner::STATUS_RISKY, $time, \false);
56208    }
56209    /**
56210     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
56211     */
56212    public function addSkippedTest(Test $test, Throwable $t, float $time) : void
56213    {
56214        $this->registerTestResult($test, $t, BaseTestRunner::STATUS_SKIPPED, $time, \false);
56215    }
56216    public function writeProgress(string $progress) : void
56217    {
56218        $this->flushOutputBuffer();
56219    }
56220    public function flush() : void
56221    {
56222        $this->flushOutputBuffer(\true);
56223    }
56224    /**
56225     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
56226     */
56227    protected function registerTestResult(Test $test, ?Throwable $t, int $status, float $time, bool $verbose) : void
56228    {
56229        $testName = $test instanceof Reorderable ? $test->sortId() : $test->getName();
56230        $result = ['className' => $this->formatClassName($test), 'testName' => $testName, 'testMethod' => $this->formatTestName($test), 'message' => '', 'status' => $status, 'time' => $time, 'verbose' => $verbose];
56231        if ($t !== null) {
56232            $result['message'] = $this->formatTestResultMessage($t, $result);
56233        }
56234        $this->testResults[$this->testIndex] = $result;
56235        $this->testNameResultIndex[$testName] = $this->testIndex;
56236    }
56237    protected function formatTestName(Test $test) : string
56238    {
56239        return method_exists($test, 'getName') ? $test->getName() : '';
56240    }
56241    protected function formatClassName(Test $test) : string
56242    {
56243        return get_class($test);
56244    }
56245    protected function testHasPassed() : bool
56246    {
56247        if (!isset($this->testResults[$this->testIndex]['status'])) {
56248            return \true;
56249        }
56250        if ($this->testResults[$this->testIndex]['status'] === BaseTestRunner::STATUS_PASSED) {
56251            return \true;
56252        }
56253        return \false;
56254    }
56255    protected function flushOutputBuffer(bool $forceFlush = \false) : void
56256    {
56257        if ($this->testFlushIndex === $this->testIndex) {
56258            return;
56259        }
56260        if ($this->testFlushIndex > 0) {
56261            if ($this->enableOutputBuffer && isset($this->originalExecutionOrder[$this->testFlushIndex - 1])) {
56262                $prevResult = $this->getTestResultByName($this->originalExecutionOrder[$this->testFlushIndex - 1]);
56263            } else {
56264                $prevResult = $this->testResults[$this->testFlushIndex - 1];
56265            }
56266        } else {
56267            $prevResult = $this->getEmptyTestResult();
56268        }
56269        if (!$this->enableOutputBuffer) {
56270            $this->writeTestResult($prevResult, $this->testResults[$this->testFlushIndex++]);
56271        } else {
56272            do {
56273                $flushed = \false;
56274                if (!$forceFlush && isset($this->originalExecutionOrder[$this->testFlushIndex])) {
56275                    $result = $this->getTestResultByName($this->originalExecutionOrder[$this->testFlushIndex]);
56276                } else {
56277                    // This test(name) cannot found in original execution order,
56278                    // flush result to output stream right away
56279                    $result = $this->testResults[$this->testFlushIndex];
56280                }
56281                if (!empty($result)) {
56282                    $this->hideSpinner();
56283                    $this->writeTestResult($prevResult, $result);
56284                    $this->testFlushIndex++;
56285                    $prevResult = $result;
56286                    $flushed = \true;
56287                } else {
56288                    $this->showSpinner();
56289                }
56290            } while ($flushed && $this->testFlushIndex < $this->testIndex);
56291        }
56292    }
56293    protected function showSpinner() : void
56294    {
56295        if (!$this->showProgress) {
56296            return;
56297        }
56298        if ($this->spinState) {
56299            $this->undrawSpinner();
56300        }
56301        $this->spinState++;
56302        $this->drawSpinner();
56303    }
56304    protected function hideSpinner() : void
56305    {
56306        if (!$this->showProgress) {
56307            return;
56308        }
56309        if ($this->spinState) {
56310            $this->undrawSpinner();
56311        }
56312        $this->spinState = 0;
56313    }
56314    protected function drawSpinner() : void
56315    {
56316        // optional for CLI printers: show the user a 'buffering output' spinner
56317    }
56318    protected function undrawSpinner() : void
56319    {
56320        // remove the spinner from the current line
56321    }
56322    protected function writeTestResult(array $prevResult, array $result) : void
56323    {
56324    }
56325    protected function getEmptyTestResult() : array
56326    {
56327        return ['className' => '', 'testName' => '', 'message' => '', 'failed' => '', 'verbose' => ''];
56328    }
56329    protected function getTestResultByName(?string $testName) : array
56330    {
56331        if (isset($this->testNameResultIndex[$testName])) {
56332            return $this->testResults[$this->testNameResultIndex[$testName]];
56333        }
56334        return [];
56335    }
56336    protected function formatThrowable(Throwable $t, ?int $status = null) : string
56337    {
56338        $message = trim(\PHPUnit\Framework\TestFailure::exceptionToString($t));
56339        if ($message) {
56340            $message .= \PHP_EOL . \PHP_EOL . $this->formatStacktrace($t);
56341        } else {
56342            $message = $this->formatStacktrace($t);
56343        }
56344        return $message;
56345    }
56346    protected function formatStacktrace(Throwable $t) : string
56347    {
56348        return \PHPUnit\Util\Filter::getFilteredStacktrace($t);
56349    }
56350    protected function formatTestResultMessage(Throwable $t, array $result, string $prefix = '│') : string
56351    {
56352        $message = $this->formatThrowable($t, $result['status']);
56353        if ($message === '') {
56354            return '';
56355        }
56356        if (!($this->verbose || $result['verbose'])) {
56357            return '';
56358        }
56359        return $this->prefixLines($prefix, $message);
56360    }
56361    protected function prefixLines(string $prefix, string $message) : string
56362    {
56363        $message = trim($message);
56364        return implode(\PHP_EOL, array_map(static function (string $text) use($prefix) {
56365            return '   ' . $prefix . ($text ? ' ' . $text : '');
56366        }, preg_split('/\\r\\n|\\r|\\n/', $message)));
56367    }
56368}
56369<?php
56370
56371declare (strict_types=1);
56372/*
56373 * This file is part of PHPUnit.
56374 *
56375 * (c) Sebastian Bergmann <sebastian@phpunit.de>
56376 *
56377 * For the full copyright and license information, please view the LICENSE
56378 * file that was distributed with this source code.
56379 */
56380namespace PHPUnit\Util\TestDox;
56381
56382use function sprintf;
56383use PHPUnit\Framework\TestResult;
56384/**
56385 * @internal This class is not covered by the backward compatibility promise for PHPUnit
56386 */
56387final class HtmlResultPrinter extends \PHPUnit\Util\TestDox\ResultPrinter
56388{
56389    /**
56390     * @var string
56391     */
56392    private const PAGE_HEADER = <<<'EOT'
56393<!doctype html>
56394<html lang="en">
56395    <head>
56396        <meta charset="utf-8"/>
56397        <title>Test Documentation</title>
56398        <style>
56399            body {
56400                text-rendering: optimizeLegibility;
56401                font-variant-ligatures: common-ligatures;
56402                font-kerning: normal;
56403                margin-left: 2em;
56404                background-color: #ffffff;
56405                color: #000000;
56406            }
56407
56408            body > ul > li {
56409                font-family: Source Serif Pro, PT Sans, Trebuchet MS, Helvetica, Arial;
56410                font-size: 2em;
56411            }
56412
56413            h2 {
56414                font-family: Tahoma, Helvetica, Arial;
56415                font-size: 3em;
56416            }
56417
56418            ul {
56419                list-style: none;
56420                margin-bottom: 1em;
56421            }
56422        </style>
56423    </head>
56424    <body>
56425EOT;
56426    /**
56427     * @var string
56428     */
56429    private const CLASS_HEADER = <<<'EOT'
56430
56431        <h2 id="%s">%s</h2>
56432        <ul>
56433
56434EOT;
56435    /**
56436     * @var string
56437     */
56438    private const CLASS_FOOTER = <<<'EOT'
56439        </ul>
56440EOT;
56441    /**
56442     * @var string
56443     */
56444    private const PAGE_FOOTER = <<<'EOT'
56445
56446    </body>
56447</html>
56448EOT;
56449    public function printResult(TestResult $result) : void
56450    {
56451    }
56452    /**
56453     * Handler for 'start run' event.
56454     */
56455    protected function startRun() : void
56456    {
56457        $this->write(self::PAGE_HEADER);
56458    }
56459    /**
56460     * Handler for 'start class' event.
56461     */
56462    protected function startClass(string $name) : void
56463    {
56464        $this->write(sprintf(self::CLASS_HEADER, $name, $this->currentTestClassPrettified));
56465    }
56466    /**
56467     * Handler for 'on test' event.
56468     */
56469    protected function onTest(string $name, bool $success = \true) : void
56470    {
56471        $this->write(sprintf("            <li style=\"color: %s;\">%s %s</li>\n", $success ? '#555753' : '#ef2929', $success ? '✓' : '❌', $name));
56472    }
56473    /**
56474     * Handler for 'end class' event.
56475     */
56476    protected function endClass(string $name) : void
56477    {
56478        $this->write(self::CLASS_FOOTER);
56479    }
56480    /**
56481     * Handler for 'end run' event.
56482     */
56483    protected function endRun() : void
56484    {
56485        $this->write(self::PAGE_FOOTER);
56486    }
56487}
56488<?php
56489
56490declare (strict_types=1);
56491/*
56492 * This file is part of PHPUnit.
56493 *
56494 * (c) Sebastian Bergmann <sebastian@phpunit.de>
56495 *
56496 * For the full copyright and license information, please view the LICENSE
56497 * file that was distributed with this source code.
56498 */
56499namespace PHPUnit\Runner;
56500
56501use function array_diff;
56502use function array_values;
56503use function basename;
56504use function class_exists;
56505use function get_declared_classes;
56506use function sprintf;
56507use function stripos;
56508use function strlen;
56509use function substr;
56510use PHPUnit\Framework\TestCase;
56511use PHPUnit\Util\FileLoader;
56512use ReflectionClass;
56513use ReflectionException;
56514/**
56515 * @internal This class is not covered by the backward compatibility promise for PHPUnit
56516 *
56517 * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039
56518 */
56519final class StandardTestSuiteLoader implements \PHPUnit\Runner\TestSuiteLoader
56520{
56521    /**
56522     * @throws Exception
56523     */
56524    public function load(string $suiteClassFile) : ReflectionClass
56525    {
56526        $suiteClassName = basename($suiteClassFile, '.php');
56527        $loadedClasses = get_declared_classes();
56528        if (!class_exists($suiteClassName, \false)) {
56529            /* @noinspection UnusedFunctionResultInspection */
56530            FileLoader::checkAndLoad($suiteClassFile);
56531            $loadedClasses = array_values(array_diff(get_declared_classes(), $loadedClasses));
56532            if (empty($loadedClasses)) {
56533                throw $this->exceptionFor($suiteClassName, $suiteClassFile);
56534            }
56535        }
56536        if (!class_exists($suiteClassName, \false)) {
56537            // this block will handle namespaced classes
56538            $offset = 0 - strlen($suiteClassName);
56539            foreach ($loadedClasses as $loadedClass) {
56540                if (stripos(substr($loadedClass, $offset - 1), '\\' . $suiteClassName) === 0) {
56541                    $suiteClassName = $loadedClass;
56542                    break;
56543                }
56544            }
56545        }
56546        if (!class_exists($suiteClassName, \false)) {
56547            throw $this->exceptionFor($suiteClassName, $suiteClassFile);
56548        }
56549        try {
56550            $class = new ReflectionClass($suiteClassName);
56551            // @codeCoverageIgnoreStart
56552        } catch (ReflectionException $e) {
56553            throw new \PHPUnit\Runner\Exception($e->getMessage(), (int) $e->getCode(), $e);
56554        }
56555        // @codeCoverageIgnoreEnd
56556        if ($class->isSubclassOf(TestCase::class) && !$class->isAbstract()) {
56557            return $class;
56558        }
56559        if ($class->hasMethod('suite')) {
56560            try {
56561                $method = $class->getMethod('suite');
56562                // @codeCoverageIgnoreStart
56563            } catch (ReflectionException $e) {
56564                throw new \PHPUnit\Runner\Exception($e->getMessage(), (int) $e->getCode(), $e);
56565            }
56566            // @codeCoverageIgnoreEnd
56567            if (!$method->isAbstract() && $method->isPublic() && $method->isStatic()) {
56568                return $class;
56569            }
56570        }
56571        throw $this->exceptionFor($suiteClassName, $suiteClassFile);
56572    }
56573    public function reload(ReflectionClass $aClass) : ReflectionClass
56574    {
56575        return $aClass;
56576    }
56577    private function exceptionFor(string $className, string $filename) : \PHPUnit\Runner\Exception
56578    {
56579        return new \PHPUnit\Runner\Exception(sprintf("Class '%s' could not be found in '%s'.", $className, $filename));
56580    }
56581}
56582<?php
56583
56584declare (strict_types=1);
56585/*
56586 * This file is part of PHPUnit.
56587 *
56588 * (c) Sebastian Bergmann <sebastian@phpunit.de>
56589 *
56590 * For the full copyright and license information, please view the LICENSE
56591 * file that was distributed with this source code.
56592 */
56593namespace PHPUnit\Runner;
56594
56595use function array_diff;
56596use function array_merge;
56597use function array_reverse;
56598use function array_splice;
56599use function count;
56600use function in_array;
56601use function max;
56602use function shuffle;
56603use function usort;
56604use PHPUnit\Framework\DataProviderTestSuite;
56605use PHPUnit\Framework\Reorderable;
56606use PHPUnit\Framework\Test;
56607use PHPUnit\Framework\TestCase;
56608use PHPUnit\Framework\TestSuite;
56609use PHPUnit\Util\Test as TestUtil;
56610/**
56611 * @internal This class is not covered by the backward compatibility promise for PHPUnit
56612 */
56613final class TestSuiteSorter
56614{
56615    /**
56616     * @var int
56617     */
56618    public const ORDER_DEFAULT = 0;
56619    /**
56620     * @var int
56621     */
56622    public const ORDER_RANDOMIZED = 1;
56623    /**
56624     * @var int
56625     */
56626    public const ORDER_REVERSED = 2;
56627    /**
56628     * @var int
56629     */
56630    public const ORDER_DEFECTS_FIRST = 3;
56631    /**
56632     * @var int
56633     */
56634    public const ORDER_DURATION = 4;
56635    /**
56636     * Order tests by @size annotation 'small', 'medium', 'large'.
56637     *
56638     * @var int
56639     */
56640    public const ORDER_SIZE = 5;
56641    /**
56642     * List of sorting weights for all test result codes. A higher number gives higher priority.
56643     */
56644    private const DEFECT_SORT_WEIGHT = [\PHPUnit\Runner\BaseTestRunner::STATUS_ERROR => 6, \PHPUnit\Runner\BaseTestRunner::STATUS_FAILURE => 5, \PHPUnit\Runner\BaseTestRunner::STATUS_WARNING => 4, \PHPUnit\Runner\BaseTestRunner::STATUS_INCOMPLETE => 3, \PHPUnit\Runner\BaseTestRunner::STATUS_RISKY => 2, \PHPUnit\Runner\BaseTestRunner::STATUS_SKIPPED => 1, \PHPUnit\Runner\BaseTestRunner::STATUS_UNKNOWN => 0];
56645    private const SIZE_SORT_WEIGHT = [TestUtil::SMALL => 1, TestUtil::MEDIUM => 2, TestUtil::LARGE => 3, TestUtil::UNKNOWN => 4];
56646    /**
56647     * @var array<string, int> Associative array of (string => DEFECT_SORT_WEIGHT) elements
56648     */
56649    private $defectSortOrder = [];
56650    /**
56651     * @var TestResultCache
56652     */
56653    private $cache;
56654    /**
56655     * @var array<string> A list of normalized names of tests before reordering
56656     */
56657    private $originalExecutionOrder = [];
56658    /**
56659     * @var array<string> A list of normalized names of tests affected by reordering
56660     */
56661    private $executionOrder = [];
56662    public function __construct(?\PHPUnit\Runner\TestResultCache $cache = null)
56663    {
56664        $this->cache = $cache ?? new \PHPUnit\Runner\NullTestResultCache();
56665    }
56666    /**
56667     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
56668     * @throws Exception
56669     */
56670    public function reorderTestsInSuite(Test $suite, int $order, bool $resolveDependencies, int $orderDefects, bool $isRootTestSuite = \true) : void
56671    {
56672        $allowedOrders = [self::ORDER_DEFAULT, self::ORDER_REVERSED, self::ORDER_RANDOMIZED, self::ORDER_DURATION, self::ORDER_SIZE];
56673        if (!in_array($order, $allowedOrders, \true)) {
56674            throw new \PHPUnit\Runner\Exception('$order must be one of TestSuiteSorter::ORDER_[DEFAULT|REVERSED|RANDOMIZED|DURATION|SIZE]');
56675        }
56676        $allowedOrderDefects = [self::ORDER_DEFAULT, self::ORDER_DEFECTS_FIRST];
56677        if (!in_array($orderDefects, $allowedOrderDefects, \true)) {
56678            throw new \PHPUnit\Runner\Exception('$orderDefects must be one of TestSuiteSorter::ORDER_DEFAULT, TestSuiteSorter::ORDER_DEFECTS_FIRST');
56679        }
56680        if ($isRootTestSuite) {
56681            $this->originalExecutionOrder = $this->calculateTestExecutionOrder($suite);
56682        }
56683        if ($suite instanceof TestSuite) {
56684            foreach ($suite as $_suite) {
56685                $this->reorderTestsInSuite($_suite, $order, $resolveDependencies, $orderDefects, \false);
56686            }
56687            if ($orderDefects === self::ORDER_DEFECTS_FIRST) {
56688                $this->addSuiteToDefectSortOrder($suite);
56689            }
56690            $this->sort($suite, $order, $resolveDependencies, $orderDefects);
56691        }
56692        if ($isRootTestSuite) {
56693            $this->executionOrder = $this->calculateTestExecutionOrder($suite);
56694        }
56695    }
56696    public function getOriginalExecutionOrder() : array
56697    {
56698        return $this->originalExecutionOrder;
56699    }
56700    public function getExecutionOrder() : array
56701    {
56702        return $this->executionOrder;
56703    }
56704    private function sort(TestSuite $suite, int $order, bool $resolveDependencies, int $orderDefects) : void
56705    {
56706        if (empty($suite->tests())) {
56707            return;
56708        }
56709        if ($order === self::ORDER_REVERSED) {
56710            $suite->setTests($this->reverse($suite->tests()));
56711        } elseif ($order === self::ORDER_RANDOMIZED) {
56712            $suite->setTests($this->randomize($suite->tests()));
56713        } elseif ($order === self::ORDER_DURATION && $this->cache !== null) {
56714            $suite->setTests($this->sortByDuration($suite->tests()));
56715        } elseif ($order === self::ORDER_SIZE) {
56716            $suite->setTests($this->sortBySize($suite->tests()));
56717        }
56718        if ($orderDefects === self::ORDER_DEFECTS_FIRST && $this->cache !== null) {
56719            $suite->setTests($this->sortDefectsFirst($suite->tests()));
56720        }
56721        if ($resolveDependencies && !$suite instanceof DataProviderTestSuite) {
56722            /** @var TestCase[] $tests */
56723            $tests = $suite->tests();
56724            $suite->setTests($this->resolveDependencies($tests));
56725        }
56726    }
56727    /**
56728     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
56729     */
56730    private function addSuiteToDefectSortOrder(TestSuite $suite) : void
56731    {
56732        $max = 0;
56733        foreach ($suite->tests() as $test) {
56734            if (!$test instanceof Reorderable) {
56735                continue;
56736            }
56737            if (!isset($this->defectSortOrder[$test->sortId()])) {
56738                $this->defectSortOrder[$test->sortId()] = self::DEFECT_SORT_WEIGHT[$this->cache->getState($test->sortId())];
56739                $max = max($max, $this->defectSortOrder[$test->sortId()]);
56740            }
56741        }
56742        $this->defectSortOrder[$suite->sortId()] = $max;
56743    }
56744    private function reverse(array $tests) : array
56745    {
56746        return array_reverse($tests);
56747    }
56748    private function randomize(array $tests) : array
56749    {
56750        shuffle($tests);
56751        return $tests;
56752    }
56753    private function sortDefectsFirst(array $tests) : array
56754    {
56755        usort(
56756            $tests,
56757            /**
56758             * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
56759             */
56760            function ($left, $right) {
56761                return $this->cmpDefectPriorityAndTime($left, $right);
56762            }
56763        );
56764        return $tests;
56765    }
56766    private function sortByDuration(array $tests) : array
56767    {
56768        usort(
56769            $tests,
56770            /**
56771             * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
56772             */
56773            function ($left, $right) {
56774                return $this->cmpDuration($left, $right);
56775            }
56776        );
56777        return $tests;
56778    }
56779    private function sortBySize(array $tests) : array
56780    {
56781        usort(
56782            $tests,
56783            /**
56784             * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
56785             */
56786            function ($left, $right) {
56787                return $this->cmpSize($left, $right);
56788            }
56789        );
56790        return $tests;
56791    }
56792    /**
56793     * Comparator callback function to sort tests for "reach failure as fast as possible".
56794     *
56795     * 1. sort tests by defect weight defined in self::DEFECT_SORT_WEIGHT
56796     * 2. when tests are equally defective, sort the fastest to the front
56797     * 3. do not reorder successful tests
56798     *
56799     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
56800     */
56801    private function cmpDefectPriorityAndTime(Test $a, Test $b) : int
56802    {
56803        if (!($a instanceof Reorderable && $b instanceof Reorderable)) {
56804            return 0;
56805        }
56806        $priorityA = $this->defectSortOrder[$a->sortId()] ?? 0;
56807        $priorityB = $this->defectSortOrder[$b->sortId()] ?? 0;
56808        if ($priorityB <=> $priorityA) {
56809            // Sort defect weight descending
56810            return $priorityB <=> $priorityA;
56811        }
56812        if ($priorityA || $priorityB) {
56813            return $this->cmpDuration($a, $b);
56814        }
56815        // do not change execution order
56816        return 0;
56817    }
56818    /**
56819     * Compares test duration for sorting tests by duration ascending.
56820     *
56821     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
56822     */
56823    private function cmpDuration(Test $a, Test $b) : int
56824    {
56825        if (!($a instanceof Reorderable && $b instanceof Reorderable)) {
56826            return 0;
56827        }
56828        return $this->cache->getTime($a->sortId()) <=> $this->cache->getTime($b->sortId());
56829    }
56830    /**
56831     * Compares test size for sorting tests small->medium->large->unknown.
56832     */
56833    private function cmpSize(Test $a, Test $b) : int
56834    {
56835        $sizeA = $a instanceof TestCase || $a instanceof DataProviderTestSuite ? $a->getSize() : TestUtil::UNKNOWN;
56836        $sizeB = $b instanceof TestCase || $b instanceof DataProviderTestSuite ? $b->getSize() : TestUtil::UNKNOWN;
56837        return self::SIZE_SORT_WEIGHT[$sizeA] <=> self::SIZE_SORT_WEIGHT[$sizeB];
56838    }
56839    /**
56840     * Reorder Tests within a TestCase in such a way as to resolve as many dependencies as possible.
56841     * The algorithm will leave the tests in original running order when it can.
56842     * For more details see the documentation for test dependencies.
56843     *
56844     * Short description of algorithm:
56845     * 1. Pick the next Test from remaining tests to be checked for dependencies.
56846     * 2. If the test has no dependencies: mark done, start again from the top
56847     * 3. If the test has dependencies but none left to do: mark done, start again from the top
56848     * 4. When we reach the end add any leftover tests to the end. These will be marked 'skipped' during execution.
56849     *
56850     * @param array<DataProviderTestSuite|TestCase> $tests
56851     *
56852     * @return array<DataProviderTestSuite|TestCase>
56853     */
56854    private function resolveDependencies(array $tests) : array
56855    {
56856        $newTestOrder = [];
56857        $i = 0;
56858        $provided = [];
56859        do {
56860            if ([] === array_diff($tests[$i]->requires(), $provided)) {
56861                $provided = array_merge($provided, $tests[$i]->provides());
56862                $newTestOrder = array_merge($newTestOrder, array_splice($tests, $i, 1));
56863                $i = 0;
56864            } else {
56865                $i++;
56866            }
56867        } while (!empty($tests) && $i < count($tests));
56868        return array_merge($newTestOrder, $tests);
56869    }
56870    /**
56871     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
56872     */
56873    private function calculateTestExecutionOrder(Test $suite) : array
56874    {
56875        $tests = [];
56876        if ($suite instanceof TestSuite) {
56877            foreach ($suite->tests() as $test) {
56878                if (!$test instanceof TestSuite && $test instanceof Reorderable) {
56879                    $tests[] = $test->sortId();
56880                } else {
56881                    $tests = array_merge($tests, $this->calculateTestExecutionOrder($test));
56882                }
56883            }
56884        }
56885        return $tests;
56886    }
56887}
56888<?php
56889
56890declare (strict_types=1);
56891/*
56892 * This file is part of PHPUnit.
56893 *
56894 * (c) Sebastian Bergmann <sebastian@phpunit.de>
56895 *
56896 * For the full copyright and license information, please view the LICENSE
56897 * file that was distributed with this source code.
56898 */
56899namespace PHPUnit\Runner;
56900
56901use ReflectionClass;
56902/**
56903 * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039
56904 *
56905 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
56906 */
56907interface TestSuiteLoader
56908{
56909    public function load(string $suiteClassFile) : ReflectionClass;
56910    public function reload(ReflectionClass $aClass) : ReflectionClass;
56911}
56912<?php
56913
56914declare (strict_types=1);
56915/*
56916 * This file is part of PHPUnit.
56917 *
56918 * (c) Sebastian Bergmann <sebastian@phpunit.de>
56919 *
56920 * For the full copyright and license information, please view the LICENSE
56921 * file that was distributed with this source code.
56922 */
56923namespace PHPUnit\Runner;
56924
56925/**
56926 * @internal This class is not covered by the backward compatibility promise for PHPUnit
56927 */
56928interface TestResultCache
56929{
56930    public function setState(string $testName, int $state) : void;
56931    public function getState(string $testName) : int;
56932    public function setTime(string $testName, float $time) : void;
56933    public function getTime(string $testName) : float;
56934    public function load() : void;
56935    public function persist() : void;
56936}
56937<?php
56938
56939declare (strict_types=1);
56940/*
56941 * This file is part of PHPUnit.
56942 *
56943 * (c) Sebastian Bergmann <sebastian@phpunit.de>
56944 *
56945 * For the full copyright and license information, please view the LICENSE
56946 * file that was distributed with this source code.
56947 */
56948namespace PHPUnit\Runner\Extension;
56949
56950use PHPUnit\PharIo\Manifest\ApplicationName;
56951use PHPUnit\PharIo\Manifest\Exception as ManifestException;
56952use PHPUnit\PharIo\Manifest\ManifestLoader;
56953use PHPUnit\PharIo\Version\Version as PharIoVersion;
56954use PHPUnit\Runner\Version;
56955use PHPUnit\SebastianBergmann\FileIterator\Facade as FileIteratorFacade;
56956/**
56957 * @internal This class is not covered by the backward compatibility promise for PHPUnit
56958 */
56959final class PharLoader
56960{
56961    /**
56962     * @psalm-return array{loadedExtensions: list<string>, notLoadedExtensions: list<string>}
56963     */
56964    public function loadPharExtensionsInDirectory(string $directory) : array
56965    {
56966        $loadedExtensions = [];
56967        $notLoadedExtensions = [];
56968        foreach ((new FileIteratorFacade())->getFilesAsArray($directory, '.phar') as $file) {
56969            if (!\is_file('phar://' . $file . '/manifest.xml')) {
56970                $notLoadedExtensions[] = $file . ' is not an extension for PHPUnit';
56971                continue;
56972            }
56973            try {
56974                $applicationName = new ApplicationName('phpunit/phpunit');
56975                $version = new PharIoVersion(Version::series());
56976                $manifest = ManifestLoader::fromFile('phar://' . $file . '/manifest.xml');
56977                if (!$manifest->isExtensionFor($applicationName)) {
56978                    $notLoadedExtensions[] = $file . ' is not an extension for PHPUnit';
56979                    continue;
56980                }
56981                if (!$manifest->isExtensionFor($applicationName, $version)) {
56982                    $notLoadedExtensions[] = $file . ' is not compatible with this version of PHPUnit';
56983                    continue;
56984                }
56985            } catch (ManifestException $e) {
56986                $notLoadedExtensions[] = $file . ': ' . $e->getMessage();
56987                continue;
56988            }
56989            /**
56990             * @noinspection PhpIncludeInspection
56991             * @psalm-suppress UnresolvableInclude
56992             */
56993            require $file;
56994            $loadedExtensions[] = $manifest->getName()->asString() . ' ' . $manifest->getVersion()->getVersionString();
56995        }
56996        return ['loadedExtensions' => $loadedExtensions, 'notLoadedExtensions' => $notLoadedExtensions];
56997    }
56998}
56999<?php
57000
57001declare (strict_types=1);
57002/*
57003 * This file is part of PHPUnit.
57004 *
57005 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57006 *
57007 * For the full copyright and license information, please view the LICENSE
57008 * file that was distributed with this source code.
57009 */
57010namespace PHPUnit\Runner\Extension;
57011
57012use function class_exists;
57013use function sprintf;
57014use PHPUnit\Framework\TestListener;
57015use PHPUnit\Runner\Exception;
57016use PHPUnit\Runner\Hook;
57017use PHPUnit\TextUI\TestRunner;
57018use PHPUnit\TextUI\XmlConfiguration\Extension;
57019use ReflectionClass;
57020use ReflectionException;
57021/**
57022 * @internal This class is not covered by the backward compatibility promise for PHPUnit
57023 */
57024final class ExtensionHandler
57025{
57026    /**
57027     * @throws Exception
57028     */
57029    public function registerExtension(Extension $extensionConfiguration, TestRunner $runner) : void
57030    {
57031        $extension = $this->createInstance($extensionConfiguration);
57032        if (!$extension instanceof Hook) {
57033            throw new Exception(sprintf('Class "%s" does not implement a PHPUnit\\Runner\\Hook interface', $extensionConfiguration->className()));
57034        }
57035        $runner->addExtension($extension);
57036    }
57037    /**
57038     * @throws Exception
57039     *
57040     * @deprecated
57041     */
57042    public function createTestListenerInstance(Extension $listenerConfiguration) : TestListener
57043    {
57044        $listener = $this->createInstance($listenerConfiguration);
57045        if (!$listener instanceof TestListener) {
57046            throw new Exception(sprintf('Class "%s" does not implement the PHPUnit\\Framework\\TestListener interface', $listenerConfiguration->className()));
57047        }
57048        return $listener;
57049    }
57050    /**
57051     * @throws Exception
57052     */
57053    private function createInstance(Extension $extensionConfiguration) : object
57054    {
57055        $this->ensureClassExists($extensionConfiguration);
57056        try {
57057            $reflector = new ReflectionClass($extensionConfiguration->className());
57058        } catch (ReflectionException $e) {
57059            throw new Exception($e->getMessage(), (int) $e->getCode(), $e);
57060        }
57061        if (!$extensionConfiguration->hasArguments()) {
57062            return $reflector->newInstance();
57063        }
57064        return $reflector->newInstanceArgs($extensionConfiguration->arguments());
57065    }
57066    /**
57067     * @throws Exception
57068     */
57069    private function ensureClassExists(Extension $extensionConfiguration) : void
57070    {
57071        if (class_exists($extensionConfiguration->className(), \false)) {
57072            return;
57073        }
57074        if ($extensionConfiguration->hasSourceFile()) {
57075            /**
57076             * @noinspection PhpIncludeInspection
57077             * @psalm-suppress UnresolvableInclude
57078             */
57079            require_once $extensionConfiguration->sourceFile();
57080        }
57081        if (!class_exists($extensionConfiguration->className())) {
57082            throw new Exception(sprintf('Class "%s" does not exist', $extensionConfiguration->className()));
57083        }
57084    }
57085}
57086<?php
57087
57088declare (strict_types=1);
57089/*
57090 * This file is part of PHPUnit.
57091 *
57092 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57093 *
57094 * For the full copyright and license information, please view the LICENSE
57095 * file that was distributed with this source code.
57096 */
57097namespace PHPUnit\Runner\Filter;
57098
57099use function in_array;
57100/**
57101 * @internal This class is not covered by the backward compatibility promise for PHPUnit
57102 */
57103final class ExcludeGroupFilterIterator extends \PHPUnit\Runner\Filter\GroupFilterIterator
57104{
57105    protected function doAccept(string $hash) : bool
57106    {
57107        return !in_array($hash, $this->groupTests, \true);
57108    }
57109}
57110<?php
57111
57112declare (strict_types=1);
57113/*
57114 * This file is part of PHPUnit.
57115 *
57116 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57117 *
57118 * For the full copyright and license information, please view the LICENSE
57119 * file that was distributed with this source code.
57120 */
57121namespace PHPUnit\Runner\Filter;
57122
57123use function in_array;
57124/**
57125 * @internal This class is not covered by the backward compatibility promise for PHPUnit
57126 */
57127final class IncludeGroupFilterIterator extends \PHPUnit\Runner\Filter\GroupFilterIterator
57128{
57129    protected function doAccept(string $hash) : bool
57130    {
57131        return in_array($hash, $this->groupTests, \true);
57132    }
57133}
57134<?php
57135
57136declare (strict_types=1);
57137/*
57138 * This file is part of PHPUnit.
57139 *
57140 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57141 *
57142 * For the full copyright and license information, please view the LICENSE
57143 * file that was distributed with this source code.
57144 */
57145namespace PHPUnit\Runner\Filter;
57146
57147use function assert;
57148use function sprintf;
57149use FilterIterator;
57150use Iterator;
57151use PHPUnit\Framework\TestSuite;
57152use PHPUnit\Runner\Exception;
57153use RecursiveFilterIterator;
57154use ReflectionClass;
57155/**
57156 * @internal This class is not covered by the backward compatibility promise for PHPUnit
57157 */
57158final class Factory
57159{
57160    /**
57161     * @psalm-var array<int,array{0: \ReflectionClass, 1: array|string}>
57162     */
57163    private $filters = [];
57164    /**
57165     * @param array|string $args
57166     *
57167     * @throws Exception
57168     */
57169    public function addFilter(ReflectionClass $filter, $args) : void
57170    {
57171        if (!$filter->isSubclassOf(RecursiveFilterIterator::class)) {
57172            throw new Exception(sprintf('Class "%s" does not extend RecursiveFilterIterator', $filter->name));
57173        }
57174        $this->filters[] = [$filter, $args];
57175    }
57176    public function factory(Iterator $iterator, TestSuite $suite) : FilterIterator
57177    {
57178        foreach ($this->filters as $filter) {
57179            [$class, $args] = $filter;
57180            $iterator = $class->newInstance($iterator, $args, $suite);
57181        }
57182        assert($iterator instanceof FilterIterator);
57183        return $iterator;
57184    }
57185}
57186<?php
57187
57188declare (strict_types=1);
57189/*
57190 * This file is part of PHPUnit.
57191 *
57192 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57193 *
57194 * For the full copyright and license information, please view the LICENSE
57195 * file that was distributed with this source code.
57196 */
57197namespace PHPUnit\Runner\Filter;
57198
57199use function array_map;
57200use function array_merge;
57201use function in_array;
57202use function spl_object_hash;
57203use PHPUnit\Framework\TestSuite;
57204use RecursiveFilterIterator;
57205use RecursiveIterator;
57206/**
57207 * @internal This class is not covered by the backward compatibility promise for PHPUnit
57208 */
57209abstract class GroupFilterIterator extends RecursiveFilterIterator
57210{
57211    /**
57212     * @var string[]
57213     */
57214    protected $groupTests = [];
57215    public function __construct(RecursiveIterator $iterator, array $groups, TestSuite $suite)
57216    {
57217        parent::__construct($iterator);
57218        foreach ($suite->getGroupDetails() as $group => $tests) {
57219            if (in_array((string) $group, $groups, \true)) {
57220                $testHashes = array_map('spl_object_hash', $tests);
57221                $this->groupTests = array_merge($this->groupTests, $testHashes);
57222            }
57223        }
57224    }
57225    public function accept() : bool
57226    {
57227        $test = $this->getInnerIterator()->current();
57228        if ($test instanceof TestSuite) {
57229            return \true;
57230        }
57231        return $this->doAccept(spl_object_hash($test));
57232    }
57233    protected abstract function doAccept(string $hash);
57234}
57235<?php
57236
57237declare (strict_types=1);
57238/*
57239 * This file is part of PHPUnit.
57240 *
57241 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57242 *
57243 * For the full copyright and license information, please view the LICENSE
57244 * file that was distributed with this source code.
57245 */
57246namespace PHPUnit\Runner\Filter;
57247
57248use function end;
57249use function implode;
57250use function preg_match;
57251use function sprintf;
57252use function str_replace;
57253use Exception;
57254use PHPUnit\Framework\ErrorTestCase;
57255use PHPUnit\Framework\TestSuite;
57256use PHPUnit\Framework\WarningTestCase;
57257use PHPUnit\Util\RegularExpression;
57258use RecursiveFilterIterator;
57259use RecursiveIterator;
57260/**
57261 * @internal This class is not covered by the backward compatibility promise for PHPUnit
57262 */
57263final class NameFilterIterator extends RecursiveFilterIterator
57264{
57265    /**
57266     * @var string
57267     */
57268    private $filter;
57269    /**
57270     * @var int
57271     */
57272    private $filterMin;
57273    /**
57274     * @var int
57275     */
57276    private $filterMax;
57277    /**
57278     * @throws Exception
57279     */
57280    public function __construct(RecursiveIterator $iterator, string $filter)
57281    {
57282        parent::__construct($iterator);
57283        $this->setFilter($filter);
57284    }
57285    /**
57286     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
57287     */
57288    public function accept() : bool
57289    {
57290        $test = $this->getInnerIterator()->current();
57291        if ($test instanceof TestSuite) {
57292            return \true;
57293        }
57294        $tmp = \PHPUnit\Util\Test::describe($test);
57295        if ($test instanceof ErrorTestCase || $test instanceof WarningTestCase) {
57296            $name = $test->getMessage();
57297        } elseif ($tmp[0] !== '') {
57298            $name = implode('::', $tmp);
57299        } else {
57300            $name = $tmp[1];
57301        }
57302        $accepted = @preg_match($this->filter, $name, $matches);
57303        if ($accepted && isset($this->filterMax)) {
57304            $set = end($matches);
57305            $accepted = $set >= $this->filterMin && $set <= $this->filterMax;
57306        }
57307        return (bool) $accepted;
57308    }
57309    /**
57310     * @throws Exception
57311     */
57312    private function setFilter(string $filter) : void
57313    {
57314        if (RegularExpression::safeMatch($filter, '') === \false) {
57315            // Handles:
57316            //  * testAssertEqualsSucceeds#4
57317            //  * testAssertEqualsSucceeds#4-8
57318            if (preg_match('/^(.*?)#(\\d+)(?:-(\\d+))?$/', $filter, $matches)) {
57319                if (isset($matches[3]) && $matches[2] < $matches[3]) {
57320                    $filter = sprintf('%s.*with data set #(\\d+)$', $matches[1]);
57321                    $this->filterMin = (int) $matches[2];
57322                    $this->filterMax = (int) $matches[3];
57323                } else {
57324                    $filter = sprintf('%s.*with data set #%s$', $matches[1], $matches[2]);
57325                }
57326            } elseif (preg_match('/^(.*?)@(.+)$/', $filter, $matches)) {
57327                $filter = sprintf('%s.*with data set "%s"$', $matches[1], $matches[2]);
57328            }
57329            // Escape delimiters in regular expression. Do NOT use preg_quote,
57330            // to keep magic characters.
57331            $filter = sprintf('/%s/i', str_replace('/', '\\/', $filter));
57332        }
57333        $this->filter = $filter;
57334    }
57335}
57336<?php
57337
57338declare (strict_types=1);
57339/*
57340 * This file is part of PHPUnit.
57341 *
57342 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57343 *
57344 * For the full copyright and license information, please view the LICENSE
57345 * file that was distributed with this source code.
57346 */
57347namespace PHPUnit\Runner;
57348
57349use function array_slice;
57350use function dirname;
57351use function explode;
57352use function implode;
57353use function strpos;
57354use PHPUnit\SebastianBergmann\Version as VersionId;
57355/**
57356 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
57357 */
57358final class Version
57359{
57360    /**
57361     * @var string
57362     */
57363    private static $pharVersion = '9.5.10';
57364    /**
57365     * @var string
57366     */
57367    private static $version = '';
57368    /**
57369     * Returns the current version of PHPUnit.
57370     */
57371    public static function id() : string
57372    {
57373        if (self::$pharVersion !== '') {
57374            return self::$pharVersion;
57375        }
57376        if (self::$version === '') {
57377            self::$version = (new VersionId('9.5.10', dirname(__DIR__, 2)))->getVersion();
57378        }
57379        return self::$version;
57380    }
57381    public static function series() : string
57382    {
57383        if (strpos(self::id(), '-')) {
57384            $version = explode('-', self::id())[0];
57385        } else {
57386            $version = self::id();
57387        }
57388        return implode('.', array_slice(explode('.', $version), 0, 2));
57389    }
57390    public static function getVersionString() : string
57391    {
57392        return 'PHPUnit ' . self::id() . ' by Sebastian Bergmann and contributors.';
57393    }
57394}
57395<?php
57396
57397declare (strict_types=1);
57398/*
57399 * This file is part of PHPUnit.
57400 *
57401 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57402 *
57403 * For the full copyright and license information, please view the LICENSE
57404 * file that was distributed with this source code.
57405 */
57406namespace PHPUnit\Runner;
57407
57408use const DIRECTORY_SEPARATOR;
57409use const LOCK_EX;
57410use function assert;
57411use function dirname;
57412use function file_get_contents;
57413use function file_put_contents;
57414use function in_array;
57415use function is_array;
57416use function is_dir;
57417use function is_file;
57418use function json_decode;
57419use function json_encode;
57420use PHPUnit\Util\Filesystem;
57421/**
57422 * @internal This class is not covered by the backward compatibility promise for PHPUnit
57423 */
57424final class DefaultTestResultCache implements \PHPUnit\Runner\TestResultCache
57425{
57426    /**
57427     * @var int
57428     */
57429    private const VERSION = 1;
57430    /**
57431     * @psalm-var list<int>
57432     */
57433    private const ALLOWED_TEST_STATUSES = [\PHPUnit\Runner\BaseTestRunner::STATUS_SKIPPED, \PHPUnit\Runner\BaseTestRunner::STATUS_INCOMPLETE, \PHPUnit\Runner\BaseTestRunner::STATUS_FAILURE, \PHPUnit\Runner\BaseTestRunner::STATUS_ERROR, \PHPUnit\Runner\BaseTestRunner::STATUS_RISKY, \PHPUnit\Runner\BaseTestRunner::STATUS_WARNING];
57434    /**
57435     * @var string
57436     */
57437    private const DEFAULT_RESULT_CACHE_FILENAME = '.phpunit.result.cache';
57438    /**
57439     * @var string
57440     */
57441    private $cacheFilename;
57442    /**
57443     * @psalm-var array<string, int>
57444     */
57445    private $defects = [];
57446    /**
57447     * @psalm-var array<string, float>
57448     */
57449    private $times = [];
57450    public function __construct(?string $filepath = null)
57451    {
57452        if ($filepath !== null && is_dir($filepath)) {
57453            $filepath .= \DIRECTORY_SEPARATOR . self::DEFAULT_RESULT_CACHE_FILENAME;
57454        }
57455        $this->cacheFilename = $filepath ?? $_ENV['PHPUNIT_RESULT_CACHE'] ?? self::DEFAULT_RESULT_CACHE_FILENAME;
57456    }
57457    public function setState(string $testName, int $state) : void
57458    {
57459        if (!in_array($state, self::ALLOWED_TEST_STATUSES, \true)) {
57460            return;
57461        }
57462        $this->defects[$testName] = $state;
57463    }
57464    public function getState(string $testName) : int
57465    {
57466        return $this->defects[$testName] ?? \PHPUnit\Runner\BaseTestRunner::STATUS_UNKNOWN;
57467    }
57468    public function setTime(string $testName, float $time) : void
57469    {
57470        $this->times[$testName] = $time;
57471    }
57472    public function getTime(string $testName) : float
57473    {
57474        return $this->times[$testName] ?? 0.0;
57475    }
57476    public function load() : void
57477    {
57478        if (!is_file($this->cacheFilename)) {
57479            return;
57480        }
57481        $data = json_decode(file_get_contents($this->cacheFilename), \true);
57482        if ($data === null) {
57483            return;
57484        }
57485        if (!isset($data['version'])) {
57486            return;
57487        }
57488        if ($data['version'] !== self::VERSION) {
57489            return;
57490        }
57491        assert(isset($data['defects']) && is_array($data['defects']));
57492        assert(isset($data['times']) && is_array($data['times']));
57493        $this->defects = $data['defects'];
57494        $this->times = $data['times'];
57495    }
57496    /**
57497     * @throws Exception
57498     */
57499    public function persist() : void
57500    {
57501        if (!Filesystem::createDirectory(dirname($this->cacheFilename))) {
57502            throw new \PHPUnit\Runner\Exception(\sprintf('Cannot create directory "%s" for result cache file', $this->cacheFilename));
57503        }
57504        file_put_contents($this->cacheFilename, json_encode(['version' => self::VERSION, 'defects' => $this->defects, 'times' => $this->times]), \LOCK_EX);
57505    }
57506}
57507<?php
57508
57509declare (strict_types=1);
57510/*
57511 * This file is part of PHPUnit.
57512 *
57513 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57514 *
57515 * For the full copyright and license information, please view the LICENSE
57516 * file that was distributed with this source code.
57517 */
57518namespace PHPUnit\Runner;
57519
57520use RuntimeException;
57521/**
57522 * @internal This class is not covered by the backward compatibility promise for PHPUnit
57523 */
57524final class Exception extends RuntimeException implements \PHPUnit\Exception
57525{
57526}
57527<?php
57528
57529declare (strict_types=1);
57530/*
57531 * This file is part of PHPUnit.
57532 *
57533 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57534 *
57535 * For the full copyright and license information, please view the LICENSE
57536 * file that was distributed with this source code.
57537 */
57538namespace PHPUnit\Runner;
57539
57540/**
57541 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
57542 */
57543interface AfterTestErrorHook extends \PHPUnit\Runner\TestHook
57544{
57545    public function executeAfterTestError(string $test, string $message, float $time) : void;
57546}
57547<?php
57548
57549declare (strict_types=1);
57550/*
57551 * This file is part of PHPUnit.
57552 *
57553 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57554 *
57555 * For the full copyright and license information, please view the LICENSE
57556 * file that was distributed with this source code.
57557 */
57558namespace PHPUnit\Runner;
57559
57560/**
57561 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
57562 */
57563interface AfterTestWarningHook extends \PHPUnit\Runner\TestHook
57564{
57565    public function executeAfterTestWarning(string $test, string $message, float $time) : void;
57566}
57567<?php
57568
57569declare (strict_types=1);
57570/*
57571 * This file is part of PHPUnit.
57572 *
57573 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57574 *
57575 * For the full copyright and license information, please view the LICENSE
57576 * file that was distributed with this source code.
57577 */
57578namespace PHPUnit\Runner;
57579
57580/**
57581 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
57582 */
57583interface AfterTestFailureHook extends \PHPUnit\Runner\TestHook
57584{
57585    public function executeAfterTestFailure(string $test, string $message, float $time) : void;
57586}
57587<?php
57588
57589declare (strict_types=1);
57590/*
57591 * This file is part of PHPUnit.
57592 *
57593 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57594 *
57595 * For the full copyright and license information, please view the LICENSE
57596 * file that was distributed with this source code.
57597 */
57598namespace PHPUnit\Runner;
57599
57600/**
57601 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
57602 */
57603interface AfterIncompleteTestHook extends \PHPUnit\Runner\TestHook
57604{
57605    public function executeAfterIncompleteTest(string $test, string $message, float $time) : void;
57606}
57607<?php
57608
57609declare (strict_types=1);
57610/*
57611 * This file is part of PHPUnit.
57612 *
57613 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57614 *
57615 * For the full copyright and license information, please view the LICENSE
57616 * file that was distributed with this source code.
57617 */
57618namespace PHPUnit\Runner;
57619
57620/**
57621 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
57622 */
57623interface AfterSkippedTestHook extends \PHPUnit\Runner\TestHook
57624{
57625    public function executeAfterSkippedTest(string $test, string $message, float $time) : void;
57626}
57627<?php
57628
57629declare (strict_types=1);
57630/*
57631 * This file is part of PHPUnit.
57632 *
57633 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57634 *
57635 * For the full copyright and license information, please view the LICENSE
57636 * file that was distributed with this source code.
57637 */
57638namespace PHPUnit\Runner;
57639
57640use PHPUnit\Framework\AssertionFailedError;
57641use PHPUnit\Framework\Test;
57642use PHPUnit\Framework\TestListener;
57643use PHPUnit\Framework\TestSuite;
57644use PHPUnit\Framework\Warning;
57645use PHPUnit\Util\Test as TestUtil;
57646use Throwable;
57647/**
57648 * @internal This class is not covered by the backward compatibility promise for PHPUnit
57649 */
57650final class TestListenerAdapter implements TestListener
57651{
57652    /**
57653     * @var TestHook[]
57654     */
57655    private $hooks = [];
57656    /**
57657     * @var bool
57658     */
57659    private $lastTestWasNotSuccessful;
57660    public function add(\PHPUnit\Runner\TestHook $hook) : void
57661    {
57662        $this->hooks[] = $hook;
57663    }
57664    public function startTest(Test $test) : void
57665    {
57666        foreach ($this->hooks as $hook) {
57667            if ($hook instanceof \PHPUnit\Runner\BeforeTestHook) {
57668                $hook->executeBeforeTest(TestUtil::describeAsString($test));
57669            }
57670        }
57671        $this->lastTestWasNotSuccessful = \false;
57672    }
57673    public function addError(Test $test, Throwable $t, float $time) : void
57674    {
57675        foreach ($this->hooks as $hook) {
57676            if ($hook instanceof \PHPUnit\Runner\AfterTestErrorHook) {
57677                $hook->executeAfterTestError(TestUtil::describeAsString($test), $t->getMessage(), $time);
57678            }
57679        }
57680        $this->lastTestWasNotSuccessful = \true;
57681    }
57682    public function addWarning(Test $test, Warning $e, float $time) : void
57683    {
57684        foreach ($this->hooks as $hook) {
57685            if ($hook instanceof \PHPUnit\Runner\AfterTestWarningHook) {
57686                $hook->executeAfterTestWarning(TestUtil::describeAsString($test), $e->getMessage(), $time);
57687            }
57688        }
57689        $this->lastTestWasNotSuccessful = \true;
57690    }
57691    public function addFailure(Test $test, AssertionFailedError $e, float $time) : void
57692    {
57693        foreach ($this->hooks as $hook) {
57694            if ($hook instanceof \PHPUnit\Runner\AfterTestFailureHook) {
57695                $hook->executeAfterTestFailure(TestUtil::describeAsString($test), $e->getMessage(), $time);
57696            }
57697        }
57698        $this->lastTestWasNotSuccessful = \true;
57699    }
57700    public function addIncompleteTest(Test $test, Throwable $t, float $time) : void
57701    {
57702        foreach ($this->hooks as $hook) {
57703            if ($hook instanceof \PHPUnit\Runner\AfterIncompleteTestHook) {
57704                $hook->executeAfterIncompleteTest(TestUtil::describeAsString($test), $t->getMessage(), $time);
57705            }
57706        }
57707        $this->lastTestWasNotSuccessful = \true;
57708    }
57709    public function addRiskyTest(Test $test, Throwable $t, float $time) : void
57710    {
57711        foreach ($this->hooks as $hook) {
57712            if ($hook instanceof \PHPUnit\Runner\AfterRiskyTestHook) {
57713                $hook->executeAfterRiskyTest(TestUtil::describeAsString($test), $t->getMessage(), $time);
57714            }
57715        }
57716        $this->lastTestWasNotSuccessful = \true;
57717    }
57718    public function addSkippedTest(Test $test, Throwable $t, float $time) : void
57719    {
57720        foreach ($this->hooks as $hook) {
57721            if ($hook instanceof \PHPUnit\Runner\AfterSkippedTestHook) {
57722                $hook->executeAfterSkippedTest(TestUtil::describeAsString($test), $t->getMessage(), $time);
57723            }
57724        }
57725        $this->lastTestWasNotSuccessful = \true;
57726    }
57727    public function endTest(Test $test, float $time) : void
57728    {
57729        if (!$this->lastTestWasNotSuccessful) {
57730            foreach ($this->hooks as $hook) {
57731                if ($hook instanceof \PHPUnit\Runner\AfterSuccessfulTestHook) {
57732                    $hook->executeAfterSuccessfulTest(TestUtil::describeAsString($test), $time);
57733                }
57734            }
57735        }
57736        foreach ($this->hooks as $hook) {
57737            if ($hook instanceof \PHPUnit\Runner\AfterTestHook) {
57738                $hook->executeAfterTest(TestUtil::describeAsString($test), $time);
57739            }
57740        }
57741    }
57742    public function startTestSuite(TestSuite $suite) : void
57743    {
57744    }
57745    public function endTestSuite(TestSuite $suite) : void
57746    {
57747    }
57748}
57749<?php
57750
57751declare (strict_types=1);
57752/*
57753 * This file is part of PHPUnit.
57754 *
57755 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57756 *
57757 * For the full copyright and license information, please view the LICENSE
57758 * file that was distributed with this source code.
57759 */
57760namespace PHPUnit\Runner;
57761
57762/**
57763 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
57764 */
57765interface AfterRiskyTestHook extends \PHPUnit\Runner\TestHook
57766{
57767    public function executeAfterRiskyTest(string $test, string $message, float $time) : void;
57768}
57769<?php
57770
57771declare (strict_types=1);
57772/*
57773 * This file is part of PHPUnit.
57774 *
57775 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57776 *
57777 * For the full copyright and license information, please view the LICENSE
57778 * file that was distributed with this source code.
57779 */
57780namespace PHPUnit\Runner;
57781
57782/**
57783 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
57784 */
57785interface BeforeFirstTestHook extends \PHPUnit\Runner\Hook
57786{
57787    public function executeBeforeFirstTest() : void;
57788}
57789<?php
57790
57791declare (strict_types=1);
57792/*
57793 * This file is part of PHPUnit.
57794 *
57795 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57796 *
57797 * For the full copyright and license information, please view the LICENSE
57798 * file that was distributed with this source code.
57799 */
57800namespace PHPUnit\Runner;
57801
57802/**
57803 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
57804 */
57805interface AfterSuccessfulTestHook extends \PHPUnit\Runner\TestHook
57806{
57807    public function executeAfterSuccessfulTest(string $test, float $time) : void;
57808}
57809<?php
57810
57811declare (strict_types=1);
57812/*
57813 * This file is part of PHPUnit.
57814 *
57815 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57816 *
57817 * For the full copyright and license information, please view the LICENSE
57818 * file that was distributed with this source code.
57819 */
57820namespace PHPUnit\Runner;
57821
57822/**
57823 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
57824 */
57825interface TestHook extends \PHPUnit\Runner\Hook
57826{
57827}
57828<?php
57829
57830declare (strict_types=1);
57831/*
57832 * This file is part of PHPUnit.
57833 *
57834 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57835 *
57836 * For the full copyright and license information, please view the LICENSE
57837 * file that was distributed with this source code.
57838 */
57839namespace PHPUnit\Runner;
57840
57841/**
57842 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
57843 */
57844interface BeforeTestHook extends \PHPUnit\Runner\TestHook
57845{
57846    public function executeBeforeTest(string $test) : void;
57847}
57848<?php
57849
57850declare (strict_types=1);
57851/*
57852 * This file is part of PHPUnit.
57853 *
57854 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57855 *
57856 * For the full copyright and license information, please view the LICENSE
57857 * file that was distributed with this source code.
57858 */
57859namespace PHPUnit\Runner;
57860
57861/**
57862 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
57863 */
57864interface AfterTestHook extends \PHPUnit\Runner\TestHook
57865{
57866    /**
57867     * This hook will fire after any test, regardless of the result.
57868     *
57869     * For more fine grained control, have a look at the other hooks
57870     * that extend PHPUnit\Runner\Hook.
57871     */
57872    public function executeAfterTest(string $test, float $time) : void;
57873}
57874<?php
57875
57876declare (strict_types=1);
57877/*
57878 * This file is part of PHPUnit.
57879 *
57880 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57881 *
57882 * For the full copyright and license information, please view the LICENSE
57883 * file that was distributed with this source code.
57884 */
57885namespace PHPUnit\Runner;
57886
57887/**
57888 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
57889 */
57890interface Hook
57891{
57892}
57893<?php
57894
57895declare (strict_types=1);
57896/*
57897 * This file is part of PHPUnit.
57898 *
57899 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57900 *
57901 * For the full copyright and license information, please view the LICENSE
57902 * file that was distributed with this source code.
57903 */
57904namespace PHPUnit\Runner;
57905
57906/**
57907 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
57908 */
57909interface AfterLastTestHook extends \PHPUnit\Runner\Hook
57910{
57911    public function executeAfterLastTest() : void;
57912}
57913<?php
57914
57915declare (strict_types=1);
57916/*
57917 * This file is part of PHPUnit.
57918 *
57919 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57920 *
57921 * For the full copyright and license information, please view the LICENSE
57922 * file that was distributed with this source code.
57923 */
57924namespace PHPUnit\Runner;
57925
57926/**
57927 * @internal This class is not covered by the backward compatibility promise for PHPUnit
57928 */
57929final class NullTestResultCache implements \PHPUnit\Runner\TestResultCache
57930{
57931    public function setState(string $testName, int $state) : void
57932    {
57933    }
57934    public function getState(string $testName) : int
57935    {
57936        return \PHPUnit\Runner\BaseTestRunner::STATUS_UNKNOWN;
57937    }
57938    public function setTime(string $testName, float $time) : void
57939    {
57940    }
57941    public function getTime(string $testName) : float
57942    {
57943        return 0;
57944    }
57945    public function load() : void
57946    {
57947    }
57948    public function persist() : void
57949    {
57950    }
57951}
57952<?php
57953
57954declare (strict_types=1);
57955/*
57956 * This file is part of PHPUnit.
57957 *
57958 * (c) Sebastian Bergmann <sebastian@phpunit.de>
57959 *
57960 * For the full copyright and license information, please view the LICENSE
57961 * file that was distributed with this source code.
57962 */
57963namespace PHPUnit\Runner;
57964
57965use const DEBUG_BACKTRACE_IGNORE_ARGS;
57966use const DIRECTORY_SEPARATOR;
57967use function array_merge;
57968use function basename;
57969use function debug_backtrace;
57970use function defined;
57971use function dirname;
57972use function explode;
57973use function extension_loaded;
57974use function file;
57975use function file_get_contents;
57976use function file_put_contents;
57977use function is_array;
57978use function is_file;
57979use function is_readable;
57980use function is_string;
57981use function ltrim;
57982use function phpversion;
57983use function preg_match;
57984use function preg_replace;
57985use function preg_split;
57986use function realpath;
57987use function rtrim;
57988use function sprintf;
57989use function str_replace;
57990use function strncasecmp;
57991use function strpos;
57992use function substr;
57993use function trim;
57994use function unlink;
57995use function unserialize;
57996use function var_export;
57997use function version_compare;
57998use PHPUnit\Framework\Assert;
57999use PHPUnit\Framework\AssertionFailedError;
58000use PHPUnit\Framework\ExecutionOrderDependency;
58001use PHPUnit\Framework\ExpectationFailedException;
58002use PHPUnit\Framework\IncompleteTestError;
58003use PHPUnit\Framework\PHPTAssertionFailedError;
58004use PHPUnit\Framework\Reorderable;
58005use PHPUnit\Framework\SelfDescribing;
58006use PHPUnit\Framework\SkippedTestError;
58007use PHPUnit\Framework\SyntheticSkippedError;
58008use PHPUnit\Framework\Test;
58009use PHPUnit\Framework\TestResult;
58010use PHPUnit\Util\PHP\AbstractPhpProcess;
58011use PHPUnit\SebastianBergmann\CodeCoverage\RawCodeCoverageData;
58012use PHPUnit\SebastianBergmann\Template\Template;
58013use PHPUnit\SebastianBergmann\Timer\Timer;
58014use Throwable;
58015/**
58016 * @internal This class is not covered by the backward compatibility promise for PHPUnit
58017 */
58018final class PhptTestCase implements Reorderable, SelfDescribing, Test
58019{
58020    /**
58021     * @var string
58022     */
58023    private $filename;
58024    /**
58025     * @var AbstractPhpProcess
58026     */
58027    private $phpUtil;
58028    /**
58029     * @var string
58030     */
58031    private $output = '';
58032    /**
58033     * Constructs a test case with the given filename.
58034     *
58035     * @throws Exception
58036     */
58037    public function __construct(string $filename, AbstractPhpProcess $phpUtil = null)
58038    {
58039        if (!is_file($filename)) {
58040            throw new \PHPUnit\Runner\Exception(sprintf('File "%s" does not exist.', $filename));
58041        }
58042        $this->filename = $filename;
58043        $this->phpUtil = $phpUtil ?: AbstractPhpProcess::factory();
58044    }
58045    /**
58046     * Counts the number of test cases executed by run(TestResult result).
58047     */
58048    public function count() : int
58049    {
58050        return 1;
58051    }
58052    /**
58053     * Runs a test and collects its result in a TestResult instance.
58054     *
58055     * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException
58056     * @throws \SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException
58057     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
58058     * @throws Exception
58059     */
58060    public function run(TestResult $result = null) : TestResult
58061    {
58062        if ($result === null) {
58063            $result = new TestResult();
58064        }
58065        try {
58066            $sections = $this->parse();
58067        } catch (\PHPUnit\Runner\Exception $e) {
58068            $result->startTest($this);
58069            $result->addFailure($this, new SkippedTestError($e->getMessage()), 0);
58070            $result->endTest($this, 0);
58071            return $result;
58072        }
58073        $code = $this->render($sections['FILE']);
58074        $xfail = \false;
58075        $settings = $this->parseIniSection($this->settings($result->getCollectCodeCoverageInformation()));
58076        $result->startTest($this);
58077        if (isset($sections['INI'])) {
58078            $settings = $this->parseIniSection($sections['INI'], $settings);
58079        }
58080        if (isset($sections['ENV'])) {
58081            $env = $this->parseEnvSection($sections['ENV']);
58082            $this->phpUtil->setEnv($env);
58083        }
58084        $this->phpUtil->setUseStderrRedirection(\true);
58085        if ($result->enforcesTimeLimit()) {
58086            $this->phpUtil->setTimeout($result->getTimeoutForLargeTests());
58087        }
58088        $skip = $this->runSkip($sections, $result, $settings);
58089        if ($skip) {
58090            return $result;
58091        }
58092        if (isset($sections['XFAIL'])) {
58093            $xfail = trim($sections['XFAIL']);
58094        }
58095        if (isset($sections['STDIN'])) {
58096            $this->phpUtil->setStdin($sections['STDIN']);
58097        }
58098        if (isset($sections['ARGS'])) {
58099            $this->phpUtil->setArgs($sections['ARGS']);
58100        }
58101        if ($result->getCollectCodeCoverageInformation()) {
58102            $codeCoverageCacheDirectory = null;
58103            $pathCoverage = \false;
58104            $codeCoverage = $result->getCodeCoverage();
58105            if ($codeCoverage) {
58106                if ($codeCoverage->cachesStaticAnalysis()) {
58107                    $codeCoverageCacheDirectory = $codeCoverage->cacheDirectory();
58108                }
58109                $pathCoverage = $codeCoverage->collectsBranchAndPathCoverage();
58110            }
58111            $this->renderForCoverage($code, $pathCoverage, $codeCoverageCacheDirectory);
58112        }
58113        $timer = new Timer();
58114        $timer->start();
58115        $jobResult = $this->phpUtil->runJob($code, $this->stringifyIni($settings));
58116        $time = $timer->stop()->asSeconds();
58117        $this->output = $jobResult['stdout'] ?? '';
58118        if (isset($codeCoverage) && ($coverage = $this->cleanupForCoverage())) {
58119            $codeCoverage->append($coverage, $this, \true, [], []);
58120        }
58121        try {
58122            $this->assertPhptExpectation($sections, $this->output);
58123        } catch (AssertionFailedError $e) {
58124            $failure = $e;
58125            if ($xfail !== \false) {
58126                $failure = new IncompleteTestError($xfail, 0, $e);
58127            } elseif ($e instanceof ExpectationFailedException) {
58128                $comparisonFailure = $e->getComparisonFailure();
58129                if ($comparisonFailure) {
58130                    $diff = $comparisonFailure->getDiff();
58131                } else {
58132                    $diff = $e->getMessage();
58133                }
58134                $hint = $this->getLocationHintFromDiff($diff, $sections);
58135                $trace = array_merge($hint, debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS));
58136                $failure = new PHPTAssertionFailedError($e->getMessage(), 0, $trace[0]['file'], $trace[0]['line'], $trace, $comparisonFailure ? $diff : '');
58137            }
58138            $result->addFailure($this, $failure, $time);
58139        } catch (Throwable $t) {
58140            $result->addError($this, $t, $time);
58141        }
58142        if ($xfail !== \false && $result->allCompletelyImplemented()) {
58143            $result->addFailure($this, new IncompleteTestError('XFAIL section but test passes'), $time);
58144        }
58145        $this->runClean($sections, $result->getCollectCodeCoverageInformation());
58146        $result->endTest($this, $time);
58147        return $result;
58148    }
58149    /**
58150     * Returns the name of the test case.
58151     */
58152    public function getName() : string
58153    {
58154        return $this->toString();
58155    }
58156    /**
58157     * Returns a string representation of the test case.
58158     */
58159    public function toString() : string
58160    {
58161        return $this->filename;
58162    }
58163    public function usesDataProvider() : bool
58164    {
58165        return \false;
58166    }
58167    public function getNumAssertions() : int
58168    {
58169        return 1;
58170    }
58171    public function getActualOutput() : string
58172    {
58173        return $this->output;
58174    }
58175    public function hasOutput() : bool
58176    {
58177        return !empty($this->output);
58178    }
58179    public function sortId() : string
58180    {
58181        return $this->filename;
58182    }
58183    /**
58184     * @return list<ExecutionOrderDependency>
58185     */
58186    public function provides() : array
58187    {
58188        return [];
58189    }
58190    /**
58191     * @return list<ExecutionOrderDependency>
58192     */
58193    public function requires() : array
58194    {
58195        return [];
58196    }
58197    /**
58198     * Parse --INI-- section key value pairs and return as array.
58199     *
58200     * @param array|string $content
58201     */
58202    private function parseIniSection($content, array $ini = []) : array
58203    {
58204        if (is_string($content)) {
58205            $content = explode("\n", trim($content));
58206        }
58207        foreach ($content as $setting) {
58208            if (strpos($setting, '=') === \false) {
58209                continue;
58210            }
58211            $setting = explode('=', $setting, 2);
58212            $name = trim($setting[0]);
58213            $value = trim($setting[1]);
58214            if ($name === 'extension' || $name === 'zend_extension') {
58215                if (!isset($ini[$name])) {
58216                    $ini[$name] = [];
58217                }
58218                $ini[$name][] = $value;
58219                continue;
58220            }
58221            $ini[$name] = $value;
58222        }
58223        return $ini;
58224    }
58225    private function parseEnvSection(string $content) : array
58226    {
58227        $env = [];
58228        foreach (explode("\n", trim($content)) as $e) {
58229            $e = explode('=', trim($e), 2);
58230            if (!empty($e[0]) && isset($e[1])) {
58231                $env[$e[0]] = $e[1];
58232            }
58233        }
58234        return $env;
58235    }
58236    /**
58237     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
58238     * @throws Exception
58239     * @throws ExpectationFailedException
58240     */
58241    private function assertPhptExpectation(array $sections, string $output) : void
58242    {
58243        $assertions = ['EXPECT' => 'assertEquals', 'EXPECTF' => 'assertStringMatchesFormat', 'EXPECTREGEX' => 'assertMatchesRegularExpression'];
58244        $actual = preg_replace('/\\r\\n/', "\n", trim($output));
58245        foreach ($assertions as $sectionName => $sectionAssertion) {
58246            if (isset($sections[$sectionName])) {
58247                $sectionContent = preg_replace('/\\r\\n/', "\n", trim($sections[$sectionName]));
58248                $expected = $sectionName === 'EXPECTREGEX' ? "/{$sectionContent}/" : $sectionContent;
58249                if ($expected === '') {
58250                    throw new \PHPUnit\Runner\Exception('No PHPT expectation found');
58251                }
58252                Assert::$sectionAssertion($expected, $actual);
58253                return;
58254            }
58255        }
58256        throw new \PHPUnit\Runner\Exception('No PHPT assertion found');
58257    }
58258    /**
58259     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
58260     */
58261    private function runSkip(array &$sections, TestResult $result, array $settings) : bool
58262    {
58263        if (!isset($sections['SKIPIF'])) {
58264            return \false;
58265        }
58266        $skipif = $this->render($sections['SKIPIF']);
58267        $jobResult = $this->phpUtil->runJob($skipif, $this->stringifyIni($settings));
58268        if (!strncasecmp('skip', ltrim($jobResult['stdout']), 4)) {
58269            $message = '';
58270            if (preg_match('/^\\s*skip\\s*(.+)\\s*/i', $jobResult['stdout'], $skipMatch)) {
58271                $message = substr($skipMatch[1], 2);
58272            }
58273            $hint = $this->getLocationHint($message, $sections, 'SKIPIF');
58274            $trace = array_merge($hint, debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS));
58275            $result->addFailure($this, new SyntheticSkippedError($message, 0, $trace[0]['file'], $trace[0]['line'], $trace), 0);
58276            $result->endTest($this, 0);
58277            return \true;
58278        }
58279        return \false;
58280    }
58281    private function runClean(array &$sections, bool $collectCoverage) : void
58282    {
58283        $this->phpUtil->setStdin('');
58284        $this->phpUtil->setArgs('');
58285        if (isset($sections['CLEAN'])) {
58286            $cleanCode = $this->render($sections['CLEAN']);
58287            $this->phpUtil->runJob($cleanCode, $this->settings($collectCoverage));
58288        }
58289    }
58290    /**
58291     * @throws Exception
58292     */
58293    private function parse() : array
58294    {
58295        $sections = [];
58296        $section = '';
58297        $unsupportedSections = ['CGI', 'COOKIE', 'DEFLATE_POST', 'EXPECTHEADERS', 'EXTENSIONS', 'GET', 'GZIP_POST', 'HEADERS', 'PHPDBG', 'POST', 'POST_RAW', 'PUT', 'REDIRECTTEST', 'REQUEST'];
58298        $lineNr = 0;
58299        foreach (file($this->filename) as $line) {
58300            $lineNr++;
58301            if (preg_match('/^--([_A-Z]+)--/', $line, $result)) {
58302                $section = $result[1];
58303                $sections[$section] = '';
58304                $sections[$section . '_offset'] = $lineNr;
58305                continue;
58306            }
58307            if (empty($section)) {
58308                throw new \PHPUnit\Runner\Exception('Invalid PHPT file: empty section header');
58309            }
58310            $sections[$section] .= $line;
58311        }
58312        if (isset($sections['FILEEOF'])) {
58313            $sections['FILE'] = rtrim($sections['FILEEOF'], "\r\n");
58314            unset($sections['FILEEOF']);
58315        }
58316        $this->parseExternal($sections);
58317        if (!$this->validate($sections)) {
58318            throw new \PHPUnit\Runner\Exception('Invalid PHPT file');
58319        }
58320        foreach ($unsupportedSections as $section) {
58321            if (isset($sections[$section])) {
58322                throw new \PHPUnit\Runner\Exception("PHPUnit does not support PHPT {$section} sections");
58323            }
58324        }
58325        return $sections;
58326    }
58327    /**
58328     * @throws Exception
58329     */
58330    private function parseExternal(array &$sections) : void
58331    {
58332        $allowSections = ['FILE', 'EXPECT', 'EXPECTF', 'EXPECTREGEX'];
58333        $testDirectory = dirname($this->filename) . \DIRECTORY_SEPARATOR;
58334        foreach ($allowSections as $section) {
58335            if (isset($sections[$section . '_EXTERNAL'])) {
58336                $externalFilename = trim($sections[$section . '_EXTERNAL']);
58337                if (!is_file($testDirectory . $externalFilename) || !is_readable($testDirectory . $externalFilename)) {
58338                    throw new \PHPUnit\Runner\Exception(sprintf('Could not load --%s-- %s for PHPT file', $section . '_EXTERNAL', $testDirectory . $externalFilename));
58339                }
58340                $sections[$section] = file_get_contents($testDirectory . $externalFilename);
58341            }
58342        }
58343    }
58344    private function validate(array &$sections) : bool
58345    {
58346        $requiredSections = ['FILE', ['EXPECT', 'EXPECTF', 'EXPECTREGEX']];
58347        foreach ($requiredSections as $section) {
58348            if (is_array($section)) {
58349                $foundSection = \false;
58350                foreach ($section as $anySection) {
58351                    if (isset($sections[$anySection])) {
58352                        $foundSection = \true;
58353                        break;
58354                    }
58355                }
58356                if (!$foundSection) {
58357                    return \false;
58358                }
58359                continue;
58360            }
58361            if (!isset($sections[$section])) {
58362                return \false;
58363            }
58364        }
58365        return \true;
58366    }
58367    private function render(string $code) : string
58368    {
58369        return str_replace(['__DIR__', '__FILE__'], ["'" . dirname($this->filename) . "'", "'" . $this->filename . "'"], $code);
58370    }
58371    private function getCoverageFiles() : array
58372    {
58373        $baseDir = dirname(realpath($this->filename)) . \DIRECTORY_SEPARATOR;
58374        $basename = basename($this->filename, 'phpt');
58375        return ['coverage' => $baseDir . $basename . 'coverage', 'job' => $baseDir . $basename . 'php'];
58376    }
58377    private function renderForCoverage(string &$job, bool $pathCoverage, ?string $codeCoverageCacheDirectory) : void
58378    {
58379        $files = $this->getCoverageFiles();
58380        $template = new Template(__DIR__ . '/../Util/PHP/Template/PhptTestCase.tpl');
58381        $composerAutoload = '\'\'';
58382        if (defined('PHPUNIT_COMPOSER_INSTALL')) {
58383            $composerAutoload = var_export(PHPUNIT_COMPOSER_INSTALL, \true);
58384        }
58385        $phar = '\'\'';
58386        if (defined('__PHPUNIT_PHAR__')) {
58387            $phar = var_export(__PHPUNIT_PHAR__, \true);
58388        }
58389        $globals = '';
58390        if (!empty($GLOBALS['__PHPUNIT_BOOTSTRAP'])) {
58391            $globals = '$GLOBALS[\'__PHPUNIT_BOOTSTRAP\'] = ' . var_export($GLOBALS['__PHPUNIT_BOOTSTRAP'], \true) . ";\n";
58392        }
58393        if ($codeCoverageCacheDirectory === null) {
58394            $codeCoverageCacheDirectory = 'null';
58395        } else {
58396            $codeCoverageCacheDirectory = "'" . $codeCoverageCacheDirectory . "'";
58397        }
58398        $template->setVar(['composerAutoload' => $composerAutoload, 'phar' => $phar, 'globals' => $globals, 'job' => $files['job'], 'coverageFile' => $files['coverage'], 'driverMethod' => $pathCoverage ? 'forLineAndPathCoverage' : 'forLineCoverage', 'codeCoverageCacheDirectory' => $codeCoverageCacheDirectory]);
58399        file_put_contents($files['job'], $job);
58400        $job = $template->render();
58401    }
58402    private function cleanupForCoverage() : RawCodeCoverageData
58403    {
58404        $coverage = RawCodeCoverageData::fromXdebugWithoutPathCoverage([]);
58405        $files = $this->getCoverageFiles();
58406        if (is_file($files['coverage'])) {
58407            $buffer = @file_get_contents($files['coverage']);
58408            if ($buffer !== \false) {
58409                $coverage = @unserialize($buffer);
58410                if ($coverage === \false) {
58411                    $coverage = RawCodeCoverageData::fromXdebugWithoutPathCoverage([]);
58412                }
58413            }
58414        }
58415        foreach ($files as $file) {
58416            @unlink($file);
58417        }
58418        return $coverage;
58419    }
58420    private function stringifyIni(array $ini) : array
58421    {
58422        $settings = [];
58423        foreach ($ini as $key => $value) {
58424            if (is_array($value)) {
58425                foreach ($value as $val) {
58426                    $settings[] = $key . '=' . $val;
58427                }
58428                continue;
58429            }
58430            $settings[] = $key . '=' . $value;
58431        }
58432        return $settings;
58433    }
58434    private function getLocationHintFromDiff(string $message, array $sections) : array
58435    {
58436        $needle = '';
58437        $previousLine = '';
58438        $block = 'message';
58439        foreach (preg_split('/\\r\\n|\\r|\\n/', $message) as $line) {
58440            $line = trim($line);
58441            if ($block === 'message' && $line === '--- Expected') {
58442                $block = 'expected';
58443            }
58444            if ($block === 'expected' && $line === '@@ @@') {
58445                $block = 'diff';
58446            }
58447            if ($block === 'diff') {
58448                if (strpos($line, '+') === 0) {
58449                    $needle = $this->getCleanDiffLine($previousLine);
58450                    break;
58451                }
58452                if (strpos($line, '-') === 0) {
58453                    $needle = $this->getCleanDiffLine($line);
58454                    break;
58455                }
58456            }
58457            if (!empty($line)) {
58458                $previousLine = $line;
58459            }
58460        }
58461        return $this->getLocationHint($needle, $sections);
58462    }
58463    private function getCleanDiffLine(string $line) : string
58464    {
58465        if (preg_match('/^[\\-+]([\'\\"]?)(.*)\\1$/', $line, $matches)) {
58466            $line = $matches[2];
58467        }
58468        return $line;
58469    }
58470    private function getLocationHint(string $needle, array $sections, ?string $sectionName = null) : array
58471    {
58472        $needle = trim($needle);
58473        if (empty($needle)) {
58474            return [['file' => realpath($this->filename), 'line' => 1]];
58475        }
58476        if ($sectionName) {
58477            $search = [$sectionName];
58478        } else {
58479            $search = [
58480                // 'FILE',
58481                'EXPECT',
58482                'EXPECTF',
58483                'EXPECTREGEX',
58484            ];
58485        }
58486        $sectionOffset = null;
58487        foreach ($search as $section) {
58488            if (!isset($sections[$section])) {
58489                continue;
58490            }
58491            if (isset($sections[$section . '_EXTERNAL'])) {
58492                $externalFile = trim($sections[$section . '_EXTERNAL']);
58493                return [['file' => realpath(dirname($this->filename) . \DIRECTORY_SEPARATOR . $externalFile), 'line' => 1], ['file' => realpath($this->filename), 'line' => ($sections[$section . '_EXTERNAL_offset'] ?? 0) + 1]];
58494            }
58495            $sectionOffset = $sections[$section . '_offset'] ?? 0;
58496            $offset = $sectionOffset + 1;
58497            foreach (preg_split('/\\r\\n|\\r|\\n/', $sections[$section]) as $line) {
58498                if (strpos($line, $needle) !== \false) {
58499                    return [['file' => realpath($this->filename), 'line' => $offset]];
58500                }
58501                $offset++;
58502            }
58503        }
58504        if ($sectionName) {
58505            // String not found in specified section, show user the start of the named section
58506            return [['file' => realpath($this->filename), 'line' => $sectionOffset]];
58507        }
58508        // No section specified, show user start of code
58509        return [['file' => realpath($this->filename), 'line' => 1]];
58510    }
58511    /**
58512     * @psalm-return list<string>
58513     */
58514    private function settings(bool $collectCoverage) : array
58515    {
58516        $settings = ['allow_url_fopen=1', 'auto_append_file=', 'auto_prepend_file=', 'disable_functions=', 'display_errors=1', 'docref_ext=.html', 'docref_root=', 'error_append_string=', 'error_prepend_string=', 'error_reporting=-1', 'html_errors=0', 'log_errors=0', 'open_basedir=', 'output_buffering=Off', 'output_handler=', 'report_memleaks=0', 'report_zend_debug=0'];
58517        if (extension_loaded('pcov')) {
58518            if ($collectCoverage) {
58519                $settings[] = 'pcov.enabled=1';
58520            } else {
58521                $settings[] = 'pcov.enabled=0';
58522            }
58523        }
58524        if (extension_loaded('xdebug')) {
58525            if (version_compare(phpversion('xdebug'), '3', '>=')) {
58526                if ($collectCoverage) {
58527                    $settings[] = 'xdebug.mode=coverage';
58528                } else {
58529                    $settings[] = 'xdebug.mode=off';
58530                }
58531            } else {
58532                $settings[] = 'xdebug.default_enable=0';
58533                if ($collectCoverage) {
58534                    $settings[] = 'xdebug.coverage_enable=1';
58535                }
58536            }
58537        }
58538        return $settings;
58539    }
58540}
58541<?php
58542
58543declare (strict_types=1);
58544/*
58545 * This file is part of PHPUnit.
58546 *
58547 * (c) Sebastian Bergmann <sebastian@phpunit.de>
58548 *
58549 * For the full copyright and license information, please view the LICENSE
58550 * file that was distributed with this source code.
58551 */
58552namespace PHPUnit\Runner;
58553
58554use function is_dir;
58555use function is_file;
58556use function substr;
58557use PHPUnit\Framework\Exception;
58558use PHPUnit\Framework\TestSuite;
58559use ReflectionClass;
58560use ReflectionException;
58561use PHPUnit\SebastianBergmann\FileIterator\Facade as FileIteratorFacade;
58562/**
58563 * @internal This class is not covered by the backward compatibility promise for PHPUnit
58564 */
58565abstract class BaseTestRunner
58566{
58567    /**
58568     * @var int
58569     */
58570    public const STATUS_UNKNOWN = -1;
58571    /**
58572     * @var int
58573     */
58574    public const STATUS_PASSED = 0;
58575    /**
58576     * @var int
58577     */
58578    public const STATUS_SKIPPED = 1;
58579    /**
58580     * @var int
58581     */
58582    public const STATUS_INCOMPLETE = 2;
58583    /**
58584     * @var int
58585     */
58586    public const STATUS_FAILURE = 3;
58587    /**
58588     * @var int
58589     */
58590    public const STATUS_ERROR = 4;
58591    /**
58592     * @var int
58593     */
58594    public const STATUS_RISKY = 5;
58595    /**
58596     * @var int
58597     */
58598    public const STATUS_WARNING = 6;
58599    /**
58600     * @var string
58601     */
58602    public const SUITE_METHODNAME = 'suite';
58603    /**
58604     * Returns the loader to be used.
58605     */
58606    public function getLoader() : \PHPUnit\Runner\TestSuiteLoader
58607    {
58608        return new \PHPUnit\Runner\StandardTestSuiteLoader();
58609    }
58610    /**
58611     * Returns the Test corresponding to the given suite.
58612     * This is a template method, subclasses override
58613     * the runFailed() and clearStatus() methods.
58614     *
58615     * @param string|string[] $suffixes
58616     *
58617     * @throws Exception
58618     */
58619    public function getTest(string $suiteClassFile, $suffixes = '') : ?TestSuite
58620    {
58621        if (is_dir($suiteClassFile)) {
58622            /** @var string[] $files */
58623            $files = (new FileIteratorFacade())->getFilesAsArray($suiteClassFile, $suffixes);
58624            $suite = new TestSuite($suiteClassFile);
58625            $suite->addTestFiles($files);
58626            return $suite;
58627        }
58628        if (is_file($suiteClassFile) && substr($suiteClassFile, -5, 5) === '.phpt') {
58629            $suite = new TestSuite();
58630            $suite->addTestFile($suiteClassFile);
58631            return $suite;
58632        }
58633        try {
58634            $testClass = $this->loadSuiteClass($suiteClassFile);
58635        } catch (\PHPUnit\Exception $e) {
58636            $this->runFailed($e->getMessage());
58637            return null;
58638        }
58639        try {
58640            $suiteMethod = $testClass->getMethod(self::SUITE_METHODNAME);
58641            if (!$suiteMethod->isStatic()) {
58642                $this->runFailed('suite() method must be static.');
58643                return null;
58644            }
58645            $test = $suiteMethod->invoke(null, $testClass->getName());
58646        } catch (ReflectionException $e) {
58647            $test = new TestSuite($testClass);
58648        }
58649        $this->clearStatus();
58650        return $test;
58651    }
58652    /**
58653     * Returns the loaded ReflectionClass for a suite name.
58654     */
58655    protected function loadSuiteClass(string $suiteClassFile) : ReflectionClass
58656    {
58657        return $this->getLoader()->load($suiteClassFile);
58658    }
58659    /**
58660     * Clears the status message.
58661     */
58662    protected function clearStatus() : void
58663    {
58664    }
58665    /**
58666     * Override to define how to handle a failed loading of
58667     * a test suite.
58668     */
58669    protected abstract function runFailed(string $message) : void;
58670}
58671<?php
58672
58673declare (strict_types=1);
58674/*
58675 * This file is part of PHPUnit.
58676 *
58677 * (c) Sebastian Bergmann <sebastian@phpunit.de>
58678 *
58679 * For the full copyright and license information, please view the LICENSE
58680 * file that was distributed with this source code.
58681 */
58682namespace PHPUnit\Runner;
58683
58684use function preg_match;
58685use function round;
58686/**
58687 * @internal This class is not covered by the backward compatibility promise for PHPUnit
58688 */
58689final class ResultCacheExtension implements \PHPUnit\Runner\AfterIncompleteTestHook, \PHPUnit\Runner\AfterLastTestHook, \PHPUnit\Runner\AfterRiskyTestHook, \PHPUnit\Runner\AfterSkippedTestHook, \PHPUnit\Runner\AfterSuccessfulTestHook, \PHPUnit\Runner\AfterTestErrorHook, \PHPUnit\Runner\AfterTestFailureHook, \PHPUnit\Runner\AfterTestWarningHook
58690{
58691    /**
58692     * @var TestResultCache
58693     */
58694    private $cache;
58695    public function __construct(\PHPUnit\Runner\TestResultCache $cache)
58696    {
58697        $this->cache = $cache;
58698    }
58699    public function flush() : void
58700    {
58701        $this->cache->persist();
58702    }
58703    public function executeAfterSuccessfulTest(string $test, float $time) : void
58704    {
58705        $testName = $this->getTestName($test);
58706        $this->cache->setTime($testName, round($time, 3));
58707    }
58708    public function executeAfterIncompleteTest(string $test, string $message, float $time) : void
58709    {
58710        $testName = $this->getTestName($test);
58711        $this->cache->setTime($testName, round($time, 3));
58712        $this->cache->setState($testName, \PHPUnit\Runner\BaseTestRunner::STATUS_INCOMPLETE);
58713    }
58714    public function executeAfterRiskyTest(string $test, string $message, float $time) : void
58715    {
58716        $testName = $this->getTestName($test);
58717        $this->cache->setTime($testName, round($time, 3));
58718        $this->cache->setState($testName, \PHPUnit\Runner\BaseTestRunner::STATUS_RISKY);
58719    }
58720    public function executeAfterSkippedTest(string $test, string $message, float $time) : void
58721    {
58722        $testName = $this->getTestName($test);
58723        $this->cache->setTime($testName, round($time, 3));
58724        $this->cache->setState($testName, \PHPUnit\Runner\BaseTestRunner::STATUS_SKIPPED);
58725    }
58726    public function executeAfterTestError(string $test, string $message, float $time) : void
58727    {
58728        $testName = $this->getTestName($test);
58729        $this->cache->setTime($testName, round($time, 3));
58730        $this->cache->setState($testName, \PHPUnit\Runner\BaseTestRunner::STATUS_ERROR);
58731    }
58732    public function executeAfterTestFailure(string $test, string $message, float $time) : void
58733    {
58734        $testName = $this->getTestName($test);
58735        $this->cache->setTime($testName, round($time, 3));
58736        $this->cache->setState($testName, \PHPUnit\Runner\BaseTestRunner::STATUS_FAILURE);
58737    }
58738    public function executeAfterTestWarning(string $test, string $message, float $time) : void
58739    {
58740        $testName = $this->getTestName($test);
58741        $this->cache->setTime($testName, round($time, 3));
58742        $this->cache->setState($testName, \PHPUnit\Runner\BaseTestRunner::STATUS_WARNING);
58743    }
58744    public function executeAfterLastTest() : void
58745    {
58746        $this->flush();
58747    }
58748    /**
58749     * @param string $test A long description format of the current test
58750     *
58751     * @return string The test name without TestSuiteClassName:: and @dataprovider details
58752     */
58753    private function getTestName(string $test) : string
58754    {
58755        $matches = [];
58756        if (preg_match('/^(?<name>\\S+::\\S+)(?:(?<dataname> with data set (?:#\\d+|"[^"]+"))\\s\\()?/', $test, $matches)) {
58757            $test = $matches['name'] . ($matches['dataname'] ?? '');
58758        }
58759        return $test;
58760    }
58761}
58762<?php
58763
58764declare (strict_types=1);
58765/*
58766 * This file is part of PHPUnit.
58767 *
58768 * (c) Sebastian Bergmann <sebastian@phpunit.de>
58769 *
58770 * For the full copyright and license information, please view the LICENSE
58771 * file that was distributed with this source code.
58772 */
58773namespace PHPUnit\TextUI\XmlConfiguration;
58774
58775use function count;
58776use function iterator_count;
58777use Countable;
58778use Iterator;
58779/**
58780 * @internal This class is not covered by the backward compatibility promise for PHPUnit
58781 */
58782final class GroupCollectionIterator implements Countable, Iterator
58783{
58784    /**
58785     * @var Group[]
58786     */
58787    private $groups;
58788    /**
58789     * @var int
58790     */
58791    private $position;
58792    public function __construct(\PHPUnit\TextUI\XmlConfiguration\GroupCollection $groups)
58793    {
58794        $this->groups = $groups->asArray();
58795    }
58796    public function count() : int
58797    {
58798        return iterator_count($this);
58799    }
58800    public function rewind() : void
58801    {
58802        $this->position = 0;
58803    }
58804    public function valid() : bool
58805    {
58806        return $this->position < count($this->groups);
58807    }
58808    public function key() : int
58809    {
58810        return $this->position;
58811    }
58812    public function current() : \PHPUnit\TextUI\XmlConfiguration\Group
58813    {
58814        return $this->groups[$this->position];
58815    }
58816    public function next() : void
58817    {
58818        $this->position++;
58819    }
58820}
58821<?php
58822
58823declare (strict_types=1);
58824/*
58825 * This file is part of PHPUnit.
58826 *
58827 * (c) Sebastian Bergmann <sebastian@phpunit.de>
58828 *
58829 * For the full copyright and license information, please view the LICENSE
58830 * file that was distributed with this source code.
58831 */
58832namespace PHPUnit\TextUI\XmlConfiguration;
58833
58834use IteratorAggregate;
58835/**
58836 * @internal This class is not covered by the backward compatibility promise for PHPUnit
58837 * @psalm-immutable
58838 */
58839final class GroupCollection implements IteratorAggregate
58840{
58841    /**
58842     * @var Group[]
58843     */
58844    private $groups;
58845    /**
58846     * @param Group[] $groups
58847     */
58848    public static function fromArray(array $groups) : self
58849    {
58850        return new self(...$groups);
58851    }
58852    private function __construct(\PHPUnit\TextUI\XmlConfiguration\Group ...$groups)
58853    {
58854        $this->groups = $groups;
58855    }
58856    /**
58857     * @return Group[]
58858     */
58859    public function asArray() : array
58860    {
58861        return $this->groups;
58862    }
58863    /**
58864     * @return string[]
58865     */
58866    public function asArrayOfStrings() : array
58867    {
58868        $result = [];
58869        foreach ($this->groups as $group) {
58870            $result[] = $group->name();
58871        }
58872        return $result;
58873    }
58874    public function isEmpty() : bool
58875    {
58876        return empty($this->groups);
58877    }
58878    public function getIterator() : \PHPUnit\TextUI\XmlConfiguration\GroupCollectionIterator
58879    {
58880        return new \PHPUnit\TextUI\XmlConfiguration\GroupCollectionIterator($this);
58881    }
58882}
58883<?php
58884
58885declare (strict_types=1);
58886/*
58887 * This file is part of PHPUnit.
58888 *
58889 * (c) Sebastian Bergmann <sebastian@phpunit.de>
58890 *
58891 * For the full copyright and license information, please view the LICENSE
58892 * file that was distributed with this source code.
58893 */
58894namespace PHPUnit\TextUI\XmlConfiguration;
58895
58896/**
58897 * @internal This class is not covered by the backward compatibility promise for PHPUnit
58898 * @psalm-immutable
58899 */
58900final class Groups
58901{
58902    /**
58903     * @var GroupCollection
58904     */
58905    private $include;
58906    /**
58907     * @var GroupCollection
58908     */
58909    private $exclude;
58910    public function __construct(\PHPUnit\TextUI\XmlConfiguration\GroupCollection $include, \PHPUnit\TextUI\XmlConfiguration\GroupCollection $exclude)
58911    {
58912        $this->include = $include;
58913        $this->exclude = $exclude;
58914    }
58915    public function hasInclude() : bool
58916    {
58917        return !$this->include->isEmpty();
58918    }
58919    public function include() : \PHPUnit\TextUI\XmlConfiguration\GroupCollection
58920    {
58921        return $this->include;
58922    }
58923    public function hasExclude() : bool
58924    {
58925        return !$this->exclude->isEmpty();
58926    }
58927    public function exclude() : \PHPUnit\TextUI\XmlConfiguration\GroupCollection
58928    {
58929        return $this->exclude;
58930    }
58931}
58932<?php
58933
58934declare (strict_types=1);
58935/*
58936 * This file is part of PHPUnit.
58937 *
58938 * (c) Sebastian Bergmann <sebastian@phpunit.de>
58939 *
58940 * For the full copyright and license information, please view the LICENSE
58941 * file that was distributed with this source code.
58942 */
58943namespace PHPUnit\TextUI\XmlConfiguration;
58944
58945/**
58946 * @internal This class is not covered by the backward compatibility promise for PHPUnit
58947 * @psalm-immutable
58948 */
58949final class Group
58950{
58951    /**
58952     * @var string
58953     */
58954    private $name;
58955    public function __construct(string $name)
58956    {
58957        $this->name = $name;
58958    }
58959    public function name() : string
58960    {
58961        return $this->name;
58962    }
58963}
58964<?php
58965
58966declare (strict_types=1);
58967/*
58968 * This file is part of PHPUnit.
58969 *
58970 * (c) Sebastian Bergmann <sebastian@phpunit.de>
58971 *
58972 * For the full copyright and license information, please view the LICENSE
58973 * file that was distributed with this source code.
58974 */
58975namespace PHPUnit\TextUI\XmlConfiguration;
58976
58977use function str_replace;
58978/**
58979 * @internal This class is not covered by the backward compatibility promise for PHPUnit
58980 */
58981final class Generator
58982{
58983    /**
58984     * @var string
58985     */
58986    private const TEMPLATE = <<<'EOT'
58987<?xml version="1.0" encoding="UTF-8"?>
58988<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
58989         xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/{phpunit_version}/phpunit.xsd"
58990         bootstrap="{bootstrap_script}"
58991         cacheResultFile="{cache_directory}/test-results"
58992         executionOrder="depends,defects"
58993         forceCoversAnnotation="true"
58994         beStrictAboutCoversAnnotation="true"
58995         beStrictAboutOutputDuringTests="true"
58996         beStrictAboutTodoAnnotatedTests="true"
58997         convertDeprecationsToExceptions="true"
58998         failOnRisky="true"
58999         failOnWarning="true"
59000         verbose="true">
59001    <testsuites>
59002        <testsuite name="default">
59003            <directory>{tests_directory}</directory>
59004        </testsuite>
59005    </testsuites>
59006
59007    <coverage cacheDirectory="{cache_directory}/code-coverage"
59008              processUncoveredFiles="true">
59009        <include>
59010            <directory suffix=".php">{src_directory}</directory>
59011        </include>
59012    </coverage>
59013</phpunit>
59014
59015EOT;
59016    public function generateDefaultConfiguration(string $phpunitVersion, string $bootstrapScript, string $testsDirectory, string $srcDirectory, string $cacheDirectory) : string
59017    {
59018        return str_replace(['{phpunit_version}', '{bootstrap_script}', '{tests_directory}', '{src_directory}', '{cache_directory}'], [$phpunitVersion, $bootstrapScript, $testsDirectory, $srcDirectory, $cacheDirectory], self::TEMPLATE);
59019    }
59020}
59021<?php
59022
59023declare (strict_types=1);
59024/*
59025 * This file is part of PHPUnit.
59026 *
59027 * (c) Sebastian Bergmann <sebastian@phpunit.de>
59028 *
59029 * For the full copyright and license information, please view the LICENSE
59030 * file that was distributed with this source code.
59031 */
59032namespace PHPUnit\TextUI\XmlConfiguration\Logging;
59033
59034use PHPUnit\TextUI\XmlConfiguration\File;
59035/**
59036 * @internal This class is not covered by the backward compatibility promise for PHPUnit
59037 * @psalm-immutable
59038 */
59039final class Text
59040{
59041    /**
59042     * @var File
59043     */
59044    private $target;
59045    public function __construct(File $target)
59046    {
59047        $this->target = $target;
59048    }
59049    public function target() : File
59050    {
59051        return $this->target;
59052    }
59053}
59054<?php
59055
59056declare (strict_types=1);
59057/*
59058 * This file is part of PHPUnit.
59059 *
59060 * (c) Sebastian Bergmann <sebastian@phpunit.de>
59061 *
59062 * For the full copyright and license information, please view the LICENSE
59063 * file that was distributed with this source code.
59064 */
59065namespace PHPUnit\TextUI\XmlConfiguration\Logging;
59066
59067use PHPUnit\TextUI\XmlConfiguration\File;
59068/**
59069 * @internal This class is not covered by the backward compatibility promise for PHPUnit
59070 * @psalm-immutable
59071 */
59072final class Junit
59073{
59074    /**
59075     * @var File
59076     */
59077    private $target;
59078    public function __construct(File $target)
59079    {
59080        $this->target = $target;
59081    }
59082    public function target() : File
59083    {
59084        return $this->target;
59085    }
59086}
59087<?php
59088
59089declare (strict_types=1);
59090/*
59091 * This file is part of PHPUnit.
59092 *
59093 * (c) Sebastian Bergmann <sebastian@phpunit.de>
59094 *
59095 * For the full copyright and license information, please view the LICENSE
59096 * file that was distributed with this source code.
59097 */
59098namespace PHPUnit\TextUI\XmlConfiguration\Logging;
59099
59100use PHPUnit\TextUI\XmlConfiguration\Exception;
59101use PHPUnit\TextUI\XmlConfiguration\Logging\TestDox\Html as TestDoxHtml;
59102use PHPUnit\TextUI\XmlConfiguration\Logging\TestDox\Text as TestDoxText;
59103use PHPUnit\TextUI\XmlConfiguration\Logging\TestDox\Xml as TestDoxXml;
59104/**
59105 * @internal This class is not covered by the backward compatibility promise for PHPUnit
59106 * @psalm-immutable
59107 */
59108final class Logging
59109{
59110    /**
59111     * @var ?Junit
59112     */
59113    private $junit;
59114    /**
59115     * @var ?Text
59116     */
59117    private $text;
59118    /**
59119     * @var ?TeamCity
59120     */
59121    private $teamCity;
59122    /**
59123     * @var ?TestDoxHtml
59124     */
59125    private $testDoxHtml;
59126    /**
59127     * @var ?TestDoxText
59128     */
59129    private $testDoxText;
59130    /**
59131     * @var ?TestDoxXml
59132     */
59133    private $testDoxXml;
59134    public function __construct(?\PHPUnit\TextUI\XmlConfiguration\Logging\Junit $junit, ?\PHPUnit\TextUI\XmlConfiguration\Logging\Text $text, ?\PHPUnit\TextUI\XmlConfiguration\Logging\TeamCity $teamCity, ?TestDoxHtml $testDoxHtml, ?TestDoxText $testDoxText, ?TestDoxXml $testDoxXml)
59135    {
59136        $this->junit = $junit;
59137        $this->text = $text;
59138        $this->teamCity = $teamCity;
59139        $this->testDoxHtml = $testDoxHtml;
59140        $this->testDoxText = $testDoxText;
59141        $this->testDoxXml = $testDoxXml;
59142    }
59143    public function hasJunit() : bool
59144    {
59145        return $this->junit !== null;
59146    }
59147    public function junit() : \PHPUnit\TextUI\XmlConfiguration\Logging\Junit
59148    {
59149        if ($this->junit === null) {
59150            throw new Exception('Logger "JUnit XML" is not configured');
59151        }
59152        return $this->junit;
59153    }
59154    public function hasText() : bool
59155    {
59156        return $this->text !== null;
59157    }
59158    public function text() : \PHPUnit\TextUI\XmlConfiguration\Logging\Text
59159    {
59160        if ($this->text === null) {
59161            throw new Exception('Logger "Text" is not configured');
59162        }
59163        return $this->text;
59164    }
59165    public function hasTeamCity() : bool
59166    {
59167        return $this->teamCity !== null;
59168    }
59169    public function teamCity() : \PHPUnit\TextUI\XmlConfiguration\Logging\TeamCity
59170    {
59171        if ($this->teamCity === null) {
59172            throw new Exception('Logger "Team City" is not configured');
59173        }
59174        return $this->teamCity;
59175    }
59176    public function hasTestDoxHtml() : bool
59177    {
59178        return $this->testDoxHtml !== null;
59179    }
59180    public function testDoxHtml() : TestDoxHtml
59181    {
59182        if ($this->testDoxHtml === null) {
59183            throw new Exception('Logger "TestDox HTML" is not configured');
59184        }
59185        return $this->testDoxHtml;
59186    }
59187    public function hasTestDoxText() : bool
59188    {
59189        return $this->testDoxText !== null;
59190    }
59191    public function testDoxText() : TestDoxText
59192    {
59193        if ($this->testDoxText === null) {
59194            throw new Exception('Logger "TestDox Text" is not configured');
59195        }
59196        return $this->testDoxText;
59197    }
59198    public function hasTestDoxXml() : bool
59199    {
59200        return $this->testDoxXml !== null;
59201    }
59202    public function testDoxXml() : TestDoxXml
59203    {
59204        if ($this->testDoxXml === null) {
59205            throw new Exception('Logger "TestDox XML" is not configured');
59206        }
59207        return $this->testDoxXml;
59208    }
59209}
59210<?php
59211
59212declare (strict_types=1);
59213/*
59214 * This file is part of PHPUnit.
59215 *
59216 * (c) Sebastian Bergmann <sebastian@phpunit.de>
59217 *
59218 * For the full copyright and license information, please view the LICENSE
59219 * file that was distributed with this source code.
59220 */
59221namespace PHPUnit\TextUI\XmlConfiguration\Logging;
59222
59223use PHPUnit\TextUI\XmlConfiguration\File;
59224/**
59225 * @internal This class is not covered by the backward compatibility promise for PHPUnit
59226 * @psalm-immutable
59227 */
59228final class TeamCity
59229{
59230    /**
59231     * @var File
59232     */
59233    private $target;
59234    public function __construct(File $target)
59235    {
59236        $this->target = $target;
59237    }
59238    public function target() : File
59239    {
59240        return $this->target;
59241    }
59242}
59243<?php
59244
59245declare (strict_types=1);
59246/*
59247 * This file is part of PHPUnit.
59248 *
59249 * (c) Sebastian Bergmann <sebastian@phpunit.de>
59250 *
59251 * For the full copyright and license information, please view the LICENSE
59252 * file that was distributed with this source code.
59253 */
59254namespace PHPUnit\TextUI\XmlConfiguration\Logging\TestDox;
59255
59256use PHPUnit\TextUI\XmlConfiguration\File;
59257/**
59258 * @internal This class is not covered by the backward compatibility promise for PHPUnit
59259 * @psalm-immutable
59260 */
59261final class Xml
59262{
59263    /**
59264     * @var File
59265     */
59266    private $target;
59267    public function __construct(File $target)
59268    {
59269        $this->target = $target;
59270    }
59271    public function target() : File
59272    {
59273        return $this->target;
59274    }
59275}
59276<?php
59277
59278declare (strict_types=1);
59279/*
59280 * This file is part of PHPUnit.
59281 *
59282 * (c) Sebastian Bergmann <sebastian@phpunit.de>
59283 *
59284 * For the full copyright and license information, please view the LICENSE
59285 * file that was distributed with this source code.
59286 */
59287namespace PHPUnit\TextUI\XmlConfiguration\Logging\TestDox;
59288
59289use PHPUnit\TextUI\XmlConfiguration\File;
59290/**
59291 * @internal This class is not covered by the backward compatibility promise for PHPUnit
59292 * @psalm-immutable
59293 */
59294final class Html
59295{
59296    /**
59297     * @var File
59298     */
59299    private $target;
59300    public function __construct(File $target)
59301    {
59302        $this->target = $target;
59303    }
59304    public function target() : File
59305    {
59306        return $this->target;
59307    }
59308}
59309<?php
59310
59311declare (strict_types=1);
59312/*
59313 * This file is part of PHPUnit.
59314 *
59315 * (c) Sebastian Bergmann <sebastian@phpunit.de>
59316 *
59317 * For the full copyright and license information, please view the LICENSE
59318 * file that was distributed with this source code.
59319 */
59320namespace PHPUnit\TextUI\XmlConfiguration\Logging\TestDox;
59321
59322use PHPUnit\TextUI\XmlConfiguration\File;
59323/**
59324 * @internal This class is not covered by the backward compatibility promise for PHPUnit
59325 * @psalm-immutable
59326 */
59327final class Text
59328{
59329    /**
59330     * @var File
59331     */
59332    private $target;
59333    public function __construct(File $target)
59334    {
59335        $this->target = $target;
59336    }
59337    public function target() : File
59338    {
59339        return $this->target;
59340    }
59341}
59342<?php
59343
59344declare (strict_types=1);
59345/*
59346 * This file is part of PHPUnit.
59347 *
59348 * (c) Sebastian Bergmann <sebastian@phpunit.de>
59349 *
59350 * For the full copyright and license information, please view the LICENSE
59351 * file that was distributed with this source code.
59352 */
59353namespace PHPUnit\TextUI\XmlConfiguration;
59354
59355use function count;
59356use function iterator_count;
59357use Countable;
59358use Iterator;
59359/**
59360 * @internal This class is not covered by the backward compatibility promise for PHPUnit
59361 */
59362final class DirectoryCollectionIterator implements Countable, Iterator
59363{
59364    /**
59365     * @var Directory[]
59366     */
59367    private $directories;
59368    /**
59369     * @var int
59370     */
59371    private $position;
59372    public function __construct(\PHPUnit\TextUI\XmlConfiguration\DirectoryCollection $directories)
59373    {
59374        $this->directories = $directories->asArray();
59375    }
59376    public function count() : int
59377    {
59378        return iterator_count($this);
59379    }
59380    public function rewind() : void
59381    {
59382        $this->position = 0;
59383    }
59384    public function valid() : bool
59385    {
59386        return $this->position < count($this->directories);
59387    }
59388    public function key() : int
59389    {
59390        return $this->position;
59391    }
59392    public function current() : \PHPUnit\TextUI\XmlConfiguration\Directory
59393    {
59394        return $this->directories[$this->position];
59395    }
59396    public function next() : void
59397    {
59398        $this->position++;
59399    }
59400}
59401<?php
59402
59403declare (strict_types=1);
59404/*
59405 * This file is part of PHPUnit.
59406 *
59407 * (c) Sebastian Bergmann <sebastian@phpunit.de>
59408 *
59409 * For the full copyright and license information, please view the LICENSE
59410 * file that was distributed with this source code.
59411 */
59412namespace PHPUnit\TextUI\XmlConfiguration;
59413
59414use function count;
59415use Countable;
59416use IteratorAggregate;
59417/**
59418 * @internal This class is not covered by the backward compatibility promise for PHPUnit
59419 * @psalm-immutable
59420 */
59421final class DirectoryCollection implements Countable, IteratorAggregate
59422{
59423    /**
59424     * @var Directory[]
59425     */
59426    private $directories;
59427    /**
59428     * @param Directory[] $directories
59429     */
59430    public static function fromArray(array $directories) : self
59431    {
59432        return new self(...$directories);
59433    }
59434    private function __construct(\PHPUnit\TextUI\XmlConfiguration\Directory ...$directories)
59435    {
59436        $this->directories = $directories;
59437    }
59438    /**
59439     * @return Directory[]
59440     */
59441    public function asArray() : array
59442    {
59443        return $this->directories;
59444    }
59445    public function count() : int
59446    {
59447        return count($this->directories);
59448    }
59449    public function getIterator() : \PHPUnit\TextUI\XmlConfiguration\DirectoryCollectionIterator
59450    {
59451        return new \PHPUnit\TextUI\XmlConfiguration\DirectoryCollectionIterator($this);
59452    }
59453    public function isEmpty() : bool
59454    {
59455        return $this->count() === 0;
59456    }
59457}
59458<?php
59459
59460declare (strict_types=1);
59461/*
59462 * This file is part of PHPUnit.
59463 *
59464 * (c) Sebastian Bergmann <sebastian@phpunit.de>
59465 *
59466 * For the full copyright and license information, please view the LICENSE
59467 * file that was distributed with this source code.
59468 */
59469namespace PHPUnit\TextUI\XmlConfiguration;
59470
59471/**
59472 * @internal This class is not covered by the backward compatibility promise for PHPUnit
59473 * @psalm-immutable
59474 */
59475final class File
59476{
59477    /**
59478     * @var string
59479     */
59480    private $path;
59481    public function __construct(string $path)
59482    {
59483        $this->path = $path;
59484    }
59485    public function path() : string
59486    {
59487        return $this->path;
59488    }
59489}
59490<?php
59491
59492declare (strict_types=1);
59493/*
59494 * This file is part of PHPUnit.
59495 *
59496 * (c) Sebastian Bergmann <sebastian@phpunit.de>
59497 *
59498 * For the full copyright and license information, please view the LICENSE
59499 * file that was distributed with this source code.
59500 */
59501namespace PHPUnit\TextUI\XmlConfiguration;
59502
59503use function count;
59504use function iterator_count;
59505use Countable;
59506use Iterator;
59507/**
59508 * @internal This class is not covered by the backward compatibility promise for PHPUnit
59509 */
59510final class FileCollectionIterator implements Countable, Iterator
59511{
59512    /**
59513     * @var File[]
59514     */
59515    private $files;
59516    /**
59517     * @var int
59518     */
59519    private $position;
59520    public function __construct(\PHPUnit\TextUI\XmlConfiguration\FileCollection $files)
59521    {
59522        $this->files = $files->asArray();
59523    }
59524    public function count() : int
59525    {
59526        return iterator_count($this);
59527    }
59528    public function rewind() : void
59529    {
59530        $this->position = 0;
59531    }
59532    public function valid() : bool
59533    {
59534        return $this->position < count($this->files);
59535    }
59536    public function key() : int
59537    {
59538        return $this->position;
59539    }
59540    public function current() : \PHPUnit\TextUI\XmlConfiguration\File
59541    {
59542        return $this->files[$this->position];
59543    }
59544    public function next() : void
59545    {
59546        $this->position++;
59547    }
59548}
59549<?php
59550
59551declare (strict_types=1);
59552/*
59553 * This file is part of PHPUnit.
59554 *
59555 * (c) Sebastian Bergmann <sebastian@phpunit.de>
59556 *
59557 * For the full copyright and license information, please view the LICENSE
59558 * file that was distributed with this source code.
59559 */
59560namespace PHPUnit\TextUI\XmlConfiguration;
59561
59562use function count;
59563use Countable;
59564use IteratorAggregate;
59565/**
59566 * @internal This class is not covered by the backward compatibility promise for PHPUnit
59567 * @psalm-immutable
59568 */
59569final class FileCollection implements Countable, IteratorAggregate
59570{
59571    /**
59572     * @var File[]
59573     */
59574    private $files;
59575    /**
59576     * @param File[] $files
59577     */
59578    public static function fromArray(array $files) : self
59579    {
59580        return new self(...$files);
59581    }
59582    private function __construct(\PHPUnit\TextUI\XmlConfiguration\File ...$files)
59583    {
59584        $this->files = $files;
59585    }
59586    /**
59587     * @return File[]
59588     */
59589    public function asArray() : array
59590    {
59591        return $this->files;
59592    }
59593    public function count() : int
59594    {
59595        return count($this->files);
59596    }
59597    public function getIterator() : \PHPUnit\TextUI\XmlConfiguration\FileCollectionIterator
59598    {
59599        return new \PHPUnit\TextUI\XmlConfiguration\FileCollectionIterator($this);
59600    }
59601    public function isEmpty() : bool
59602    {
59603        return $this->count() === 0;
59604    }
59605}
59606<?php
59607
59608declare (strict_types=1);
59609/*
59610 * This file is part of PHPUnit.
59611 *
59612 * (c) Sebastian Bergmann <sebastian@phpunit.de>
59613 *
59614 * For the full copyright and license information, please view the LICENSE
59615 * file that was distributed with this source code.
59616 */
59617namespace PHPUnit\TextUI\XmlConfiguration;
59618
59619/**
59620 * @internal This class is not covered by the backward compatibility promise for PHPUnit
59621 * @psalm-immutable
59622 */
59623final class Directory
59624{
59625    /**
59626     * @var string
59627     */
59628    private $path;
59629    public function __construct(string $path)
59630    {
59631        $this->path = $path;
59632    }
59633    public function path() : string
59634    {
59635        return $this->path;
59636    }
59637}
59638<?php
59639
59640declare (strict_types=1);
59641/*
59642 * This file is part of PHPUnit.
59643 *
59644 * (c) Sebastian Bergmann <sebastian@phpunit.de>
59645 *
59646 * For the full copyright and license information, please view the LICENSE
59647 * file that was distributed with this source code.
59648 */
59649namespace PHPUnit\TextUI\XmlConfiguration;
59650
59651use const DIRECTORY_SEPARATOR;
59652use const PHP_VERSION;
59653use function assert;
59654use function defined;
59655use function dirname;
59656use function explode;
59657use function is_file;
59658use function is_numeric;
59659use function preg_match;
59660use function stream_resolve_include_path;
59661use function strlen;
59662use function strpos;
59663use function strtolower;
59664use function substr;
59665use function trim;
59666use DOMDocument;
59667use DOMElement;
59668use DOMNodeList;
59669use DOMXPath;
59670use PHPUnit\Runner\TestSuiteSorter;
59671use PHPUnit\Runner\Version;
59672use PHPUnit\TextUI\DefaultResultPrinter;
59673use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\CodeCoverage;
59674use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Filter\Directory as FilterDirectory;
59675use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Filter\DirectoryCollection as FilterDirectoryCollection;
59676use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Clover;
59677use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Cobertura;
59678use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Crap4j;
59679use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Html as CodeCoverageHtml;
59680use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Php as CodeCoveragePhp;
59681use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Text as CodeCoverageText;
59682use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Xml as CodeCoverageXml;
59683use PHPUnit\TextUI\XmlConfiguration\Logging\Junit;
59684use PHPUnit\TextUI\XmlConfiguration\Logging\Logging;
59685use PHPUnit\TextUI\XmlConfiguration\Logging\TeamCity;
59686use PHPUnit\TextUI\XmlConfiguration\Logging\TestDox\Html as TestDoxHtml;
59687use PHPUnit\TextUI\XmlConfiguration\Logging\TestDox\Text as TestDoxText;
59688use PHPUnit\TextUI\XmlConfiguration\Logging\TestDox\Xml as TestDoxXml;
59689use PHPUnit\TextUI\XmlConfiguration\Logging\Text;
59690use PHPUnit\TextUI\XmlConfiguration\TestSuite as TestSuiteConfiguration;
59691use PHPUnit\Util\TestDox\CliTestDoxPrinter;
59692use PHPUnit\Util\VersionComparisonOperator;
59693use PHPUnit\Util\Xml;
59694use PHPUnit\Util\Xml\Exception as XmlException;
59695use PHPUnit\Util\Xml\Loader as XmlLoader;
59696use PHPUnit\Util\Xml\SchemaFinder;
59697use PHPUnit\Util\Xml\Validator;
59698/**
59699 * @internal This class is not covered by the backward compatibility promise for PHPUnit
59700 */
59701final class Loader
59702{
59703    /**
59704     * @throws Exception
59705     */
59706    public function load(string $filename) : \PHPUnit\TextUI\XmlConfiguration\Configuration
59707    {
59708        try {
59709            $document = (new XmlLoader())->loadFile($filename, \false, \true, \true);
59710        } catch (XmlException $e) {
59711            throw new \PHPUnit\TextUI\XmlConfiguration\Exception($e->getMessage(), (int) $e->getCode(), $e);
59712        }
59713        $xpath = new DOMXPath($document);
59714        try {
59715            $xsdFilename = (new SchemaFinder())->find(Version::series());
59716        } catch (XmlException $e) {
59717            throw new \PHPUnit\TextUI\XmlConfiguration\Exception($e->getMessage(), (int) $e->getCode(), $e);
59718        }
59719        return new \PHPUnit\TextUI\XmlConfiguration\Configuration($filename, (new Validator())->validate($document, $xsdFilename), $this->extensions($filename, $xpath), $this->codeCoverage($filename, $xpath, $document), $this->groups($xpath), $this->testdoxGroups($xpath), $this->listeners($filename, $xpath), $this->logging($filename, $xpath), $this->php($filename, $xpath), $this->phpunit($filename, $document), $this->testSuite($filename, $xpath));
59720    }
59721    public function logging(string $filename, DOMXPath $xpath) : Logging
59722    {
59723        if ($xpath->query('logging/log')->length !== 0) {
59724            return $this->legacyLogging($filename, $xpath);
59725        }
59726        $junit = null;
59727        $element = $this->element($xpath, 'logging/junit');
59728        if ($element) {
59729            $junit = new Junit(new \PHPUnit\TextUI\XmlConfiguration\File($this->toAbsolutePath($filename, (string) $this->getStringAttribute($element, 'outputFile'))));
59730        }
59731        $text = null;
59732        $element = $this->element($xpath, 'logging/text');
59733        if ($element) {
59734            $text = new Text(new \PHPUnit\TextUI\XmlConfiguration\File($this->toAbsolutePath($filename, (string) $this->getStringAttribute($element, 'outputFile'))));
59735        }
59736        $teamCity = null;
59737        $element = $this->element($xpath, 'logging/teamcity');
59738        if ($element) {
59739            $teamCity = new TeamCity(new \PHPUnit\TextUI\XmlConfiguration\File($this->toAbsolutePath($filename, (string) $this->getStringAttribute($element, 'outputFile'))));
59740        }
59741        $testDoxHtml = null;
59742        $element = $this->element($xpath, 'logging/testdoxHtml');
59743        if ($element) {
59744            $testDoxHtml = new TestDoxHtml(new \PHPUnit\TextUI\XmlConfiguration\File($this->toAbsolutePath($filename, (string) $this->getStringAttribute($element, 'outputFile'))));
59745        }
59746        $testDoxText = null;
59747        $element = $this->element($xpath, 'logging/testdoxText');
59748        if ($element) {
59749            $testDoxText = new TestDoxText(new \PHPUnit\TextUI\XmlConfiguration\File($this->toAbsolutePath($filename, (string) $this->getStringAttribute($element, 'outputFile'))));
59750        }
59751        $testDoxXml = null;
59752        $element = $this->element($xpath, 'logging/testdoxXml');
59753        if ($element) {
59754            $testDoxXml = new TestDoxXml(new \PHPUnit\TextUI\XmlConfiguration\File($this->toAbsolutePath($filename, (string) $this->getStringAttribute($element, 'outputFile'))));
59755        }
59756        return new Logging($junit, $text, $teamCity, $testDoxHtml, $testDoxText, $testDoxXml);
59757    }
59758    public function legacyLogging(string $filename, DOMXPath $xpath) : Logging
59759    {
59760        $junit = null;
59761        $teamCity = null;
59762        $testDoxHtml = null;
59763        $testDoxText = null;
59764        $testDoxXml = null;
59765        $text = null;
59766        foreach ($xpath->query('logging/log') as $log) {
59767            assert($log instanceof DOMElement);
59768            $type = (string) $log->getAttribute('type');
59769            $target = (string) $log->getAttribute('target');
59770            if (!$target) {
59771                continue;
59772            }
59773            $target = $this->toAbsolutePath($filename, $target);
59774            switch ($type) {
59775                case 'plain':
59776                    $text = new Text(new \PHPUnit\TextUI\XmlConfiguration\File($target));
59777                    break;
59778                case 'junit':
59779                    $junit = new Junit(new \PHPUnit\TextUI\XmlConfiguration\File($target));
59780                    break;
59781                case 'teamcity':
59782                    $teamCity = new TeamCity(new \PHPUnit\TextUI\XmlConfiguration\File($target));
59783                    break;
59784                case 'testdox-html':
59785                    $testDoxHtml = new TestDoxHtml(new \PHPUnit\TextUI\XmlConfiguration\File($target));
59786                    break;
59787                case 'testdox-text':
59788                    $testDoxText = new TestDoxText(new \PHPUnit\TextUI\XmlConfiguration\File($target));
59789                    break;
59790                case 'testdox-xml':
59791                    $testDoxXml = new TestDoxXml(new \PHPUnit\TextUI\XmlConfiguration\File($target));
59792                    break;
59793            }
59794        }
59795        return new Logging($junit, $text, $teamCity, $testDoxHtml, $testDoxText, $testDoxXml);
59796    }
59797    private function extensions(string $filename, DOMXPath $xpath) : \PHPUnit\TextUI\XmlConfiguration\ExtensionCollection
59798    {
59799        $extensions = [];
59800        foreach ($xpath->query('extensions/extension') as $extension) {
59801            assert($extension instanceof DOMElement);
59802            $extensions[] = $this->getElementConfigurationParameters($filename, $extension);
59803        }
59804        return \PHPUnit\TextUI\XmlConfiguration\ExtensionCollection::fromArray($extensions);
59805    }
59806    private function getElementConfigurationParameters(string $filename, DOMElement $element) : \PHPUnit\TextUI\XmlConfiguration\Extension
59807    {
59808        /** @psalm-var class-string $class */
59809        $class = (string) $element->getAttribute('class');
59810        $file = '';
59811        $arguments = $this->getConfigurationArguments($filename, $element->childNodes);
59812        if ($element->getAttribute('file')) {
59813            $file = $this->toAbsolutePath($filename, (string) $element->getAttribute('file'), \true);
59814        }
59815        return new \PHPUnit\TextUI\XmlConfiguration\Extension($class, $file, $arguments);
59816    }
59817    private function toAbsolutePath(string $filename, string $path, bool $useIncludePath = \false) : string
59818    {
59819        $path = trim($path);
59820        if (strpos($path, '/') === 0) {
59821            return $path;
59822        }
59823        // Matches the following on Windows:
59824        //  - \\NetworkComputer\Path
59825        //  - \\.\D:
59826        //  - \\.\c:
59827        //  - C:\Windows
59828        //  - C:\windows
59829        //  - C:/windows
59830        //  - c:/windows
59831        if (defined('PHP_WINDOWS_VERSION_BUILD') && ($path[0] === '\\' || strlen($path) >= 3 && preg_match('#^[A-Z]\\:[/\\\\]#i', substr($path, 0, 3)))) {
59832            return $path;
59833        }
59834        if (strpos($path, '://') !== \false) {
59835            return $path;
59836        }
59837        $file = dirname($filename) . \DIRECTORY_SEPARATOR . $path;
59838        if ($useIncludePath && !is_file($file)) {
59839            $includePathFile = stream_resolve_include_path($path);
59840            if ($includePathFile) {
59841                $file = $includePathFile;
59842            }
59843        }
59844        return $file;
59845    }
59846    private function getConfigurationArguments(string $filename, DOMNodeList $nodes) : array
59847    {
59848        $arguments = [];
59849        if ($nodes->length === 0) {
59850            return $arguments;
59851        }
59852        foreach ($nodes as $node) {
59853            if (!$node instanceof DOMElement) {
59854                continue;
59855            }
59856            if ($node->tagName !== 'arguments') {
59857                continue;
59858            }
59859            foreach ($node->childNodes as $argument) {
59860                if (!$argument instanceof DOMElement) {
59861                    continue;
59862                }
59863                if ($argument->tagName === 'file' || $argument->tagName === 'directory') {
59864                    $arguments[] = $this->toAbsolutePath($filename, (string) $argument->textContent);
59865                } else {
59866                    $arguments[] = Xml::xmlToVariable($argument);
59867                }
59868            }
59869        }
59870        return $arguments;
59871    }
59872    private function codeCoverage(string $filename, DOMXPath $xpath, DOMDocument $document) : CodeCoverage
59873    {
59874        if ($xpath->query('filter/whitelist')->length !== 0) {
59875            return $this->legacyCodeCoverage($filename, $xpath, $document);
59876        }
59877        $cacheDirectory = null;
59878        $pathCoverage = \false;
59879        $includeUncoveredFiles = \true;
59880        $processUncoveredFiles = \false;
59881        $ignoreDeprecatedCodeUnits = \false;
59882        $disableCodeCoverageIgnore = \false;
59883        $element = $this->element($xpath, 'coverage');
59884        if ($element) {
59885            $cacheDirectory = $this->getStringAttribute($element, 'cacheDirectory');
59886            if ($cacheDirectory !== null) {
59887                $cacheDirectory = new \PHPUnit\TextUI\XmlConfiguration\Directory($this->toAbsolutePath($filename, $cacheDirectory));
59888            }
59889            $pathCoverage = $this->getBooleanAttribute($element, 'pathCoverage', \false);
59890            $includeUncoveredFiles = $this->getBooleanAttribute($element, 'includeUncoveredFiles', \true);
59891            $processUncoveredFiles = $this->getBooleanAttribute($element, 'processUncoveredFiles', \false);
59892            $ignoreDeprecatedCodeUnits = $this->getBooleanAttribute($element, 'ignoreDeprecatedCodeUnits', \false);
59893            $disableCodeCoverageIgnore = $this->getBooleanAttribute($element, 'disableCodeCoverageIgnore', \false);
59894        }
59895        $clover = null;
59896        $element = $this->element($xpath, 'coverage/report/clover');
59897        if ($element) {
59898            $clover = new Clover(new \PHPUnit\TextUI\XmlConfiguration\File($this->toAbsolutePath($filename, (string) $this->getStringAttribute($element, 'outputFile'))));
59899        }
59900        $cobertura = null;
59901        $element = $this->element($xpath, 'coverage/report/cobertura');
59902        if ($element) {
59903            $cobertura = new Cobertura(new \PHPUnit\TextUI\XmlConfiguration\File($this->toAbsolutePath($filename, (string) $this->getStringAttribute($element, 'outputFile'))));
59904        }
59905        $crap4j = null;
59906        $element = $this->element($xpath, 'coverage/report/crap4j');
59907        if ($element) {
59908            $crap4j = new Crap4j(new \PHPUnit\TextUI\XmlConfiguration\File($this->toAbsolutePath($filename, (string) $this->getStringAttribute($element, 'outputFile'))), $this->getIntegerAttribute($element, 'threshold', 30));
59909        }
59910        $html = null;
59911        $element = $this->element($xpath, 'coverage/report/html');
59912        if ($element) {
59913            $html = new CodeCoverageHtml(new \PHPUnit\TextUI\XmlConfiguration\Directory($this->toAbsolutePath($filename, (string) $this->getStringAttribute($element, 'outputDirectory'))), $this->getIntegerAttribute($element, 'lowUpperBound', 50), $this->getIntegerAttribute($element, 'highLowerBound', 90));
59914        }
59915        $php = null;
59916        $element = $this->element($xpath, 'coverage/report/php');
59917        if ($element) {
59918            $php = new CodeCoveragePhp(new \PHPUnit\TextUI\XmlConfiguration\File($this->toAbsolutePath($filename, (string) $this->getStringAttribute($element, 'outputFile'))));
59919        }
59920        $text = null;
59921        $element = $this->element($xpath, 'coverage/report/text');
59922        if ($element) {
59923            $text = new CodeCoverageText(new \PHPUnit\TextUI\XmlConfiguration\File($this->toAbsolutePath($filename, (string) $this->getStringAttribute($element, 'outputFile'))), $this->getBooleanAttribute($element, 'showUncoveredFiles', \false), $this->getBooleanAttribute($element, 'showOnlySummary', \false));
59924        }
59925        $xml = null;
59926        $element = $this->element($xpath, 'coverage/report/xml');
59927        if ($element) {
59928            $xml = new CodeCoverageXml(new \PHPUnit\TextUI\XmlConfiguration\Directory($this->toAbsolutePath($filename, (string) $this->getStringAttribute($element, 'outputDirectory'))));
59929        }
59930        return new CodeCoverage($cacheDirectory, $this->readFilterDirectories($filename, $xpath, 'coverage/include/directory'), $this->readFilterFiles($filename, $xpath, 'coverage/include/file'), $this->readFilterDirectories($filename, $xpath, 'coverage/exclude/directory'), $this->readFilterFiles($filename, $xpath, 'coverage/exclude/file'), $pathCoverage, $includeUncoveredFiles, $processUncoveredFiles, $ignoreDeprecatedCodeUnits, $disableCodeCoverageIgnore, $clover, $cobertura, $crap4j, $html, $php, $text, $xml);
59931    }
59932    /**
59933     * @deprecated
59934     */
59935    private function legacyCodeCoverage(string $filename, DOMXPath $xpath, DOMDocument $document) : CodeCoverage
59936    {
59937        $ignoreDeprecatedCodeUnits = $this->getBooleanAttribute($document->documentElement, 'ignoreDeprecatedCodeUnitsFromCodeCoverage', \false);
59938        $disableCodeCoverageIgnore = $this->getBooleanAttribute($document->documentElement, 'disableCodeCoverageIgnore', \false);
59939        $includeUncoveredFiles = \true;
59940        $processUncoveredFiles = \false;
59941        $element = $this->element($xpath, 'filter/whitelist');
59942        if ($element) {
59943            if ($element->hasAttribute('addUncoveredFilesFromWhitelist')) {
59944                $includeUncoveredFiles = (bool) $this->getBoolean((string) $element->getAttribute('addUncoveredFilesFromWhitelist'), \true);
59945            }
59946            if ($element->hasAttribute('processUncoveredFilesFromWhitelist')) {
59947                $processUncoveredFiles = (bool) $this->getBoolean((string) $element->getAttribute('processUncoveredFilesFromWhitelist'), \false);
59948            }
59949        }
59950        $clover = null;
59951        $cobertura = null;
59952        $crap4j = null;
59953        $html = null;
59954        $php = null;
59955        $text = null;
59956        $xml = null;
59957        foreach ($xpath->query('logging/log') as $log) {
59958            assert($log instanceof DOMElement);
59959            $type = (string) $log->getAttribute('type');
59960            $target = (string) $log->getAttribute('target');
59961            if (!$target) {
59962                continue;
59963            }
59964            $target = $this->toAbsolutePath($filename, $target);
59965            switch ($type) {
59966                case 'coverage-clover':
59967                    $clover = new Clover(new \PHPUnit\TextUI\XmlConfiguration\File($target));
59968                    break;
59969                case 'coverage-cobertura':
59970                    $cobertura = new Cobertura(new \PHPUnit\TextUI\XmlConfiguration\File($target));
59971                    break;
59972                case 'coverage-crap4j':
59973                    $crap4j = new Crap4j(new \PHPUnit\TextUI\XmlConfiguration\File($target), $this->getIntegerAttribute($log, 'threshold', 30));
59974                    break;
59975                case 'coverage-html':
59976                    $html = new CodeCoverageHtml(new \PHPUnit\TextUI\XmlConfiguration\Directory($target), $this->getIntegerAttribute($log, 'lowUpperBound', 50), $this->getIntegerAttribute($log, 'highLowerBound', 90));
59977                    break;
59978                case 'coverage-php':
59979                    $php = new CodeCoveragePhp(new \PHPUnit\TextUI\XmlConfiguration\File($target));
59980                    break;
59981                case 'coverage-text':
59982                    $text = new CodeCoverageText(new \PHPUnit\TextUI\XmlConfiguration\File($target), $this->getBooleanAttribute($log, 'showUncoveredFiles', \false), $this->getBooleanAttribute($log, 'showOnlySummary', \false));
59983                    break;
59984                case 'coverage-xml':
59985                    $xml = new CodeCoverageXml(new \PHPUnit\TextUI\XmlConfiguration\Directory($target));
59986                    break;
59987            }
59988        }
59989        return new CodeCoverage(null, $this->readFilterDirectories($filename, $xpath, 'filter/whitelist/directory'), $this->readFilterFiles($filename, $xpath, 'filter/whitelist/file'), $this->readFilterDirectories($filename, $xpath, 'filter/whitelist/exclude/directory'), $this->readFilterFiles($filename, $xpath, 'filter/whitelist/exclude/file'), \false, $includeUncoveredFiles, $processUncoveredFiles, $ignoreDeprecatedCodeUnits, $disableCodeCoverageIgnore, $clover, $cobertura, $crap4j, $html, $php, $text, $xml);
59990    }
59991    /**
59992     * If $value is 'false' or 'true', this returns the value that $value represents.
59993     * Otherwise, returns $default, which may be a string in rare cases.
59994     *
59995     * @see \PHPUnit\TextUI\XmlConfigurationTest::testPHPConfigurationIsReadCorrectly
59996     *
59997     * @param bool|string $default
59998     *
59999     * @return bool|string
60000     */
60001    private function getBoolean(string $value, $default)
60002    {
60003        if (strtolower($value) === 'false') {
60004            return \false;
60005        }
60006        if (strtolower($value) === 'true') {
60007            return \true;
60008        }
60009        return $default;
60010    }
60011    private function readFilterDirectories(string $filename, DOMXPath $xpath, string $query) : FilterDirectoryCollection
60012    {
60013        $directories = [];
60014        foreach ($xpath->query($query) as $directoryNode) {
60015            assert($directoryNode instanceof DOMElement);
60016            $directoryPath = (string) $directoryNode->textContent;
60017            if (!$directoryPath) {
60018                continue;
60019            }
60020            $directories[] = new FilterDirectory($this->toAbsolutePath($filename, $directoryPath), $directoryNode->hasAttribute('prefix') ? (string) $directoryNode->getAttribute('prefix') : '', $directoryNode->hasAttribute('suffix') ? (string) $directoryNode->getAttribute('suffix') : '.php', $directoryNode->hasAttribute('group') ? (string) $directoryNode->getAttribute('group') : 'DEFAULT');
60021        }
60022        return FilterDirectoryCollection::fromArray($directories);
60023    }
60024    private function readFilterFiles(string $filename, DOMXPath $xpath, string $query) : \PHPUnit\TextUI\XmlConfiguration\FileCollection
60025    {
60026        $files = [];
60027        foreach ($xpath->query($query) as $file) {
60028            $filePath = (string) $file->textContent;
60029            if ($filePath) {
60030                $files[] = new \PHPUnit\TextUI\XmlConfiguration\File($this->toAbsolutePath($filename, $filePath));
60031            }
60032        }
60033        return \PHPUnit\TextUI\XmlConfiguration\FileCollection::fromArray($files);
60034    }
60035    private function groups(DOMXPath $xpath) : \PHPUnit\TextUI\XmlConfiguration\Groups
60036    {
60037        return $this->parseGroupConfiguration($xpath, 'groups');
60038    }
60039    private function testdoxGroups(DOMXPath $xpath) : \PHPUnit\TextUI\XmlConfiguration\Groups
60040    {
60041        return $this->parseGroupConfiguration($xpath, 'testdoxGroups');
60042    }
60043    private function parseGroupConfiguration(DOMXPath $xpath, string $root) : \PHPUnit\TextUI\XmlConfiguration\Groups
60044    {
60045        $include = [];
60046        $exclude = [];
60047        foreach ($xpath->query($root . '/include/group') as $group) {
60048            $include[] = new \PHPUnit\TextUI\XmlConfiguration\Group((string) $group->textContent);
60049        }
60050        foreach ($xpath->query($root . '/exclude/group') as $group) {
60051            $exclude[] = new \PHPUnit\TextUI\XmlConfiguration\Group((string) $group->textContent);
60052        }
60053        return new \PHPUnit\TextUI\XmlConfiguration\Groups(\PHPUnit\TextUI\XmlConfiguration\GroupCollection::fromArray($include), \PHPUnit\TextUI\XmlConfiguration\GroupCollection::fromArray($exclude));
60054    }
60055    private function listeners(string $filename, DOMXPath $xpath) : \PHPUnit\TextUI\XmlConfiguration\ExtensionCollection
60056    {
60057        $listeners = [];
60058        foreach ($xpath->query('listeners/listener') as $listener) {
60059            assert($listener instanceof DOMElement);
60060            $listeners[] = $this->getElementConfigurationParameters($filename, $listener);
60061        }
60062        return \PHPUnit\TextUI\XmlConfiguration\ExtensionCollection::fromArray($listeners);
60063    }
60064    private function getBooleanAttribute(DOMElement $element, string $attribute, bool $default) : bool
60065    {
60066        if (!$element->hasAttribute($attribute)) {
60067            return $default;
60068        }
60069        return (bool) $this->getBoolean((string) $element->getAttribute($attribute), \false);
60070    }
60071    private function getIntegerAttribute(DOMElement $element, string $attribute, int $default) : int
60072    {
60073        if (!$element->hasAttribute($attribute)) {
60074            return $default;
60075        }
60076        return $this->getInteger((string) $element->getAttribute($attribute), $default);
60077    }
60078    private function getStringAttribute(DOMElement $element, string $attribute) : ?string
60079    {
60080        if (!$element->hasAttribute($attribute)) {
60081            return null;
60082        }
60083        return (string) $element->getAttribute($attribute);
60084    }
60085    private function getInteger(string $value, int $default) : int
60086    {
60087        if (is_numeric($value)) {
60088            return (int) $value;
60089        }
60090        return $default;
60091    }
60092    private function php(string $filename, DOMXPath $xpath) : \PHPUnit\TextUI\XmlConfiguration\Php
60093    {
60094        $includePaths = [];
60095        foreach ($xpath->query('php/includePath') as $includePath) {
60096            $path = (string) $includePath->textContent;
60097            if ($path) {
60098                $includePaths[] = new \PHPUnit\TextUI\XmlConfiguration\Directory($this->toAbsolutePath($filename, $path));
60099            }
60100        }
60101        $iniSettings = [];
60102        foreach ($xpath->query('php/ini') as $ini) {
60103            assert($ini instanceof DOMElement);
60104            $iniSettings[] = new \PHPUnit\TextUI\XmlConfiguration\IniSetting((string) $ini->getAttribute('name'), (string) $ini->getAttribute('value'));
60105        }
60106        $constants = [];
60107        foreach ($xpath->query('php/const') as $const) {
60108            assert($const instanceof DOMElement);
60109            $value = (string) $const->getAttribute('value');
60110            $constants[] = new \PHPUnit\TextUI\XmlConfiguration\Constant((string) $const->getAttribute('name'), $this->getBoolean($value, $value));
60111        }
60112        $variables = ['var' => [], 'env' => [], 'post' => [], 'get' => [], 'cookie' => [], 'server' => [], 'files' => [], 'request' => []];
60113        foreach (['var', 'env', 'post', 'get', 'cookie', 'server', 'files', 'request'] as $array) {
60114            foreach ($xpath->query('php/' . $array) as $var) {
60115                assert($var instanceof DOMElement);
60116                $name = (string) $var->getAttribute('name');
60117                $value = (string) $var->getAttribute('value');
60118                $force = \false;
60119                $verbatim = \false;
60120                if ($var->hasAttribute('force')) {
60121                    $force = (bool) $this->getBoolean($var->getAttribute('force'), \false);
60122                }
60123                if ($var->hasAttribute('verbatim')) {
60124                    $verbatim = $this->getBoolean($var->getAttribute('verbatim'), \false);
60125                }
60126                if (!$verbatim) {
60127                    $value = $this->getBoolean($value, $value);
60128                }
60129                $variables[$array][] = new \PHPUnit\TextUI\XmlConfiguration\Variable($name, $value, $force);
60130            }
60131        }
60132        return new \PHPUnit\TextUI\XmlConfiguration\Php(\PHPUnit\TextUI\XmlConfiguration\DirectoryCollection::fromArray($includePaths), \PHPUnit\TextUI\XmlConfiguration\IniSettingCollection::fromArray($iniSettings), \PHPUnit\TextUI\XmlConfiguration\ConstantCollection::fromArray($constants), \PHPUnit\TextUI\XmlConfiguration\VariableCollection::fromArray($variables['var']), \PHPUnit\TextUI\XmlConfiguration\VariableCollection::fromArray($variables['env']), \PHPUnit\TextUI\XmlConfiguration\VariableCollection::fromArray($variables['post']), \PHPUnit\TextUI\XmlConfiguration\VariableCollection::fromArray($variables['get']), \PHPUnit\TextUI\XmlConfiguration\VariableCollection::fromArray($variables['cookie']), \PHPUnit\TextUI\XmlConfiguration\VariableCollection::fromArray($variables['server']), \PHPUnit\TextUI\XmlConfiguration\VariableCollection::fromArray($variables['files']), \PHPUnit\TextUI\XmlConfiguration\VariableCollection::fromArray($variables['request']));
60133    }
60134    private function phpunit(string $filename, DOMDocument $document) : \PHPUnit\TextUI\XmlConfiguration\PHPUnit
60135    {
60136        $executionOrder = TestSuiteSorter::ORDER_DEFAULT;
60137        $defectsFirst = \false;
60138        $resolveDependencies = $this->getBooleanAttribute($document->documentElement, 'resolveDependencies', \true);
60139        if ($document->documentElement->hasAttribute('executionOrder')) {
60140            foreach (explode(',', $document->documentElement->getAttribute('executionOrder')) as $order) {
60141                switch ($order) {
60142                    case 'default':
60143                        $executionOrder = TestSuiteSorter::ORDER_DEFAULT;
60144                        $defectsFirst = \false;
60145                        $resolveDependencies = \true;
60146                        break;
60147                    case 'depends':
60148                        $resolveDependencies = \true;
60149                        break;
60150                    case 'no-depends':
60151                        $resolveDependencies = \false;
60152                        break;
60153                    case 'defects':
60154                        $defectsFirst = \true;
60155                        break;
60156                    case 'duration':
60157                        $executionOrder = TestSuiteSorter::ORDER_DURATION;
60158                        break;
60159                    case 'random':
60160                        $executionOrder = TestSuiteSorter::ORDER_RANDOMIZED;
60161                        break;
60162                    case 'reverse':
60163                        $executionOrder = TestSuiteSorter::ORDER_REVERSED;
60164                        break;
60165                    case 'size':
60166                        $executionOrder = TestSuiteSorter::ORDER_SIZE;
60167                        break;
60168                }
60169            }
60170        }
60171        $printerClass = $this->getStringAttribute($document->documentElement, 'printerClass');
60172        $testdox = $this->getBooleanAttribute($document->documentElement, 'testdox', \false);
60173        $conflictBetweenPrinterClassAndTestdox = \false;
60174        if ($testdox) {
60175            if ($printerClass !== null) {
60176                $conflictBetweenPrinterClassAndTestdox = \true;
60177            }
60178            $printerClass = CliTestDoxPrinter::class;
60179        }
60180        $cacheResultFile = $this->getStringAttribute($document->documentElement, 'cacheResultFile');
60181        if ($cacheResultFile !== null) {
60182            $cacheResultFile = $this->toAbsolutePath($filename, $cacheResultFile);
60183        }
60184        $bootstrap = $this->getStringAttribute($document->documentElement, 'bootstrap');
60185        if ($bootstrap !== null) {
60186            $bootstrap = $this->toAbsolutePath($filename, $bootstrap);
60187        }
60188        $extensionsDirectory = $this->getStringAttribute($document->documentElement, 'extensionsDirectory');
60189        if ($extensionsDirectory !== null) {
60190            $extensionsDirectory = $this->toAbsolutePath($filename, $extensionsDirectory);
60191        }
60192        $testSuiteLoaderFile = $this->getStringAttribute($document->documentElement, 'testSuiteLoaderFile');
60193        if ($testSuiteLoaderFile !== null) {
60194            $testSuiteLoaderFile = $this->toAbsolutePath($filename, $testSuiteLoaderFile);
60195        }
60196        $printerFile = $this->getStringAttribute($document->documentElement, 'printerFile');
60197        if ($printerFile !== null) {
60198            $printerFile = $this->toAbsolutePath($filename, $printerFile);
60199        }
60200        return new \PHPUnit\TextUI\XmlConfiguration\PHPUnit($this->getBooleanAttribute($document->documentElement, 'cacheResult', \true), $cacheResultFile, $this->getColumns($document), $this->getColors($document), $this->getBooleanAttribute($document->documentElement, 'stderr', \false), $this->getBooleanAttribute($document->documentElement, 'noInteraction', \false), $this->getBooleanAttribute($document->documentElement, 'verbose', \false), $this->getBooleanAttribute($document->documentElement, 'reverseDefectList', \false), $this->getBooleanAttribute($document->documentElement, 'convertDeprecationsToExceptions', \false), $this->getBooleanAttribute($document->documentElement, 'convertErrorsToExceptions', \true), $this->getBooleanAttribute($document->documentElement, 'convertNoticesToExceptions', \true), $this->getBooleanAttribute($document->documentElement, 'convertWarningsToExceptions', \true), $this->getBooleanAttribute($document->documentElement, 'forceCoversAnnotation', \false), $bootstrap, $this->getBooleanAttribute($document->documentElement, 'processIsolation', \false), $this->getBooleanAttribute($document->documentElement, 'failOnEmptyTestSuite', \false), $this->getBooleanAttribute($document->documentElement, 'failOnIncomplete', \false), $this->getBooleanAttribute($document->documentElement, 'failOnRisky', \false), $this->getBooleanAttribute($document->documentElement, 'failOnSkipped', \false), $this->getBooleanAttribute($document->documentElement, 'failOnWarning', \false), $this->getBooleanAttribute($document->documentElement, 'stopOnDefect', \false), $this->getBooleanAttribute($document->documentElement, 'stopOnError', \false), $this->getBooleanAttribute($document->documentElement, 'stopOnFailure', \false), $this->getBooleanAttribute($document->documentElement, 'stopOnWarning', \false), $this->getBooleanAttribute($document->documentElement, 'stopOnIncomplete', \false), $this->getBooleanAttribute($document->documentElement, 'stopOnRisky', \false), $this->getBooleanAttribute($document->documentElement, 'stopOnSkipped', \false), $extensionsDirectory, $this->getStringAttribute($document->documentElement, 'testSuiteLoaderClass'), $testSuiteLoaderFile, $printerClass, $printerFile, $this->getBooleanAttribute($document->documentElement, 'beStrictAboutChangesToGlobalState', \false), $this->getBooleanAttribute($document->documentElement, 'beStrictAboutOutputDuringTests', \false), $this->getBooleanAttribute($document->documentElement, 'beStrictAboutResourceUsageDuringSmallTests', \false), $this->getBooleanAttribute($document->documentElement, 'beStrictAboutTestsThatDoNotTestAnything', \true), $this->getBooleanAttribute($document->documentElement, 'beStrictAboutTodoAnnotatedTests', \false), $this->getBooleanAttribute($document->documentElement, 'beStrictAboutCoversAnnotation', \false), $this->getBooleanAttribute($document->documentElement, 'enforceTimeLimit', \false), $this->getIntegerAttribute($document->documentElement, 'defaultTimeLimit', 1), $this->getIntegerAttribute($document->documentElement, 'timeoutForSmallTests', 1), $this->getIntegerAttribute($document->documentElement, 'timeoutForMediumTests', 10), $this->getIntegerAttribute($document->documentElement, 'timeoutForLargeTests', 60), $this->getStringAttribute($document->documentElement, 'defaultTestSuite'), $executionOrder, $resolveDependencies, $defectsFirst, $this->getBooleanAttribute($document->documentElement, 'backupGlobals', \false), $this->getBooleanAttribute($document->documentElement, 'backupStaticAttributes', \false), $this->getBooleanAttribute($document->documentElement, 'registerMockObjectsFromTestArgumentsRecursively', \false), $conflictBetweenPrinterClassAndTestdox);
60201    }
60202    private function getColors(DOMDocument $document) : string
60203    {
60204        $colors = DefaultResultPrinter::COLOR_DEFAULT;
60205        if ($document->documentElement->hasAttribute('colors')) {
60206            /* only allow boolean for compatibility with previous versions
60207               'always' only allowed from command line */
60208            if ($this->getBoolean($document->documentElement->getAttribute('colors'), \false)) {
60209                $colors = DefaultResultPrinter::COLOR_AUTO;
60210            } else {
60211                $colors = DefaultResultPrinter::COLOR_NEVER;
60212            }
60213        }
60214        return $colors;
60215    }
60216    /**
60217     * @return int|string
60218     */
60219    private function getColumns(DOMDocument $document)
60220    {
60221        $columns = 80;
60222        if ($document->documentElement->hasAttribute('columns')) {
60223            $columns = (string) $document->documentElement->getAttribute('columns');
60224            if ($columns !== 'max') {
60225                $columns = $this->getInteger($columns, 80);
60226            }
60227        }
60228        return $columns;
60229    }
60230    private function testSuite(string $filename, DOMXPath $xpath) : \PHPUnit\TextUI\XmlConfiguration\TestSuiteCollection
60231    {
60232        $testSuites = [];
60233        foreach ($this->getTestSuiteElements($xpath) as $element) {
60234            $exclude = [];
60235            foreach ($element->getElementsByTagName('exclude') as $excludeNode) {
60236                $excludeFile = (string) $excludeNode->textContent;
60237                if ($excludeFile) {
60238                    $exclude[] = new \PHPUnit\TextUI\XmlConfiguration\File($this->toAbsolutePath($filename, $excludeFile));
60239                }
60240            }
60241            $directories = [];
60242            foreach ($element->getElementsByTagName('directory') as $directoryNode) {
60243                assert($directoryNode instanceof DOMElement);
60244                $directory = (string) $directoryNode->textContent;
60245                if (empty($directory)) {
60246                    continue;
60247                }
60248                $prefix = '';
60249                if ($directoryNode->hasAttribute('prefix')) {
60250                    $prefix = (string) $directoryNode->getAttribute('prefix');
60251                }
60252                $suffix = 'Test.php';
60253                if ($directoryNode->hasAttribute('suffix')) {
60254                    $suffix = (string) $directoryNode->getAttribute('suffix');
60255                }
60256                $phpVersion = \PHP_VERSION;
60257                if ($directoryNode->hasAttribute('phpVersion')) {
60258                    $phpVersion = (string) $directoryNode->getAttribute('phpVersion');
60259                }
60260                $phpVersionOperator = new VersionComparisonOperator('>=');
60261                if ($directoryNode->hasAttribute('phpVersionOperator')) {
60262                    $phpVersionOperator = new VersionComparisonOperator((string) $directoryNode->getAttribute('phpVersionOperator'));
60263                }
60264                $directories[] = new \PHPUnit\TextUI\XmlConfiguration\TestDirectory($this->toAbsolutePath($filename, $directory), $prefix, $suffix, $phpVersion, $phpVersionOperator);
60265            }
60266            $files = [];
60267            foreach ($element->getElementsByTagName('file') as $fileNode) {
60268                assert($fileNode instanceof DOMElement);
60269                $file = (string) $fileNode->textContent;
60270                if (empty($file)) {
60271                    continue;
60272                }
60273                $phpVersion = \PHP_VERSION;
60274                if ($fileNode->hasAttribute('phpVersion')) {
60275                    $phpVersion = (string) $fileNode->getAttribute('phpVersion');
60276                }
60277                $phpVersionOperator = new VersionComparisonOperator('>=');
60278                if ($fileNode->hasAttribute('phpVersionOperator')) {
60279                    $phpVersionOperator = new VersionComparisonOperator((string) $fileNode->getAttribute('phpVersionOperator'));
60280                }
60281                $files[] = new \PHPUnit\TextUI\XmlConfiguration\TestFile($this->toAbsolutePath($filename, $file), $phpVersion, $phpVersionOperator);
60282            }
60283            $testSuites[] = new TestSuiteConfiguration((string) $element->getAttribute('name'), \PHPUnit\TextUI\XmlConfiguration\TestDirectoryCollection::fromArray($directories), \PHPUnit\TextUI\XmlConfiguration\TestFileCollection::fromArray($files), \PHPUnit\TextUI\XmlConfiguration\FileCollection::fromArray($exclude));
60284        }
60285        return \PHPUnit\TextUI\XmlConfiguration\TestSuiteCollection::fromArray($testSuites);
60286    }
60287    /**
60288     * @return DOMElement[]
60289     */
60290    private function getTestSuiteElements(DOMXPath $xpath) : array
60291    {
60292        /** @var DOMElement[] $elements */
60293        $elements = [];
60294        $testSuiteNodes = $xpath->query('testsuites/testsuite');
60295        if ($testSuiteNodes->length === 0) {
60296            $testSuiteNodes = $xpath->query('testsuite');
60297        }
60298        if ($testSuiteNodes->length === 1) {
60299            $element = $testSuiteNodes->item(0);
60300            assert($element instanceof DOMElement);
60301            $elements[] = $element;
60302        } else {
60303            foreach ($testSuiteNodes as $testSuiteNode) {
60304                assert($testSuiteNode instanceof DOMElement);
60305                $elements[] = $testSuiteNode;
60306            }
60307        }
60308        return $elements;
60309    }
60310    private function element(DOMXPath $xpath, string $element) : ?DOMElement
60311    {
60312        $nodes = $xpath->query($element);
60313        if ($nodes->length === 1) {
60314            $node = $nodes->item(0);
60315            assert($node instanceof DOMElement);
60316            return $node;
60317        }
60318        return null;
60319    }
60320}
60321<?php
60322
60323declare (strict_types=1);
60324/*
60325 * This file is part of PHPUnit.
60326 *
60327 * (c) Sebastian Bergmann <sebastian@phpunit.de>
60328 *
60329 * For the full copyright and license information, please view the LICENSE
60330 * file that was distributed with this source code.
60331 */
60332namespace PHPUnit\TextUI\XmlConfiguration;
60333
60334use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\CodeCoverage;
60335use PHPUnit\TextUI\XmlConfiguration\Logging\Logging;
60336use PHPUnit\Util\Xml\ValidationResult;
60337/**
60338 * @internal This class is not covered by the backward compatibility promise for PHPUnit
60339 * @psalm-immutable
60340 */
60341final class Configuration
60342{
60343    /**
60344     * @var string
60345     */
60346    private $filename;
60347    /**
60348     * @var ValidationResult
60349     */
60350    private $validationResult;
60351    /**
60352     * @var ExtensionCollection
60353     */
60354    private $extensions;
60355    /**
60356     * @var CodeCoverage
60357     */
60358    private $codeCoverage;
60359    /**
60360     * @var Groups
60361     */
60362    private $groups;
60363    /**
60364     * @var Groups
60365     */
60366    private $testdoxGroups;
60367    /**
60368     * @var ExtensionCollection
60369     */
60370    private $listeners;
60371    /**
60372     * @var Logging
60373     */
60374    private $logging;
60375    /**
60376     * @var Php
60377     */
60378    private $php;
60379    /**
60380     * @var PHPUnit
60381     */
60382    private $phpunit;
60383    /**
60384     * @var TestSuiteCollection
60385     */
60386    private $testSuite;
60387    public function __construct(string $filename, ValidationResult $validationResult, \PHPUnit\TextUI\XmlConfiguration\ExtensionCollection $extensions, CodeCoverage $codeCoverage, \PHPUnit\TextUI\XmlConfiguration\Groups $groups, \PHPUnit\TextUI\XmlConfiguration\Groups $testdoxGroups, \PHPUnit\TextUI\XmlConfiguration\ExtensionCollection $listeners, Logging $logging, \PHPUnit\TextUI\XmlConfiguration\Php $php, \PHPUnit\TextUI\XmlConfiguration\PHPUnit $phpunit, \PHPUnit\TextUI\XmlConfiguration\TestSuiteCollection $testSuite)
60388    {
60389        $this->filename = $filename;
60390        $this->validationResult = $validationResult;
60391        $this->extensions = $extensions;
60392        $this->codeCoverage = $codeCoverage;
60393        $this->groups = $groups;
60394        $this->testdoxGroups = $testdoxGroups;
60395        $this->listeners = $listeners;
60396        $this->logging = $logging;
60397        $this->php = $php;
60398        $this->phpunit = $phpunit;
60399        $this->testSuite = $testSuite;
60400    }
60401    public function filename() : string
60402    {
60403        return $this->filename;
60404    }
60405    public function hasValidationErrors() : bool
60406    {
60407        return $this->validationResult->hasValidationErrors();
60408    }
60409    public function validationErrors() : string
60410    {
60411        return $this->validationResult->asString();
60412    }
60413    public function extensions() : \PHPUnit\TextUI\XmlConfiguration\ExtensionCollection
60414    {
60415        return $this->extensions;
60416    }
60417    public function codeCoverage() : CodeCoverage
60418    {
60419        return $this->codeCoverage;
60420    }
60421    public function groups() : \PHPUnit\TextUI\XmlConfiguration\Groups
60422    {
60423        return $this->groups;
60424    }
60425    public function testdoxGroups() : \PHPUnit\TextUI\XmlConfiguration\Groups
60426    {
60427        return $this->testdoxGroups;
60428    }
60429    public function listeners() : \PHPUnit\TextUI\XmlConfiguration\ExtensionCollection
60430    {
60431        return $this->listeners;
60432    }
60433    public function logging() : Logging
60434    {
60435        return $this->logging;
60436    }
60437    public function php() : \PHPUnit\TextUI\XmlConfiguration\Php
60438    {
60439        return $this->php;
60440    }
60441    public function phpunit() : \PHPUnit\TextUI\XmlConfiguration\PHPUnit
60442    {
60443        return $this->phpunit;
60444    }
60445    public function testSuite() : \PHPUnit\TextUI\XmlConfiguration\TestSuiteCollection
60446    {
60447        return $this->testSuite;
60448    }
60449}
60450<?php
60451
60452declare (strict_types=1);
60453/*
60454 * This file is part of PHPUnit.
60455 *
60456 * (c) Sebastian Bergmann <sebastian@phpunit.de>
60457 *
60458 * For the full copyright and license information, please view the LICENSE
60459 * file that was distributed with this source code.
60460 */
60461namespace PHPUnit\TextUI\XmlConfiguration;
60462
60463/**
60464 * @internal This class is not covered by the backward compatibility promise for PHPUnit
60465 * @psalm-immutable
60466 */
60467final class PHPUnit
60468{
60469    /**
60470     * @var bool
60471     */
60472    private $cacheResult;
60473    /**
60474     * @var ?string
60475     */
60476    private $cacheResultFile;
60477    /**
60478     * @var int|string
60479     */
60480    private $columns;
60481    /**
60482     * @var string
60483     */
60484    private $colors;
60485    /**
60486     * @var bool
60487     */
60488    private $stderr;
60489    /**
60490     * @var bool
60491     */
60492    private $noInteraction;
60493    /**
60494     * @var bool
60495     */
60496    private $verbose;
60497    /**
60498     * @var bool
60499     */
60500    private $reverseDefectList;
60501    /**
60502     * @var bool
60503     */
60504    private $convertDeprecationsToExceptions;
60505    /**
60506     * @var bool
60507     */
60508    private $convertErrorsToExceptions;
60509    /**
60510     * @var bool
60511     */
60512    private $convertNoticesToExceptions;
60513    /**
60514     * @var bool
60515     */
60516    private $convertWarningsToExceptions;
60517    /**
60518     * @var bool
60519     */
60520    private $forceCoversAnnotation;
60521    /**
60522     * @var ?string
60523     */
60524    private $bootstrap;
60525    /**
60526     * @var bool
60527     */
60528    private $processIsolation;
60529    /**
60530     * @var bool
60531     */
60532    private $failOnEmptyTestSuite;
60533    /**
60534     * @var bool
60535     */
60536    private $failOnIncomplete;
60537    /**
60538     * @var bool
60539     */
60540    private $failOnRisky;
60541    /**
60542     * @var bool
60543     */
60544    private $failOnSkipped;
60545    /**
60546     * @var bool
60547     */
60548    private $failOnWarning;
60549    /**
60550     * @var bool
60551     */
60552    private $stopOnDefect;
60553    /**
60554     * @var bool
60555     */
60556    private $stopOnError;
60557    /**
60558     * @var bool
60559     */
60560    private $stopOnFailure;
60561    /**
60562     * @var bool
60563     */
60564    private $stopOnWarning;
60565    /**
60566     * @var bool
60567     */
60568    private $stopOnIncomplete;
60569    /**
60570     * @var bool
60571     */
60572    private $stopOnRisky;
60573    /**
60574     * @var bool
60575     */
60576    private $stopOnSkipped;
60577    /**
60578     * @var ?string
60579     */
60580    private $extensionsDirectory;
60581    /**
60582     * @var ?string
60583     *
60584     * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039
60585     */
60586    private $testSuiteLoaderClass;
60587    /**
60588     * @var ?string
60589     *
60590     * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039
60591     */
60592    private $testSuiteLoaderFile;
60593    /**
60594     * @var ?string
60595     */
60596    private $printerClass;
60597    /**
60598     * @var ?string
60599     */
60600    private $printerFile;
60601    /**
60602     * @var bool
60603     */
60604    private $beStrictAboutChangesToGlobalState;
60605    /**
60606     * @var bool
60607     */
60608    private $beStrictAboutOutputDuringTests;
60609    /**
60610     * @var bool
60611     */
60612    private $beStrictAboutResourceUsageDuringSmallTests;
60613    /**
60614     * @var bool
60615     */
60616    private $beStrictAboutTestsThatDoNotTestAnything;
60617    /**
60618     * @var bool
60619     */
60620    private $beStrictAboutTodoAnnotatedTests;
60621    /**
60622     * @var bool
60623     */
60624    private $beStrictAboutCoversAnnotation;
60625    /**
60626     * @var bool
60627     */
60628    private $enforceTimeLimit;
60629    /**
60630     * @var int
60631     */
60632    private $defaultTimeLimit;
60633    /**
60634     * @var int
60635     */
60636    private $timeoutForSmallTests;
60637    /**
60638     * @var int
60639     */
60640    private $timeoutForMediumTests;
60641    /**
60642     * @var int
60643     */
60644    private $timeoutForLargeTests;
60645    /**
60646     * @var ?string
60647     */
60648    private $defaultTestSuite;
60649    /**
60650     * @var int
60651     */
60652    private $executionOrder;
60653    /**
60654     * @var bool
60655     */
60656    private $resolveDependencies;
60657    /**
60658     * @var bool
60659     */
60660    private $defectsFirst;
60661    /**
60662     * @var bool
60663     */
60664    private $backupGlobals;
60665    /**
60666     * @var bool
60667     */
60668    private $backupStaticAttributes;
60669    /**
60670     * @var bool
60671     */
60672    private $registerMockObjectsFromTestArgumentsRecursively;
60673    /**
60674     * @var bool
60675     */
60676    private $conflictBetweenPrinterClassAndTestdox;
60677    public function __construct(bool $cacheResult, ?string $cacheResultFile, $columns, string $colors, bool $stderr, bool $noInteraction, bool $verbose, bool $reverseDefectList, bool $convertDeprecationsToExceptions, bool $convertErrorsToExceptions, bool $convertNoticesToExceptions, bool $convertWarningsToExceptions, bool $forceCoversAnnotation, ?string $bootstrap, bool $processIsolation, bool $failOnEmptyTestSuite, bool $failOnIncomplete, bool $failOnRisky, bool $failOnSkipped, bool $failOnWarning, bool $stopOnDefect, bool $stopOnError, bool $stopOnFailure, bool $stopOnWarning, bool $stopOnIncomplete, bool $stopOnRisky, bool $stopOnSkipped, ?string $extensionsDirectory, ?string $testSuiteLoaderClass, ?string $testSuiteLoaderFile, ?string $printerClass, ?string $printerFile, bool $beStrictAboutChangesToGlobalState, bool $beStrictAboutOutputDuringTests, bool $beStrictAboutResourceUsageDuringSmallTests, bool $beStrictAboutTestsThatDoNotTestAnything, bool $beStrictAboutTodoAnnotatedTests, bool $beStrictAboutCoversAnnotation, bool $enforceTimeLimit, int $defaultTimeLimit, int $timeoutForSmallTests, int $timeoutForMediumTests, int $timeoutForLargeTests, ?string $defaultTestSuite, int $executionOrder, bool $resolveDependencies, bool $defectsFirst, bool $backupGlobals, bool $backupStaticAttributes, bool $registerMockObjectsFromTestArgumentsRecursively, bool $conflictBetweenPrinterClassAndTestdox)
60678    {
60679        $this->cacheResult = $cacheResult;
60680        $this->cacheResultFile = $cacheResultFile;
60681        $this->columns = $columns;
60682        $this->colors = $colors;
60683        $this->stderr = $stderr;
60684        $this->noInteraction = $noInteraction;
60685        $this->verbose = $verbose;
60686        $this->reverseDefectList = $reverseDefectList;
60687        $this->convertDeprecationsToExceptions = $convertDeprecationsToExceptions;
60688        $this->convertErrorsToExceptions = $convertErrorsToExceptions;
60689        $this->convertNoticesToExceptions = $convertNoticesToExceptions;
60690        $this->convertWarningsToExceptions = $convertWarningsToExceptions;
60691        $this->forceCoversAnnotation = $forceCoversAnnotation;
60692        $this->bootstrap = $bootstrap;
60693        $this->processIsolation = $processIsolation;
60694        $this->failOnEmptyTestSuite = $failOnEmptyTestSuite;
60695        $this->failOnIncomplete = $failOnIncomplete;
60696        $this->failOnRisky = $failOnRisky;
60697        $this->failOnSkipped = $failOnSkipped;
60698        $this->failOnWarning = $failOnWarning;
60699        $this->stopOnDefect = $stopOnDefect;
60700        $this->stopOnError = $stopOnError;
60701        $this->stopOnFailure = $stopOnFailure;
60702        $this->stopOnWarning = $stopOnWarning;
60703        $this->stopOnIncomplete = $stopOnIncomplete;
60704        $this->stopOnRisky = $stopOnRisky;
60705        $this->stopOnSkipped = $stopOnSkipped;
60706        $this->extensionsDirectory = $extensionsDirectory;
60707        $this->testSuiteLoaderClass = $testSuiteLoaderClass;
60708        $this->testSuiteLoaderFile = $testSuiteLoaderFile;
60709        $this->printerClass = $printerClass;
60710        $this->printerFile = $printerFile;
60711        $this->beStrictAboutChangesToGlobalState = $beStrictAboutChangesToGlobalState;
60712        $this->beStrictAboutOutputDuringTests = $beStrictAboutOutputDuringTests;
60713        $this->beStrictAboutResourceUsageDuringSmallTests = $beStrictAboutResourceUsageDuringSmallTests;
60714        $this->beStrictAboutTestsThatDoNotTestAnything = $beStrictAboutTestsThatDoNotTestAnything;
60715        $this->beStrictAboutTodoAnnotatedTests = $beStrictAboutTodoAnnotatedTests;
60716        $this->beStrictAboutCoversAnnotation = $beStrictAboutCoversAnnotation;
60717        $this->enforceTimeLimit = $enforceTimeLimit;
60718        $this->defaultTimeLimit = $defaultTimeLimit;
60719        $this->timeoutForSmallTests = $timeoutForSmallTests;
60720        $this->timeoutForMediumTests = $timeoutForMediumTests;
60721        $this->timeoutForLargeTests = $timeoutForLargeTests;
60722        $this->defaultTestSuite = $defaultTestSuite;
60723        $this->executionOrder = $executionOrder;
60724        $this->resolveDependencies = $resolveDependencies;
60725        $this->defectsFirst = $defectsFirst;
60726        $this->backupGlobals = $backupGlobals;
60727        $this->backupStaticAttributes = $backupStaticAttributes;
60728        $this->registerMockObjectsFromTestArgumentsRecursively = $registerMockObjectsFromTestArgumentsRecursively;
60729        $this->conflictBetweenPrinterClassAndTestdox = $conflictBetweenPrinterClassAndTestdox;
60730    }
60731    public function cacheResult() : bool
60732    {
60733        return $this->cacheResult;
60734    }
60735    /**
60736     * @psalm-assert-if-true !null $this->cacheResultFile
60737     */
60738    public function hasCacheResultFile() : bool
60739    {
60740        return $this->cacheResultFile !== null;
60741    }
60742    /**
60743     * @throws Exception
60744     */
60745    public function cacheResultFile() : string
60746    {
60747        if (!$this->hasCacheResultFile()) {
60748            throw new \PHPUnit\TextUI\XmlConfiguration\Exception('Cache result file is not configured');
60749        }
60750        return (string) $this->cacheResultFile;
60751    }
60752    public function columns()
60753    {
60754        return $this->columns;
60755    }
60756    public function colors() : string
60757    {
60758        return $this->colors;
60759    }
60760    public function stderr() : bool
60761    {
60762        return $this->stderr;
60763    }
60764    public function noInteraction() : bool
60765    {
60766        return $this->noInteraction;
60767    }
60768    public function verbose() : bool
60769    {
60770        return $this->verbose;
60771    }
60772    public function reverseDefectList() : bool
60773    {
60774        return $this->reverseDefectList;
60775    }
60776    public function convertDeprecationsToExceptions() : bool
60777    {
60778        return $this->convertDeprecationsToExceptions;
60779    }
60780    public function convertErrorsToExceptions() : bool
60781    {
60782        return $this->convertErrorsToExceptions;
60783    }
60784    public function convertNoticesToExceptions() : bool
60785    {
60786        return $this->convertNoticesToExceptions;
60787    }
60788    public function convertWarningsToExceptions() : bool
60789    {
60790        return $this->convertWarningsToExceptions;
60791    }
60792    public function forceCoversAnnotation() : bool
60793    {
60794        return $this->forceCoversAnnotation;
60795    }
60796    /**
60797     * @psalm-assert-if-true !null $this->bootstrap
60798     */
60799    public function hasBootstrap() : bool
60800    {
60801        return $this->bootstrap !== null;
60802    }
60803    /**
60804     * @throws Exception
60805     */
60806    public function bootstrap() : string
60807    {
60808        if (!$this->hasBootstrap()) {
60809            throw new \PHPUnit\TextUI\XmlConfiguration\Exception('Bootstrap script is not configured');
60810        }
60811        return (string) $this->bootstrap;
60812    }
60813    public function processIsolation() : bool
60814    {
60815        return $this->processIsolation;
60816    }
60817    public function failOnEmptyTestSuite() : bool
60818    {
60819        return $this->failOnEmptyTestSuite;
60820    }
60821    public function failOnIncomplete() : bool
60822    {
60823        return $this->failOnIncomplete;
60824    }
60825    public function failOnRisky() : bool
60826    {
60827        return $this->failOnRisky;
60828    }
60829    public function failOnSkipped() : bool
60830    {
60831        return $this->failOnSkipped;
60832    }
60833    public function failOnWarning() : bool
60834    {
60835        return $this->failOnWarning;
60836    }
60837    public function stopOnDefect() : bool
60838    {
60839        return $this->stopOnDefect;
60840    }
60841    public function stopOnError() : bool
60842    {
60843        return $this->stopOnError;
60844    }
60845    public function stopOnFailure() : bool
60846    {
60847        return $this->stopOnFailure;
60848    }
60849    public function stopOnWarning() : bool
60850    {
60851        return $this->stopOnWarning;
60852    }
60853    public function stopOnIncomplete() : bool
60854    {
60855        return $this->stopOnIncomplete;
60856    }
60857    public function stopOnRisky() : bool
60858    {
60859        return $this->stopOnRisky;
60860    }
60861    public function stopOnSkipped() : bool
60862    {
60863        return $this->stopOnSkipped;
60864    }
60865    /**
60866     * @psalm-assert-if-true !null $this->extensionsDirectory
60867     */
60868    public function hasExtensionsDirectory() : bool
60869    {
60870        return $this->extensionsDirectory !== null;
60871    }
60872    /**
60873     * @throws Exception
60874     */
60875    public function extensionsDirectory() : string
60876    {
60877        if (!$this->hasExtensionsDirectory()) {
60878            throw new \PHPUnit\TextUI\XmlConfiguration\Exception('Extensions directory is not configured');
60879        }
60880        return (string) $this->extensionsDirectory;
60881    }
60882    /**
60883     * @psalm-assert-if-true !null $this->testSuiteLoaderClass
60884     *
60885     * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039
60886     */
60887    public function hasTestSuiteLoaderClass() : bool
60888    {
60889        return $this->testSuiteLoaderClass !== null;
60890    }
60891    /**
60892     * @throws Exception
60893     *
60894     * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039
60895     */
60896    public function testSuiteLoaderClass() : string
60897    {
60898        if (!$this->hasTestSuiteLoaderClass()) {
60899            throw new \PHPUnit\TextUI\XmlConfiguration\Exception('TestSuiteLoader class is not configured');
60900        }
60901        return (string) $this->testSuiteLoaderClass;
60902    }
60903    /**
60904     * @psalm-assert-if-true !null $this->testSuiteLoaderFile
60905     *
60906     * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039
60907     */
60908    public function hasTestSuiteLoaderFile() : bool
60909    {
60910        return $this->testSuiteLoaderFile !== null;
60911    }
60912    /**
60913     * @throws Exception
60914     *
60915     * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039
60916     */
60917    public function testSuiteLoaderFile() : string
60918    {
60919        if (!$this->hasTestSuiteLoaderFile()) {
60920            throw new \PHPUnit\TextUI\XmlConfiguration\Exception('TestSuiteLoader sourcecode file is not configured');
60921        }
60922        return (string) $this->testSuiteLoaderFile;
60923    }
60924    /**
60925     * @psalm-assert-if-true !null $this->printerClass
60926     */
60927    public function hasPrinterClass() : bool
60928    {
60929        return $this->printerClass !== null;
60930    }
60931    /**
60932     * @throws Exception
60933     */
60934    public function printerClass() : string
60935    {
60936        if (!$this->hasPrinterClass()) {
60937            throw new \PHPUnit\TextUI\XmlConfiguration\Exception('ResultPrinter class is not configured');
60938        }
60939        return (string) $this->printerClass;
60940    }
60941    /**
60942     * @psalm-assert-if-true !null $this->printerFile
60943     */
60944    public function hasPrinterFile() : bool
60945    {
60946        return $this->printerFile !== null;
60947    }
60948    /**
60949     * @throws Exception
60950     */
60951    public function printerFile() : string
60952    {
60953        if (!$this->hasPrinterFile()) {
60954            throw new \PHPUnit\TextUI\XmlConfiguration\Exception('ResultPrinter sourcecode file is not configured');
60955        }
60956        return (string) $this->printerFile;
60957    }
60958    public function beStrictAboutChangesToGlobalState() : bool
60959    {
60960        return $this->beStrictAboutChangesToGlobalState;
60961    }
60962    public function beStrictAboutOutputDuringTests() : bool
60963    {
60964        return $this->beStrictAboutOutputDuringTests;
60965    }
60966    public function beStrictAboutResourceUsageDuringSmallTests() : bool
60967    {
60968        return $this->beStrictAboutResourceUsageDuringSmallTests;
60969    }
60970    public function beStrictAboutTestsThatDoNotTestAnything() : bool
60971    {
60972        return $this->beStrictAboutTestsThatDoNotTestAnything;
60973    }
60974    public function beStrictAboutTodoAnnotatedTests() : bool
60975    {
60976        return $this->beStrictAboutTodoAnnotatedTests;
60977    }
60978    public function beStrictAboutCoversAnnotation() : bool
60979    {
60980        return $this->beStrictAboutCoversAnnotation;
60981    }
60982    public function enforceTimeLimit() : bool
60983    {
60984        return $this->enforceTimeLimit;
60985    }
60986    public function defaultTimeLimit() : int
60987    {
60988        return $this->defaultTimeLimit;
60989    }
60990    public function timeoutForSmallTests() : int
60991    {
60992        return $this->timeoutForSmallTests;
60993    }
60994    public function timeoutForMediumTests() : int
60995    {
60996        return $this->timeoutForMediumTests;
60997    }
60998    public function timeoutForLargeTests() : int
60999    {
61000        return $this->timeoutForLargeTests;
61001    }
61002    /**
61003     * @psalm-assert-if-true !null $this->defaultTestSuite
61004     */
61005    public function hasDefaultTestSuite() : bool
61006    {
61007        return $this->defaultTestSuite !== null;
61008    }
61009    /**
61010     * @throws Exception
61011     */
61012    public function defaultTestSuite() : string
61013    {
61014        if (!$this->hasDefaultTestSuite()) {
61015            throw new \PHPUnit\TextUI\XmlConfiguration\Exception('Default test suite is not configured');
61016        }
61017        return (string) $this->defaultTestSuite;
61018    }
61019    public function executionOrder() : int
61020    {
61021        return $this->executionOrder;
61022    }
61023    public function resolveDependencies() : bool
61024    {
61025        return $this->resolveDependencies;
61026    }
61027    public function defectsFirst() : bool
61028    {
61029        return $this->defectsFirst;
61030    }
61031    public function backupGlobals() : bool
61032    {
61033        return $this->backupGlobals;
61034    }
61035    public function backupStaticAttributes() : bool
61036    {
61037        return $this->backupStaticAttributes;
61038    }
61039    public function registerMockObjectsFromTestArgumentsRecursively() : bool
61040    {
61041        return $this->registerMockObjectsFromTestArgumentsRecursively;
61042    }
61043    public function conflictBetweenPrinterClassAndTestdox() : bool
61044    {
61045        return $this->conflictBetweenPrinterClassAndTestdox;
61046    }
61047}
61048<?php
61049
61050declare (strict_types=1);
61051/*
61052 * This file is part of PHPUnit.
61053 *
61054 * (c) Sebastian Bergmann <sebastian@phpunit.de>
61055 *
61056 * For the full copyright and license information, please view the LICENSE
61057 * file that was distributed with this source code.
61058 */
61059namespace PHPUnit\TextUI\XmlConfiguration;
61060
61061/**
61062 * @internal This class is not covered by the backward compatibility promise for PHPUnit
61063 * @psalm-immutable
61064 */
61065final class Extension
61066{
61067    /**
61068     * @var string
61069     * @psalm-var class-string
61070     */
61071    private $className;
61072    /**
61073     * @var string
61074     */
61075    private $sourceFile;
61076    /**
61077     * @var array
61078     */
61079    private $arguments;
61080    /**
61081     * @psalm-param class-string $className
61082     */
61083    public function __construct(string $className, string $sourceFile, array $arguments)
61084    {
61085        $this->className = $className;
61086        $this->sourceFile = $sourceFile;
61087        $this->arguments = $arguments;
61088    }
61089    /**
61090     * @psalm-return class-string
61091     */
61092    public function className() : string
61093    {
61094        return $this->className;
61095    }
61096    public function hasSourceFile() : bool
61097    {
61098        return $this->sourceFile !== '';
61099    }
61100    public function sourceFile() : string
61101    {
61102        return $this->sourceFile;
61103    }
61104    public function hasArguments() : bool
61105    {
61106        return !empty($this->arguments);
61107    }
61108    public function arguments() : array
61109    {
61110        return $this->arguments;
61111    }
61112}
61113<?php
61114
61115declare (strict_types=1);
61116/*
61117 * This file is part of PHPUnit.
61118 *
61119 * (c) Sebastian Bergmann <sebastian@phpunit.de>
61120 *
61121 * For the full copyright and license information, please view the LICENSE
61122 * file that was distributed with this source code.
61123 */
61124namespace PHPUnit\TextUI\XmlConfiguration;
61125
61126use IteratorAggregate;
61127/**
61128 * @internal This class is not covered by the backward compatibility promise for PHPUnit
61129 * @psalm-immutable
61130 */
61131final class ExtensionCollection implements IteratorAggregate
61132{
61133    /**
61134     * @var Extension[]
61135     */
61136    private $extensions;
61137    /**
61138     * @param Extension[] $extensions
61139     */
61140    public static function fromArray(array $extensions) : self
61141    {
61142        return new self(...$extensions);
61143    }
61144    private function __construct(\PHPUnit\TextUI\XmlConfiguration\Extension ...$extensions)
61145    {
61146        $this->extensions = $extensions;
61147    }
61148    /**
61149     * @return Extension[]
61150     */
61151    public function asArray() : array
61152    {
61153        return $this->extensions;
61154    }
61155    public function getIterator() : \PHPUnit\TextUI\XmlConfiguration\ExtensionCollectionIterator
61156    {
61157        return new \PHPUnit\TextUI\XmlConfiguration\ExtensionCollectionIterator($this);
61158    }
61159}
61160<?php
61161
61162declare (strict_types=1);
61163/*
61164 * This file is part of PHPUnit.
61165 *
61166 * (c) Sebastian Bergmann <sebastian@phpunit.de>
61167 *
61168 * For the full copyright and license information, please view the LICENSE
61169 * file that was distributed with this source code.
61170 */
61171namespace PHPUnit\TextUI\XmlConfiguration;
61172
61173use function count;
61174use function iterator_count;
61175use Countable;
61176use Iterator;
61177/**
61178 * @internal This class is not covered by the backward compatibility promise for PHPUnit
61179 */
61180final class ExtensionCollectionIterator implements Countable, Iterator
61181{
61182    /**
61183     * @var Extension[]
61184     */
61185    private $extensions;
61186    /**
61187     * @var int
61188     */
61189    private $position;
61190    public function __construct(\PHPUnit\TextUI\XmlConfiguration\ExtensionCollection $extensions)
61191    {
61192        $this->extensions = $extensions->asArray();
61193    }
61194    public function count() : int
61195    {
61196        return iterator_count($this);
61197    }
61198    public function rewind() : void
61199    {
61200        $this->position = 0;
61201    }
61202    public function valid() : bool
61203    {
61204        return $this->position < count($this->extensions);
61205    }
61206    public function key() : int
61207    {
61208        return $this->position;
61209    }
61210    public function current() : \PHPUnit\TextUI\XmlConfiguration\Extension
61211    {
61212        return $this->extensions[$this->position];
61213    }
61214    public function next() : void
61215    {
61216        $this->position++;
61217    }
61218}
61219<?php
61220
61221declare (strict_types=1);
61222/*
61223 * This file is part of PHPUnit.
61224 *
61225 * (c) Sebastian Bergmann <sebastian@phpunit.de>
61226 *
61227 * For the full copyright and license information, please view the LICENSE
61228 * file that was distributed with this source code.
61229 */
61230namespace PHPUnit\TextUI\XmlConfiguration;
61231
61232/**
61233 * @internal This class is not covered by the backward compatibility promise for PHPUnit
61234 * @psalm-immutable
61235 */
61236final class TestSuite
61237{
61238    /**
61239     * @var string
61240     */
61241    private $name;
61242    /**
61243     * @var TestDirectoryCollection
61244     */
61245    private $directories;
61246    /**
61247     * @var TestFileCollection
61248     */
61249    private $files;
61250    /**
61251     * @var FileCollection
61252     */
61253    private $exclude;
61254    public function __construct(string $name, \PHPUnit\TextUI\XmlConfiguration\TestDirectoryCollection $directories, \PHPUnit\TextUI\XmlConfiguration\TestFileCollection $files, \PHPUnit\TextUI\XmlConfiguration\FileCollection $exclude)
61255    {
61256        $this->name = $name;
61257        $this->directories = $directories;
61258        $this->files = $files;
61259        $this->exclude = $exclude;
61260    }
61261    public function name() : string
61262    {
61263        return $this->name;
61264    }
61265    public function directories() : \PHPUnit\TextUI\XmlConfiguration\TestDirectoryCollection
61266    {
61267        return $this->directories;
61268    }
61269    public function files() : \PHPUnit\TextUI\XmlConfiguration\TestFileCollection
61270    {
61271        return $this->files;
61272    }
61273    public function exclude() : \PHPUnit\TextUI\XmlConfiguration\FileCollection
61274    {
61275        return $this->exclude;
61276    }
61277}
61278<?php
61279
61280declare (strict_types=1);
61281/*
61282 * This file is part of PHPUnit.
61283 *
61284 * (c) Sebastian Bergmann <sebastian@phpunit.de>
61285 *
61286 * For the full copyright and license information, please view the LICENSE
61287 * file that was distributed with this source code.
61288 */
61289namespace PHPUnit\TextUI\XmlConfiguration;
61290
61291use PHPUnit\Util\VersionComparisonOperator;
61292/**
61293 * @internal This class is not covered by the backward compatibility promise for PHPUnit
61294 * @psalm-immutable
61295 */
61296final class TestDirectory
61297{
61298    /**
61299     * @var string
61300     */
61301    private $path;
61302    /**
61303     * @var string
61304     */
61305    private $prefix;
61306    /**
61307     * @var string
61308     */
61309    private $suffix;
61310    /**
61311     * @var string
61312     */
61313    private $phpVersion;
61314    /**
61315     * @var VersionComparisonOperator
61316     */
61317    private $phpVersionOperator;
61318    public function __construct(string $path, string $prefix, string $suffix, string $phpVersion, VersionComparisonOperator $phpVersionOperator)
61319    {
61320        $this->path = $path;
61321        $this->prefix = $prefix;
61322        $this->suffix = $suffix;
61323        $this->phpVersion = $phpVersion;
61324        $this->phpVersionOperator = $phpVersionOperator;
61325    }
61326    public function path() : string
61327    {
61328        return $this->path;
61329    }
61330    public function prefix() : string
61331    {
61332        return $this->prefix;
61333    }
61334    public function suffix() : string
61335    {
61336        return $this->suffix;
61337    }
61338    public function phpVersion() : string
61339    {
61340        return $this->phpVersion;
61341    }
61342    public function phpVersionOperator() : VersionComparisonOperator
61343    {
61344        return $this->phpVersionOperator;
61345    }
61346}
61347<?php
61348
61349declare (strict_types=1);
61350/*
61351 * This file is part of PHPUnit.
61352 *
61353 * (c) Sebastian Bergmann <sebastian@phpunit.de>
61354 *
61355 * For the full copyright and license information, please view the LICENSE
61356 * file that was distributed with this source code.
61357 */
61358namespace PHPUnit\TextUI\XmlConfiguration;
61359
61360use function count;
61361use function iterator_count;
61362use Countable;
61363use Iterator;
61364/**
61365 * @internal This class is not covered by the backward compatibility promise for PHPUnit
61366 */
61367final class TestSuiteCollectionIterator implements Countable, Iterator
61368{
61369    /**
61370     * @var TestSuite[]
61371     */
61372    private $testSuites;
61373    /**
61374     * @var int
61375     */
61376    private $position;
61377    public function __construct(\PHPUnit\TextUI\XmlConfiguration\TestSuiteCollection $testSuites)
61378    {
61379        $this->testSuites = $testSuites->asArray();
61380    }
61381    public function count() : int
61382    {
61383        return iterator_count($this);
61384    }
61385    public function rewind() : void
61386    {
61387        $this->position = 0;
61388    }
61389    public function valid() : bool
61390    {
61391        return $this->position < count($this->testSuites);
61392    }
61393    public function key() : int
61394    {
61395        return $this->position;
61396    }
61397    public function current() : \PHPUnit\TextUI\XmlConfiguration\TestSuite
61398    {
61399        return $this->testSuites[$this->position];
61400    }
61401    public function next() : void
61402    {
61403        $this->position++;
61404    }
61405}
61406<?php
61407
61408declare (strict_types=1);
61409/*
61410 * This file is part of PHPUnit.
61411 *
61412 * (c) Sebastian Bergmann <sebastian@phpunit.de>
61413 *
61414 * For the full copyright and license information, please view the LICENSE
61415 * file that was distributed with this source code.
61416 */
61417namespace PHPUnit\TextUI\XmlConfiguration;
61418
61419use PHPUnit\Util\VersionComparisonOperator;
61420/**
61421 * @internal This class is not covered by the backward compatibility promise for PHPUnit
61422 * @psalm-immutable
61423 */
61424final class TestFile
61425{
61426    /**
61427     * @var string
61428     */
61429    private $path;
61430    /**
61431     * @var string
61432     */
61433    private $phpVersion;
61434    /**
61435     * @var VersionComparisonOperator
61436     */
61437    private $phpVersionOperator;
61438    public function __construct(string $path, string $phpVersion, VersionComparisonOperator $phpVersionOperator)
61439    {
61440        $this->path = $path;
61441        $this->phpVersion = $phpVersion;
61442        $this->phpVersionOperator = $phpVersionOperator;
61443    }
61444    public function path() : string
61445    {
61446        return $this->path;
61447    }
61448    public function phpVersion() : string
61449    {
61450        return $this->phpVersion;
61451    }
61452    public function phpVersionOperator() : VersionComparisonOperator
61453    {
61454        return $this->phpVersionOperator;
61455    }
61456}
61457<?php
61458
61459declare (strict_types=1);
61460/*
61461 * This file is part of PHPUnit.
61462 *
61463 * (c) Sebastian Bergmann <sebastian@phpunit.de>
61464 *
61465 * For the full copyright and license information, please view the LICENSE
61466 * file that was distributed with this source code.
61467 */
61468namespace PHPUnit\TextUI\XmlConfiguration;
61469
61470use function count;
61471use Countable;
61472use IteratorAggregate;
61473/**
61474 * @internal This class is not covered by the backward compatibility promise for PHPUnit
61475 * @psalm-immutable
61476 */
61477final class TestDirectoryCollection implements Countable, IteratorAggregate
61478{
61479    /**
61480     * @var TestDirectory[]
61481     */
61482    private $directories;
61483    /**
61484     * @param TestDirectory[] $directories
61485     */
61486    public static function fromArray(array $directories) : self
61487    {
61488        return new self(...$directories);
61489    }
61490    private function __construct(\PHPUnit\TextUI\XmlConfiguration\TestDirectory ...$directories)
61491    {
61492        $this->directories = $directories;
61493    }
61494    /**
61495     * @return TestDirectory[]
61496     */
61497    public function asArray() : array
61498    {
61499        return $this->directories;
61500    }
61501    public function count() : int
61502    {
61503        return count($this->directories);
61504    }
61505    public function getIterator() : \PHPUnit\TextUI\XmlConfiguration\TestDirectoryCollectionIterator
61506    {
61507        return new \PHPUnit\TextUI\XmlConfiguration\TestDirectoryCollectionIterator($this);
61508    }
61509    public function isEmpty() : bool
61510    {
61511        return $this->count() === 0;
61512    }
61513}
61514<?php
61515
61516declare (strict_types=1);
61517/*
61518 * This file is part of PHPUnit.
61519 *
61520 * (c) Sebastian Bergmann <sebastian@phpunit.de>
61521 *
61522 * For the full copyright and license information, please view the LICENSE
61523 * file that was distributed with this source code.
61524 */
61525namespace PHPUnit\TextUI\XmlConfiguration;
61526
61527use function count;
61528use Countable;
61529use IteratorAggregate;
61530/**
61531 * @internal This class is not covered by the backward compatibility promise for PHPUnit
61532 * @psalm-immutable
61533 */
61534final class TestSuiteCollection implements Countable, IteratorAggregate
61535{
61536    /**
61537     * @var TestSuite[]
61538     */
61539    private $testSuites;
61540    /**
61541     * @param TestSuite[] $testSuites
61542     */
61543    public static function fromArray(array $testSuites) : self
61544    {
61545        return new self(...$testSuites);
61546    }
61547    private function __construct(\PHPUnit\TextUI\XmlConfiguration\TestSuite ...$testSuites)
61548    {
61549        $this->testSuites = $testSuites;
61550    }
61551    /**
61552     * @return TestSuite[]
61553     */
61554    public function asArray() : array
61555    {
61556        return $this->testSuites;
61557    }
61558    public function count() : int
61559    {
61560        return count($this->testSuites);
61561    }
61562    public function getIterator() : \PHPUnit\TextUI\XmlConfiguration\TestSuiteCollectionIterator
61563    {
61564        return new \PHPUnit\TextUI\XmlConfiguration\TestSuiteCollectionIterator($this);
61565    }
61566    public function isEmpty() : bool
61567    {
61568        return $this->count() === 0;
61569    }
61570}
61571<?php
61572
61573declare (strict_types=1);
61574/*
61575 * This file is part of PHPUnit.
61576 *
61577 * (c) Sebastian Bergmann <sebastian@phpunit.de>
61578 *
61579 * For the full copyright and license information, please view the LICENSE
61580 * file that was distributed with this source code.
61581 */
61582namespace PHPUnit\TextUI\XmlConfiguration;
61583
61584use function count;
61585use function iterator_count;
61586use Countable;
61587use Iterator;
61588/**
61589 * @internal This class is not covered by the backward compatibility promise for PHPUnit
61590 */
61591final class TestFileCollectionIterator implements Countable, Iterator
61592{
61593    /**
61594     * @var TestFile[]
61595     */
61596    private $files;
61597    /**
61598     * @var int
61599     */
61600    private $position;
61601    public function __construct(\PHPUnit\TextUI\XmlConfiguration\TestFileCollection $files)
61602    {
61603        $this->files = $files->asArray();
61604    }
61605    public function count() : int
61606    {
61607        return iterator_count($this);
61608    }
61609    public function rewind() : void
61610    {
61611        $this->position = 0;
61612    }
61613    public function valid() : bool
61614    {
61615        return $this->position < count($this->files);
61616    }
61617    public function key() : int
61618    {
61619        return $this->position;
61620    }
61621    public function current() : \PHPUnit\TextUI\XmlConfiguration\TestFile
61622    {
61623        return $this->files[$this->position];
61624    }
61625    public function next() : void
61626    {
61627        $this->position++;
61628    }
61629}
61630<?php
61631
61632declare (strict_types=1);
61633/*
61634 * This file is part of PHPUnit.
61635 *
61636 * (c) Sebastian Bergmann <sebastian@phpunit.de>
61637 *
61638 * For the full copyright and license information, please view the LICENSE
61639 * file that was distributed with this source code.
61640 */
61641namespace PHPUnit\TextUI\XmlConfiguration;
61642
61643use function count;
61644use Countable;
61645use IteratorAggregate;
61646/**
61647 * @internal This class is not covered by the backward compatibility promise for PHPUnit
61648 * @psalm-immutable
61649 */
61650final class TestFileCollection implements Countable, IteratorAggregate
61651{
61652    /**
61653     * @var TestFile[]
61654     */
61655    private $files;
61656    /**
61657     * @param TestFile[] $files
61658     */
61659    public static function fromArray(array $files) : self
61660    {
61661        return new self(...$files);
61662    }
61663    private function __construct(\PHPUnit\TextUI\XmlConfiguration\TestFile ...$files)
61664    {
61665        $this->files = $files;
61666    }
61667    /**
61668     * @return TestFile[]
61669     */
61670    public function asArray() : array
61671    {
61672        return $this->files;
61673    }
61674    public function count() : int
61675    {
61676        return count($this->files);
61677    }
61678    public function getIterator() : \PHPUnit\TextUI\XmlConfiguration\TestFileCollectionIterator
61679    {
61680        return new \PHPUnit\TextUI\XmlConfiguration\TestFileCollectionIterator($this);
61681    }
61682    public function isEmpty() : bool
61683    {
61684        return $this->count() === 0;
61685    }
61686}
61687<?php
61688
61689declare (strict_types=1);
61690/*
61691 * This file is part of PHPUnit.
61692 *
61693 * (c) Sebastian Bergmann <sebastian@phpunit.de>
61694 *
61695 * For the full copyright and license information, please view the LICENSE
61696 * file that was distributed with this source code.
61697 */
61698namespace PHPUnit\TextUI\XmlConfiguration;
61699
61700use function count;
61701use function iterator_count;
61702use Countable;
61703use Iterator;
61704/**
61705 * @internal This class is not covered by the backward compatibility promise for PHPUnit
61706 */
61707final class TestDirectoryCollectionIterator implements Countable, Iterator
61708{
61709    /**
61710     * @var TestDirectory[]
61711     */
61712    private $directories;
61713    /**
61714     * @var int
61715     */
61716    private $position;
61717    public function __construct(\PHPUnit\TextUI\XmlConfiguration\TestDirectoryCollection $directories)
61718    {
61719        $this->directories = $directories->asArray();
61720    }
61721    public function count() : int
61722    {
61723        return iterator_count($this);
61724    }
61725    public function rewind() : void
61726    {
61727        $this->position = 0;
61728    }
61729    public function valid() : bool
61730    {
61731        return $this->position < count($this->directories);
61732    }
61733    public function key() : int
61734    {
61735        return $this->position;
61736    }
61737    public function current() : \PHPUnit\TextUI\XmlConfiguration\TestDirectory
61738    {
61739        return $this->directories[$this->position];
61740    }
61741    public function next() : void
61742    {
61743        $this->position++;
61744    }
61745}
61746<?php
61747
61748declare (strict_types=1);
61749/*
61750 * This file is part of PHPUnit.
61751 *
61752 * (c) Sebastian Bergmann <sebastian@phpunit.de>
61753 *
61754 * For the full copyright and license information, please view the LICENSE
61755 * file that was distributed with this source code.
61756 */
61757namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Filter;
61758
61759use function count;
61760use function iterator_count;
61761use Countable;
61762use Iterator;
61763/**
61764 * @internal This class is not covered by the backward compatibility promise for PHPUnit
61765 */
61766final class DirectoryCollectionIterator implements Countable, Iterator
61767{
61768    /**
61769     * @var Directory[]
61770     */
61771    private $directories;
61772    /**
61773     * @var int
61774     */
61775    private $position;
61776    public function __construct(\PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Filter\DirectoryCollection $directories)
61777    {
61778        $this->directories = $directories->asArray();
61779    }
61780    public function count() : int
61781    {
61782        return iterator_count($this);
61783    }
61784    public function rewind() : void
61785    {
61786        $this->position = 0;
61787    }
61788    public function valid() : bool
61789    {
61790        return $this->position < count($this->directories);
61791    }
61792    public function key() : int
61793    {
61794        return $this->position;
61795    }
61796    public function current() : \PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Filter\Directory
61797    {
61798        return $this->directories[$this->position];
61799    }
61800    public function next() : void
61801    {
61802        $this->position++;
61803    }
61804}
61805<?php
61806
61807declare (strict_types=1);
61808/*
61809 * This file is part of PHPUnit.
61810 *
61811 * (c) Sebastian Bergmann <sebastian@phpunit.de>
61812 *
61813 * For the full copyright and license information, please view the LICENSE
61814 * file that was distributed with this source code.
61815 */
61816namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Filter;
61817
61818use function count;
61819use Countable;
61820use IteratorAggregate;
61821/**
61822 * @internal This class is not covered by the backward compatibility promise for PHPUnit
61823 * @psalm-immutable
61824 */
61825final class DirectoryCollection implements Countable, IteratorAggregate
61826{
61827    /**
61828     * @var Directory[]
61829     */
61830    private $directories;
61831    /**
61832     * @param Directory[] $directories
61833     */
61834    public static function fromArray(array $directories) : self
61835    {
61836        return new self(...$directories);
61837    }
61838    private function __construct(\PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Filter\Directory ...$directories)
61839    {
61840        $this->directories = $directories;
61841    }
61842    /**
61843     * @return Directory[]
61844     */
61845    public function asArray() : array
61846    {
61847        return $this->directories;
61848    }
61849    public function count() : int
61850    {
61851        return count($this->directories);
61852    }
61853    public function getIterator() : \PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Filter\DirectoryCollectionIterator
61854    {
61855        return new \PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Filter\DirectoryCollectionIterator($this);
61856    }
61857}
61858<?php
61859
61860declare (strict_types=1);
61861/*
61862 * This file is part of PHPUnit.
61863 *
61864 * (c) Sebastian Bergmann <sebastian@phpunit.de>
61865 *
61866 * For the full copyright and license information, please view the LICENSE
61867 * file that was distributed with this source code.
61868 */
61869namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Filter;
61870
61871/**
61872 * @internal This class is not covered by the backward compatibility promise for PHPUnit
61873 * @psalm-immutable
61874 */
61875final class Directory
61876{
61877    /**
61878     * @var string
61879     */
61880    private $path;
61881    /**
61882     * @var string
61883     */
61884    private $prefix;
61885    /**
61886     * @var string
61887     */
61888    private $suffix;
61889    /**
61890     * @var string
61891     */
61892    private $group;
61893    public function __construct(string $path, string $prefix, string $suffix, string $group)
61894    {
61895        $this->path = $path;
61896        $this->prefix = $prefix;
61897        $this->suffix = $suffix;
61898        $this->group = $group;
61899    }
61900    public function path() : string
61901    {
61902        return $this->path;
61903    }
61904    public function prefix() : string
61905    {
61906        return $this->prefix;
61907    }
61908    public function suffix() : string
61909    {
61910        return $this->suffix;
61911    }
61912    public function group() : string
61913    {
61914        return $this->group;
61915    }
61916}
61917<?php
61918
61919declare (strict_types=1);
61920/*
61921 * This file is part of PHPUnit.
61922 *
61923 * (c) Sebastian Bergmann <sebastian@phpunit.de>
61924 *
61925 * For the full copyright and license information, please view the LICENSE
61926 * file that was distributed with this source code.
61927 */
61928namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage;
61929
61930use function count;
61931use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Filter\DirectoryCollection;
61932use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Clover;
61933use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Cobertura;
61934use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Crap4j;
61935use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Html;
61936use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Php;
61937use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Text;
61938use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Xml;
61939use PHPUnit\TextUI\XmlConfiguration\Directory;
61940use PHPUnit\TextUI\XmlConfiguration\Exception;
61941use PHPUnit\TextUI\XmlConfiguration\FileCollection;
61942/**
61943 * @internal This class is not covered by the backward compatibility promise for PHPUnit
61944 * @psalm-immutable
61945 */
61946final class CodeCoverage
61947{
61948    /**
61949     * @var ?Directory
61950     */
61951    private $cacheDirectory;
61952    /**
61953     * @var DirectoryCollection
61954     */
61955    private $directories;
61956    /**
61957     * @var FileCollection
61958     */
61959    private $files;
61960    /**
61961     * @var DirectoryCollection
61962     */
61963    private $excludeDirectories;
61964    /**
61965     * @var FileCollection
61966     */
61967    private $excludeFiles;
61968    /**
61969     * @var bool
61970     */
61971    private $pathCoverage;
61972    /**
61973     * @var bool
61974     */
61975    private $includeUncoveredFiles;
61976    /**
61977     * @var bool
61978     */
61979    private $processUncoveredFiles;
61980    /**
61981     * @var bool
61982     */
61983    private $ignoreDeprecatedCodeUnits;
61984    /**
61985     * @var bool
61986     */
61987    private $disableCodeCoverageIgnore;
61988    /**
61989     * @var ?Clover
61990     */
61991    private $clover;
61992    /**
61993     * @var ?Cobertura
61994     */
61995    private $cobertura;
61996    /**
61997     * @var ?Crap4j
61998     */
61999    private $crap4j;
62000    /**
62001     * @var ?Html
62002     */
62003    private $html;
62004    /**
62005     * @var ?Php
62006     */
62007    private $php;
62008    /**
62009     * @var ?Text
62010     */
62011    private $text;
62012    /**
62013     * @var ?Xml
62014     */
62015    private $xml;
62016    public function __construct(?Directory $cacheDirectory, DirectoryCollection $directories, FileCollection $files, DirectoryCollection $excludeDirectories, FileCollection $excludeFiles, bool $pathCoverage, bool $includeUncoveredFiles, bool $processUncoveredFiles, bool $ignoreDeprecatedCodeUnits, bool $disableCodeCoverageIgnore, ?Clover $clover, ?Cobertura $cobertura, ?Crap4j $crap4j, ?Html $html, ?Php $php, ?Text $text, ?Xml $xml)
62017    {
62018        $this->cacheDirectory = $cacheDirectory;
62019        $this->directories = $directories;
62020        $this->files = $files;
62021        $this->excludeDirectories = $excludeDirectories;
62022        $this->excludeFiles = $excludeFiles;
62023        $this->pathCoverage = $pathCoverage;
62024        $this->includeUncoveredFiles = $includeUncoveredFiles;
62025        $this->processUncoveredFiles = $processUncoveredFiles;
62026        $this->ignoreDeprecatedCodeUnits = $ignoreDeprecatedCodeUnits;
62027        $this->disableCodeCoverageIgnore = $disableCodeCoverageIgnore;
62028        $this->clover = $clover;
62029        $this->cobertura = $cobertura;
62030        $this->crap4j = $crap4j;
62031        $this->html = $html;
62032        $this->php = $php;
62033        $this->text = $text;
62034        $this->xml = $xml;
62035    }
62036    /**
62037     * @psalm-assert-if-true !null $this->cacheDirectory
62038     */
62039    public function hasCacheDirectory() : bool
62040    {
62041        return $this->cacheDirectory !== null;
62042    }
62043    /**
62044     * @throws Exception
62045     */
62046    public function cacheDirectory() : Directory
62047    {
62048        if (!$this->hasCacheDirectory()) {
62049            throw new Exception('No cache directory has been configured');
62050        }
62051        return $this->cacheDirectory;
62052    }
62053    public function hasNonEmptyListOfFilesToBeIncludedInCodeCoverageReport() : bool
62054    {
62055        return count($this->directories) > 0 || count($this->files) > 0;
62056    }
62057    public function directories() : DirectoryCollection
62058    {
62059        return $this->directories;
62060    }
62061    public function files() : FileCollection
62062    {
62063        return $this->files;
62064    }
62065    public function excludeDirectories() : DirectoryCollection
62066    {
62067        return $this->excludeDirectories;
62068    }
62069    public function excludeFiles() : FileCollection
62070    {
62071        return $this->excludeFiles;
62072    }
62073    public function pathCoverage() : bool
62074    {
62075        return $this->pathCoverage;
62076    }
62077    public function includeUncoveredFiles() : bool
62078    {
62079        return $this->includeUncoveredFiles;
62080    }
62081    public function ignoreDeprecatedCodeUnits() : bool
62082    {
62083        return $this->ignoreDeprecatedCodeUnits;
62084    }
62085    public function disableCodeCoverageIgnore() : bool
62086    {
62087        return $this->disableCodeCoverageIgnore;
62088    }
62089    public function processUncoveredFiles() : bool
62090    {
62091        return $this->processUncoveredFiles;
62092    }
62093    /**
62094     * @psalm-assert-if-true !null $this->clover
62095     */
62096    public function hasClover() : bool
62097    {
62098        return $this->clover !== null;
62099    }
62100    /**
62101     * @throws Exception
62102     */
62103    public function clover() : Clover
62104    {
62105        if (!$this->hasClover()) {
62106            throw new Exception('Code Coverage report "Clover XML" has not been configured');
62107        }
62108        return $this->clover;
62109    }
62110    /**
62111     * @psalm-assert-if-true !null $this->cobertura
62112     */
62113    public function hasCobertura() : bool
62114    {
62115        return $this->cobertura !== null;
62116    }
62117    /**
62118     * @throws Exception
62119     */
62120    public function cobertura() : Cobertura
62121    {
62122        if (!$this->hasCobertura()) {
62123            throw new Exception('Code Coverage report "Cobertura XML" has not been configured');
62124        }
62125        return $this->cobertura;
62126    }
62127    /**
62128     * @psalm-assert-if-true !null $this->crap4j
62129     */
62130    public function hasCrap4j() : bool
62131    {
62132        return $this->crap4j !== null;
62133    }
62134    /**
62135     * @throws Exception
62136     */
62137    public function crap4j() : Crap4j
62138    {
62139        if (!$this->hasCrap4j()) {
62140            throw new Exception('Code Coverage report "Crap4J" has not been configured');
62141        }
62142        return $this->crap4j;
62143    }
62144    /**
62145     * @psalm-assert-if-true !null $this->html
62146     */
62147    public function hasHtml() : bool
62148    {
62149        return $this->html !== null;
62150    }
62151    /**
62152     * @throws Exception
62153     */
62154    public function html() : Html
62155    {
62156        if (!$this->hasHtml()) {
62157            throw new Exception('Code Coverage report "HTML" has not been configured');
62158        }
62159        return $this->html;
62160    }
62161    /**
62162     * @psalm-assert-if-true !null $this->php
62163     */
62164    public function hasPhp() : bool
62165    {
62166        return $this->php !== null;
62167    }
62168    /**
62169     * @throws Exception
62170     */
62171    public function php() : Php
62172    {
62173        if (!$this->hasPhp()) {
62174            throw new Exception('Code Coverage report "PHP" has not been configured');
62175        }
62176        return $this->php;
62177    }
62178    /**
62179     * @psalm-assert-if-true !null $this->text
62180     */
62181    public function hasText() : bool
62182    {
62183        return $this->text !== null;
62184    }
62185    /**
62186     * @throws Exception
62187     */
62188    public function text() : Text
62189    {
62190        if (!$this->hasText()) {
62191            throw new Exception('Code Coverage report "Text" has not been configured');
62192        }
62193        return $this->text;
62194    }
62195    /**
62196     * @psalm-assert-if-true !null $this->xml
62197     */
62198    public function hasXml() : bool
62199    {
62200        return $this->xml !== null;
62201    }
62202    /**
62203     * @throws Exception
62204     */
62205    public function xml() : Xml
62206    {
62207        if (!$this->hasXml()) {
62208            throw new Exception('Code Coverage report "XML" has not been configured');
62209        }
62210        return $this->xml;
62211    }
62212}
62213<?php
62214
62215declare (strict_types=1);
62216/*
62217 * This file is part of PHPUnit.
62218 *
62219 * (c) Sebastian Bergmann <sebastian@phpunit.de>
62220 *
62221 * For the full copyright and license information, please view the LICENSE
62222 * file that was distributed with this source code.
62223 */
62224namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage;
62225
62226use PHPUnit\SebastianBergmann\CodeCoverage\Filter;
62227/**
62228 * @internal This class is not covered by the backward compatibility promise for PHPUnit
62229 */
62230final class FilterMapper
62231{
62232    public function map(Filter $filter, \PHPUnit\TextUI\XmlConfiguration\CodeCoverage\CodeCoverage $configuration) : void
62233    {
62234        foreach ($configuration->directories() as $directory) {
62235            $filter->includeDirectory($directory->path(), $directory->suffix(), $directory->prefix());
62236        }
62237        foreach ($configuration->files() as $file) {
62238            $filter->includeFile($file->path());
62239        }
62240        foreach ($configuration->excludeDirectories() as $directory) {
62241            $filter->excludeDirectory($directory->path(), $directory->suffix(), $directory->prefix());
62242        }
62243        foreach ($configuration->excludeFiles() as $file) {
62244            $filter->excludeFile($file->path());
62245        }
62246    }
62247}
62248<?php
62249
62250declare (strict_types=1);
62251/*
62252 * This file is part of PHPUnit.
62253 *
62254 * (c) Sebastian Bergmann <sebastian@phpunit.de>
62255 *
62256 * For the full copyright and license information, please view the LICENSE
62257 * file that was distributed with this source code.
62258 */
62259namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report;
62260
62261use PHPUnit\TextUI\XmlConfiguration\Directory;
62262/**
62263 * @internal This class is not covered by the backward compatibility promise for PHPUnit
62264 * @psalm-immutable
62265 */
62266final class Xml
62267{
62268    /**
62269     * @var Directory
62270     */
62271    private $target;
62272    public function __construct(Directory $target)
62273    {
62274        $this->target = $target;
62275    }
62276    public function target() : Directory
62277    {
62278        return $this->target;
62279    }
62280}
62281<?php
62282
62283declare (strict_types=1);
62284/*
62285 * This file is part of PHPUnit.
62286 *
62287 * (c) Sebastian Bergmann <sebastian@phpunit.de>
62288 *
62289 * For the full copyright and license information, please view the LICENSE
62290 * file that was distributed with this source code.
62291 */
62292namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report;
62293
62294use PHPUnit\TextUI\XmlConfiguration\File;
62295/**
62296 * @internal This class is not covered by the backward compatibility promise for PHPUnit
62297 * @psalm-immutable
62298 */
62299final class Php
62300{
62301    /**
62302     * @var File
62303     */
62304    private $target;
62305    public function __construct(File $target)
62306    {
62307        $this->target = $target;
62308    }
62309    public function target() : File
62310    {
62311        return $this->target;
62312    }
62313}
62314<?php
62315
62316declare (strict_types=1);
62317/*
62318 * This file is part of PHPUnit.
62319 *
62320 * (c) Sebastian Bergmann <sebastian@phpunit.de>
62321 *
62322 * For the full copyright and license information, please view the LICENSE
62323 * file that was distributed with this source code.
62324 */
62325namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report;
62326
62327use PHPUnit\TextUI\XmlConfiguration\Directory;
62328/**
62329 * @internal This class is not covered by the backward compatibility promise for PHPUnit
62330 * @psalm-immutable
62331 */
62332final class Html
62333{
62334    /**
62335     * @var Directory
62336     */
62337    private $target;
62338    /**
62339     * @var int
62340     */
62341    private $lowUpperBound;
62342    /**
62343     * @var int
62344     */
62345    private $highLowerBound;
62346    public function __construct(Directory $target, int $lowUpperBound, int $highLowerBound)
62347    {
62348        $this->target = $target;
62349        $this->lowUpperBound = $lowUpperBound;
62350        $this->highLowerBound = $highLowerBound;
62351    }
62352    public function target() : Directory
62353    {
62354        return $this->target;
62355    }
62356    public function lowUpperBound() : int
62357    {
62358        return $this->lowUpperBound;
62359    }
62360    public function highLowerBound() : int
62361    {
62362        return $this->highLowerBound;
62363    }
62364}
62365<?php
62366
62367declare (strict_types=1);
62368/*
62369 * This file is part of PHPUnit.
62370 *
62371 * (c) Sebastian Bergmann <sebastian@phpunit.de>
62372 *
62373 * For the full copyright and license information, please view the LICENSE
62374 * file that was distributed with this source code.
62375 */
62376namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report;
62377
62378use PHPUnit\TextUI\XmlConfiguration\File;
62379/**
62380 * @internal This class is not covered by the backward compatibility promise for PHPUnit
62381 * @psalm-immutable
62382 */
62383final class Crap4j
62384{
62385    /**
62386     * @var File
62387     */
62388    private $target;
62389    /**
62390     * @var int
62391     */
62392    private $threshold;
62393    public function __construct(File $target, int $threshold)
62394    {
62395        $this->target = $target;
62396        $this->threshold = $threshold;
62397    }
62398    public function target() : File
62399    {
62400        return $this->target;
62401    }
62402    public function threshold() : int
62403    {
62404        return $this->threshold;
62405    }
62406}
62407<?php
62408
62409declare (strict_types=1);
62410/*
62411 * This file is part of PHPUnit.
62412 *
62413 * (c) Sebastian Bergmann <sebastian@phpunit.de>
62414 *
62415 * For the full copyright and license information, please view the LICENSE
62416 * file that was distributed with this source code.
62417 */
62418namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report;
62419
62420use PHPUnit\TextUI\XmlConfiguration\File;
62421/**
62422 * @internal This class is not covered by the backward compatibility promise for PHPUnit
62423 * @psalm-immutable
62424 */
62425final class Text
62426{
62427    /**
62428     * @var File
62429     */
62430    private $target;
62431    /**
62432     * @var bool
62433     */
62434    private $showUncoveredFiles;
62435    /**
62436     * @var bool
62437     */
62438    private $showOnlySummary;
62439    public function __construct(File $target, bool $showUncoveredFiles, bool $showOnlySummary)
62440    {
62441        $this->target = $target;
62442        $this->showUncoveredFiles = $showUncoveredFiles;
62443        $this->showOnlySummary = $showOnlySummary;
62444    }
62445    public function target() : File
62446    {
62447        return $this->target;
62448    }
62449    public function showUncoveredFiles() : bool
62450    {
62451        return $this->showUncoveredFiles;
62452    }
62453    public function showOnlySummary() : bool
62454    {
62455        return $this->showOnlySummary;
62456    }
62457}
62458<?php
62459
62460declare (strict_types=1);
62461/*
62462 * This file is part of PHPUnit.
62463 *
62464 * (c) Sebastian Bergmann <sebastian@phpunit.de>
62465 *
62466 * For the full copyright and license information, please view the LICENSE
62467 * file that was distributed with this source code.
62468 */
62469namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report;
62470
62471use PHPUnit\TextUI\XmlConfiguration\File;
62472/**
62473 * @internal This class is not covered by the backward compatibility promise for PHPUnit
62474 * @psalm-immutable
62475 */
62476final class Clover
62477{
62478    /**
62479     * @var File
62480     */
62481    private $target;
62482    public function __construct(File $target)
62483    {
62484        $this->target = $target;
62485    }
62486    public function target() : File
62487    {
62488        return $this->target;
62489    }
62490}
62491<?php
62492
62493declare (strict_types=1);
62494/*
62495 * This file is part of PHPUnit.
62496 *
62497 * (c) Sebastian Bergmann <sebastian@phpunit.de>
62498 *
62499 * For the full copyright and license information, please view the LICENSE
62500 * file that was distributed with this source code.
62501 */
62502namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report;
62503
62504use PHPUnit\TextUI\XmlConfiguration\File;
62505/**
62506 * @internal This class is not covered by the backward compatibility promise for PHPUnit
62507 * @psalm-immutable
62508 */
62509final class Cobertura
62510{
62511    /**
62512     * @var File
62513     */
62514    private $target;
62515    public function __construct(File $target)
62516    {
62517        $this->target = $target;
62518    }
62519    public function target() : File
62520    {
62521        return $this->target;
62522    }
62523}
62524<?php
62525
62526declare (strict_types=1);
62527/*
62528 * This file is part of PHPUnit.
62529 *
62530 * (c) Sebastian Bergmann <sebastian@phpunit.de>
62531 *
62532 * For the full copyright and license information, please view the LICENSE
62533 * file that was distributed with this source code.
62534 */
62535namespace PHPUnit\TextUI\XmlConfiguration;
62536
62537use RuntimeException;
62538/**
62539 * @internal This class is not covered by the backward compatibility promise for PHPUnit
62540 */
62541final class Exception extends RuntimeException implements \PHPUnit\Exception
62542{
62543}
62544<?php
62545
62546declare (strict_types=1);
62547/*
62548 * This file is part of PHPUnit.
62549 *
62550 * (c) Sebastian Bergmann <sebastian@phpunit.de>
62551 *
62552 * For the full copyright and license information, please view the LICENSE
62553 * file that was distributed with this source code.
62554 */
62555namespace PHPUnit\TextUI\XmlConfiguration;
62556
62557/**
62558 * @internal This class is not covered by the backward compatibility promise for PHPUnit
62559 * @psalm-immutable
62560 */
62561final class Php
62562{
62563    /**
62564     * @var DirectoryCollection
62565     */
62566    private $includePaths;
62567    /**
62568     * @var IniSettingCollection
62569     */
62570    private $iniSettings;
62571    /**
62572     * @var ConstantCollection
62573     */
62574    private $constants;
62575    /**
62576     * @var VariableCollection
62577     */
62578    private $globalVariables;
62579    /**
62580     * @var VariableCollection
62581     */
62582    private $envVariables;
62583    /**
62584     * @var VariableCollection
62585     */
62586    private $postVariables;
62587    /**
62588     * @var VariableCollection
62589     */
62590    private $getVariables;
62591    /**
62592     * @var VariableCollection
62593     */
62594    private $cookieVariables;
62595    /**
62596     * @var VariableCollection
62597     */
62598    private $serverVariables;
62599    /**
62600     * @var VariableCollection
62601     */
62602    private $filesVariables;
62603    /**
62604     * @var VariableCollection
62605     */
62606    private $requestVariables;
62607    public function __construct(\PHPUnit\TextUI\XmlConfiguration\DirectoryCollection $includePaths, \PHPUnit\TextUI\XmlConfiguration\IniSettingCollection $iniSettings, \PHPUnit\TextUI\XmlConfiguration\ConstantCollection $constants, \PHPUnit\TextUI\XmlConfiguration\VariableCollection $globalVariables, \PHPUnit\TextUI\XmlConfiguration\VariableCollection $envVariables, \PHPUnit\TextUI\XmlConfiguration\VariableCollection $postVariables, \PHPUnit\TextUI\XmlConfiguration\VariableCollection $getVariables, \PHPUnit\TextUI\XmlConfiguration\VariableCollection $cookieVariables, \PHPUnit\TextUI\XmlConfiguration\VariableCollection $serverVariables, \PHPUnit\TextUI\XmlConfiguration\VariableCollection $filesVariables, \PHPUnit\TextUI\XmlConfiguration\VariableCollection $requestVariables)
62608    {
62609        $this->includePaths = $includePaths;
62610        $this->iniSettings = $iniSettings;
62611        $this->constants = $constants;
62612        $this->globalVariables = $globalVariables;
62613        $this->envVariables = $envVariables;
62614        $this->postVariables = $postVariables;
62615        $this->getVariables = $getVariables;
62616        $this->cookieVariables = $cookieVariables;
62617        $this->serverVariables = $serverVariables;
62618        $this->filesVariables = $filesVariables;
62619        $this->requestVariables = $requestVariables;
62620    }
62621    public function includePaths() : \PHPUnit\TextUI\XmlConfiguration\DirectoryCollection
62622    {
62623        return $this->includePaths;
62624    }
62625    public function iniSettings() : \PHPUnit\TextUI\XmlConfiguration\IniSettingCollection
62626    {
62627        return $this->iniSettings;
62628    }
62629    public function constants() : \PHPUnit\TextUI\XmlConfiguration\ConstantCollection
62630    {
62631        return $this->constants;
62632    }
62633    public function globalVariables() : \PHPUnit\TextUI\XmlConfiguration\VariableCollection
62634    {
62635        return $this->globalVariables;
62636    }
62637    public function envVariables() : \PHPUnit\TextUI\XmlConfiguration\VariableCollection
62638    {
62639        return $this->envVariables;
62640    }
62641    public function postVariables() : \PHPUnit\TextUI\XmlConfiguration\VariableCollection
62642    {
62643        return $this->postVariables;
62644    }
62645    public function getVariables() : \PHPUnit\TextUI\XmlConfiguration\VariableCollection
62646    {
62647        return $this->getVariables;
62648    }
62649    public function cookieVariables() : \PHPUnit\TextUI\XmlConfiguration\VariableCollection
62650    {
62651        return $this->cookieVariables;
62652    }
62653    public function serverVariables() : \PHPUnit\TextUI\XmlConfiguration\VariableCollection
62654    {
62655        return $this->serverVariables;
62656    }
62657    public function filesVariables() : \PHPUnit\TextUI\XmlConfiguration\VariableCollection
62658    {
62659        return $this->filesVariables;
62660    }
62661    public function requestVariables() : \PHPUnit\TextUI\XmlConfiguration\VariableCollection
62662    {
62663        return $this->requestVariables;
62664    }
62665}
62666<?php
62667
62668declare (strict_types=1);
62669/*
62670 * This file is part of PHPUnit.
62671 *
62672 * (c) Sebastian Bergmann <sebastian@phpunit.de>
62673 *
62674 * For the full copyright and license information, please view the LICENSE
62675 * file that was distributed with this source code.
62676 */
62677namespace PHPUnit\TextUI\XmlConfiguration;
62678
62679use function count;
62680use Countable;
62681use IteratorAggregate;
62682/**
62683 * @internal This class is not covered by the backward compatibility promise for PHPUnit
62684 * @psalm-immutable
62685 */
62686final class VariableCollection implements Countable, IteratorAggregate
62687{
62688    /**
62689     * @var Variable[]
62690     */
62691    private $variables;
62692    /**
62693     * @param Variable[] $variables
62694     */
62695    public static function fromArray(array $variables) : self
62696    {
62697        return new self(...$variables);
62698    }
62699    private function __construct(\PHPUnit\TextUI\XmlConfiguration\Variable ...$variables)
62700    {
62701        $this->variables = $variables;
62702    }
62703    /**
62704     * @return Variable[]
62705     */
62706    public function asArray() : array
62707    {
62708        return $this->variables;
62709    }
62710    public function count() : int
62711    {
62712        return count($this->variables);
62713    }
62714    public function getIterator() : \PHPUnit\TextUI\XmlConfiguration\VariableCollectionIterator
62715    {
62716        return new \PHPUnit\TextUI\XmlConfiguration\VariableCollectionIterator($this);
62717    }
62718}
62719<?php
62720
62721declare (strict_types=1);
62722/*
62723 * This file is part of PHPUnit.
62724 *
62725 * (c) Sebastian Bergmann <sebastian@phpunit.de>
62726 *
62727 * For the full copyright and license information, please view the LICENSE
62728 * file that was distributed with this source code.
62729 */
62730namespace PHPUnit\TextUI\XmlConfiguration;
62731
62732/**
62733 * @internal This class is not covered by the backward compatibility promise for PHPUnit
62734 * @psalm-immutable
62735 */
62736final class Variable
62737{
62738    /**
62739     * @var string
62740     */
62741    private $name;
62742    /**
62743     * @var mixed
62744     */
62745    private $value;
62746    /**
62747     * @var bool
62748     */
62749    private $force;
62750    public function __construct(string $name, $value, bool $force)
62751    {
62752        $this->name = $name;
62753        $this->value = $value;
62754        $this->force = $force;
62755    }
62756    public function name() : string
62757    {
62758        return $this->name;
62759    }
62760    public function value()
62761    {
62762        return $this->value;
62763    }
62764    public function force() : bool
62765    {
62766        return $this->force;
62767    }
62768}
62769<?php
62770
62771declare (strict_types=1);
62772/*
62773 * This file is part of PHPUnit.
62774 *
62775 * (c) Sebastian Bergmann <sebastian@phpunit.de>
62776 *
62777 * For the full copyright and license information, please view the LICENSE
62778 * file that was distributed with this source code.
62779 */
62780namespace PHPUnit\TextUI\XmlConfiguration;
62781
62782use function count;
62783use function iterator_count;
62784use Countable;
62785use Iterator;
62786/**
62787 * @internal This class is not covered by the backward compatibility promise for PHPUnit
62788 */
62789final class ConstantCollectionIterator implements Countable, Iterator
62790{
62791    /**
62792     * @var Constant[]
62793     */
62794    private $constants;
62795    /**
62796     * @var int
62797     */
62798    private $position;
62799    public function __construct(\PHPUnit\TextUI\XmlConfiguration\ConstantCollection $constants)
62800    {
62801        $this->constants = $constants->asArray();
62802    }
62803    public function count() : int
62804    {
62805        return iterator_count($this);
62806    }
62807    public function rewind() : void
62808    {
62809        $this->position = 0;
62810    }
62811    public function valid() : bool
62812    {
62813        return $this->position < count($this->constants);
62814    }
62815    public function key() : int
62816    {
62817        return $this->position;
62818    }
62819    public function current() : \PHPUnit\TextUI\XmlConfiguration\Constant
62820    {
62821        return $this->constants[$this->position];
62822    }
62823    public function next() : void
62824    {
62825        $this->position++;
62826    }
62827}
62828<?php
62829
62830declare (strict_types=1);
62831/*
62832 * This file is part of PHPUnit.
62833 *
62834 * (c) Sebastian Bergmann <sebastian@phpunit.de>
62835 *
62836 * For the full copyright and license information, please view the LICENSE
62837 * file that was distributed with this source code.
62838 */
62839namespace PHPUnit\TextUI\XmlConfiguration;
62840
62841use function count;
62842use function iterator_count;
62843use Countable;
62844use Iterator;
62845/**
62846 * @internal This class is not covered by the backward compatibility promise for PHPUnit
62847 */
62848final class IniSettingCollectionIterator implements Countable, Iterator
62849{
62850    /**
62851     * @var IniSetting[]
62852     */
62853    private $iniSettings;
62854    /**
62855     * @var int
62856     */
62857    private $position;
62858    public function __construct(\PHPUnit\TextUI\XmlConfiguration\IniSettingCollection $iniSettings)
62859    {
62860        $this->iniSettings = $iniSettings->asArray();
62861    }
62862    public function count() : int
62863    {
62864        return iterator_count($this);
62865    }
62866    public function rewind() : void
62867    {
62868        $this->position = 0;
62869    }
62870    public function valid() : bool
62871    {
62872        return $this->position < count($this->iniSettings);
62873    }
62874    public function key() : int
62875    {
62876        return $this->position;
62877    }
62878    public function current() : \PHPUnit\TextUI\XmlConfiguration\IniSetting
62879    {
62880        return $this->iniSettings[$this->position];
62881    }
62882    public function next() : void
62883    {
62884        $this->position++;
62885    }
62886}
62887<?php
62888
62889declare (strict_types=1);
62890/*
62891 * This file is part of PHPUnit.
62892 *
62893 * (c) Sebastian Bergmann <sebastian@phpunit.de>
62894 *
62895 * For the full copyright and license information, please view the LICENSE
62896 * file that was distributed with this source code.
62897 */
62898namespace PHPUnit\TextUI\XmlConfiguration;
62899
62900use function count;
62901use Countable;
62902use IteratorAggregate;
62903/**
62904 * @internal This class is not covered by the backward compatibility promise for PHPUnit
62905 * @psalm-immutable
62906 */
62907final class IniSettingCollection implements Countable, IteratorAggregate
62908{
62909    /**
62910     * @var IniSetting[]
62911     */
62912    private $iniSettings;
62913    /**
62914     * @param IniSetting[] $iniSettings
62915     */
62916    public static function fromArray(array $iniSettings) : self
62917    {
62918        return new self(...$iniSettings);
62919    }
62920    private function __construct(\PHPUnit\TextUI\XmlConfiguration\IniSetting ...$iniSettings)
62921    {
62922        $this->iniSettings = $iniSettings;
62923    }
62924    /**
62925     * @return IniSetting[]
62926     */
62927    public function asArray() : array
62928    {
62929        return $this->iniSettings;
62930    }
62931    public function count() : int
62932    {
62933        return count($this->iniSettings);
62934    }
62935    public function getIterator() : \PHPUnit\TextUI\XmlConfiguration\IniSettingCollectionIterator
62936    {
62937        return new \PHPUnit\TextUI\XmlConfiguration\IniSettingCollectionIterator($this);
62938    }
62939}
62940<?php
62941
62942declare (strict_types=1);
62943/*
62944 * This file is part of PHPUnit.
62945 *
62946 * (c) Sebastian Bergmann <sebastian@phpunit.de>
62947 *
62948 * For the full copyright and license information, please view the LICENSE
62949 * file that was distributed with this source code.
62950 */
62951namespace PHPUnit\TextUI\XmlConfiguration;
62952
62953use const PATH_SEPARATOR;
62954use function constant;
62955use function define;
62956use function defined;
62957use function getenv;
62958use function implode;
62959use function ini_get;
62960use function ini_set;
62961use function putenv;
62962/**
62963 * @internal This class is not covered by the backward compatibility promise for PHPUnit
62964 */
62965final class PhpHandler
62966{
62967    public function handle(\PHPUnit\TextUI\XmlConfiguration\Php $configuration) : void
62968    {
62969        $this->handleIncludePaths($configuration->includePaths());
62970        $this->handleIniSettings($configuration->iniSettings());
62971        $this->handleConstants($configuration->constants());
62972        $this->handleGlobalVariables($configuration->globalVariables());
62973        $this->handleServerVariables($configuration->serverVariables());
62974        $this->handleEnvVariables($configuration->envVariables());
62975        $this->handleVariables('_POST', $configuration->postVariables());
62976        $this->handleVariables('_GET', $configuration->getVariables());
62977        $this->handleVariables('_COOKIE', $configuration->cookieVariables());
62978        $this->handleVariables('_FILES', $configuration->filesVariables());
62979        $this->handleVariables('_REQUEST', $configuration->requestVariables());
62980    }
62981    private function handleIncludePaths(\PHPUnit\TextUI\XmlConfiguration\DirectoryCollection $includePaths) : void
62982    {
62983        if (!$includePaths->isEmpty()) {
62984            $includePathsAsStrings = [];
62985            foreach ($includePaths as $includePath) {
62986                $includePathsAsStrings[] = $includePath->path();
62987            }
62988            ini_set('include_path', implode(\PATH_SEPARATOR, $includePathsAsStrings) . \PATH_SEPARATOR . ini_get('include_path'));
62989        }
62990    }
62991    private function handleIniSettings(\PHPUnit\TextUI\XmlConfiguration\IniSettingCollection $iniSettings) : void
62992    {
62993        foreach ($iniSettings as $iniSetting) {
62994            $value = $iniSetting->value();
62995            if (defined($value)) {
62996                $value = (string) constant($value);
62997            }
62998            ini_set($iniSetting->name(), $value);
62999        }
63000    }
63001    private function handleConstants(\PHPUnit\TextUI\XmlConfiguration\ConstantCollection $constants) : void
63002    {
63003        foreach ($constants as $constant) {
63004            if (!defined($constant->name())) {
63005                define($constant->name(), $constant->value());
63006            }
63007        }
63008    }
63009    private function handleGlobalVariables(\PHPUnit\TextUI\XmlConfiguration\VariableCollection $variables) : void
63010    {
63011        foreach ($variables as $variable) {
63012            $GLOBALS[$variable->name()] = $variable->value();
63013        }
63014    }
63015    private function handleServerVariables(\PHPUnit\TextUI\XmlConfiguration\VariableCollection $variables) : void
63016    {
63017        foreach ($variables as $variable) {
63018            $_SERVER[$variable->name()] = $variable->value();
63019        }
63020    }
63021    private function handleVariables(string $target, \PHPUnit\TextUI\XmlConfiguration\VariableCollection $variables) : void
63022    {
63023        foreach ($variables as $variable) {
63024            $GLOBALS[$target][$variable->name()] = $variable->value();
63025        }
63026    }
63027    private function handleEnvVariables(\PHPUnit\TextUI\XmlConfiguration\VariableCollection $variables) : void
63028    {
63029        foreach ($variables as $variable) {
63030            $name = $variable->name();
63031            $value = $variable->value();
63032            $force = $variable->force();
63033            if ($force || getenv($name) === \false) {
63034                putenv("{$name}={$value}");
63035            }
63036            $value = getenv($name);
63037            if ($force || !isset($_ENV[$name])) {
63038                $_ENV[$name] = $value;
63039            }
63040        }
63041    }
63042}
63043<?php
63044
63045declare (strict_types=1);
63046/*
63047 * This file is part of PHPUnit.
63048 *
63049 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63050 *
63051 * For the full copyright and license information, please view the LICENSE
63052 * file that was distributed with this source code.
63053 */
63054namespace PHPUnit\TextUI\XmlConfiguration;
63055
63056/**
63057 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63058 * @psalm-immutable
63059 */
63060final class Constant
63061{
63062    /**
63063     * @var string
63064     */
63065    private $name;
63066    /**
63067     * @var mixed
63068     */
63069    private $value;
63070    public function __construct(string $name, $value)
63071    {
63072        $this->name = $name;
63073        $this->value = $value;
63074    }
63075    public function name() : string
63076    {
63077        return $this->name;
63078    }
63079    public function value()
63080    {
63081        return $this->value;
63082    }
63083}
63084<?php
63085
63086declare (strict_types=1);
63087/*
63088 * This file is part of PHPUnit.
63089 *
63090 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63091 *
63092 * For the full copyright and license information, please view the LICENSE
63093 * file that was distributed with this source code.
63094 */
63095namespace PHPUnit\TextUI\XmlConfiguration;
63096
63097use function count;
63098use function iterator_count;
63099use Countable;
63100use Iterator;
63101/**
63102 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63103 */
63104final class VariableCollectionIterator implements Countable, Iterator
63105{
63106    /**
63107     * @var Variable[]
63108     */
63109    private $variables;
63110    /**
63111     * @var int
63112     */
63113    private $position;
63114    public function __construct(\PHPUnit\TextUI\XmlConfiguration\VariableCollection $variables)
63115    {
63116        $this->variables = $variables->asArray();
63117    }
63118    public function count() : int
63119    {
63120        return iterator_count($this);
63121    }
63122    public function rewind() : void
63123    {
63124        $this->position = 0;
63125    }
63126    public function valid() : bool
63127    {
63128        return $this->position < count($this->variables);
63129    }
63130    public function key() : int
63131    {
63132        return $this->position;
63133    }
63134    public function current() : \PHPUnit\TextUI\XmlConfiguration\Variable
63135    {
63136        return $this->variables[$this->position];
63137    }
63138    public function next() : void
63139    {
63140        $this->position++;
63141    }
63142}
63143<?php
63144
63145declare (strict_types=1);
63146/*
63147 * This file is part of PHPUnit.
63148 *
63149 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63150 *
63151 * For the full copyright and license information, please view the LICENSE
63152 * file that was distributed with this source code.
63153 */
63154namespace PHPUnit\TextUI\XmlConfiguration;
63155
63156use function count;
63157use Countable;
63158use IteratorAggregate;
63159/**
63160 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63161 * @psalm-immutable
63162 */
63163final class ConstantCollection implements Countable, IteratorAggregate
63164{
63165    /**
63166     * @var Constant[]
63167     */
63168    private $constants;
63169    /**
63170     * @param Constant[] $constants
63171     */
63172    public static function fromArray(array $constants) : self
63173    {
63174        return new self(...$constants);
63175    }
63176    private function __construct(\PHPUnit\TextUI\XmlConfiguration\Constant ...$constants)
63177    {
63178        $this->constants = $constants;
63179    }
63180    /**
63181     * @return Constant[]
63182     */
63183    public function asArray() : array
63184    {
63185        return $this->constants;
63186    }
63187    public function count() : int
63188    {
63189        return count($this->constants);
63190    }
63191    public function getIterator() : \PHPUnit\TextUI\XmlConfiguration\ConstantCollectionIterator
63192    {
63193        return new \PHPUnit\TextUI\XmlConfiguration\ConstantCollectionIterator($this);
63194    }
63195}
63196<?php
63197
63198declare (strict_types=1);
63199/*
63200 * This file is part of PHPUnit.
63201 *
63202 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63203 *
63204 * For the full copyright and license information, please view the LICENSE
63205 * file that was distributed with this source code.
63206 */
63207namespace PHPUnit\TextUI\XmlConfiguration;
63208
63209/**
63210 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63211 * @psalm-immutable
63212 */
63213final class IniSetting
63214{
63215    /**
63216     * @var string
63217     */
63218    private $name;
63219    /**
63220     * @var string
63221     */
63222    private $value;
63223    public function __construct(string $name, string $value)
63224    {
63225        $this->name = $name;
63226        $this->value = $value;
63227    }
63228    public function name() : string
63229    {
63230        return $this->name;
63231    }
63232    public function value() : string
63233    {
63234        return $this->value;
63235    }
63236}
63237<?php
63238
63239declare (strict_types=1);
63240/*
63241 * This file is part of PHPUnit.
63242 *
63243 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63244 *
63245 * For the full copyright and license information, please view the LICENSE
63246 * file that was distributed with this source code.
63247 */
63248namespace PHPUnit\TextUI\XmlConfiguration;
63249
63250use function sprintf;
63251use PHPUnit\Util\Xml\Exception as XmlException;
63252use PHPUnit\Util\Xml\Loader as XmlLoader;
63253use PHPUnit\Util\Xml\SchemaDetector;
63254/**
63255 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63256 */
63257final class Migrator
63258{
63259    /**
63260     * @throws Exception
63261     * @throws MigrationBuilderException
63262     * @throws MigrationException
63263     * @throws XmlException
63264     */
63265    public function migrate(string $filename) : string
63266    {
63267        $origin = (new SchemaDetector())->detect($filename);
63268        if (!$origin->detected()) {
63269            throw new \PHPUnit\TextUI\XmlConfiguration\Exception(sprintf('"%s" is not a valid PHPUnit XML configuration file that can be migrated', $filename));
63270        }
63271        $configurationDocument = (new XmlLoader())->loadFile($filename, \false, \true, \true);
63272        foreach ((new \PHPUnit\TextUI\XmlConfiguration\MigrationBuilder())->build($origin->version()) as $migration) {
63273            $migration->migrate($configurationDocument);
63274        }
63275        $configurationDocument->formatOutput = \true;
63276        $configurationDocument->preserveWhiteSpace = \false;
63277        return $configurationDocument->saveXML();
63278    }
63279}
63280<?php
63281
63282declare (strict_types=1);
63283/*
63284 * This file is part of PHPUnit.
63285 *
63286 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63287 *
63288 * For the full copyright and license information, please view the LICENSE
63289 * file that was distributed with this source code.
63290 */
63291namespace PHPUnit\TextUI\XmlConfiguration;
63292
63293use RuntimeException;
63294/**
63295 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63296 */
63297final class MigrationBuilderException extends RuntimeException implements \PHPUnit\Exception
63298{
63299}
63300<?php
63301
63302declare (strict_types=1);
63303/*
63304 * This file is part of PHPUnit.
63305 *
63306 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63307 *
63308 * For the full copyright and license information, please view the LICENSE
63309 * file that was distributed with this source code.
63310 */
63311namespace PHPUnit\TextUI\XmlConfiguration;
63312
63313use DOMDocument;
63314use DOMElement;
63315/**
63316 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63317 */
63318final class MoveAttributesFromFilterWhitelistToCoverage implements \PHPUnit\TextUI\XmlConfiguration\Migration
63319{
63320    /**
63321     * @throws MigrationException
63322     */
63323    public function migrate(DOMDocument $document) : void
63324    {
63325        $whitelist = $document->getElementsByTagName('whitelist')->item(0);
63326        if (!$whitelist) {
63327            return;
63328        }
63329        $coverage = $document->getElementsByTagName('coverage')->item(0);
63330        if (!$coverage instanceof DOMElement) {
63331            throw new \PHPUnit\TextUI\XmlConfiguration\MigrationException('Unexpected state - No coverage element');
63332        }
63333        $map = ['addUncoveredFilesFromWhitelist' => 'includeUncoveredFiles', 'processUncoveredFilesFromWhitelist' => 'processUncoveredFiles'];
63334        foreach ($map as $old => $new) {
63335            if (!$whitelist->hasAttribute($old)) {
63336                continue;
63337            }
63338            $coverage->setAttribute($new, $whitelist->getAttribute($old));
63339            $whitelist->removeAttribute($old);
63340        }
63341    }
63342}
63343<?php
63344
63345declare (strict_types=1);
63346/*
63347 * This file is part of PHPUnit.
63348 *
63349 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63350 *
63351 * For the full copyright and license information, please view the LICENSE
63352 * file that was distributed with this source code.
63353 */
63354namespace PHPUnit\TextUI\XmlConfiguration;
63355
63356use DOMDocument;
63357use DOMElement;
63358/**
63359 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63360 */
63361final class MoveAttributesFromRootToCoverage implements \PHPUnit\TextUI\XmlConfiguration\Migration
63362{
63363    /**
63364     * @throws MigrationException
63365     */
63366    public function migrate(DOMDocument $document) : void
63367    {
63368        $map = ['disableCodeCoverageIgnore' => 'disableCodeCoverageIgnore', 'ignoreDeprecatedCodeUnitsFromCodeCoverage' => 'ignoreDeprecatedCodeUnits'];
63369        $root = $document->documentElement;
63370        $coverage = $document->getElementsByTagName('coverage')->item(0);
63371        if (!$coverage instanceof DOMElement) {
63372            throw new \PHPUnit\TextUI\XmlConfiguration\MigrationException('Unexpected state - No coverage element');
63373        }
63374        foreach ($map as $old => $new) {
63375            if (!$root->hasAttribute($old)) {
63376                continue;
63377            }
63378            $coverage->setAttribute($new, $root->getAttribute($old));
63379            $root->removeAttribute($old);
63380        }
63381    }
63382}
63383<?php
63384
63385declare (strict_types=1);
63386/*
63387 * This file is part of PHPUnit.
63388 *
63389 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63390 *
63391 * For the full copyright and license information, please view the LICENSE
63392 * file that was distributed with this source code.
63393 */
63394namespace PHPUnit\TextUI\XmlConfiguration;
63395
63396use DOMDocument;
63397/**
63398 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63399 */
63400final class RemoveCacheTokensAttribute implements \PHPUnit\TextUI\XmlConfiguration\Migration
63401{
63402    public function migrate(DOMDocument $document) : void
63403    {
63404        $root = $document->documentElement;
63405        if ($root->hasAttribute('cacheTokens')) {
63406            $root->removeAttribute('cacheTokens');
63407        }
63408    }
63409}
63410<?php
63411
63412declare (strict_types=1);
63413/*
63414 * This file is part of PHPUnit.
63415 *
63416 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63417 *
63418 * For the full copyright and license information, please view the LICENSE
63419 * file that was distributed with this source code.
63420 */
63421namespace PHPUnit\TextUI\XmlConfiguration;
63422
63423use DOMDocument;
63424use DOMElement;
63425/**
63426 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63427 */
63428final class ConvertLogTypes implements \PHPUnit\TextUI\XmlConfiguration\Migration
63429{
63430    public function migrate(DOMDocument $document) : void
63431    {
63432        $logging = $document->getElementsByTagName('logging')->item(0);
63433        if (!$logging instanceof DOMElement) {
63434            return;
63435        }
63436        $types = ['junit' => 'junit', 'teamcity' => 'teamcity', 'testdox-html' => 'testdoxHtml', 'testdox-text' => 'testdoxText', 'testdox-xml' => 'testdoxXml', 'plain' => 'text'];
63437        $logNodes = [];
63438        foreach ($logging->getElementsByTagName('log') as $logNode) {
63439            if (!isset($types[$logNode->getAttribute('type')])) {
63440                continue;
63441            }
63442            $logNodes[] = $logNode;
63443        }
63444        foreach ($logNodes as $oldNode) {
63445            $newLogNode = $document->createElement($types[$oldNode->getAttribute('type')]);
63446            $newLogNode->setAttribute('outputFile', $oldNode->getAttribute('target'));
63447            $logging->replaceChild($newLogNode, $oldNode);
63448        }
63449    }
63450}
63451<?php
63452
63453declare (strict_types=1);
63454/*
63455 * This file is part of PHPUnit.
63456 *
63457 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63458 *
63459 * For the full copyright and license information, please view the LICENSE
63460 * file that was distributed with this source code.
63461 */
63462namespace PHPUnit\TextUI\XmlConfiguration;
63463
63464use DOMElement;
63465/**
63466 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63467 */
63468final class CoverageCloverToReport extends \PHPUnit\TextUI\XmlConfiguration\LogToReportMigration
63469{
63470    protected function forType() : string
63471    {
63472        return 'coverage-clover';
63473    }
63474    protected function toReportFormat(DOMElement $logNode) : DOMElement
63475    {
63476        $clover = $logNode->ownerDocument->createElement('clover');
63477        $clover->setAttribute('outputFile', $logNode->getAttribute('target'));
63478        return $clover;
63479    }
63480}
63481<?php
63482
63483declare (strict_types=1);
63484/*
63485 * This file is part of PHPUnit.
63486 *
63487 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63488 *
63489 * For the full copyright and license information, please view the LICENSE
63490 * file that was distributed with this source code.
63491 */
63492namespace PHPUnit\TextUI\XmlConfiguration;
63493
63494use DOMElement;
63495/**
63496 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63497 */
63498final class CoveragePhpToReport extends \PHPUnit\TextUI\XmlConfiguration\LogToReportMigration
63499{
63500    protected function forType() : string
63501    {
63502        return 'coverage-php';
63503    }
63504    protected function toReportFormat(DOMElement $logNode) : DOMElement
63505    {
63506        $php = $logNode->ownerDocument->createElement('php');
63507        $php->setAttribute('outputFile', $logNode->getAttribute('target'));
63508        return $php;
63509    }
63510}
63511<?php
63512
63513declare (strict_types=1);
63514/*
63515 * This file is part of PHPUnit.
63516 *
63517 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63518 *
63519 * For the full copyright and license information, please view the LICENSE
63520 * file that was distributed with this source code.
63521 */
63522namespace PHPUnit\TextUI\XmlConfiguration;
63523
63524use DOMDocument;
63525/**
63526 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63527 */
63528interface Migration
63529{
63530    public function migrate(DOMDocument $document) : void;
63531}
63532<?php
63533
63534declare (strict_types=1);
63535/*
63536 * This file is part of PHPUnit.
63537 *
63538 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63539 *
63540 * For the full copyright and license information, please view the LICENSE
63541 * file that was distributed with this source code.
63542 */
63543namespace PHPUnit\TextUI\XmlConfiguration;
63544
63545use DOMDocument;
63546/**
63547 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63548 */
63549final class UpdateSchemaLocationTo93 implements \PHPUnit\TextUI\XmlConfiguration\Migration
63550{
63551    public function migrate(DOMDocument $document) : void
63552    {
63553        $document->documentElement->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:noNamespaceSchemaLocation', 'https://schema.phpunit.de/9.3/phpunit.xsd');
63554    }
63555}
63556<?php
63557
63558declare (strict_types=1);
63559/*
63560 * This file is part of PHPUnit.
63561 *
63562 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63563 *
63564 * For the full copyright and license information, please view the LICENSE
63565 * file that was distributed with this source code.
63566 */
63567namespace PHPUnit\TextUI\XmlConfiguration;
63568
63569use DOMElement;
63570/**
63571 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63572 */
63573final class CoverageCrap4jToReport extends \PHPUnit\TextUI\XmlConfiguration\LogToReportMigration
63574{
63575    protected function forType() : string
63576    {
63577        return 'coverage-crap4j';
63578    }
63579    protected function toReportFormat(DOMElement $logNode) : DOMElement
63580    {
63581        $crap4j = $logNode->ownerDocument->createElement('crap4j');
63582        $crap4j->setAttribute('outputFile', $logNode->getAttribute('target'));
63583        $this->migrateAttributes($logNode, $crap4j, ['threshold']);
63584        return $crap4j;
63585    }
63586}
63587<?php
63588
63589declare (strict_types=1);
63590/*
63591 * This file is part of PHPUnit.
63592 *
63593 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63594 *
63595 * For the full copyright and license information, please view the LICENSE
63596 * file that was distributed with this source code.
63597 */
63598namespace PHPUnit\TextUI\XmlConfiguration;
63599
63600use DOMDocument;
63601/**
63602 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63603 */
63604final class IntroduceCoverageElement implements \PHPUnit\TextUI\XmlConfiguration\Migration
63605{
63606    public function migrate(DOMDocument $document) : void
63607    {
63608        $coverage = $document->createElement('coverage');
63609        $document->documentElement->insertBefore($coverage, $document->documentElement->firstChild);
63610    }
63611}
63612<?php
63613
63614declare (strict_types=1);
63615/*
63616 * This file is part of PHPUnit.
63617 *
63618 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63619 *
63620 * For the full copyright and license information, please view the LICENSE
63621 * file that was distributed with this source code.
63622 */
63623namespace PHPUnit\TextUI\XmlConfiguration;
63624
63625use function sprintf;
63626use DOMDocument;
63627use DOMElement;
63628/**
63629 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63630 */
63631final class RemoveEmptyFilter implements \PHPUnit\TextUI\XmlConfiguration\Migration
63632{
63633    /**
63634     * @throws MigrationException
63635     */
63636    public function migrate(DOMDocument $document) : void
63637    {
63638        $whitelist = $document->getElementsByTagName('whitelist')->item(0);
63639        if ($whitelist instanceof DOMElement) {
63640            $this->ensureEmpty($whitelist);
63641            $whitelist->parentNode->removeChild($whitelist);
63642        }
63643        $filter = $document->getElementsByTagName('filter')->item(0);
63644        if ($filter instanceof DOMElement) {
63645            $this->ensureEmpty($filter);
63646            $filter->parentNode->removeChild($filter);
63647        }
63648    }
63649    /**
63650     * @throws MigrationException
63651     */
63652    private function ensureEmpty(DOMElement $element) : void
63653    {
63654        if ($element->attributes->length > 0) {
63655            throw new \PHPUnit\TextUI\XmlConfiguration\MigrationException(sprintf('%s element has unexpected attributes', $element->nodeName));
63656        }
63657        if ($element->getElementsByTagName('*')->length > 0) {
63658            throw new \PHPUnit\TextUI\XmlConfiguration\MigrationException(sprintf('%s element has unexpected children', $element->nodeName));
63659        }
63660    }
63661}
63662<?php
63663
63664declare (strict_types=1);
63665/*
63666 * This file is part of PHPUnit.
63667 *
63668 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63669 *
63670 * For the full copyright and license information, please view the LICENSE
63671 * file that was distributed with this source code.
63672 */
63673namespace PHPUnit\TextUI\XmlConfiguration;
63674
63675use DOMDocument;
63676use DOMElement;
63677use PHPUnit\Util\Xml\SnapshotNodeList;
63678/**
63679 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63680 */
63681final class MoveWhitelistDirectoriesToCoverage implements \PHPUnit\TextUI\XmlConfiguration\Migration
63682{
63683    /**
63684     * @throws MigrationException
63685     */
63686    public function migrate(DOMDocument $document) : void
63687    {
63688        $whitelist = $document->getElementsByTagName('whitelist')->item(0);
63689        if ($whitelist === null) {
63690            return;
63691        }
63692        $coverage = $document->getElementsByTagName('coverage')->item(0);
63693        if (!$coverage instanceof DOMElement) {
63694            throw new \PHPUnit\TextUI\XmlConfiguration\MigrationException('Unexpected state - No coverage element');
63695        }
63696        $include = $document->createElement('include');
63697        $coverage->appendChild($include);
63698        foreach (SnapshotNodeList::fromNodeList($whitelist->childNodes) as $child) {
63699            if (!$child instanceof DOMElement || $child->nodeName !== 'directory') {
63700                continue;
63701            }
63702            $include->appendChild($child);
63703        }
63704    }
63705}
63706<?php
63707
63708declare (strict_types=1);
63709/*
63710 * This file is part of PHPUnit.
63711 *
63712 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63713 *
63714 * For the full copyright and license information, please view the LICENSE
63715 * file that was distributed with this source code.
63716 */
63717namespace PHPUnit\TextUI\XmlConfiguration;
63718
63719use DOMDocument;
63720use DOMElement;
63721use PHPUnit\Util\Xml\SnapshotNodeList;
63722/**
63723 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63724 */
63725final class RemoveLogTypes implements \PHPUnit\TextUI\XmlConfiguration\Migration
63726{
63727    public function migrate(DOMDocument $document) : void
63728    {
63729        $logging = $document->getElementsByTagName('logging')->item(0);
63730        if (!$logging instanceof DOMElement) {
63731            return;
63732        }
63733        foreach (SnapshotNodeList::fromNodeList($logging->getElementsByTagName('log')) as $logNode) {
63734            switch ($logNode->getAttribute('type')) {
63735                case 'json':
63736                case 'tap':
63737                    $logging->removeChild($logNode);
63738            }
63739        }
63740    }
63741}
63742<?php
63743
63744declare (strict_types=1);
63745/*
63746 * This file is part of PHPUnit.
63747 *
63748 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63749 *
63750 * For the full copyright and license information, please view the LICENSE
63751 * file that was distributed with this source code.
63752 */
63753namespace PHPUnit\TextUI\XmlConfiguration;
63754
63755use DOMElement;
63756/**
63757 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63758 */
63759final class CoverageHtmlToReport extends \PHPUnit\TextUI\XmlConfiguration\LogToReportMigration
63760{
63761    protected function forType() : string
63762    {
63763        return 'coverage-html';
63764    }
63765    protected function toReportFormat(DOMElement $logNode) : DOMElement
63766    {
63767        $html = $logNode->ownerDocument->createElement('html');
63768        $html->setAttribute('outputDirectory', $logNode->getAttribute('target'));
63769        $this->migrateAttributes($logNode, $html, ['lowUpperBound', 'highLowerBound']);
63770        return $html;
63771    }
63772}
63773<?php
63774
63775declare (strict_types=1);
63776/*
63777 * This file is part of PHPUnit.
63778 *
63779 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63780 *
63781 * For the full copyright and license information, please view the LICENSE
63782 * file that was distributed with this source code.
63783 */
63784namespace PHPUnit\TextUI\XmlConfiguration;
63785
63786use function sprintf;
63787use DOMDocument;
63788use DOMElement;
63789use DOMXPath;
63790/**
63791 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63792 */
63793abstract class LogToReportMigration implements \PHPUnit\TextUI\XmlConfiguration\Migration
63794{
63795    /**
63796     * @throws MigrationException
63797     */
63798    public function migrate(DOMDocument $document) : void
63799    {
63800        $coverage = $document->getElementsByTagName('coverage')->item(0);
63801        if (!$coverage instanceof DOMElement) {
63802            throw new \PHPUnit\TextUI\XmlConfiguration\MigrationException('Unexpected state - No coverage element');
63803        }
63804        $logNode = $this->findLogNode($document);
63805        if ($logNode === null) {
63806            return;
63807        }
63808        $reportChild = $this->toReportFormat($logNode);
63809        $report = $coverage->getElementsByTagName('report')->item(0);
63810        if ($report === null) {
63811            $report = $coverage->appendChild($document->createElement('report'));
63812        }
63813        $report->appendChild($reportChild);
63814        $logNode->parentNode->removeChild($logNode);
63815    }
63816    protected function migrateAttributes(DOMElement $src, DOMElement $dest, array $attributes) : void
63817    {
63818        foreach ($attributes as $attr) {
63819            if (!$src->hasAttribute($attr)) {
63820                continue;
63821            }
63822            $dest->setAttribute($attr, $src->getAttribute($attr));
63823            $src->removeAttribute($attr);
63824        }
63825    }
63826    protected abstract function forType() : string;
63827    protected abstract function toReportFormat(DOMElement $logNode) : DOMElement;
63828    private function findLogNode(DOMDocument $document) : ?DOMElement
63829    {
63830        $logNode = (new DOMXPath($document))->query(sprintf('//logging/log[@type="%s"]', $this->forType()))->item(0);
63831        if (!$logNode instanceof DOMElement) {
63832            return null;
63833        }
63834        return $logNode;
63835    }
63836}
63837<?php
63838
63839declare (strict_types=1);
63840/*
63841 * This file is part of PHPUnit.
63842 *
63843 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63844 *
63845 * For the full copyright and license information, please view the LICENSE
63846 * file that was distributed with this source code.
63847 */
63848namespace PHPUnit\TextUI\XmlConfiguration;
63849
63850use DOMElement;
63851/**
63852 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63853 */
63854final class CoverageTextToReport extends \PHPUnit\TextUI\XmlConfiguration\LogToReportMigration
63855{
63856    protected function forType() : string
63857    {
63858        return 'coverage-text';
63859    }
63860    protected function toReportFormat(DOMElement $logNode) : DOMElement
63861    {
63862        $text = $logNode->ownerDocument->createElement('text');
63863        $text->setAttribute('outputFile', $logNode->getAttribute('target'));
63864        $this->migrateAttributes($logNode, $text, ['showUncoveredFiles', 'showOnlySummary']);
63865        return $text;
63866    }
63867}
63868<?php
63869
63870declare (strict_types=1);
63871/*
63872 * This file is part of PHPUnit.
63873 *
63874 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63875 *
63876 * For the full copyright and license information, please view the LICENSE
63877 * file that was distributed with this source code.
63878 */
63879namespace PHPUnit\TextUI\XmlConfiguration;
63880
63881use DOMDocument;
63882use DOMElement;
63883use PHPUnit\Util\Xml\SnapshotNodeList;
63884/**
63885 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63886 */
63887final class MoveWhitelistExcludesToCoverage implements \PHPUnit\TextUI\XmlConfiguration\Migration
63888{
63889    /**
63890     * @throws MigrationException
63891     */
63892    public function migrate(DOMDocument $document) : void
63893    {
63894        $whitelist = $document->getElementsByTagName('whitelist')->item(0);
63895        if ($whitelist === null) {
63896            return;
63897        }
63898        $excludeNodes = SnapshotNodeList::fromNodeList($whitelist->getElementsByTagName('exclude'));
63899        if ($excludeNodes->count() === 0) {
63900            return;
63901        }
63902        $coverage = $document->getElementsByTagName('coverage')->item(0);
63903        if (!$coverage instanceof DOMElement) {
63904            throw new \PHPUnit\TextUI\XmlConfiguration\MigrationException('Unexpected state - No coverage element');
63905        }
63906        $targetExclude = $coverage->getElementsByTagName('exclude')->item(0);
63907        if ($targetExclude === null) {
63908            $targetExclude = $coverage->appendChild($document->createElement('exclude'));
63909        }
63910        foreach ($excludeNodes as $excludeNode) {
63911            \assert($excludeNode instanceof DOMElement);
63912            foreach (SnapshotNodeList::fromNodeList($excludeNode->childNodes) as $child) {
63913                if (!$child instanceof DOMElement || !\in_array($child->nodeName, ['directory', 'file'], \true)) {
63914                    continue;
63915                }
63916                $targetExclude->appendChild($child);
63917            }
63918            if ($excludeNode->getElementsByTagName('*')->count() !== 0) {
63919                throw new \PHPUnit\TextUI\XmlConfiguration\MigrationException('Dangling child elements in exclude found.');
63920            }
63921            $whitelist->removeChild($excludeNode);
63922        }
63923    }
63924}
63925<?php
63926
63927declare (strict_types=1);
63928/*
63929 * This file is part of PHPUnit.
63930 *
63931 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63932 *
63933 * For the full copyright and license information, please view the LICENSE
63934 * file that was distributed with this source code.
63935 */
63936namespace PHPUnit\TextUI\XmlConfiguration;
63937
63938use DOMElement;
63939/**
63940 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63941 */
63942final class CoverageXmlToReport extends \PHPUnit\TextUI\XmlConfiguration\LogToReportMigration
63943{
63944    protected function forType() : string
63945    {
63946        return 'coverage-xml';
63947    }
63948    protected function toReportFormat(DOMElement $logNode) : DOMElement
63949    {
63950        $xml = $logNode->ownerDocument->createElement('xml');
63951        $xml->setAttribute('outputDirectory', $logNode->getAttribute('target'));
63952        return $xml;
63953    }
63954}
63955<?php
63956
63957declare (strict_types=1);
63958/*
63959 * This file is part of PHPUnit.
63960 *
63961 * (c) Sebastian Bergmann <sebastian@phpunit.de>
63962 *
63963 * For the full copyright and license information, please view the LICENSE
63964 * file that was distributed with this source code.
63965 */
63966namespace PHPUnit\TextUI\XmlConfiguration;
63967
63968use function array_key_exists;
63969use function sprintf;
63970use function version_compare;
63971/**
63972 * @internal This class is not covered by the backward compatibility promise for PHPUnit
63973 */
63974final class MigrationBuilder
63975{
63976    private const AVAILABLE_MIGRATIONS = ['8.5' => [\PHPUnit\TextUI\XmlConfiguration\RemoveLogTypes::class], '9.2' => [\PHPUnit\TextUI\XmlConfiguration\RemoveCacheTokensAttribute::class, \PHPUnit\TextUI\XmlConfiguration\IntroduceCoverageElement::class, \PHPUnit\TextUI\XmlConfiguration\MoveAttributesFromRootToCoverage::class, \PHPUnit\TextUI\XmlConfiguration\MoveAttributesFromFilterWhitelistToCoverage::class, \PHPUnit\TextUI\XmlConfiguration\MoveWhitelistDirectoriesToCoverage::class, \PHPUnit\TextUI\XmlConfiguration\MoveWhitelistExcludesToCoverage::class, \PHPUnit\TextUI\XmlConfiguration\RemoveEmptyFilter::class, \PHPUnit\TextUI\XmlConfiguration\CoverageCloverToReport::class, \PHPUnit\TextUI\XmlConfiguration\CoverageCrap4jToReport::class, \PHPUnit\TextUI\XmlConfiguration\CoverageHtmlToReport::class, \PHPUnit\TextUI\XmlConfiguration\CoveragePhpToReport::class, \PHPUnit\TextUI\XmlConfiguration\CoverageTextToReport::class, \PHPUnit\TextUI\XmlConfiguration\CoverageXmlToReport::class, \PHPUnit\TextUI\XmlConfiguration\ConvertLogTypes::class, \PHPUnit\TextUI\XmlConfiguration\UpdateSchemaLocationTo93::class]];
63977    /**
63978     * @throws MigrationBuilderException
63979     */
63980    public function build(string $fromVersion) : array
63981    {
63982        if (!array_key_exists($fromVersion, self::AVAILABLE_MIGRATIONS)) {
63983            throw new \PHPUnit\TextUI\XmlConfiguration\MigrationBuilderException(sprintf('Migration from schema version %s is not supported', $fromVersion));
63984        }
63985        $stack = [];
63986        foreach (self::AVAILABLE_MIGRATIONS as $version => $migrations) {
63987            if (version_compare($version, $fromVersion, '<')) {
63988                continue;
63989            }
63990            foreach ($migrations as $migration) {
63991                $stack[] = new $migration();
63992            }
63993        }
63994        return $stack;
63995    }
63996}
63997<?php
63998
63999declare (strict_types=1);
64000/*
64001 * This file is part of PHPUnit.
64002 *
64003 * (c) Sebastian Bergmann <sebastian@phpunit.de>
64004 *
64005 * For the full copyright and license information, please view the LICENSE
64006 * file that was distributed with this source code.
64007 */
64008namespace PHPUnit\TextUI\XmlConfiguration;
64009
64010use RuntimeException;
64011/**
64012 * @internal This class is not covered by the backward compatibility promise for PHPUnit
64013 */
64014final class MigrationException extends RuntimeException implements \PHPUnit\Exception
64015{
64016}
64017<?php
64018
64019declare (strict_types=1);
64020/*
64021 * This file is part of PHPUnit.
64022 *
64023 * (c) Sebastian Bergmann <sebastian@phpunit.de>
64024 *
64025 * For the full copyright and license information, please view the LICENSE
64026 * file that was distributed with this source code.
64027 */
64028namespace PHPUnit\TextUI;
64029
64030use const PHP_EOL;
64031use function count;
64032use function explode;
64033use function max;
64034use function preg_replace_callback;
64035use function str_pad;
64036use function str_repeat;
64037use function strlen;
64038use function wordwrap;
64039use PHPUnit\Util\Color;
64040use PHPUnit\SebastianBergmann\Environment\Console;
64041/**
64042 * @internal This class is not covered by the backward compatibility promise for PHPUnit
64043 */
64044final class Help
64045{
64046    private const LEFT_MARGIN = '  ';
64047    private const HELP_TEXT = ['Usage' => [['text' => 'phpunit [options] UnitTest.php'], ['text' => 'phpunit [options] <directory>']], 'Code Coverage Options' => [['arg' => '--coverage-clover <file>', 'desc' => 'Generate code coverage report in Clover XML format'], ['arg' => '--coverage-cobertura <file>', 'desc' => 'Generate code coverage report in Cobertura XML format'], ['arg' => '--coverage-crap4j <file>', 'desc' => 'Generate code coverage report in Crap4J XML format'], ['arg' => '--coverage-html <dir>', 'desc' => 'Generate code coverage report in HTML format'], ['arg' => '--coverage-php <file>', 'desc' => 'Export PHP_CodeCoverage object to file'], ['arg' => '--coverage-text=<file>', 'desc' => 'Generate code coverage report in text format [default: standard output]'], ['arg' => '--coverage-xml <dir>', 'desc' => 'Generate code coverage report in PHPUnit XML format'], ['arg' => '--coverage-cache <dir>', 'desc' => 'Cache static analysis results'], ['arg' => '--warm-coverage-cache', 'desc' => 'Warm static analysis cache'], ['arg' => '--coverage-filter <dir>', 'desc' => 'Include <dir> in code coverage analysis'], ['arg' => '--path-coverage', 'desc' => 'Perform path coverage analysis'], ['arg' => '--disable-coverage-ignore', 'desc' => 'Disable annotations for ignoring code coverage'], ['arg' => '--no-coverage', 'desc' => 'Ignore code coverage configuration']], 'Logging Options' => [['arg' => '--log-junit <file>', 'desc' => 'Log test execution in JUnit XML format to file'], ['arg' => '--log-teamcity <file>', 'desc' => 'Log test execution in TeamCity format to file'], ['arg' => '--testdox-html <file>', 'desc' => 'Write agile documentation in HTML format to file'], ['arg' => '--testdox-text <file>', 'desc' => 'Write agile documentation in Text format to file'], ['arg' => '--testdox-xml <file>', 'desc' => 'Write agile documentation in XML format to file'], ['arg' => '--reverse-list', 'desc' => 'Print defects in reverse order'], ['arg' => '--no-logging', 'desc' => 'Ignore logging configuration']], 'Test Selection Options' => [['arg' => '--list-suites', 'desc' => 'List available test suites'], ['arg' => '--testsuite <name>', 'desc' => 'Filter which testsuite to run'], ['arg' => '--list-groups', 'desc' => 'List available test groups'], ['arg' => '--group <name>', 'desc' => 'Only runs tests from the specified group(s)'], ['arg' => '--exclude-group <name>', 'desc' => 'Exclude tests from the specified group(s)'], ['arg' => '--covers <name>', 'desc' => 'Only runs tests annotated with "@covers <name>"'], ['arg' => '--uses <name>', 'desc' => 'Only runs tests annotated with "@uses <name>"'], ['arg' => '--list-tests', 'desc' => 'List available tests'], ['arg' => '--list-tests-xml <file>', 'desc' => 'List available tests in XML format'], ['arg' => '--filter <pattern>', 'desc' => 'Filter which tests to run'], ['arg' => '--test-suffix <suffixes>', 'desc' => 'Only search for test in files with specified suffix(es). Default: Test.php,.phpt']], 'Test Execution Options' => [['arg' => '--dont-report-useless-tests', 'desc' => 'Do not report tests that do not test anything'], ['arg' => '--strict-coverage', 'desc' => 'Be strict about @covers annotation usage'], ['arg' => '--strict-global-state', 'desc' => 'Be strict about changes to global state'], ['arg' => '--disallow-test-output', 'desc' => 'Be strict about output during tests'], ['arg' => '--disallow-resource-usage', 'desc' => 'Be strict about resource usage during small tests'], ['arg' => '--enforce-time-limit', 'desc' => 'Enforce time limit based on test size'], ['arg' => '--default-time-limit <sec>', 'desc' => 'Timeout in seconds for tests without @small, @medium or @large'], ['arg' => '--disallow-todo-tests', 'desc' => 'Disallow @todo-annotated tests'], ['spacer' => ''], ['arg' => '--process-isolation', 'desc' => 'Run each test in a separate PHP process'], ['arg' => '--globals-backup', 'desc' => 'Backup and restore $GLOBALS for each test'], ['arg' => '--static-backup', 'desc' => 'Backup and restore static attributes for each test'], ['spacer' => ''], ['arg' => '--colors <flag>', 'desc' => 'Use colors in output ("never", "auto" or "always")'], ['arg' => '--columns <n>', 'desc' => 'Number of columns to use for progress output'], ['arg' => '--columns max', 'desc' => 'Use maximum number of columns for progress output'], ['arg' => '--stderr', 'desc' => 'Write to STDERR instead of STDOUT'], ['arg' => '--stop-on-defect', 'desc' => 'Stop execution upon first not-passed test'], ['arg' => '--stop-on-error', 'desc' => 'Stop execution upon first error'], ['arg' => '--stop-on-failure', 'desc' => 'Stop execution upon first error or failure'], ['arg' => '--stop-on-warning', 'desc' => 'Stop execution upon first warning'], ['arg' => '--stop-on-risky', 'desc' => 'Stop execution upon first risky test'], ['arg' => '--stop-on-skipped', 'desc' => 'Stop execution upon first skipped test'], ['arg' => '--stop-on-incomplete', 'desc' => 'Stop execution upon first incomplete test'], ['arg' => '--fail-on-incomplete', 'desc' => 'Treat incomplete tests as failures'], ['arg' => '--fail-on-risky', 'desc' => 'Treat risky tests as failures'], ['arg' => '--fail-on-skipped', 'desc' => 'Treat skipped tests as failures'], ['arg' => '--fail-on-warning', 'desc' => 'Treat tests with warnings as failures'], ['arg' => '-v|--verbose', 'desc' => 'Output more verbose information'], ['arg' => '--debug', 'desc' => 'Display debugging information'], ['spacer' => ''], ['arg' => '--repeat <times>', 'desc' => 'Runs the test(s) repeatedly'], ['arg' => '--teamcity', 'desc' => 'Report test execution progress in TeamCity format'], ['arg' => '--testdox', 'desc' => 'Report test execution progress in TestDox format'], ['arg' => '--testdox-group', 'desc' => 'Only include tests from the specified group(s)'], ['arg' => '--testdox-exclude-group', 'desc' => 'Exclude tests from the specified group(s)'], ['arg' => '--no-interaction', 'desc' => 'Disable TestDox progress animation'], ['arg' => '--printer <printer>', 'desc' => 'TestListener implementation to use'], ['spacer' => ''], ['arg' => '--order-by <order>', 'desc' => 'Run tests in order: default|defects|duration|no-depends|random|reverse|size'], ['arg' => '--random-order-seed <N>', 'desc' => 'Use a specific random seed <N> for random order'], ['arg' => '--cache-result', 'desc' => 'Write test results to cache file'], ['arg' => '--do-not-cache-result', 'desc' => 'Do not write test results to cache file']], 'Configuration Options' => [['arg' => '--prepend <file>', 'desc' => 'A PHP script that is included as early as possible'], ['arg' => '--bootstrap <file>', 'desc' => 'A PHP script that is included before the tests run'], ['arg' => '-c|--configuration <file>', 'desc' => 'Read configuration from XML file'], ['arg' => '--no-configuration', 'desc' => 'Ignore default configuration file (phpunit.xml)'], ['arg' => '--extensions <extensions>', 'desc' => 'A comma separated list of PHPUnit extensions to load'], ['arg' => '--no-extensions', 'desc' => 'Do not load PHPUnit extensions'], ['arg' => '--include-path <path(s)>', 'desc' => 'Prepend PHP\'s include_path with given path(s)'], ['arg' => '-d <key[=value]>', 'desc' => 'Sets a php.ini value'], ['arg' => '--cache-result-file <file>', 'desc' => 'Specify result cache path and filename'], ['arg' => '--generate-configuration', 'desc' => 'Generate configuration file with suggested settings'], ['arg' => '--migrate-configuration', 'desc' => 'Migrate configuration file to current format']], 'Miscellaneous Options' => [['arg' => '-h|--help', 'desc' => 'Prints this usage information'], ['arg' => '--version', 'desc' => 'Prints the version and exits'], ['arg' => '--atleast-version <min>', 'desc' => 'Checks that version is greater than min and exits'], ['arg' => '--check-version', 'desc' => 'Check whether PHPUnit is the latest version']]];
64048    /**
64049     * @var int Number of columns required to write the longest option name to the console
64050     */
64051    private $maxArgLength = 0;
64052    /**
64053     * @var int Number of columns left for the description field after padding and option
64054     */
64055    private $maxDescLength;
64056    /**
64057     * @var bool Use color highlights for sections, options and parameters
64058     */
64059    private $hasColor = \false;
64060    public function __construct(?int $width = null, ?bool $withColor = null)
64061    {
64062        if ($width === null) {
64063            $width = (new Console())->getNumberOfColumns();
64064        }
64065        if ($withColor === null) {
64066            $this->hasColor = (new Console())->hasColorSupport();
64067        } else {
64068            $this->hasColor = $withColor;
64069        }
64070        foreach (self::HELP_TEXT as $options) {
64071            foreach ($options as $option) {
64072                if (isset($option['arg'])) {
64073                    $this->maxArgLength = max($this->maxArgLength, isset($option['arg']) ? strlen($option['arg']) : 0);
64074                }
64075            }
64076        }
64077        $this->maxDescLength = $width - $this->maxArgLength - 4;
64078    }
64079    /**
64080     * Write the help file to the CLI, adapting width and colors to the console.
64081     */
64082    public function writeToConsole() : void
64083    {
64084        if ($this->hasColor) {
64085            $this->writeWithColor();
64086        } else {
64087            $this->writePlaintext();
64088        }
64089    }
64090    private function writePlaintext() : void
64091    {
64092        foreach (self::HELP_TEXT as $section => $options) {
64093            print "{$section}:" . \PHP_EOL;
64094            if ($section !== 'Usage') {
64095                print \PHP_EOL;
64096            }
64097            foreach ($options as $option) {
64098                if (isset($option['spacer'])) {
64099                    print \PHP_EOL;
64100                }
64101                if (isset($option['text'])) {
64102                    print self::LEFT_MARGIN . $option['text'] . \PHP_EOL;
64103                }
64104                if (isset($option['arg'])) {
64105                    $arg = str_pad($option['arg'], $this->maxArgLength);
64106                    print self::LEFT_MARGIN . $arg . ' ' . $option['desc'] . \PHP_EOL;
64107                }
64108            }
64109            print \PHP_EOL;
64110        }
64111    }
64112    private function writeWithColor() : void
64113    {
64114        foreach (self::HELP_TEXT as $section => $options) {
64115            print Color::colorize('fg-yellow', "{$section}:") . \PHP_EOL;
64116            foreach ($options as $option) {
64117                if (isset($option['spacer'])) {
64118                    print \PHP_EOL;
64119                }
64120                if (isset($option['text'])) {
64121                    print self::LEFT_MARGIN . $option['text'] . \PHP_EOL;
64122                }
64123                if (isset($option['arg'])) {
64124                    $arg = Color::colorize('fg-green', str_pad($option['arg'], $this->maxArgLength));
64125                    $arg = preg_replace_callback('/(<[^>]+>)/', static function ($matches) {
64126                        return Color::colorize('fg-cyan', $matches[0]);
64127                    }, $arg);
64128                    $desc = explode(\PHP_EOL, wordwrap($option['desc'], $this->maxDescLength, \PHP_EOL));
64129                    print self::LEFT_MARGIN . $arg . ' ' . $desc[0] . \PHP_EOL;
64130                    for ($i = 1; $i < count($desc); $i++) {
64131                        print str_repeat(' ', $this->maxArgLength + 3) . $desc[$i] . \PHP_EOL;
64132                    }
64133                }
64134            }
64135            print \PHP_EOL;
64136        }
64137    }
64138}
64139<?php
64140
64141declare (strict_types=1);
64142/*
64143 * This file is part of PHPUnit.
64144 *
64145 * (c) Sebastian Bergmann <sebastian@phpunit.de>
64146 *
64147 * For the full copyright and license information, please view the LICENSE
64148 * file that was distributed with this source code.
64149 */
64150namespace PHPUnit\TextUI;
64151
64152use const PHP_EOL;
64153use const PHP_SAPI;
64154use const PHP_VERSION;
64155use function array_diff;
64156use function array_map;
64157use function array_merge;
64158use function assert;
64159use function class_exists;
64160use function count;
64161use function dirname;
64162use function file_put_contents;
64163use function htmlspecialchars;
64164use function is_array;
64165use function is_int;
64166use function is_string;
64167use function mt_srand;
64168use function range;
64169use function realpath;
64170use function sprintf;
64171use function time;
64172use PHPUnit\Framework\Exception;
64173use PHPUnit\Framework\TestResult;
64174use PHPUnit\Framework\TestSuite;
64175use PHPUnit\Runner\AfterLastTestHook;
64176use PHPUnit\Runner\BaseTestRunner;
64177use PHPUnit\Runner\BeforeFirstTestHook;
64178use PHPUnit\Runner\DefaultTestResultCache;
64179use PHPUnit\Runner\Extension\ExtensionHandler;
64180use PHPUnit\Runner\Filter\ExcludeGroupFilterIterator;
64181use PHPUnit\Runner\Filter\Factory;
64182use PHPUnit\Runner\Filter\IncludeGroupFilterIterator;
64183use PHPUnit\Runner\Filter\NameFilterIterator;
64184use PHPUnit\Runner\Hook;
64185use PHPUnit\Runner\NullTestResultCache;
64186use PHPUnit\Runner\ResultCacheExtension;
64187use PHPUnit\Runner\StandardTestSuiteLoader;
64188use PHPUnit\Runner\TestHook;
64189use PHPUnit\Runner\TestListenerAdapter;
64190use PHPUnit\Runner\TestSuiteLoader;
64191use PHPUnit\Runner\TestSuiteSorter;
64192use PHPUnit\Runner\Version;
64193use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\FilterMapper;
64194use PHPUnit\TextUI\XmlConfiguration\Configuration;
64195use PHPUnit\TextUI\XmlConfiguration\Loader;
64196use PHPUnit\TextUI\XmlConfiguration\PhpHandler;
64197use PHPUnit\Util\Filesystem;
64198use PHPUnit\Util\Log\JUnit;
64199use PHPUnit\Util\Log\TeamCity;
64200use PHPUnit\Util\Printer;
64201use PHPUnit\Util\TestDox\CliTestDoxPrinter;
64202use PHPUnit\Util\TestDox\HtmlResultPrinter;
64203use PHPUnit\Util\TestDox\TextResultPrinter;
64204use PHPUnit\Util\TestDox\XmlResultPrinter;
64205use PHPUnit\Util\XdebugFilterScriptGenerator;
64206use PHPUnit\Util\Xml\SchemaDetector;
64207use ReflectionClass;
64208use ReflectionException;
64209use PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage;
64210use PHPUnit\SebastianBergmann\CodeCoverage\Driver\Selector;
64211use PHPUnit\SebastianBergmann\CodeCoverage\Exception as CodeCoverageException;
64212use PHPUnit\SebastianBergmann\CodeCoverage\Filter as CodeCoverageFilter;
64213use PHPUnit\SebastianBergmann\CodeCoverage\Report\Clover as CloverReport;
64214use PHPUnit\SebastianBergmann\CodeCoverage\Report\Cobertura as CoberturaReport;
64215use PHPUnit\SebastianBergmann\CodeCoverage\Report\Crap4j as Crap4jReport;
64216use PHPUnit\SebastianBergmann\CodeCoverage\Report\Html\Facade as HtmlReport;
64217use PHPUnit\SebastianBergmann\CodeCoverage\Report\PHP as PhpReport;
64218use PHPUnit\SebastianBergmann\CodeCoverage\Report\Text as TextReport;
64219use PHPUnit\SebastianBergmann\CodeCoverage\Report\Xml\Facade as XmlReport;
64220use PHPUnit\SebastianBergmann\Comparator\Comparator;
64221use PHPUnit\SebastianBergmann\Environment\Runtime;
64222use PHPUnit\SebastianBergmann\Invoker\Invoker;
64223use PHPUnit\SebastianBergmann\Timer\Timer;
64224/**
64225 * @internal This class is not covered by the backward compatibility promise for PHPUnit
64226 */
64227final class TestRunner extends BaseTestRunner
64228{
64229    public const SUCCESS_EXIT = 0;
64230    public const FAILURE_EXIT = 1;
64231    public const EXCEPTION_EXIT = 2;
64232    /**
64233     * @var bool
64234     */
64235    private static $versionStringPrinted = \false;
64236    /**
64237     * @var CodeCoverageFilter
64238     */
64239    private $codeCoverageFilter;
64240    /**
64241     * @var TestSuiteLoader
64242     */
64243    private $loader;
64244    /**
64245     * @var ResultPrinter
64246     */
64247    private $printer;
64248    /**
64249     * @var bool
64250     */
64251    private $messagePrinted = \false;
64252    /**
64253     * @var Hook[]
64254     */
64255    private $extensions = [];
64256    /**
64257     * @var Timer
64258     */
64259    private $timer;
64260    public function __construct(TestSuiteLoader $loader = null, CodeCoverageFilter $filter = null)
64261    {
64262        if ($filter === null) {
64263            $filter = new CodeCoverageFilter();
64264        }
64265        $this->codeCoverageFilter = $filter;
64266        $this->loader = $loader;
64267        $this->timer = new Timer();
64268    }
64269    /**
64270     * @throws \PHPUnit\Runner\Exception
64271     * @throws \PHPUnit\TextUI\XmlConfiguration\Exception
64272     * @throws Exception
64273     */
64274    public function run(TestSuite $suite, array $arguments = [], array $warnings = [], bool $exit = \true) : TestResult
64275    {
64276        if (isset($arguments['configuration'])) {
64277            $GLOBALS['__PHPUNIT_CONFIGURATION_FILE'] = $arguments['configuration'];
64278        }
64279        $this->handleConfiguration($arguments);
64280        $warnings = array_merge($warnings, $arguments['warnings']);
64281        if (is_int($arguments['columns']) && $arguments['columns'] < 16) {
64282            $arguments['columns'] = 16;
64283            $tooFewColumnsRequested = \true;
64284        }
64285        if (isset($arguments['bootstrap'])) {
64286            $GLOBALS['__PHPUNIT_BOOTSTRAP'] = $arguments['bootstrap'];
64287        }
64288        if ($arguments['backupGlobals'] === \true) {
64289            $suite->setBackupGlobals(\true);
64290        }
64291        if ($arguments['backupStaticAttributes'] === \true) {
64292            $suite->setBackupStaticAttributes(\true);
64293        }
64294        if ($arguments['beStrictAboutChangesToGlobalState'] === \true) {
64295            $suite->setBeStrictAboutChangesToGlobalState(\true);
64296        }
64297        if ($arguments['executionOrder'] === TestSuiteSorter::ORDER_RANDOMIZED) {
64298            mt_srand($arguments['randomOrderSeed']);
64299        }
64300        if ($arguments['cacheResult']) {
64301            if (!isset($arguments['cacheResultFile'])) {
64302                if (isset($arguments['configurationObject'])) {
64303                    assert($arguments['configurationObject'] instanceof Configuration);
64304                    $cacheLocation = $arguments['configurationObject']->filename();
64305                } else {
64306                    $cacheLocation = $_SERVER['PHP_SELF'];
64307                }
64308                $arguments['cacheResultFile'] = null;
64309                $cacheResultFile = realpath($cacheLocation);
64310                if ($cacheResultFile !== \false) {
64311                    $arguments['cacheResultFile'] = dirname($cacheResultFile);
64312                }
64313            }
64314            $cache = new DefaultTestResultCache($arguments['cacheResultFile']);
64315            $this->addExtension(new ResultCacheExtension($cache));
64316        }
64317        if ($arguments['executionOrder'] !== TestSuiteSorter::ORDER_DEFAULT || $arguments['executionOrderDefects'] !== TestSuiteSorter::ORDER_DEFAULT || $arguments['resolveDependencies']) {
64318            $cache = $cache ?? new NullTestResultCache();
64319            $cache->load();
64320            $sorter = new TestSuiteSorter($cache);
64321            $sorter->reorderTestsInSuite($suite, $arguments['executionOrder'], $arguments['resolveDependencies'], $arguments['executionOrderDefects']);
64322            $originalExecutionOrder = $sorter->getOriginalExecutionOrder();
64323            unset($sorter);
64324        }
64325        if (is_int($arguments['repeat']) && $arguments['repeat'] > 0) {
64326            $_suite = new TestSuite();
64327            /* @noinspection PhpUnusedLocalVariableInspection */
64328            foreach (range(1, $arguments['repeat']) as $step) {
64329                $_suite->addTest($suite);
64330            }
64331            $suite = $_suite;
64332            unset($_suite);
64333        }
64334        $result = $this->createTestResult();
64335        $listener = new TestListenerAdapter();
64336        $listenerNeeded = \false;
64337        foreach ($this->extensions as $extension) {
64338            if ($extension instanceof TestHook) {
64339                $listener->add($extension);
64340                $listenerNeeded = \true;
64341            }
64342        }
64343        if ($listenerNeeded) {
64344            $result->addListener($listener);
64345        }
64346        unset($listener, $listenerNeeded);
64347        if ($arguments['convertDeprecationsToExceptions']) {
64348            $result->convertDeprecationsToExceptions(\true);
64349        }
64350        if (!$arguments['convertErrorsToExceptions']) {
64351            $result->convertErrorsToExceptions(\false);
64352        }
64353        if (!$arguments['convertNoticesToExceptions']) {
64354            $result->convertNoticesToExceptions(\false);
64355        }
64356        if (!$arguments['convertWarningsToExceptions']) {
64357            $result->convertWarningsToExceptions(\false);
64358        }
64359        if ($arguments['stopOnError']) {
64360            $result->stopOnError(\true);
64361        }
64362        if ($arguments['stopOnFailure']) {
64363            $result->stopOnFailure(\true);
64364        }
64365        if ($arguments['stopOnWarning']) {
64366            $result->stopOnWarning(\true);
64367        }
64368        if ($arguments['stopOnIncomplete']) {
64369            $result->stopOnIncomplete(\true);
64370        }
64371        if ($arguments['stopOnRisky']) {
64372            $result->stopOnRisky(\true);
64373        }
64374        if ($arguments['stopOnSkipped']) {
64375            $result->stopOnSkipped(\true);
64376        }
64377        if ($arguments['stopOnDefect']) {
64378            $result->stopOnDefect(\true);
64379        }
64380        if ($arguments['registerMockObjectsFromTestArgumentsRecursively']) {
64381            $result->setRegisterMockObjectsFromTestArgumentsRecursively(\true);
64382        }
64383        if ($this->printer === null) {
64384            if (isset($arguments['printer'])) {
64385                if ($arguments['printer'] instanceof \PHPUnit\TextUI\ResultPrinter) {
64386                    $this->printer = $arguments['printer'];
64387                } elseif (is_string($arguments['printer']) && class_exists($arguments['printer'], \false)) {
64388                    try {
64389                        $reflector = new ReflectionClass($arguments['printer']);
64390                        if ($reflector->implementsInterface(\PHPUnit\TextUI\ResultPrinter::class)) {
64391                            $this->printer = $this->createPrinter($arguments['printer'], $arguments);
64392                        }
64393                        // @codeCoverageIgnoreStart
64394                    } catch (ReflectionException $e) {
64395                        throw new Exception($e->getMessage(), (int) $e->getCode(), $e);
64396                    }
64397                    // @codeCoverageIgnoreEnd
64398                }
64399            } else {
64400                $this->printer = $this->createPrinter(\PHPUnit\TextUI\DefaultResultPrinter::class, $arguments);
64401            }
64402        }
64403        if (isset($originalExecutionOrder) && $this->printer instanceof CliTestDoxPrinter) {
64404            assert($this->printer instanceof CliTestDoxPrinter);
64405            $this->printer->setOriginalExecutionOrder($originalExecutionOrder);
64406            $this->printer->setShowProgressAnimation(!$arguments['noInteraction']);
64407        }
64408        $this->printer->write(Version::getVersionString() . "\n");
64409        self::$versionStringPrinted = \true;
64410        foreach ($arguments['listeners'] as $listener) {
64411            $result->addListener($listener);
64412        }
64413        $result->addListener($this->printer);
64414        $coverageFilterFromConfigurationFile = \false;
64415        $coverageFilterFromOption = \false;
64416        $codeCoverageReports = 0;
64417        if (isset($arguments['testdoxHTMLFile'])) {
64418            $result->addListener(new HtmlResultPrinter($arguments['testdoxHTMLFile'], $arguments['testdoxGroups'], $arguments['testdoxExcludeGroups']));
64419        }
64420        if (isset($arguments['testdoxTextFile'])) {
64421            $result->addListener(new TextResultPrinter($arguments['testdoxTextFile'], $arguments['testdoxGroups'], $arguments['testdoxExcludeGroups']));
64422        }
64423        if (isset($arguments['testdoxXMLFile'])) {
64424            $result->addListener(new XmlResultPrinter($arguments['testdoxXMLFile']));
64425        }
64426        if (isset($arguments['teamcityLogfile'])) {
64427            $result->addListener(new TeamCity($arguments['teamcityLogfile']));
64428        }
64429        if (isset($arguments['junitLogfile'])) {
64430            $result->addListener(new JUnit($arguments['junitLogfile'], $arguments['reportUselessTests']));
64431        }
64432        if (isset($arguments['coverageClover'])) {
64433            $codeCoverageReports++;
64434        }
64435        if (isset($arguments['coverageCobertura'])) {
64436            $codeCoverageReports++;
64437        }
64438        if (isset($arguments['coverageCrap4J'])) {
64439            $codeCoverageReports++;
64440        }
64441        if (isset($arguments['coverageHtml'])) {
64442            $codeCoverageReports++;
64443        }
64444        if (isset($arguments['coveragePHP'])) {
64445            $codeCoverageReports++;
64446        }
64447        if (isset($arguments['coverageText'])) {
64448            $codeCoverageReports++;
64449        }
64450        if (isset($arguments['coverageXml'])) {
64451            $codeCoverageReports++;
64452        }
64453        if ($codeCoverageReports > 0 || isset($arguments['xdebugFilterFile'])) {
64454            if (isset($arguments['coverageFilter'])) {
64455                if (!is_array($arguments['coverageFilter'])) {
64456                    $coverageFilterDirectories = [$arguments['coverageFilter']];
64457                } else {
64458                    $coverageFilterDirectories = $arguments['coverageFilter'];
64459                }
64460                foreach ($coverageFilterDirectories as $coverageFilterDirectory) {
64461                    $this->codeCoverageFilter->includeDirectory($coverageFilterDirectory);
64462                }
64463                $coverageFilterFromOption = \true;
64464            }
64465            if (isset($arguments['configurationObject'])) {
64466                assert($arguments['configurationObject'] instanceof Configuration);
64467                $codeCoverageConfiguration = $arguments['configurationObject']->codeCoverage();
64468                if ($codeCoverageConfiguration->hasNonEmptyListOfFilesToBeIncludedInCodeCoverageReport()) {
64469                    $coverageFilterFromConfigurationFile = \true;
64470                    (new FilterMapper())->map($this->codeCoverageFilter, $codeCoverageConfiguration);
64471                }
64472            }
64473        }
64474        if ($codeCoverageReports > 0) {
64475            try {
64476                if (isset($codeCoverageConfiguration) && ($codeCoverageConfiguration->pathCoverage() || isset($arguments['pathCoverage']) && $arguments['pathCoverage'] === \true)) {
64477                    $codeCoverageDriver = (new Selector())->forLineAndPathCoverage($this->codeCoverageFilter);
64478                } else {
64479                    $codeCoverageDriver = (new Selector())->forLineCoverage($this->codeCoverageFilter);
64480                }
64481                $codeCoverage = new CodeCoverage($codeCoverageDriver, $this->codeCoverageFilter);
64482                if (isset($codeCoverageConfiguration) && $codeCoverageConfiguration->hasCacheDirectory()) {
64483                    $codeCoverage->cacheStaticAnalysis($codeCoverageConfiguration->cacheDirectory()->path());
64484                }
64485                if (isset($arguments['coverageCacheDirectory'])) {
64486                    $codeCoverage->cacheStaticAnalysis($arguments['coverageCacheDirectory']);
64487                }
64488                $codeCoverage->excludeSubclassesOfThisClassFromUnintentionallyCoveredCodeCheck(Comparator::class);
64489                if ($arguments['strictCoverage']) {
64490                    $codeCoverage->enableCheckForUnintentionallyCoveredCode();
64491                }
64492                if (isset($arguments['ignoreDeprecatedCodeUnitsFromCodeCoverage'])) {
64493                    if ($arguments['ignoreDeprecatedCodeUnitsFromCodeCoverage']) {
64494                        $codeCoverage->ignoreDeprecatedCode();
64495                    } else {
64496                        $codeCoverage->doNotIgnoreDeprecatedCode();
64497                    }
64498                }
64499                if (isset($arguments['disableCodeCoverageIgnore'])) {
64500                    if ($arguments['disableCodeCoverageIgnore']) {
64501                        $codeCoverage->disableAnnotationsForIgnoringCode();
64502                    } else {
64503                        $codeCoverage->enableAnnotationsForIgnoringCode();
64504                    }
64505                }
64506                if (isset($arguments['configurationObject'])) {
64507                    $codeCoverageConfiguration = $arguments['configurationObject']->codeCoverage();
64508                    if ($codeCoverageConfiguration->hasNonEmptyListOfFilesToBeIncludedInCodeCoverageReport()) {
64509                        if ($codeCoverageConfiguration->includeUncoveredFiles()) {
64510                            $codeCoverage->includeUncoveredFiles();
64511                        } else {
64512                            $codeCoverage->excludeUncoveredFiles();
64513                        }
64514                        if ($codeCoverageConfiguration->processUncoveredFiles()) {
64515                            $codeCoverage->processUncoveredFiles();
64516                        } else {
64517                            $codeCoverage->doNotProcessUncoveredFiles();
64518                        }
64519                    }
64520                }
64521                if ($this->codeCoverageFilter->isEmpty()) {
64522                    if (!$coverageFilterFromConfigurationFile && !$coverageFilterFromOption) {
64523                        $warnings[] = 'No filter is configured, code coverage will not be processed';
64524                    } else {
64525                        $warnings[] = 'Incorrect filter configuration, code coverage will not be processed';
64526                    }
64527                    unset($codeCoverage);
64528                }
64529            } catch (CodeCoverageException $e) {
64530                $warnings[] = $e->getMessage();
64531            }
64532        }
64533        if ($arguments['verbose']) {
64534            if (\PHP_SAPI === 'phpdbg') {
64535                $this->writeMessage('Runtime', 'PHPDBG ' . \PHP_VERSION);
64536            } else {
64537                $runtime = 'PHP ' . \PHP_VERSION;
64538                if (isset($codeCoverageDriver)) {
64539                    $runtime .= ' with ' . $codeCoverageDriver->nameAndVersion();
64540                }
64541                $this->writeMessage('Runtime', $runtime);
64542            }
64543            if (isset($arguments['configurationObject'])) {
64544                assert($arguments['configurationObject'] instanceof Configuration);
64545                $this->writeMessage('Configuration', $arguments['configurationObject']->filename());
64546            }
64547            foreach ($arguments['loadedExtensions'] as $extension) {
64548                $this->writeMessage('Extension', $extension);
64549            }
64550            foreach ($arguments['notLoadedExtensions'] as $extension) {
64551                $this->writeMessage('Extension', $extension);
64552            }
64553        }
64554        if ($arguments['executionOrder'] === TestSuiteSorter::ORDER_RANDOMIZED) {
64555            $this->writeMessage('Random Seed', (string) $arguments['randomOrderSeed']);
64556        }
64557        if (isset($tooFewColumnsRequested)) {
64558            $warnings[] = 'Less than 16 columns requested, number of columns set to 16';
64559        }
64560        if ((new Runtime())->discardsComments()) {
64561            $warnings[] = 'opcache.save_comments=0 set; annotations will not work';
64562        }
64563        if (isset($arguments['conflictBetweenPrinterClassAndTestdox'])) {
64564            $warnings[] = 'Directives printerClass and testdox are mutually exclusive';
64565        }
64566        foreach ($warnings as $warning) {
64567            $this->writeMessage('Warning', $warning);
64568        }
64569        if (isset($arguments['configurationObject'])) {
64570            assert($arguments['configurationObject'] instanceof Configuration);
64571            if ($arguments['configurationObject']->hasValidationErrors()) {
64572                if ((new SchemaDetector())->detect($arguments['configurationObject']->filename())->detected()) {
64573                    $this->writeMessage('Warning', 'Your XML configuration validates against a deprecated schema.');
64574                    $this->writeMessage('Suggestion', 'Migrate your XML configuration using "--migrate-configuration"!');
64575                } else {
64576                    $this->write("\n  Warning - The configuration file did not pass validation!\n  The following problems have been detected:\n");
64577                    $this->write($arguments['configurationObject']->validationErrors());
64578                    $this->write("\n  Test results may not be as expected.\n\n");
64579                }
64580            }
64581        }
64582        if (isset($arguments['xdebugFilterFile'], $codeCoverageConfiguration)) {
64583            $this->write(\PHP_EOL . 'Please note that --dump-xdebug-filter and --prepend are deprecated and will be removed in PHPUnit 10.' . \PHP_EOL);
64584            $script = (new XdebugFilterScriptGenerator())->generate($codeCoverageConfiguration);
64585            if ($arguments['xdebugFilterFile'] !== 'php://stdout' && $arguments['xdebugFilterFile'] !== 'php://stderr' && !Filesystem::createDirectory(dirname($arguments['xdebugFilterFile']))) {
64586                $this->write(sprintf('Cannot write Xdebug filter script to %s ' . \PHP_EOL, $arguments['xdebugFilterFile']));
64587                exit(self::EXCEPTION_EXIT);
64588            }
64589            file_put_contents($arguments['xdebugFilterFile'], $script);
64590            $this->write(sprintf('Wrote Xdebug filter script to %s ' . \PHP_EOL . \PHP_EOL, $arguments['xdebugFilterFile']));
64591            exit(self::SUCCESS_EXIT);
64592        }
64593        $this->printer->write("\n");
64594        if (isset($codeCoverage)) {
64595            $result->setCodeCoverage($codeCoverage);
64596        }
64597        $result->beStrictAboutTestsThatDoNotTestAnything($arguments['reportUselessTests']);
64598        $result->beStrictAboutOutputDuringTests($arguments['disallowTestOutput']);
64599        $result->beStrictAboutTodoAnnotatedTests($arguments['disallowTodoAnnotatedTests']);
64600        $result->beStrictAboutResourceUsageDuringSmallTests($arguments['beStrictAboutResourceUsageDuringSmallTests']);
64601        if ($arguments['enforceTimeLimit'] === \true && !(new Invoker())->canInvokeWithTimeout()) {
64602            $this->writeMessage('Error', 'PHP extension pcntl is required for enforcing time limits');
64603        }
64604        $result->enforceTimeLimit($arguments['enforceTimeLimit']);
64605        $result->setDefaultTimeLimit($arguments['defaultTimeLimit']);
64606        $result->setTimeoutForSmallTests($arguments['timeoutForSmallTests']);
64607        $result->setTimeoutForMediumTests($arguments['timeoutForMediumTests']);
64608        $result->setTimeoutForLargeTests($arguments['timeoutForLargeTests']);
64609        if (isset($arguments['forceCoversAnnotation']) && $arguments['forceCoversAnnotation'] === \true) {
64610            $result->forceCoversAnnotation();
64611        }
64612        $this->processSuiteFilters($suite, $arguments);
64613        $suite->setRunTestInSeparateProcess($arguments['processIsolation']);
64614        foreach ($this->extensions as $extension) {
64615            if ($extension instanceof BeforeFirstTestHook) {
64616                $extension->executeBeforeFirstTest();
64617            }
64618        }
64619        $testSuiteWarningsPrinted = \false;
64620        foreach ($suite->warnings() as $warning) {
64621            $this->writeMessage('Warning', $warning);
64622            $testSuiteWarningsPrinted = \true;
64623        }
64624        if ($testSuiteWarningsPrinted) {
64625            $this->write(\PHP_EOL);
64626        }
64627        $suite->run($result);
64628        foreach ($this->extensions as $extension) {
64629            if ($extension instanceof AfterLastTestHook) {
64630                $extension->executeAfterLastTest();
64631            }
64632        }
64633        $result->flushListeners();
64634        $this->printer->printResult($result);
64635        if (isset($codeCoverage)) {
64636            if (isset($arguments['coverageClover'])) {
64637                $this->codeCoverageGenerationStart('Clover XML');
64638                try {
64639                    $writer = new CloverReport();
64640                    $writer->process($codeCoverage, $arguments['coverageClover']);
64641                    $this->codeCoverageGenerationSucceeded();
64642                    unset($writer);
64643                } catch (CodeCoverageException $e) {
64644                    $this->codeCoverageGenerationFailed($e);
64645                }
64646            }
64647            if (isset($arguments['coverageCobertura'])) {
64648                $this->codeCoverageGenerationStart('Cobertura XML');
64649                try {
64650                    $writer = new CoberturaReport();
64651                    $writer->process($codeCoverage, $arguments['coverageCobertura']);
64652                    $this->codeCoverageGenerationSucceeded();
64653                    unset($writer);
64654                } catch (CodeCoverageException $e) {
64655                    $this->codeCoverageGenerationFailed($e);
64656                }
64657            }
64658            if (isset($arguments['coverageCrap4J'])) {
64659                $this->codeCoverageGenerationStart('Crap4J XML');
64660                try {
64661                    $writer = new Crap4jReport($arguments['crap4jThreshold']);
64662                    $writer->process($codeCoverage, $arguments['coverageCrap4J']);
64663                    $this->codeCoverageGenerationSucceeded();
64664                    unset($writer);
64665                } catch (CodeCoverageException $e) {
64666                    $this->codeCoverageGenerationFailed($e);
64667                }
64668            }
64669            if (isset($arguments['coverageHtml'])) {
64670                $this->codeCoverageGenerationStart('HTML');
64671                try {
64672                    $writer = new HtmlReport($arguments['reportLowUpperBound'], $arguments['reportHighLowerBound'], sprintf(' and <a href="https://phpunit.de/">PHPUnit %s</a>', Version::id()));
64673                    $writer->process($codeCoverage, $arguments['coverageHtml']);
64674                    $this->codeCoverageGenerationSucceeded();
64675                    unset($writer);
64676                } catch (CodeCoverageException $e) {
64677                    $this->codeCoverageGenerationFailed($e);
64678                }
64679            }
64680            if (isset($arguments['coveragePHP'])) {
64681                $this->codeCoverageGenerationStart('PHP');
64682                try {
64683                    $writer = new PhpReport();
64684                    $writer->process($codeCoverage, $arguments['coveragePHP']);
64685                    $this->codeCoverageGenerationSucceeded();
64686                    unset($writer);
64687                } catch (CodeCoverageException $e) {
64688                    $this->codeCoverageGenerationFailed($e);
64689                }
64690            }
64691            if (isset($arguments['coverageText'])) {
64692                if ($arguments['coverageText'] === 'php://stdout') {
64693                    $outputStream = $this->printer;
64694                    $colors = $arguments['colors'] && $arguments['colors'] !== \PHPUnit\TextUI\DefaultResultPrinter::COLOR_NEVER;
64695                } else {
64696                    $outputStream = new Printer($arguments['coverageText']);
64697                    $colors = \false;
64698                }
64699                $processor = new TextReport($arguments['reportLowUpperBound'], $arguments['reportHighLowerBound'], $arguments['coverageTextShowUncoveredFiles'], $arguments['coverageTextShowOnlySummary']);
64700                $outputStream->write($processor->process($codeCoverage, $colors));
64701            }
64702            if (isset($arguments['coverageXml'])) {
64703                $this->codeCoverageGenerationStart('PHPUnit XML');
64704                try {
64705                    $writer = new XmlReport(Version::id());
64706                    $writer->process($codeCoverage, $arguments['coverageXml']);
64707                    $this->codeCoverageGenerationSucceeded();
64708                    unset($writer);
64709                } catch (CodeCoverageException $e) {
64710                    $this->codeCoverageGenerationFailed($e);
64711                }
64712            }
64713        }
64714        if ($exit) {
64715            if (isset($arguments['failOnEmptyTestSuite']) && $arguments['failOnEmptyTestSuite'] === \true && count($result) === 0) {
64716                exit(self::FAILURE_EXIT);
64717            }
64718            if ($result->wasSuccessfulIgnoringWarnings()) {
64719                if ($arguments['failOnRisky'] && !$result->allHarmless()) {
64720                    exit(self::FAILURE_EXIT);
64721                }
64722                if ($arguments['failOnWarning'] && $result->warningCount() > 0) {
64723                    exit(self::FAILURE_EXIT);
64724                }
64725                if ($arguments['failOnIncomplete'] && $result->notImplementedCount() > 0) {
64726                    exit(self::FAILURE_EXIT);
64727                }
64728                if ($arguments['failOnSkipped'] && $result->skippedCount() > 0) {
64729                    exit(self::FAILURE_EXIT);
64730                }
64731                exit(self::SUCCESS_EXIT);
64732            }
64733            if ($result->errorCount() > 0) {
64734                exit(self::EXCEPTION_EXIT);
64735            }
64736            if ($result->failureCount() > 0) {
64737                exit(self::FAILURE_EXIT);
64738            }
64739        }
64740        return $result;
64741    }
64742    /**
64743     * Returns the loader to be used.
64744     */
64745    public function getLoader() : TestSuiteLoader
64746    {
64747        if ($this->loader === null) {
64748            $this->loader = new StandardTestSuiteLoader();
64749        }
64750        return $this->loader;
64751    }
64752    public function addExtension(Hook $extension) : void
64753    {
64754        $this->extensions[] = $extension;
64755    }
64756    /**
64757     * Override to define how to handle a failed loading of
64758     * a test suite.
64759     */
64760    protected function runFailed(string $message) : void
64761    {
64762        $this->write($message . \PHP_EOL);
64763        exit(self::FAILURE_EXIT);
64764    }
64765    private function createTestResult() : TestResult
64766    {
64767        return new TestResult();
64768    }
64769    private function write(string $buffer) : void
64770    {
64771        if (\PHP_SAPI !== 'cli' && \PHP_SAPI !== 'phpdbg') {
64772            $buffer = htmlspecialchars($buffer);
64773        }
64774        if ($this->printer !== null) {
64775            $this->printer->write($buffer);
64776        } else {
64777            print $buffer;
64778        }
64779    }
64780    /**
64781     * @throws \PHPUnit\TextUI\XmlConfiguration\Exception
64782     * @throws Exception
64783     */
64784    private function handleConfiguration(array &$arguments) : void
64785    {
64786        if (!isset($arguments['configurationObject']) && isset($arguments['configuration'])) {
64787            $arguments['configurationObject'] = (new Loader())->load($arguments['configuration']);
64788        }
64789        if (!isset($arguments['warnings'])) {
64790            $arguments['warnings'] = [];
64791        }
64792        $arguments['debug'] = $arguments['debug'] ?? \false;
64793        $arguments['filter'] = $arguments['filter'] ?? \false;
64794        $arguments['listeners'] = $arguments['listeners'] ?? [];
64795        if (isset($arguments['configurationObject'])) {
64796            (new PhpHandler())->handle($arguments['configurationObject']->php());
64797            $codeCoverageConfiguration = $arguments['configurationObject']->codeCoverage();
64798            if (!isset($arguments['noCoverage'])) {
64799                if (!isset($arguments['coverageClover']) && $codeCoverageConfiguration->hasClover()) {
64800                    $arguments['coverageClover'] = $codeCoverageConfiguration->clover()->target()->path();
64801                }
64802                if (!isset($arguments['coverageCobertura']) && $codeCoverageConfiguration->hasCobertura()) {
64803                    $arguments['coverageCobertura'] = $codeCoverageConfiguration->cobertura()->target()->path();
64804                }
64805                if (!isset($arguments['coverageCrap4J']) && $codeCoverageConfiguration->hasCrap4j()) {
64806                    $arguments['coverageCrap4J'] = $codeCoverageConfiguration->crap4j()->target()->path();
64807                    if (!isset($arguments['crap4jThreshold'])) {
64808                        $arguments['crap4jThreshold'] = $codeCoverageConfiguration->crap4j()->threshold();
64809                    }
64810                }
64811                if (!isset($arguments['coverageHtml']) && $codeCoverageConfiguration->hasHtml()) {
64812                    $arguments['coverageHtml'] = $codeCoverageConfiguration->html()->target()->path();
64813                    if (!isset($arguments['reportLowUpperBound'])) {
64814                        $arguments['reportLowUpperBound'] = $codeCoverageConfiguration->html()->lowUpperBound();
64815                    }
64816                    if (!isset($arguments['reportHighLowerBound'])) {
64817                        $arguments['reportHighLowerBound'] = $codeCoverageConfiguration->html()->highLowerBound();
64818                    }
64819                }
64820                if (!isset($arguments['coveragePHP']) && $codeCoverageConfiguration->hasPhp()) {
64821                    $arguments['coveragePHP'] = $codeCoverageConfiguration->php()->target()->path();
64822                }
64823                if (!isset($arguments['coverageText']) && $codeCoverageConfiguration->hasText()) {
64824                    $arguments['coverageText'] = $codeCoverageConfiguration->text()->target()->path();
64825                    $arguments['coverageTextShowUncoveredFiles'] = $codeCoverageConfiguration->text()->showUncoveredFiles();
64826                    $arguments['coverageTextShowOnlySummary'] = $codeCoverageConfiguration->text()->showOnlySummary();
64827                }
64828                if (!isset($arguments['coverageXml']) && $codeCoverageConfiguration->hasXml()) {
64829                    $arguments['coverageXml'] = $codeCoverageConfiguration->xml()->target()->path();
64830                }
64831            }
64832            $phpunitConfiguration = $arguments['configurationObject']->phpunit();
64833            $arguments['backupGlobals'] = $arguments['backupGlobals'] ?? $phpunitConfiguration->backupGlobals();
64834            $arguments['backupStaticAttributes'] = $arguments['backupStaticAttributes'] ?? $phpunitConfiguration->backupStaticAttributes();
64835            $arguments['beStrictAboutChangesToGlobalState'] = $arguments['beStrictAboutChangesToGlobalState'] ?? $phpunitConfiguration->beStrictAboutChangesToGlobalState();
64836            $arguments['cacheResult'] = $arguments['cacheResult'] ?? $phpunitConfiguration->cacheResult();
64837            $arguments['colors'] = $arguments['colors'] ?? $phpunitConfiguration->colors();
64838            $arguments['convertDeprecationsToExceptions'] = $arguments['convertDeprecationsToExceptions'] ?? $phpunitConfiguration->convertDeprecationsToExceptions();
64839            $arguments['convertErrorsToExceptions'] = $arguments['convertErrorsToExceptions'] ?? $phpunitConfiguration->convertErrorsToExceptions();
64840            $arguments['convertNoticesToExceptions'] = $arguments['convertNoticesToExceptions'] ?? $phpunitConfiguration->convertNoticesToExceptions();
64841            $arguments['convertWarningsToExceptions'] = $arguments['convertWarningsToExceptions'] ?? $phpunitConfiguration->convertWarningsToExceptions();
64842            $arguments['processIsolation'] = $arguments['processIsolation'] ?? $phpunitConfiguration->processIsolation();
64843            $arguments['stopOnDefect'] = $arguments['stopOnDefect'] ?? $phpunitConfiguration->stopOnDefect();
64844            $arguments['stopOnError'] = $arguments['stopOnError'] ?? $phpunitConfiguration->stopOnError();
64845            $arguments['stopOnFailure'] = $arguments['stopOnFailure'] ?? $phpunitConfiguration->stopOnFailure();
64846            $arguments['stopOnWarning'] = $arguments['stopOnWarning'] ?? $phpunitConfiguration->stopOnWarning();
64847            $arguments['stopOnIncomplete'] = $arguments['stopOnIncomplete'] ?? $phpunitConfiguration->stopOnIncomplete();
64848            $arguments['stopOnRisky'] = $arguments['stopOnRisky'] ?? $phpunitConfiguration->stopOnRisky();
64849            $arguments['stopOnSkipped'] = $arguments['stopOnSkipped'] ?? $phpunitConfiguration->stopOnSkipped();
64850            $arguments['failOnEmptyTestSuite'] = $arguments['failOnEmptyTestSuite'] ?? $phpunitConfiguration->failOnEmptyTestSuite();
64851            $arguments['failOnIncomplete'] = $arguments['failOnIncomplete'] ?? $phpunitConfiguration->failOnIncomplete();
64852            $arguments['failOnRisky'] = $arguments['failOnRisky'] ?? $phpunitConfiguration->failOnRisky();
64853            $arguments['failOnSkipped'] = $arguments['failOnSkipped'] ?? $phpunitConfiguration->failOnSkipped();
64854            $arguments['failOnWarning'] = $arguments['failOnWarning'] ?? $phpunitConfiguration->failOnWarning();
64855            $arguments['enforceTimeLimit'] = $arguments['enforceTimeLimit'] ?? $phpunitConfiguration->enforceTimeLimit();
64856            $arguments['defaultTimeLimit'] = $arguments['defaultTimeLimit'] ?? $phpunitConfiguration->defaultTimeLimit();
64857            $arguments['timeoutForSmallTests'] = $arguments['timeoutForSmallTests'] ?? $phpunitConfiguration->timeoutForSmallTests();
64858            $arguments['timeoutForMediumTests'] = $arguments['timeoutForMediumTests'] ?? $phpunitConfiguration->timeoutForMediumTests();
64859            $arguments['timeoutForLargeTests'] = $arguments['timeoutForLargeTests'] ?? $phpunitConfiguration->timeoutForLargeTests();
64860            $arguments['reportUselessTests'] = $arguments['reportUselessTests'] ?? $phpunitConfiguration->beStrictAboutTestsThatDoNotTestAnything();
64861            $arguments['strictCoverage'] = $arguments['strictCoverage'] ?? $phpunitConfiguration->beStrictAboutCoversAnnotation();
64862            $arguments['ignoreDeprecatedCodeUnitsFromCodeCoverage'] = $arguments['ignoreDeprecatedCodeUnitsFromCodeCoverage'] ?? $codeCoverageConfiguration->ignoreDeprecatedCodeUnits();
64863            $arguments['disallowTestOutput'] = $arguments['disallowTestOutput'] ?? $phpunitConfiguration->beStrictAboutOutputDuringTests();
64864            $arguments['disallowTodoAnnotatedTests'] = $arguments['disallowTodoAnnotatedTests'] ?? $phpunitConfiguration->beStrictAboutTodoAnnotatedTests();
64865            $arguments['beStrictAboutResourceUsageDuringSmallTests'] = $arguments['beStrictAboutResourceUsageDuringSmallTests'] ?? $phpunitConfiguration->beStrictAboutResourceUsageDuringSmallTests();
64866            $arguments['verbose'] = $arguments['verbose'] ?? $phpunitConfiguration->verbose();
64867            $arguments['reverseDefectList'] = $arguments['reverseDefectList'] ?? $phpunitConfiguration->reverseDefectList();
64868            $arguments['forceCoversAnnotation'] = $arguments['forceCoversAnnotation'] ?? $phpunitConfiguration->forceCoversAnnotation();
64869            $arguments['disableCodeCoverageIgnore'] = $arguments['disableCodeCoverageIgnore'] ?? $codeCoverageConfiguration->disableCodeCoverageIgnore();
64870            $arguments['registerMockObjectsFromTestArgumentsRecursively'] = $arguments['registerMockObjectsFromTestArgumentsRecursively'] ?? $phpunitConfiguration->registerMockObjectsFromTestArgumentsRecursively();
64871            $arguments['noInteraction'] = $arguments['noInteraction'] ?? $phpunitConfiguration->noInteraction();
64872            $arguments['executionOrder'] = $arguments['executionOrder'] ?? $phpunitConfiguration->executionOrder();
64873            $arguments['resolveDependencies'] = $arguments['resolveDependencies'] ?? $phpunitConfiguration->resolveDependencies();
64874            if (!isset($arguments['bootstrap']) && $phpunitConfiguration->hasBootstrap()) {
64875                $arguments['bootstrap'] = $phpunitConfiguration->bootstrap();
64876            }
64877            if (!isset($arguments['cacheResultFile']) && $phpunitConfiguration->hasCacheResultFile()) {
64878                $arguments['cacheResultFile'] = $phpunitConfiguration->cacheResultFile();
64879            }
64880            if (!isset($arguments['executionOrderDefects'])) {
64881                $arguments['executionOrderDefects'] = $phpunitConfiguration->defectsFirst() ? TestSuiteSorter::ORDER_DEFECTS_FIRST : TestSuiteSorter::ORDER_DEFAULT;
64882            }
64883            if ($phpunitConfiguration->conflictBetweenPrinterClassAndTestdox()) {
64884                $arguments['conflictBetweenPrinterClassAndTestdox'] = \true;
64885            }
64886            $groupCliArgs = [];
64887            if (!empty($arguments['groups'])) {
64888                $groupCliArgs = $arguments['groups'];
64889            }
64890            $groupConfiguration = $arguments['configurationObject']->groups();
64891            if (!isset($arguments['groups']) && $groupConfiguration->hasInclude()) {
64892                $arguments['groups'] = $groupConfiguration->include()->asArrayOfStrings();
64893            }
64894            if (!isset($arguments['excludeGroups']) && $groupConfiguration->hasExclude()) {
64895                $arguments['excludeGroups'] = array_diff($groupConfiguration->exclude()->asArrayOfStrings(), $groupCliArgs);
64896            }
64897            $extensionHandler = new ExtensionHandler();
64898            foreach ($arguments['configurationObject']->extensions() as $extension) {
64899                $extensionHandler->registerExtension($extension, $this);
64900            }
64901            foreach ($arguments['configurationObject']->listeners() as $listener) {
64902                $arguments['listeners'][] = $extensionHandler->createTestListenerInstance($listener);
64903            }
64904            unset($extensionHandler);
64905            foreach ($arguments['unavailableExtensions'] as $extension) {
64906                $arguments['warnings'][] = sprintf('Extension "%s" is not available', $extension);
64907            }
64908            $loggingConfiguration = $arguments['configurationObject']->logging();
64909            if (!isset($arguments['noLogging'])) {
64910                if ($loggingConfiguration->hasText()) {
64911                    $arguments['listeners'][] = new \PHPUnit\TextUI\DefaultResultPrinter($loggingConfiguration->text()->target()->path(), \true);
64912                }
64913                if (!isset($arguments['teamcityLogfile']) && $loggingConfiguration->hasTeamCity()) {
64914                    $arguments['teamcityLogfile'] = $loggingConfiguration->teamCity()->target()->path();
64915                }
64916                if (!isset($arguments['junitLogfile']) && $loggingConfiguration->hasJunit()) {
64917                    $arguments['junitLogfile'] = $loggingConfiguration->junit()->target()->path();
64918                }
64919                if (!isset($arguments['testdoxHTMLFile']) && $loggingConfiguration->hasTestDoxHtml()) {
64920                    $arguments['testdoxHTMLFile'] = $loggingConfiguration->testDoxHtml()->target()->path();
64921                }
64922                if (!isset($arguments['testdoxTextFile']) && $loggingConfiguration->hasTestDoxText()) {
64923                    $arguments['testdoxTextFile'] = $loggingConfiguration->testDoxText()->target()->path();
64924                }
64925                if (!isset($arguments['testdoxXMLFile']) && $loggingConfiguration->hasTestDoxXml()) {
64926                    $arguments['testdoxXMLFile'] = $loggingConfiguration->testDoxXml()->target()->path();
64927                }
64928            }
64929            $testdoxGroupConfiguration = $arguments['configurationObject']->testdoxGroups();
64930            if (!isset($arguments['testdoxGroups']) && $testdoxGroupConfiguration->hasInclude()) {
64931                $arguments['testdoxGroups'] = $testdoxGroupConfiguration->include()->asArrayOfStrings();
64932            }
64933            if (!isset($arguments['testdoxExcludeGroups']) && $testdoxGroupConfiguration->hasExclude()) {
64934                $arguments['testdoxExcludeGroups'] = $testdoxGroupConfiguration->exclude()->asArrayOfStrings();
64935            }
64936        }
64937        $extensionHandler = new ExtensionHandler();
64938        foreach ($arguments['extensions'] as $extension) {
64939            $extensionHandler->registerExtension($extension, $this);
64940        }
64941        unset($extensionHandler);
64942        $arguments['backupGlobals'] = $arguments['backupGlobals'] ?? null;
64943        $arguments['backupStaticAttributes'] = $arguments['backupStaticAttributes'] ?? null;
64944        $arguments['beStrictAboutChangesToGlobalState'] = $arguments['beStrictAboutChangesToGlobalState'] ?? null;
64945        $arguments['beStrictAboutResourceUsageDuringSmallTests'] = $arguments['beStrictAboutResourceUsageDuringSmallTests'] ?? \false;
64946        $arguments['cacheResult'] = $arguments['cacheResult'] ?? \true;
64947        $arguments['colors'] = $arguments['colors'] ?? \PHPUnit\TextUI\DefaultResultPrinter::COLOR_DEFAULT;
64948        $arguments['columns'] = $arguments['columns'] ?? 80;
64949        $arguments['convertDeprecationsToExceptions'] = $arguments['convertDeprecationsToExceptions'] ?? \false;
64950        $arguments['convertErrorsToExceptions'] = $arguments['convertErrorsToExceptions'] ?? \true;
64951        $arguments['convertNoticesToExceptions'] = $arguments['convertNoticesToExceptions'] ?? \true;
64952        $arguments['convertWarningsToExceptions'] = $arguments['convertWarningsToExceptions'] ?? \true;
64953        $arguments['crap4jThreshold'] = $arguments['crap4jThreshold'] ?? 30;
64954        $arguments['disallowTestOutput'] = $arguments['disallowTestOutput'] ?? \false;
64955        $arguments['disallowTodoAnnotatedTests'] = $arguments['disallowTodoAnnotatedTests'] ?? \false;
64956        $arguments['defaultTimeLimit'] = $arguments['defaultTimeLimit'] ?? 0;
64957        $arguments['enforceTimeLimit'] = $arguments['enforceTimeLimit'] ?? \false;
64958        $arguments['excludeGroups'] = $arguments['excludeGroups'] ?? [];
64959        $arguments['executionOrder'] = $arguments['executionOrder'] ?? TestSuiteSorter::ORDER_DEFAULT;
64960        $arguments['executionOrderDefects'] = $arguments['executionOrderDefects'] ?? TestSuiteSorter::ORDER_DEFAULT;
64961        $arguments['failOnIncomplete'] = $arguments['failOnIncomplete'] ?? \false;
64962        $arguments['failOnRisky'] = $arguments['failOnRisky'] ?? \false;
64963        $arguments['failOnSkipped'] = $arguments['failOnSkipped'] ?? \false;
64964        $arguments['failOnWarning'] = $arguments['failOnWarning'] ?? \false;
64965        $arguments['groups'] = $arguments['groups'] ?? [];
64966        $arguments['noInteraction'] = $arguments['noInteraction'] ?? \false;
64967        $arguments['processIsolation'] = $arguments['processIsolation'] ?? \false;
64968        $arguments['randomOrderSeed'] = $arguments['randomOrderSeed'] ?? time();
64969        $arguments['registerMockObjectsFromTestArgumentsRecursively'] = $arguments['registerMockObjectsFromTestArgumentsRecursively'] ?? \false;
64970        $arguments['repeat'] = $arguments['repeat'] ?? \false;
64971        $arguments['reportHighLowerBound'] = $arguments['reportHighLowerBound'] ?? 90;
64972        $arguments['reportLowUpperBound'] = $arguments['reportLowUpperBound'] ?? 50;
64973        $arguments['reportUselessTests'] = $arguments['reportUselessTests'] ?? \true;
64974        $arguments['reverseList'] = $arguments['reverseList'] ?? \false;
64975        $arguments['resolveDependencies'] = $arguments['resolveDependencies'] ?? \true;
64976        $arguments['stopOnError'] = $arguments['stopOnError'] ?? \false;
64977        $arguments['stopOnFailure'] = $arguments['stopOnFailure'] ?? \false;
64978        $arguments['stopOnIncomplete'] = $arguments['stopOnIncomplete'] ?? \false;
64979        $arguments['stopOnRisky'] = $arguments['stopOnRisky'] ?? \false;
64980        $arguments['stopOnSkipped'] = $arguments['stopOnSkipped'] ?? \false;
64981        $arguments['stopOnWarning'] = $arguments['stopOnWarning'] ?? \false;
64982        $arguments['stopOnDefect'] = $arguments['stopOnDefect'] ?? \false;
64983        $arguments['strictCoverage'] = $arguments['strictCoverage'] ?? \false;
64984        $arguments['testdoxExcludeGroups'] = $arguments['testdoxExcludeGroups'] ?? [];
64985        $arguments['testdoxGroups'] = $arguments['testdoxGroups'] ?? [];
64986        $arguments['timeoutForLargeTests'] = $arguments['timeoutForLargeTests'] ?? 60;
64987        $arguments['timeoutForMediumTests'] = $arguments['timeoutForMediumTests'] ?? 10;
64988        $arguments['timeoutForSmallTests'] = $arguments['timeoutForSmallTests'] ?? 1;
64989        $arguments['verbose'] = $arguments['verbose'] ?? \false;
64990    }
64991    private function processSuiteFilters(TestSuite $suite, array $arguments) : void
64992    {
64993        if (!$arguments['filter'] && empty($arguments['groups']) && empty($arguments['excludeGroups']) && empty($arguments['testsCovering']) && empty($arguments['testsUsing'])) {
64994            return;
64995        }
64996        $filterFactory = new Factory();
64997        if (!empty($arguments['excludeGroups'])) {
64998            $filterFactory->addFilter(new ReflectionClass(ExcludeGroupFilterIterator::class), $arguments['excludeGroups']);
64999        }
65000        if (!empty($arguments['groups'])) {
65001            $filterFactory->addFilter(new ReflectionClass(IncludeGroupFilterIterator::class), $arguments['groups']);
65002        }
65003        if (!empty($arguments['testsCovering'])) {
65004            $filterFactory->addFilter(new ReflectionClass(IncludeGroupFilterIterator::class), array_map(static function (string $name) : string {
65005                return '__phpunit_covers_' . $name;
65006            }, $arguments['testsCovering']));
65007        }
65008        if (!empty($arguments['testsUsing'])) {
65009            $filterFactory->addFilter(new ReflectionClass(IncludeGroupFilterIterator::class), array_map(static function (string $name) : string {
65010                return '__phpunit_uses_' . $name;
65011            }, $arguments['testsUsing']));
65012        }
65013        if ($arguments['filter']) {
65014            $filterFactory->addFilter(new ReflectionClass(NameFilterIterator::class), $arguments['filter']);
65015        }
65016        $suite->injectFilter($filterFactory);
65017    }
65018    private function writeMessage(string $type, string $message) : void
65019    {
65020        if (!$this->messagePrinted) {
65021            $this->write("\n");
65022        }
65023        $this->write(sprintf("%-15s%s\n", $type . ':', $message));
65024        $this->messagePrinted = \true;
65025    }
65026    private function createPrinter(string $class, array $arguments) : \PHPUnit\TextUI\ResultPrinter
65027    {
65028        $object = new $class(isset($arguments['stderr']) && $arguments['stderr'] === \true ? 'php://stderr' : null, $arguments['verbose'], $arguments['colors'], $arguments['debug'], $arguments['columns'], $arguments['reverseList']);
65029        assert($object instanceof \PHPUnit\TextUI\ResultPrinter);
65030        return $object;
65031    }
65032    private function codeCoverageGenerationStart(string $format) : void
65033    {
65034        $this->printer->write(sprintf("\nGenerating code coverage report in %s format ... ", $format));
65035        $this->timer->start();
65036    }
65037    private function codeCoverageGenerationSucceeded() : void
65038    {
65039        $this->printer->write(sprintf("done [%s]\n", $this->timer->stop()->asString()));
65040    }
65041    private function codeCoverageGenerationFailed(\Exception $e) : void
65042    {
65043        $this->printer->write(sprintf("failed [%s]\n%s\n", $this->timer->stop()->asString(), $e->getMessage()));
65044    }
65045}
65046<?php
65047
65048declare (strict_types=1);
65049/*
65050 * This file is part of PHPUnit.
65051 *
65052 * (c) Sebastian Bergmann <sebastian@phpunit.de>
65053 *
65054 * For the full copyright and license information, please view the LICENSE
65055 * file that was distributed with this source code.
65056 */
65057namespace PHPUnit\TextUI;
65058
65059use function sprintf;
65060use RuntimeException;
65061/**
65062 * @internal This interface is not covered by the backward compatibility promise for PHPUnit
65063 */
65064final class TestFileNotFoundException extends RuntimeException implements \PHPUnit\TextUI\Exception
65065{
65066    public function __construct(string $path)
65067    {
65068        parent::__construct(sprintf('Test file "%s" not found', $path));
65069    }
65070}
65071<?php
65072
65073declare (strict_types=1);
65074/*
65075 * This file is part of PHPUnit.
65076 *
65077 * (c) Sebastian Bergmann <sebastian@phpunit.de>
65078 *
65079 * For the full copyright and license information, please view the LICENSE
65080 * file that was distributed with this source code.
65081 */
65082namespace PHPUnit\TextUI;
65083
65084use RuntimeException;
65085/**
65086 * @internal This interface is not covered by the backward compatibility promise for PHPUnit
65087 */
65088final class ReflectionException extends RuntimeException implements \PHPUnit\TextUI\Exception
65089{
65090}
65091<?php
65092
65093declare (strict_types=1);
65094/*
65095 * This file is part of PHPUnit.
65096 *
65097 * (c) Sebastian Bergmann <sebastian@phpunit.de>
65098 *
65099 * For the full copyright and license information, please view the LICENSE
65100 * file that was distributed with this source code.
65101 */
65102namespace PHPUnit\TextUI;
65103
65104/**
65105 * @internal This interface is not covered by the backward compatibility promise for PHPUnit
65106 */
65107final class RuntimeException extends \RuntimeException implements \PHPUnit\TextUI\Exception
65108{
65109}
65110<?php
65111
65112declare (strict_types=1);
65113/*
65114 * This file is part of PHPUnit.
65115 *
65116 * (c) Sebastian Bergmann <sebastian@phpunit.de>
65117 *
65118 * For the full copyright and license information, please view the LICENSE
65119 * file that was distributed with this source code.
65120 */
65121namespace PHPUnit\TextUI;
65122
65123use function sprintf;
65124use RuntimeException;
65125/**
65126 * @internal This interface is not covered by the backward compatibility promise for PHPUnit
65127 */
65128final class TestDirectoryNotFoundException extends RuntimeException implements \PHPUnit\TextUI\Exception
65129{
65130    public function __construct(string $path)
65131    {
65132        parent::__construct(sprintf('Test directory "%s" not found', $path));
65133    }
65134}
65135<?php
65136
65137declare (strict_types=1);
65138/*
65139 * This file is part of PHPUnit.
65140 *
65141 * (c) Sebastian Bergmann <sebastian@phpunit.de>
65142 *
65143 * For the full copyright and license information, please view the LICENSE
65144 * file that was distributed with this source code.
65145 */
65146namespace PHPUnit\TextUI;
65147
65148use Throwable;
65149/**
65150 * @internal This interface is not covered by the backward compatibility promise for PHPUnit
65151 */
65152interface Exception extends Throwable
65153{
65154}
65155<?php
65156
65157declare (strict_types=1);
65158/*
65159 * This file is part of PHPUnit.
65160 *
65161 * (c) Sebastian Bergmann <sebastian@phpunit.de>
65162 *
65163 * For the full copyright and license information, please view the LICENSE
65164 * file that was distributed with this source code.
65165 */
65166namespace PHPUnit\TextUI;
65167
65168use PHPUnit\Framework\TestListener;
65169use PHPUnit\Framework\TestResult;
65170/**
65171 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
65172 */
65173interface ResultPrinter extends TestListener
65174{
65175    public function printResult(TestResult $result) : void;
65176    public function write(string $buffer) : void;
65177}
65178<?php
65179
65180declare (strict_types=1);
65181/*
65182 * This file is part of PHPUnit.
65183 *
65184 * (c) Sebastian Bergmann <sebastian@phpunit.de>
65185 *
65186 * For the full copyright and license information, please view the LICENSE
65187 * file that was distributed with this source code.
65188 */
65189namespace PHPUnit\TextUI;
65190
65191use const PHP_EOL;
65192use function array_map;
65193use function array_reverse;
65194use function count;
65195use function floor;
65196use function implode;
65197use function in_array;
65198use function is_int;
65199use function max;
65200use function preg_split;
65201use function sprintf;
65202use function str_pad;
65203use function str_repeat;
65204use function strlen;
65205use function vsprintf;
65206use PHPUnit\Framework\AssertionFailedError;
65207use PHPUnit\Framework\Exception;
65208use PHPUnit\Framework\InvalidArgumentException;
65209use PHPUnit\Framework\Test;
65210use PHPUnit\Framework\TestCase;
65211use PHPUnit\Framework\TestFailure;
65212use PHPUnit\Framework\TestResult;
65213use PHPUnit\Framework\TestSuite;
65214use PHPUnit\Framework\Warning;
65215use PHPUnit\Runner\PhptTestCase;
65216use PHPUnit\Util\Color;
65217use PHPUnit\Util\Printer;
65218use PHPUnit\SebastianBergmann\Environment\Console;
65219use PHPUnit\SebastianBergmann\Timer\ResourceUsageFormatter;
65220use PHPUnit\SebastianBergmann\Timer\Timer;
65221use Throwable;
65222/**
65223 * @internal This class is not covered by the backward compatibility promise for PHPUnit
65224 */
65225class DefaultResultPrinter extends Printer implements \PHPUnit\TextUI\ResultPrinter
65226{
65227    public const EVENT_TEST_START = 0;
65228    public const EVENT_TEST_END = 1;
65229    public const EVENT_TESTSUITE_START = 2;
65230    public const EVENT_TESTSUITE_END = 3;
65231    public const COLOR_NEVER = 'never';
65232    public const COLOR_AUTO = 'auto';
65233    public const COLOR_ALWAYS = 'always';
65234    public const COLOR_DEFAULT = self::COLOR_NEVER;
65235    private const AVAILABLE_COLORS = [self::COLOR_NEVER, self::COLOR_AUTO, self::COLOR_ALWAYS];
65236    /**
65237     * @var int
65238     */
65239    protected $column = 0;
65240    /**
65241     * @var int
65242     */
65243    protected $maxColumn;
65244    /**
65245     * @var bool
65246     */
65247    protected $lastTestFailed = \false;
65248    /**
65249     * @var int
65250     */
65251    protected $numAssertions = 0;
65252    /**
65253     * @var int
65254     */
65255    protected $numTests = -1;
65256    /**
65257     * @var int
65258     */
65259    protected $numTestsRun = 0;
65260    /**
65261     * @var int
65262     */
65263    protected $numTestsWidth;
65264    /**
65265     * @var bool
65266     */
65267    protected $colors = \false;
65268    /**
65269     * @var bool
65270     */
65271    protected $debug = \false;
65272    /**
65273     * @var bool
65274     */
65275    protected $verbose = \false;
65276    /**
65277     * @var int
65278     */
65279    private $numberOfColumns;
65280    /**
65281     * @var bool
65282     */
65283    private $reverse;
65284    /**
65285     * @var bool
65286     */
65287    private $defectListPrinted = \false;
65288    /**
65289     * @var Timer
65290     */
65291    private $timer;
65292    /**
65293     * Constructor.
65294     *
65295     * @param null|resource|string $out
65296     * @param int|string           $numberOfColumns
65297     *
65298     * @throws Exception
65299     */
65300    public function __construct($out = null, bool $verbose = \false, string $colors = self::COLOR_DEFAULT, bool $debug = \false, $numberOfColumns = 80, bool $reverse = \false)
65301    {
65302        parent::__construct($out);
65303        if (!in_array($colors, self::AVAILABLE_COLORS, \true)) {
65304            throw InvalidArgumentException::create(3, vsprintf('value from "%s", "%s" or "%s"', self::AVAILABLE_COLORS));
65305        }
65306        if (!is_int($numberOfColumns) && $numberOfColumns !== 'max') {
65307            throw InvalidArgumentException::create(5, 'integer or "max"');
65308        }
65309        $console = new Console();
65310        $maxNumberOfColumns = $console->getNumberOfColumns();
65311        if ($numberOfColumns === 'max' || $numberOfColumns !== 80 && $numberOfColumns > $maxNumberOfColumns) {
65312            $numberOfColumns = $maxNumberOfColumns;
65313        }
65314        $this->numberOfColumns = $numberOfColumns;
65315        $this->verbose = $verbose;
65316        $this->debug = $debug;
65317        $this->reverse = $reverse;
65318        if ($colors === self::COLOR_AUTO && $console->hasColorSupport()) {
65319            $this->colors = \true;
65320        } else {
65321            $this->colors = self::COLOR_ALWAYS === $colors;
65322        }
65323        $this->timer = new Timer();
65324        $this->timer->start();
65325    }
65326    public function printResult(TestResult $result) : void
65327    {
65328        $this->printHeader($result);
65329        $this->printErrors($result);
65330        $this->printWarnings($result);
65331        $this->printFailures($result);
65332        $this->printRisky($result);
65333        if ($this->verbose) {
65334            $this->printIncompletes($result);
65335            $this->printSkipped($result);
65336        }
65337        $this->printFooter($result);
65338    }
65339    /**
65340     * An error occurred.
65341     */
65342    public function addError(Test $test, Throwable $t, float $time) : void
65343    {
65344        $this->writeProgressWithColor('fg-red, bold', 'E');
65345        $this->lastTestFailed = \true;
65346    }
65347    /**
65348     * A failure occurred.
65349     */
65350    public function addFailure(Test $test, AssertionFailedError $e, float $time) : void
65351    {
65352        $this->writeProgressWithColor('bg-red, fg-white', 'F');
65353        $this->lastTestFailed = \true;
65354    }
65355    /**
65356     * A warning occurred.
65357     */
65358    public function addWarning(Test $test, Warning $e, float $time) : void
65359    {
65360        $this->writeProgressWithColor('fg-yellow, bold', 'W');
65361        $this->lastTestFailed = \true;
65362    }
65363    /**
65364     * Incomplete test.
65365     */
65366    public function addIncompleteTest(Test $test, Throwable $t, float $time) : void
65367    {
65368        $this->writeProgressWithColor('fg-yellow, bold', 'I');
65369        $this->lastTestFailed = \true;
65370    }
65371    /**
65372     * Risky test.
65373     */
65374    public function addRiskyTest(Test $test, Throwable $t, float $time) : void
65375    {
65376        $this->writeProgressWithColor('fg-yellow, bold', 'R');
65377        $this->lastTestFailed = \true;
65378    }
65379    /**
65380     * Skipped test.
65381     */
65382    public function addSkippedTest(Test $test, Throwable $t, float $time) : void
65383    {
65384        $this->writeProgressWithColor('fg-cyan, bold', 'S');
65385        $this->lastTestFailed = \true;
65386    }
65387    /**
65388     * A testsuite started.
65389     */
65390    public function startTestSuite(TestSuite $suite) : void
65391    {
65392        if ($this->numTests == -1) {
65393            $this->numTests = count($suite);
65394            $this->numTestsWidth = strlen((string) $this->numTests);
65395            $this->maxColumn = $this->numberOfColumns - strlen('  /  (XXX%)') - 2 * $this->numTestsWidth;
65396        }
65397    }
65398    /**
65399     * A testsuite ended.
65400     */
65401    public function endTestSuite(TestSuite $suite) : void
65402    {
65403    }
65404    /**
65405     * A test started.
65406     */
65407    public function startTest(Test $test) : void
65408    {
65409        if ($this->debug) {
65410            $this->write(sprintf("Test '%s' started\n", \PHPUnit\Util\Test::describeAsString($test)));
65411        }
65412    }
65413    /**
65414     * A test ended.
65415     */
65416    public function endTest(Test $test, float $time) : void
65417    {
65418        if ($this->debug) {
65419            $this->write(sprintf("Test '%s' ended\n", \PHPUnit\Util\Test::describeAsString($test)));
65420        }
65421        if (!$this->lastTestFailed) {
65422            $this->writeProgress('.');
65423        }
65424        if ($test instanceof TestCase) {
65425            $this->numAssertions += $test->getNumAssertions();
65426        } elseif ($test instanceof PhptTestCase) {
65427            $this->numAssertions++;
65428        }
65429        $this->lastTestFailed = \false;
65430        if ($test instanceof TestCase && !$test->hasExpectationOnOutput()) {
65431            $this->write($test->getActualOutput());
65432        }
65433    }
65434    protected function printDefects(array $defects, string $type) : void
65435    {
65436        $count = count($defects);
65437        if ($count == 0) {
65438            return;
65439        }
65440        if ($this->defectListPrinted) {
65441            $this->write("\n--\n\n");
65442        }
65443        $this->write(sprintf("There %s %d %s%s:\n", $count == 1 ? 'was' : 'were', $count, $type, $count == 1 ? '' : 's'));
65444        $i = 1;
65445        if ($this->reverse) {
65446            $defects = array_reverse($defects);
65447        }
65448        foreach ($defects as $defect) {
65449            $this->printDefect($defect, $i++);
65450        }
65451        $this->defectListPrinted = \true;
65452    }
65453    protected function printDefect(TestFailure $defect, int $count) : void
65454    {
65455        $this->printDefectHeader($defect, $count);
65456        $this->printDefectTrace($defect);
65457    }
65458    protected function printDefectHeader(TestFailure $defect, int $count) : void
65459    {
65460        $this->write(sprintf("\n%d) %s\n", $count, $defect->getTestName()));
65461    }
65462    protected function printDefectTrace(TestFailure $defect) : void
65463    {
65464        $e = $defect->thrownException();
65465        $this->write((string) $e);
65466        while ($e = $e->getPrevious()) {
65467            $this->write("\nCaused by\n" . $e);
65468        }
65469    }
65470    protected function printErrors(TestResult $result) : void
65471    {
65472        $this->printDefects($result->errors(), 'error');
65473    }
65474    protected function printFailures(TestResult $result) : void
65475    {
65476        $this->printDefects($result->failures(), 'failure');
65477    }
65478    protected function printWarnings(TestResult $result) : void
65479    {
65480        $this->printDefects($result->warnings(), 'warning');
65481    }
65482    protected function printIncompletes(TestResult $result) : void
65483    {
65484        $this->printDefects($result->notImplemented(), 'incomplete test');
65485    }
65486    protected function printRisky(TestResult $result) : void
65487    {
65488        $this->printDefects($result->risky(), 'risky test');
65489    }
65490    protected function printSkipped(TestResult $result) : void
65491    {
65492        $this->printDefects($result->skipped(), 'skipped test');
65493    }
65494    protected function printHeader(TestResult $result) : void
65495    {
65496        if (count($result) > 0) {
65497            $this->write(\PHP_EOL . \PHP_EOL . (new ResourceUsageFormatter())->resourceUsage($this->timer->stop()) . \PHP_EOL . \PHP_EOL);
65498        }
65499    }
65500    protected function printFooter(TestResult $result) : void
65501    {
65502        if (count($result) === 0) {
65503            $this->writeWithColor('fg-black, bg-yellow', 'No tests executed!');
65504            return;
65505        }
65506        if ($result->wasSuccessfulAndNoTestIsRiskyOrSkippedOrIncomplete()) {
65507            $this->writeWithColor('fg-black, bg-green', sprintf('OK (%d test%s, %d assertion%s)', count($result), count($result) === 1 ? '' : 's', $this->numAssertions, $this->numAssertions === 1 ? '' : 's'));
65508            return;
65509        }
65510        $color = 'fg-black, bg-yellow';
65511        if ($result->wasSuccessful()) {
65512            if ($this->verbose || !$result->allHarmless()) {
65513                $this->write("\n");
65514            }
65515            $this->writeWithColor($color, 'OK, but incomplete, skipped, or risky tests!');
65516        } else {
65517            $this->write("\n");
65518            if ($result->errorCount()) {
65519                $color = 'fg-white, bg-red';
65520                $this->writeWithColor($color, 'ERRORS!');
65521            } elseif ($result->failureCount()) {
65522                $color = 'fg-white, bg-red';
65523                $this->writeWithColor($color, 'FAILURES!');
65524            } elseif ($result->warningCount()) {
65525                $color = 'fg-black, bg-yellow';
65526                $this->writeWithColor($color, 'WARNINGS!');
65527            }
65528        }
65529        $this->writeCountString(count($result), 'Tests', $color, \true);
65530        $this->writeCountString($this->numAssertions, 'Assertions', $color, \true);
65531        $this->writeCountString($result->errorCount(), 'Errors', $color);
65532        $this->writeCountString($result->failureCount(), 'Failures', $color);
65533        $this->writeCountString($result->warningCount(), 'Warnings', $color);
65534        $this->writeCountString($result->skippedCount(), 'Skipped', $color);
65535        $this->writeCountString($result->notImplementedCount(), 'Incomplete', $color);
65536        $this->writeCountString($result->riskyCount(), 'Risky', $color);
65537        $this->writeWithColor($color, '.');
65538    }
65539    protected function writeProgress(string $progress) : void
65540    {
65541        if ($this->debug) {
65542            return;
65543        }
65544        $this->write($progress);
65545        $this->column++;
65546        $this->numTestsRun++;
65547        if ($this->column == $this->maxColumn || $this->numTestsRun == $this->numTests) {
65548            if ($this->numTestsRun == $this->numTests) {
65549                $this->write(str_repeat(' ', $this->maxColumn - $this->column));
65550            }
65551            $this->write(sprintf(' %' . $this->numTestsWidth . 'd / %' . $this->numTestsWidth . 'd (%3s%%)', $this->numTestsRun, $this->numTests, floor($this->numTestsRun / $this->numTests * 100)));
65552            if ($this->column == $this->maxColumn) {
65553                $this->writeNewLine();
65554            }
65555        }
65556    }
65557    protected function writeNewLine() : void
65558    {
65559        $this->column = 0;
65560        $this->write("\n");
65561    }
65562    /**
65563     * Formats a buffer with a specified ANSI color sequence if colors are
65564     * enabled.
65565     */
65566    protected function colorizeTextBox(string $color, string $buffer) : string
65567    {
65568        if (!$this->colors) {
65569            return $buffer;
65570        }
65571        $lines = preg_split('/\\r\\n|\\r|\\n/', $buffer);
65572        $padding = max(array_map('\\strlen', $lines));
65573        $styledLines = [];
65574        foreach ($lines as $line) {
65575            $styledLines[] = Color::colorize($color, str_pad($line, $padding));
65576        }
65577        return implode(\PHP_EOL, $styledLines);
65578    }
65579    /**
65580     * Writes a buffer out with a color sequence if colors are enabled.
65581     */
65582    protected function writeWithColor(string $color, string $buffer, bool $lf = \true) : void
65583    {
65584        $this->write($this->colorizeTextBox($color, $buffer));
65585        if ($lf) {
65586            $this->write(\PHP_EOL);
65587        }
65588    }
65589    /**
65590     * Writes progress with a color sequence if colors are enabled.
65591     */
65592    protected function writeProgressWithColor(string $color, string $buffer) : void
65593    {
65594        $buffer = $this->colorizeTextBox($color, $buffer);
65595        $this->writeProgress($buffer);
65596    }
65597    private function writeCountString(int $count, string $name, string $color, bool $always = \false) : void
65598    {
65599        static $first = \true;
65600        if ($always || $count > 0) {
65601            $this->writeWithColor($color, sprintf('%s%s: %d', !$first ? ', ' : '', $name, $count), \false);
65602            $first = \false;
65603        }
65604    }
65605}
65606<?php
65607
65608declare (strict_types=1);
65609/*
65610 * This file is part of PHPUnit.
65611 *
65612 * (c) Sebastian Bergmann <sebastian@phpunit.de>
65613 *
65614 * For the full copyright and license information, please view the LICENSE
65615 * file that was distributed with this source code.
65616 */
65617namespace PHPUnit\TextUI\CliArguments;
65618
65619/**
65620 * @internal This class is not covered by the backward compatibility promise for PHPUnit
65621 */
65622final class Mapper
65623{
65624    /**
65625     * @throws Exception
65626     */
65627    public function mapToLegacyArray(\PHPUnit\TextUI\CliArguments\Configuration $arguments) : array
65628    {
65629        $result = ['extensions' => [], 'listGroups' => \false, 'listSuites' => \false, 'listTests' => \false, 'listTestsXml' => \false, 'loader' => null, 'useDefaultConfiguration' => \true, 'loadedExtensions' => [], 'unavailableExtensions' => [], 'notLoadedExtensions' => []];
65630        if ($arguments->hasColors()) {
65631            $result['colors'] = $arguments->colors();
65632        }
65633        if ($arguments->hasBootstrap()) {
65634            $result['bootstrap'] = $arguments->bootstrap();
65635        }
65636        if ($arguments->hasCacheResult()) {
65637            $result['cacheResult'] = $arguments->cacheResult();
65638        }
65639        if ($arguments->hasCacheResultFile()) {
65640            $result['cacheResultFile'] = $arguments->cacheResultFile();
65641        }
65642        if ($arguments->hasColumns()) {
65643            $result['columns'] = $arguments->columns();
65644        }
65645        if ($arguments->hasConfiguration()) {
65646            $result['configuration'] = $arguments->configuration();
65647        }
65648        if ($arguments->hasCoverageCacheDirectory()) {
65649            $result['coverageCacheDirectory'] = $arguments->coverageCacheDirectory();
65650        }
65651        if ($arguments->hasWarmCoverageCache()) {
65652            $result['warmCoverageCache'] = $arguments->warmCoverageCache();
65653        }
65654        if ($arguments->hasCoverageClover()) {
65655            $result['coverageClover'] = $arguments->coverageClover();
65656        }
65657        if ($arguments->hasCoverageCobertura()) {
65658            $result['coverageCobertura'] = $arguments->coverageCobertura();
65659        }
65660        if ($arguments->hasCoverageCrap4J()) {
65661            $result['coverageCrap4J'] = $arguments->coverageCrap4J();
65662        }
65663        if ($arguments->hasCoverageHtml()) {
65664            $result['coverageHtml'] = $arguments->coverageHtml();
65665        }
65666        if ($arguments->hasCoveragePhp()) {
65667            $result['coveragePHP'] = $arguments->coveragePhp();
65668        }
65669        if ($arguments->hasCoverageText()) {
65670            $result['coverageText'] = $arguments->coverageText();
65671        }
65672        if ($arguments->hasCoverageTextShowUncoveredFiles()) {
65673            $result['coverageTextShowUncoveredFiles'] = $arguments->hasCoverageTextShowUncoveredFiles();
65674        }
65675        if ($arguments->hasCoverageTextShowOnlySummary()) {
65676            $result['coverageTextShowOnlySummary'] = $arguments->coverageTextShowOnlySummary();
65677        }
65678        if ($arguments->hasCoverageXml()) {
65679            $result['coverageXml'] = $arguments->coverageXml();
65680        }
65681        if ($arguments->hasPathCoverage()) {
65682            $result['pathCoverage'] = $arguments->pathCoverage();
65683        }
65684        if ($arguments->hasDebug()) {
65685            $result['debug'] = $arguments->debug();
65686        }
65687        if ($arguments->hasHelp()) {
65688            $result['help'] = $arguments->help();
65689        }
65690        if ($arguments->hasFilter()) {
65691            $result['filter'] = $arguments->filter();
65692        }
65693        if ($arguments->hasTestSuite()) {
65694            $result['testsuite'] = $arguments->testSuite();
65695        }
65696        if ($arguments->hasGroups()) {
65697            $result['groups'] = $arguments->groups();
65698        }
65699        if ($arguments->hasExcludeGroups()) {
65700            $result['excludeGroups'] = $arguments->excludeGroups();
65701        }
65702        if ($arguments->hasTestsCovering()) {
65703            $result['testsCovering'] = $arguments->testsCovering();
65704        }
65705        if ($arguments->hasTestsUsing()) {
65706            $result['testsUsing'] = $arguments->testsUsing();
65707        }
65708        if ($arguments->hasTestSuffixes()) {
65709            $result['testSuffixes'] = $arguments->testSuffixes();
65710        }
65711        if ($arguments->hasIncludePath()) {
65712            $result['includePath'] = $arguments->includePath();
65713        }
65714        if ($arguments->hasListGroups()) {
65715            $result['listGroups'] = $arguments->listGroups();
65716        }
65717        if ($arguments->hasListSuites()) {
65718            $result['listSuites'] = $arguments->listSuites();
65719        }
65720        if ($arguments->hasListTests()) {
65721            $result['listTests'] = $arguments->listTests();
65722        }
65723        if ($arguments->hasListTestsXml()) {
65724            $result['listTestsXml'] = $arguments->listTestsXml();
65725        }
65726        if ($arguments->hasPrinter()) {
65727            $result['printer'] = $arguments->printer();
65728        }
65729        if ($arguments->hasLoader()) {
65730            $result['loader'] = $arguments->loader();
65731        }
65732        if ($arguments->hasJunitLogfile()) {
65733            $result['junitLogfile'] = $arguments->junitLogfile();
65734        }
65735        if ($arguments->hasTeamcityLogfile()) {
65736            $result['teamcityLogfile'] = $arguments->teamcityLogfile();
65737        }
65738        if ($arguments->hasExecutionOrder()) {
65739            $result['executionOrder'] = $arguments->executionOrder();
65740        }
65741        if ($arguments->hasExecutionOrderDefects()) {
65742            $result['executionOrderDefects'] = $arguments->executionOrderDefects();
65743        }
65744        if ($arguments->hasExtensions()) {
65745            $result['extensions'] = $arguments->extensions();
65746        }
65747        if ($arguments->hasUnavailableExtensions()) {
65748            $result['unavailableExtensions'] = $arguments->unavailableExtensions();
65749        }
65750        if ($arguments->hasResolveDependencies()) {
65751            $result['resolveDependencies'] = $arguments->resolveDependencies();
65752        }
65753        if ($arguments->hasProcessIsolation()) {
65754            $result['processIsolation'] = $arguments->processIsolation();
65755        }
65756        if ($arguments->hasRepeat()) {
65757            $result['repeat'] = $arguments->repeat();
65758        }
65759        if ($arguments->hasStderr()) {
65760            $result['stderr'] = $arguments->stderr();
65761        }
65762        if ($arguments->hasStopOnDefect()) {
65763            $result['stopOnDefect'] = $arguments->stopOnDefect();
65764        }
65765        if ($arguments->hasStopOnError()) {
65766            $result['stopOnError'] = $arguments->stopOnError();
65767        }
65768        if ($arguments->hasStopOnFailure()) {
65769            $result['stopOnFailure'] = $arguments->stopOnFailure();
65770        }
65771        if ($arguments->hasStopOnWarning()) {
65772            $result['stopOnWarning'] = $arguments->stopOnWarning();
65773        }
65774        if ($arguments->hasStopOnIncomplete()) {
65775            $result['stopOnIncomplete'] = $arguments->stopOnIncomplete();
65776        }
65777        if ($arguments->hasStopOnRisky()) {
65778            $result['stopOnRisky'] = $arguments->stopOnRisky();
65779        }
65780        if ($arguments->hasStopOnSkipped()) {
65781            $result['stopOnSkipped'] = $arguments->stopOnSkipped();
65782        }
65783        if ($arguments->hasFailOnEmptyTestSuite()) {
65784            $result['failOnEmptyTestSuite'] = $arguments->failOnEmptyTestSuite();
65785        }
65786        if ($arguments->hasFailOnIncomplete()) {
65787            $result['failOnIncomplete'] = $arguments->failOnIncomplete();
65788        }
65789        if ($arguments->hasFailOnRisky()) {
65790            $result['failOnRisky'] = $arguments->failOnRisky();
65791        }
65792        if ($arguments->hasFailOnSkipped()) {
65793            $result['failOnSkipped'] = $arguments->failOnSkipped();
65794        }
65795        if ($arguments->hasFailOnWarning()) {
65796            $result['failOnWarning'] = $arguments->failOnWarning();
65797        }
65798        if ($arguments->hasTestdoxGroups()) {
65799            $result['testdoxGroups'] = $arguments->testdoxGroups();
65800        }
65801        if ($arguments->hasTestdoxExcludeGroups()) {
65802            $result['testdoxExcludeGroups'] = $arguments->testdoxExcludeGroups();
65803        }
65804        if ($arguments->hasTestdoxHtmlFile()) {
65805            $result['testdoxHTMLFile'] = $arguments->testdoxHtmlFile();
65806        }
65807        if ($arguments->hasTestdoxTextFile()) {
65808            $result['testdoxTextFile'] = $arguments->testdoxTextFile();
65809        }
65810        if ($arguments->hasTestdoxXmlFile()) {
65811            $result['testdoxXMLFile'] = $arguments->testdoxXmlFile();
65812        }
65813        if ($arguments->hasUseDefaultConfiguration()) {
65814            $result['useDefaultConfiguration'] = $arguments->useDefaultConfiguration();
65815        }
65816        if ($arguments->hasNoExtensions()) {
65817            $result['noExtensions'] = $arguments->noExtensions();
65818        }
65819        if ($arguments->hasNoCoverage()) {
65820            $result['noCoverage'] = $arguments->noCoverage();
65821        }
65822        if ($arguments->hasNoLogging()) {
65823            $result['noLogging'] = $arguments->noLogging();
65824        }
65825        if ($arguments->hasNoInteraction()) {
65826            $result['noInteraction'] = $arguments->noInteraction();
65827        }
65828        if ($arguments->hasBackupGlobals()) {
65829            $result['backupGlobals'] = $arguments->backupGlobals();
65830        }
65831        if ($arguments->hasBackupStaticAttributes()) {
65832            $result['backupStaticAttributes'] = $arguments->backupStaticAttributes();
65833        }
65834        if ($arguments->hasVerbose()) {
65835            $result['verbose'] = $arguments->verbose();
65836        }
65837        if ($arguments->hasReportUselessTests()) {
65838            $result['reportUselessTests'] = $arguments->reportUselessTests();
65839        }
65840        if ($arguments->hasStrictCoverage()) {
65841            $result['strictCoverage'] = $arguments->strictCoverage();
65842        }
65843        if ($arguments->hasDisableCodeCoverageIgnore()) {
65844            $result['disableCodeCoverageIgnore'] = $arguments->disableCodeCoverageIgnore();
65845        }
65846        if ($arguments->hasBeStrictAboutChangesToGlobalState()) {
65847            $result['beStrictAboutChangesToGlobalState'] = $arguments->beStrictAboutChangesToGlobalState();
65848        }
65849        if ($arguments->hasDisallowTestOutput()) {
65850            $result['disallowTestOutput'] = $arguments->disallowTestOutput();
65851        }
65852        if ($arguments->hasBeStrictAboutResourceUsageDuringSmallTests()) {
65853            $result['beStrictAboutResourceUsageDuringSmallTests'] = $arguments->beStrictAboutResourceUsageDuringSmallTests();
65854        }
65855        if ($arguments->hasDefaultTimeLimit()) {
65856            $result['defaultTimeLimit'] = $arguments->defaultTimeLimit();
65857        }
65858        if ($arguments->hasEnforceTimeLimit()) {
65859            $result['enforceTimeLimit'] = $arguments->enforceTimeLimit();
65860        }
65861        if ($arguments->hasDisallowTodoAnnotatedTests()) {
65862            $result['disallowTodoAnnotatedTests'] = $arguments->disallowTodoAnnotatedTests();
65863        }
65864        if ($arguments->hasReverseList()) {
65865            $result['reverseList'] = $arguments->reverseList();
65866        }
65867        if ($arguments->hasCoverageFilter()) {
65868            $result['coverageFilter'] = $arguments->coverageFilter();
65869        }
65870        if ($arguments->hasRandomOrderSeed()) {
65871            $result['randomOrderSeed'] = $arguments->randomOrderSeed();
65872        }
65873        if ($arguments->hasXdebugFilterFile()) {
65874            $result['xdebugFilterFile'] = $arguments->xdebugFilterFile();
65875        }
65876        return $result;
65877    }
65878}
65879<?php
65880
65881declare (strict_types=1);
65882/*
65883 * This file is part of PHPUnit.
65884 *
65885 * (c) Sebastian Bergmann <sebastian@phpunit.de>
65886 *
65887 * For the full copyright and license information, please view the LICENSE
65888 * file that was distributed with this source code.
65889 */
65890namespace PHPUnit\TextUI\CliArguments;
65891
65892use PHPUnit\TextUI\XmlConfiguration\Extension;
65893/**
65894 * @internal This class is not covered by the backward compatibility promise for PHPUnit
65895 * @psalm-immutable
65896 */
65897final class Configuration
65898{
65899    /**
65900     * @var ?string
65901     */
65902    private $argument;
65903    /**
65904     * @var ?string
65905     */
65906    private $atLeastVersion;
65907    /**
65908     * @var ?bool
65909     */
65910    private $backupGlobals;
65911    /**
65912     * @var ?bool
65913     */
65914    private $backupStaticAttributes;
65915    /**
65916     * @var ?bool
65917     */
65918    private $beStrictAboutChangesToGlobalState;
65919    /**
65920     * @var ?bool
65921     */
65922    private $beStrictAboutResourceUsageDuringSmallTests;
65923    /**
65924     * @var ?string
65925     */
65926    private $bootstrap;
65927    /**
65928     * @var ?bool
65929     */
65930    private $cacheResult;
65931    /**
65932     * @var ?string
65933     */
65934    private $cacheResultFile;
65935    /**
65936     * @var ?bool
65937     */
65938    private $checkVersion;
65939    /**
65940     * @var ?string
65941     */
65942    private $colors;
65943    /**
65944     * @var null|int|string
65945     */
65946    private $columns;
65947    /**
65948     * @var ?string
65949     */
65950    private $configuration;
65951    /**
65952     * @var null|string[]
65953     */
65954    private $coverageFilter;
65955    /**
65956     * @var ?string
65957     */
65958    private $coverageClover;
65959    /**
65960     * @var ?string
65961     */
65962    private $coverageCobertura;
65963    /**
65964     * @var ?string
65965     */
65966    private $coverageCrap4J;
65967    /**
65968     * @var ?string
65969     */
65970    private $coverageHtml;
65971    /**
65972     * @var ?string
65973     */
65974    private $coveragePhp;
65975    /**
65976     * @var ?string
65977     */
65978    private $coverageText;
65979    /**
65980     * @var ?bool
65981     */
65982    private $coverageTextShowUncoveredFiles;
65983    /**
65984     * @var ?bool
65985     */
65986    private $coverageTextShowOnlySummary;
65987    /**
65988     * @var ?string
65989     */
65990    private $coverageXml;
65991    /**
65992     * @var ?bool
65993     */
65994    private $pathCoverage;
65995    /**
65996     * @var ?string
65997     */
65998    private $coverageCacheDirectory;
65999    /**
66000     * @var ?bool
66001     */
66002    private $warmCoverageCache;
66003    /**
66004     * @var ?bool
66005     */
66006    private $debug;
66007    /**
66008     * @var ?int
66009     */
66010    private $defaultTimeLimit;
66011    /**
66012     * @var ?bool
66013     */
66014    private $disableCodeCoverageIgnore;
66015    /**
66016     * @var ?bool
66017     */
66018    private $disallowTestOutput;
66019    /**
66020     * @var ?bool
66021     */
66022    private $disallowTodoAnnotatedTests;
66023    /**
66024     * @var ?bool
66025     */
66026    private $enforceTimeLimit;
66027    /**
66028     * @var null|string[]
66029     */
66030    private $excludeGroups;
66031    /**
66032     * @var ?int
66033     */
66034    private $executionOrder;
66035    /**
66036     * @var ?int
66037     */
66038    private $executionOrderDefects;
66039    /**
66040     * @var null|Extension[]
66041     */
66042    private $extensions;
66043    /**
66044     * @var null|string[]
66045     */
66046    private $unavailableExtensions;
66047    /**
66048     * @var ?bool
66049     */
66050    private $failOnEmptyTestSuite;
66051    /**
66052     * @var ?bool
66053     */
66054    private $failOnIncomplete;
66055    /**
66056     * @var ?bool
66057     */
66058    private $failOnRisky;
66059    /**
66060     * @var ?bool
66061     */
66062    private $failOnSkipped;
66063    /**
66064     * @var ?bool
66065     */
66066    private $failOnWarning;
66067    /**
66068     * @var ?string
66069     */
66070    private $filter;
66071    /**
66072     * @var ?bool
66073     */
66074    private $generateConfiguration;
66075    /**
66076     * @var ?bool
66077     */
66078    private $migrateConfiguration;
66079    /**
66080     * @var null|string[]
66081     */
66082    private $groups;
66083    /**
66084     * @var null|string[]
66085     */
66086    private $testsCovering;
66087    /**
66088     * @var null|string[]
66089     */
66090    private $testsUsing;
66091    /**
66092     * @var ?bool
66093     */
66094    private $help;
66095    /**
66096     * @var ?string
66097     */
66098    private $includePath;
66099    /**
66100     * @var null|string[]
66101     */
66102    private $iniSettings;
66103    /**
66104     * @var ?string
66105     */
66106    private $junitLogfile;
66107    /**
66108     * @var ?bool
66109     */
66110    private $listGroups;
66111    /**
66112     * @var ?bool
66113     */
66114    private $listSuites;
66115    /**
66116     * @var ?bool
66117     */
66118    private $listTests;
66119    /**
66120     * @var ?string
66121     */
66122    private $listTestsXml;
66123    /**
66124     * @var ?string
66125     */
66126    private $loader;
66127    /**
66128     * @var ?bool
66129     */
66130    private $noCoverage;
66131    /**
66132     * @var ?bool
66133     */
66134    private $noExtensions;
66135    /**
66136     * @var ?bool
66137     */
66138    private $noInteraction;
66139    /**
66140     * @var ?bool
66141     */
66142    private $noLogging;
66143    /**
66144     * @var ?string
66145     */
66146    private $printer;
66147    /**
66148     * @var ?bool
66149     */
66150    private $processIsolation;
66151    /**
66152     * @var ?int
66153     */
66154    private $randomOrderSeed;
66155    /**
66156     * @var ?int
66157     */
66158    private $repeat;
66159    /**
66160     * @var ?bool
66161     */
66162    private $reportUselessTests;
66163    /**
66164     * @var ?bool
66165     */
66166    private $resolveDependencies;
66167    /**
66168     * @var ?bool
66169     */
66170    private $reverseList;
66171    /**
66172     * @var ?bool
66173     */
66174    private $stderr;
66175    /**
66176     * @var ?bool
66177     */
66178    private $strictCoverage;
66179    /**
66180     * @var ?bool
66181     */
66182    private $stopOnDefect;
66183    /**
66184     * @var ?bool
66185     */
66186    private $stopOnError;
66187    /**
66188     * @var ?bool
66189     */
66190    private $stopOnFailure;
66191    /**
66192     * @var ?bool
66193     */
66194    private $stopOnIncomplete;
66195    /**
66196     * @var ?bool
66197     */
66198    private $stopOnRisky;
66199    /**
66200     * @var ?bool
66201     */
66202    private $stopOnSkipped;
66203    /**
66204     * @var ?bool
66205     */
66206    private $stopOnWarning;
66207    /**
66208     * @var ?string
66209     */
66210    private $teamcityLogfile;
66211    /**
66212     * @var null|string[]
66213     */
66214    private $testdoxExcludeGroups;
66215    /**
66216     * @var null|string[]
66217     */
66218    private $testdoxGroups;
66219    /**
66220     * @var ?string
66221     */
66222    private $testdoxHtmlFile;
66223    /**
66224     * @var ?string
66225     */
66226    private $testdoxTextFile;
66227    /**
66228     * @var ?string
66229     */
66230    private $testdoxXmlFile;
66231    /**
66232     * @var null|string[]
66233     */
66234    private $testSuffixes;
66235    /**
66236     * @var ?string
66237     */
66238    private $testSuite;
66239    /**
66240     * @var string[]
66241     */
66242    private $unrecognizedOptions;
66243    /**
66244     * @var ?string
66245     */
66246    private $unrecognizedOrderBy;
66247    /**
66248     * @var ?bool
66249     */
66250    private $useDefaultConfiguration;
66251    /**
66252     * @var ?bool
66253     */
66254    private $verbose;
66255    /**
66256     * @var ?bool
66257     */
66258    private $version;
66259    /**
66260     * @var ?string
66261     */
66262    private $xdebugFilterFile;
66263    /**
66264     * @param null|int|string $columns
66265     */
66266    public function __construct(?string $argument, ?string $atLeastVersion, ?bool $backupGlobals, ?bool $backupStaticAttributes, ?bool $beStrictAboutChangesToGlobalState, ?bool $beStrictAboutResourceUsageDuringSmallTests, ?string $bootstrap, ?bool $cacheResult, ?string $cacheResultFile, ?bool $checkVersion, ?string $colors, $columns, ?string $configuration, ?string $coverageClover, ?string $coverageCobertura, ?string $coverageCrap4J, ?string $coverageHtml, ?string $coveragePhp, ?string $coverageText, ?bool $coverageTextShowUncoveredFiles, ?bool $coverageTextShowOnlySummary, ?string $coverageXml, ?bool $pathCoverage, ?string $coverageCacheDirectory, ?bool $warmCoverageCache, ?bool $debug, ?int $defaultTimeLimit, ?bool $disableCodeCoverageIgnore, ?bool $disallowTestOutput, ?bool $disallowTodoAnnotatedTests, ?bool $enforceTimeLimit, ?array $excludeGroups, ?int $executionOrder, ?int $executionOrderDefects, ?array $extensions, ?array $unavailableExtensions, ?bool $failOnEmptyTestSuite, ?bool $failOnIncomplete, ?bool $failOnRisky, ?bool $failOnSkipped, ?bool $failOnWarning, ?string $filter, ?bool $generateConfiguration, ?bool $migrateConfiguration, ?array $groups, ?array $testsCovering, ?array $testsUsing, ?bool $help, ?string $includePath, ?array $iniSettings, ?string $junitLogfile, ?bool $listGroups, ?bool $listSuites, ?bool $listTests, ?string $listTestsXml, ?string $loader, ?bool $noCoverage, ?bool $noExtensions, ?bool $noInteraction, ?bool $noLogging, ?string $printer, ?bool $processIsolation, ?int $randomOrderSeed, ?int $repeat, ?bool $reportUselessTests, ?bool $resolveDependencies, ?bool $reverseList, ?bool $stderr, ?bool $strictCoverage, ?bool $stopOnDefect, ?bool $stopOnError, ?bool $stopOnFailure, ?bool $stopOnIncomplete, ?bool $stopOnRisky, ?bool $stopOnSkipped, ?bool $stopOnWarning, ?string $teamcityLogfile, ?array $testdoxExcludeGroups, ?array $testdoxGroups, ?string $testdoxHtmlFile, ?string $testdoxTextFile, ?string $testdoxXmlFile, ?array $testSuffixes, ?string $testSuite, array $unrecognizedOptions, ?string $unrecognizedOrderBy, ?bool $useDefaultConfiguration, ?bool $verbose, ?bool $version, ?array $coverageFilter, ?string $xdebugFilterFile)
66267    {
66268        $this->argument = $argument;
66269        $this->atLeastVersion = $atLeastVersion;
66270        $this->backupGlobals = $backupGlobals;
66271        $this->backupStaticAttributes = $backupStaticAttributes;
66272        $this->beStrictAboutChangesToGlobalState = $beStrictAboutChangesToGlobalState;
66273        $this->beStrictAboutResourceUsageDuringSmallTests = $beStrictAboutResourceUsageDuringSmallTests;
66274        $this->bootstrap = $bootstrap;
66275        $this->cacheResult = $cacheResult;
66276        $this->cacheResultFile = $cacheResultFile;
66277        $this->checkVersion = $checkVersion;
66278        $this->colors = $colors;
66279        $this->columns = $columns;
66280        $this->configuration = $configuration;
66281        $this->coverageFilter = $coverageFilter;
66282        $this->coverageClover = $coverageClover;
66283        $this->coverageCobertura = $coverageCobertura;
66284        $this->coverageCrap4J = $coverageCrap4J;
66285        $this->coverageHtml = $coverageHtml;
66286        $this->coveragePhp = $coveragePhp;
66287        $this->coverageText = $coverageText;
66288        $this->coverageTextShowUncoveredFiles = $coverageTextShowUncoveredFiles;
66289        $this->coverageTextShowOnlySummary = $coverageTextShowOnlySummary;
66290        $this->coverageXml = $coverageXml;
66291        $this->pathCoverage = $pathCoverage;
66292        $this->coverageCacheDirectory = $coverageCacheDirectory;
66293        $this->warmCoverageCache = $warmCoverageCache;
66294        $this->debug = $debug;
66295        $this->defaultTimeLimit = $defaultTimeLimit;
66296        $this->disableCodeCoverageIgnore = $disableCodeCoverageIgnore;
66297        $this->disallowTestOutput = $disallowTestOutput;
66298        $this->disallowTodoAnnotatedTests = $disallowTodoAnnotatedTests;
66299        $this->enforceTimeLimit = $enforceTimeLimit;
66300        $this->excludeGroups = $excludeGroups;
66301        $this->executionOrder = $executionOrder;
66302        $this->executionOrderDefects = $executionOrderDefects;
66303        $this->extensions = $extensions;
66304        $this->unavailableExtensions = $unavailableExtensions;
66305        $this->failOnEmptyTestSuite = $failOnEmptyTestSuite;
66306        $this->failOnIncomplete = $failOnIncomplete;
66307        $this->failOnRisky = $failOnRisky;
66308        $this->failOnSkipped = $failOnSkipped;
66309        $this->failOnWarning = $failOnWarning;
66310        $this->filter = $filter;
66311        $this->generateConfiguration = $generateConfiguration;
66312        $this->migrateConfiguration = $migrateConfiguration;
66313        $this->groups = $groups;
66314        $this->testsCovering = $testsCovering;
66315        $this->testsUsing = $testsUsing;
66316        $this->help = $help;
66317        $this->includePath = $includePath;
66318        $this->iniSettings = $iniSettings;
66319        $this->junitLogfile = $junitLogfile;
66320        $this->listGroups = $listGroups;
66321        $this->listSuites = $listSuites;
66322        $this->listTests = $listTests;
66323        $this->listTestsXml = $listTestsXml;
66324        $this->loader = $loader;
66325        $this->noCoverage = $noCoverage;
66326        $this->noExtensions = $noExtensions;
66327        $this->noInteraction = $noInteraction;
66328        $this->noLogging = $noLogging;
66329        $this->printer = $printer;
66330        $this->processIsolation = $processIsolation;
66331        $this->randomOrderSeed = $randomOrderSeed;
66332        $this->repeat = $repeat;
66333        $this->reportUselessTests = $reportUselessTests;
66334        $this->resolveDependencies = $resolveDependencies;
66335        $this->reverseList = $reverseList;
66336        $this->stderr = $stderr;
66337        $this->strictCoverage = $strictCoverage;
66338        $this->stopOnDefect = $stopOnDefect;
66339        $this->stopOnError = $stopOnError;
66340        $this->stopOnFailure = $stopOnFailure;
66341        $this->stopOnIncomplete = $stopOnIncomplete;
66342        $this->stopOnRisky = $stopOnRisky;
66343        $this->stopOnSkipped = $stopOnSkipped;
66344        $this->stopOnWarning = $stopOnWarning;
66345        $this->teamcityLogfile = $teamcityLogfile;
66346        $this->testdoxExcludeGroups = $testdoxExcludeGroups;
66347        $this->testdoxGroups = $testdoxGroups;
66348        $this->testdoxHtmlFile = $testdoxHtmlFile;
66349        $this->testdoxTextFile = $testdoxTextFile;
66350        $this->testdoxXmlFile = $testdoxXmlFile;
66351        $this->testSuffixes = $testSuffixes;
66352        $this->testSuite = $testSuite;
66353        $this->unrecognizedOptions = $unrecognizedOptions;
66354        $this->unrecognizedOrderBy = $unrecognizedOrderBy;
66355        $this->useDefaultConfiguration = $useDefaultConfiguration;
66356        $this->verbose = $verbose;
66357        $this->version = $version;
66358        $this->xdebugFilterFile = $xdebugFilterFile;
66359    }
66360    public function hasArgument() : bool
66361    {
66362        return $this->argument !== null;
66363    }
66364    /**
66365     * @throws Exception
66366     */
66367    public function argument() : string
66368    {
66369        if ($this->argument === null) {
66370            throw new \PHPUnit\TextUI\CliArguments\Exception();
66371        }
66372        return $this->argument;
66373    }
66374    public function hasAtLeastVersion() : bool
66375    {
66376        return $this->atLeastVersion !== null;
66377    }
66378    /**
66379     * @throws Exception
66380     */
66381    public function atLeastVersion() : string
66382    {
66383        if ($this->atLeastVersion === null) {
66384            throw new \PHPUnit\TextUI\CliArguments\Exception();
66385        }
66386        return $this->atLeastVersion;
66387    }
66388    public function hasBackupGlobals() : bool
66389    {
66390        return $this->backupGlobals !== null;
66391    }
66392    /**
66393     * @throws Exception
66394     */
66395    public function backupGlobals() : bool
66396    {
66397        if ($this->backupGlobals === null) {
66398            throw new \PHPUnit\TextUI\CliArguments\Exception();
66399        }
66400        return $this->backupGlobals;
66401    }
66402    public function hasBackupStaticAttributes() : bool
66403    {
66404        return $this->backupStaticAttributes !== null;
66405    }
66406    /**
66407     * @throws Exception
66408     */
66409    public function backupStaticAttributes() : bool
66410    {
66411        if ($this->backupStaticAttributes === null) {
66412            throw new \PHPUnit\TextUI\CliArguments\Exception();
66413        }
66414        return $this->backupStaticAttributes;
66415    }
66416    public function hasBeStrictAboutChangesToGlobalState() : bool
66417    {
66418        return $this->beStrictAboutChangesToGlobalState !== null;
66419    }
66420    /**
66421     * @throws Exception
66422     */
66423    public function beStrictAboutChangesToGlobalState() : bool
66424    {
66425        if ($this->beStrictAboutChangesToGlobalState === null) {
66426            throw new \PHPUnit\TextUI\CliArguments\Exception();
66427        }
66428        return $this->beStrictAboutChangesToGlobalState;
66429    }
66430    public function hasBeStrictAboutResourceUsageDuringSmallTests() : bool
66431    {
66432        return $this->beStrictAboutResourceUsageDuringSmallTests !== null;
66433    }
66434    /**
66435     * @throws Exception
66436     */
66437    public function beStrictAboutResourceUsageDuringSmallTests() : bool
66438    {
66439        if ($this->beStrictAboutResourceUsageDuringSmallTests === null) {
66440            throw new \PHPUnit\TextUI\CliArguments\Exception();
66441        }
66442        return $this->beStrictAboutResourceUsageDuringSmallTests;
66443    }
66444    public function hasBootstrap() : bool
66445    {
66446        return $this->bootstrap !== null;
66447    }
66448    /**
66449     * @throws Exception
66450     */
66451    public function bootstrap() : string
66452    {
66453        if ($this->bootstrap === null) {
66454            throw new \PHPUnit\TextUI\CliArguments\Exception();
66455        }
66456        return $this->bootstrap;
66457    }
66458    public function hasCacheResult() : bool
66459    {
66460        return $this->cacheResult !== null;
66461    }
66462    /**
66463     * @throws Exception
66464     */
66465    public function cacheResult() : bool
66466    {
66467        if ($this->cacheResult === null) {
66468            throw new \PHPUnit\TextUI\CliArguments\Exception();
66469        }
66470        return $this->cacheResult;
66471    }
66472    public function hasCacheResultFile() : bool
66473    {
66474        return $this->cacheResultFile !== null;
66475    }
66476    /**
66477     * @throws Exception
66478     */
66479    public function cacheResultFile() : string
66480    {
66481        if ($this->cacheResultFile === null) {
66482            throw new \PHPUnit\TextUI\CliArguments\Exception();
66483        }
66484        return $this->cacheResultFile;
66485    }
66486    public function hasCheckVersion() : bool
66487    {
66488        return $this->checkVersion !== null;
66489    }
66490    /**
66491     * @throws Exception
66492     */
66493    public function checkVersion() : bool
66494    {
66495        if ($this->checkVersion === null) {
66496            throw new \PHPUnit\TextUI\CliArguments\Exception();
66497        }
66498        return $this->checkVersion;
66499    }
66500    public function hasColors() : bool
66501    {
66502        return $this->colors !== null;
66503    }
66504    /**
66505     * @throws Exception
66506     */
66507    public function colors() : string
66508    {
66509        if ($this->colors === null) {
66510            throw new \PHPUnit\TextUI\CliArguments\Exception();
66511        }
66512        return $this->colors;
66513    }
66514    public function hasColumns() : bool
66515    {
66516        return $this->columns !== null;
66517    }
66518    /**
66519     * @throws Exception
66520     */
66521    public function columns()
66522    {
66523        if ($this->columns === null) {
66524            throw new \PHPUnit\TextUI\CliArguments\Exception();
66525        }
66526        return $this->columns;
66527    }
66528    public function hasConfiguration() : bool
66529    {
66530        return $this->configuration !== null;
66531    }
66532    /**
66533     * @throws Exception
66534     */
66535    public function configuration() : string
66536    {
66537        if ($this->configuration === null) {
66538            throw new \PHPUnit\TextUI\CliArguments\Exception();
66539        }
66540        return $this->configuration;
66541    }
66542    public function hasCoverageFilter() : bool
66543    {
66544        return $this->coverageFilter !== null;
66545    }
66546    /**
66547     * @throws Exception
66548     */
66549    public function coverageFilter() : array
66550    {
66551        if ($this->coverageFilter === null) {
66552            throw new \PHPUnit\TextUI\CliArguments\Exception();
66553        }
66554        return $this->coverageFilter;
66555    }
66556    public function hasCoverageClover() : bool
66557    {
66558        return $this->coverageClover !== null;
66559    }
66560    /**
66561     * @throws Exception
66562     */
66563    public function coverageClover() : string
66564    {
66565        if ($this->coverageClover === null) {
66566            throw new \PHPUnit\TextUI\CliArguments\Exception();
66567        }
66568        return $this->coverageClover;
66569    }
66570    public function hasCoverageCobertura() : bool
66571    {
66572        return $this->coverageCobertura !== null;
66573    }
66574    /**
66575     * @throws Exception
66576     */
66577    public function coverageCobertura() : string
66578    {
66579        if ($this->coverageCobertura === null) {
66580            throw new \PHPUnit\TextUI\CliArguments\Exception();
66581        }
66582        return $this->coverageCobertura;
66583    }
66584    public function hasCoverageCrap4J() : bool
66585    {
66586        return $this->coverageCrap4J !== null;
66587    }
66588    /**
66589     * @throws Exception
66590     */
66591    public function coverageCrap4J() : string
66592    {
66593        if ($this->coverageCrap4J === null) {
66594            throw new \PHPUnit\TextUI\CliArguments\Exception();
66595        }
66596        return $this->coverageCrap4J;
66597    }
66598    public function hasCoverageHtml() : bool
66599    {
66600        return $this->coverageHtml !== null;
66601    }
66602    /**
66603     * @throws Exception
66604     */
66605    public function coverageHtml() : string
66606    {
66607        if ($this->coverageHtml === null) {
66608            throw new \PHPUnit\TextUI\CliArguments\Exception();
66609        }
66610        return $this->coverageHtml;
66611    }
66612    public function hasCoveragePhp() : bool
66613    {
66614        return $this->coveragePhp !== null;
66615    }
66616    /**
66617     * @throws Exception
66618     */
66619    public function coveragePhp() : string
66620    {
66621        if ($this->coveragePhp === null) {
66622            throw new \PHPUnit\TextUI\CliArguments\Exception();
66623        }
66624        return $this->coveragePhp;
66625    }
66626    public function hasCoverageText() : bool
66627    {
66628        return $this->coverageText !== null;
66629    }
66630    /**
66631     * @throws Exception
66632     */
66633    public function coverageText() : string
66634    {
66635        if ($this->coverageText === null) {
66636            throw new \PHPUnit\TextUI\CliArguments\Exception();
66637        }
66638        return $this->coverageText;
66639    }
66640    public function hasCoverageTextShowUncoveredFiles() : bool
66641    {
66642        return $this->coverageTextShowUncoveredFiles !== null;
66643    }
66644    /**
66645     * @throws Exception
66646     */
66647    public function coverageTextShowUncoveredFiles() : bool
66648    {
66649        if ($this->coverageTextShowUncoveredFiles === null) {
66650            throw new \PHPUnit\TextUI\CliArguments\Exception();
66651        }
66652        return $this->coverageTextShowUncoveredFiles;
66653    }
66654    public function hasCoverageTextShowOnlySummary() : bool
66655    {
66656        return $this->coverageTextShowOnlySummary !== null;
66657    }
66658    /**
66659     * @throws Exception
66660     */
66661    public function coverageTextShowOnlySummary() : bool
66662    {
66663        if ($this->coverageTextShowOnlySummary === null) {
66664            throw new \PHPUnit\TextUI\CliArguments\Exception();
66665        }
66666        return $this->coverageTextShowOnlySummary;
66667    }
66668    public function hasCoverageXml() : bool
66669    {
66670        return $this->coverageXml !== null;
66671    }
66672    /**
66673     * @throws Exception
66674     */
66675    public function coverageXml() : string
66676    {
66677        if ($this->coverageXml === null) {
66678            throw new \PHPUnit\TextUI\CliArguments\Exception();
66679        }
66680        return $this->coverageXml;
66681    }
66682    public function hasPathCoverage() : bool
66683    {
66684        return $this->pathCoverage !== null;
66685    }
66686    /**
66687     * @throws Exception
66688     */
66689    public function pathCoverage() : bool
66690    {
66691        if ($this->pathCoverage === null) {
66692            throw new \PHPUnit\TextUI\CliArguments\Exception();
66693        }
66694        return $this->pathCoverage;
66695    }
66696    public function hasCoverageCacheDirectory() : bool
66697    {
66698        return $this->coverageCacheDirectory !== null;
66699    }
66700    /**
66701     * @throws Exception
66702     */
66703    public function coverageCacheDirectory() : string
66704    {
66705        if ($this->coverageCacheDirectory === null) {
66706            throw new \PHPUnit\TextUI\CliArguments\Exception();
66707        }
66708        return $this->coverageCacheDirectory;
66709    }
66710    public function hasWarmCoverageCache() : bool
66711    {
66712        return $this->warmCoverageCache !== null;
66713    }
66714    /**
66715     * @throws Exception
66716     */
66717    public function warmCoverageCache() : bool
66718    {
66719        if ($this->warmCoverageCache === null) {
66720            throw new \PHPUnit\TextUI\CliArguments\Exception();
66721        }
66722        return $this->warmCoverageCache;
66723    }
66724    public function hasDebug() : bool
66725    {
66726        return $this->debug !== null;
66727    }
66728    /**
66729     * @throws Exception
66730     */
66731    public function debug() : bool
66732    {
66733        if ($this->debug === null) {
66734            throw new \PHPUnit\TextUI\CliArguments\Exception();
66735        }
66736        return $this->debug;
66737    }
66738    public function hasDefaultTimeLimit() : bool
66739    {
66740        return $this->defaultTimeLimit !== null;
66741    }
66742    /**
66743     * @throws Exception
66744     */
66745    public function defaultTimeLimit() : int
66746    {
66747        if ($this->defaultTimeLimit === null) {
66748            throw new \PHPUnit\TextUI\CliArguments\Exception();
66749        }
66750        return $this->defaultTimeLimit;
66751    }
66752    public function hasDisableCodeCoverageIgnore() : bool
66753    {
66754        return $this->disableCodeCoverageIgnore !== null;
66755    }
66756    /**
66757     * @throws Exception
66758     */
66759    public function disableCodeCoverageIgnore() : bool
66760    {
66761        if ($this->disableCodeCoverageIgnore === null) {
66762            throw new \PHPUnit\TextUI\CliArguments\Exception();
66763        }
66764        return $this->disableCodeCoverageIgnore;
66765    }
66766    public function hasDisallowTestOutput() : bool
66767    {
66768        return $this->disallowTestOutput !== null;
66769    }
66770    /**
66771     * @throws Exception
66772     */
66773    public function disallowTestOutput() : bool
66774    {
66775        if ($this->disallowTestOutput === null) {
66776            throw new \PHPUnit\TextUI\CliArguments\Exception();
66777        }
66778        return $this->disallowTestOutput;
66779    }
66780    public function hasDisallowTodoAnnotatedTests() : bool
66781    {
66782        return $this->disallowTodoAnnotatedTests !== null;
66783    }
66784    /**
66785     * @throws Exception
66786     */
66787    public function disallowTodoAnnotatedTests() : bool
66788    {
66789        if ($this->disallowTodoAnnotatedTests === null) {
66790            throw new \PHPUnit\TextUI\CliArguments\Exception();
66791        }
66792        return $this->disallowTodoAnnotatedTests;
66793    }
66794    public function hasEnforceTimeLimit() : bool
66795    {
66796        return $this->enforceTimeLimit !== null;
66797    }
66798    /**
66799     * @throws Exception
66800     */
66801    public function enforceTimeLimit() : bool
66802    {
66803        if ($this->enforceTimeLimit === null) {
66804            throw new \PHPUnit\TextUI\CliArguments\Exception();
66805        }
66806        return $this->enforceTimeLimit;
66807    }
66808    public function hasExcludeGroups() : bool
66809    {
66810        return $this->excludeGroups !== null;
66811    }
66812    /**
66813     * @throws Exception
66814     */
66815    public function excludeGroups() : array
66816    {
66817        if ($this->excludeGroups === null) {
66818            throw new \PHPUnit\TextUI\CliArguments\Exception();
66819        }
66820        return $this->excludeGroups;
66821    }
66822    public function hasExecutionOrder() : bool
66823    {
66824        return $this->executionOrder !== null;
66825    }
66826    /**
66827     * @throws Exception
66828     */
66829    public function executionOrder() : int
66830    {
66831        if ($this->executionOrder === null) {
66832            throw new \PHPUnit\TextUI\CliArguments\Exception();
66833        }
66834        return $this->executionOrder;
66835    }
66836    public function hasExecutionOrderDefects() : bool
66837    {
66838        return $this->executionOrderDefects !== null;
66839    }
66840    /**
66841     * @throws Exception
66842     */
66843    public function executionOrderDefects() : int
66844    {
66845        if ($this->executionOrderDefects === null) {
66846            throw new \PHPUnit\TextUI\CliArguments\Exception();
66847        }
66848        return $this->executionOrderDefects;
66849    }
66850    public function hasFailOnEmptyTestSuite() : bool
66851    {
66852        return $this->failOnEmptyTestSuite !== null;
66853    }
66854    /**
66855     * @throws Exception
66856     */
66857    public function failOnEmptyTestSuite() : bool
66858    {
66859        if ($this->failOnEmptyTestSuite === null) {
66860            throw new \PHPUnit\TextUI\CliArguments\Exception();
66861        }
66862        return $this->failOnEmptyTestSuite;
66863    }
66864    public function hasFailOnIncomplete() : bool
66865    {
66866        return $this->failOnIncomplete !== null;
66867    }
66868    /**
66869     * @throws Exception
66870     */
66871    public function failOnIncomplete() : bool
66872    {
66873        if ($this->failOnIncomplete === null) {
66874            throw new \PHPUnit\TextUI\CliArguments\Exception();
66875        }
66876        return $this->failOnIncomplete;
66877    }
66878    public function hasFailOnRisky() : bool
66879    {
66880        return $this->failOnRisky !== null;
66881    }
66882    /**
66883     * @throws Exception
66884     */
66885    public function failOnRisky() : bool
66886    {
66887        if ($this->failOnRisky === null) {
66888            throw new \PHPUnit\TextUI\CliArguments\Exception();
66889        }
66890        return $this->failOnRisky;
66891    }
66892    public function hasFailOnSkipped() : bool
66893    {
66894        return $this->failOnSkipped !== null;
66895    }
66896    /**
66897     * @throws Exception
66898     */
66899    public function failOnSkipped() : bool
66900    {
66901        if ($this->failOnSkipped === null) {
66902            throw new \PHPUnit\TextUI\CliArguments\Exception();
66903        }
66904        return $this->failOnSkipped;
66905    }
66906    public function hasFailOnWarning() : bool
66907    {
66908        return $this->failOnWarning !== null;
66909    }
66910    /**
66911     * @throws Exception
66912     */
66913    public function failOnWarning() : bool
66914    {
66915        if ($this->failOnWarning === null) {
66916            throw new \PHPUnit\TextUI\CliArguments\Exception();
66917        }
66918        return $this->failOnWarning;
66919    }
66920    public function hasFilter() : bool
66921    {
66922        return $this->filter !== null;
66923    }
66924    /**
66925     * @throws Exception
66926     */
66927    public function filter() : string
66928    {
66929        if ($this->filter === null) {
66930            throw new \PHPUnit\TextUI\CliArguments\Exception();
66931        }
66932        return $this->filter;
66933    }
66934    public function hasGenerateConfiguration() : bool
66935    {
66936        return $this->generateConfiguration !== null;
66937    }
66938    /**
66939     * @throws Exception
66940     */
66941    public function generateConfiguration() : bool
66942    {
66943        if ($this->generateConfiguration === null) {
66944            throw new \PHPUnit\TextUI\CliArguments\Exception();
66945        }
66946        return $this->generateConfiguration;
66947    }
66948    public function hasMigrateConfiguration() : bool
66949    {
66950        return $this->migrateConfiguration !== null;
66951    }
66952    /**
66953     * @throws Exception
66954     */
66955    public function migrateConfiguration() : bool
66956    {
66957        if ($this->migrateConfiguration === null) {
66958            throw new \PHPUnit\TextUI\CliArguments\Exception();
66959        }
66960        return $this->migrateConfiguration;
66961    }
66962    public function hasGroups() : bool
66963    {
66964        return $this->groups !== null;
66965    }
66966    /**
66967     * @throws Exception
66968     */
66969    public function groups() : array
66970    {
66971        if ($this->groups === null) {
66972            throw new \PHPUnit\TextUI\CliArguments\Exception();
66973        }
66974        return $this->groups;
66975    }
66976    public function hasTestsCovering() : bool
66977    {
66978        return $this->testsCovering !== null;
66979    }
66980    /**
66981     * @throws Exception
66982     */
66983    public function testsCovering() : array
66984    {
66985        if ($this->testsCovering === null) {
66986            throw new \PHPUnit\TextUI\CliArguments\Exception();
66987        }
66988        return $this->testsCovering;
66989    }
66990    public function hasTestsUsing() : bool
66991    {
66992        return $this->testsUsing !== null;
66993    }
66994    /**
66995     * @throws Exception
66996     */
66997    public function testsUsing() : array
66998    {
66999        if ($this->testsUsing === null) {
67000            throw new \PHPUnit\TextUI\CliArguments\Exception();
67001        }
67002        return $this->testsUsing;
67003    }
67004    public function hasHelp() : bool
67005    {
67006        return $this->help !== null;
67007    }
67008    /**
67009     * @throws Exception
67010     */
67011    public function help() : bool
67012    {
67013        if ($this->help === null) {
67014            throw new \PHPUnit\TextUI\CliArguments\Exception();
67015        }
67016        return $this->help;
67017    }
67018    public function hasIncludePath() : bool
67019    {
67020        return $this->includePath !== null;
67021    }
67022    /**
67023     * @throws Exception
67024     */
67025    public function includePath() : string
67026    {
67027        if ($this->includePath === null) {
67028            throw new \PHPUnit\TextUI\CliArguments\Exception();
67029        }
67030        return $this->includePath;
67031    }
67032    public function hasIniSettings() : bool
67033    {
67034        return $this->iniSettings !== null;
67035    }
67036    /**
67037     * @throws Exception
67038     */
67039    public function iniSettings() : array
67040    {
67041        if ($this->iniSettings === null) {
67042            throw new \PHPUnit\TextUI\CliArguments\Exception();
67043        }
67044        return $this->iniSettings;
67045    }
67046    public function hasJunitLogfile() : bool
67047    {
67048        return $this->junitLogfile !== null;
67049    }
67050    /**
67051     * @throws Exception
67052     */
67053    public function junitLogfile() : string
67054    {
67055        if ($this->junitLogfile === null) {
67056            throw new \PHPUnit\TextUI\CliArguments\Exception();
67057        }
67058        return $this->junitLogfile;
67059    }
67060    public function hasListGroups() : bool
67061    {
67062        return $this->listGroups !== null;
67063    }
67064    /**
67065     * @throws Exception
67066     */
67067    public function listGroups() : bool
67068    {
67069        if ($this->listGroups === null) {
67070            throw new \PHPUnit\TextUI\CliArguments\Exception();
67071        }
67072        return $this->listGroups;
67073    }
67074    public function hasListSuites() : bool
67075    {
67076        return $this->listSuites !== null;
67077    }
67078    /**
67079     * @throws Exception
67080     */
67081    public function listSuites() : bool
67082    {
67083        if ($this->listSuites === null) {
67084            throw new \PHPUnit\TextUI\CliArguments\Exception();
67085        }
67086        return $this->listSuites;
67087    }
67088    public function hasListTests() : bool
67089    {
67090        return $this->listTests !== null;
67091    }
67092    /**
67093     * @throws Exception
67094     */
67095    public function listTests() : bool
67096    {
67097        if ($this->listTests === null) {
67098            throw new \PHPUnit\TextUI\CliArguments\Exception();
67099        }
67100        return $this->listTests;
67101    }
67102    public function hasListTestsXml() : bool
67103    {
67104        return $this->listTestsXml !== null;
67105    }
67106    /**
67107     * @throws Exception
67108     */
67109    public function listTestsXml() : string
67110    {
67111        if ($this->listTestsXml === null) {
67112            throw new \PHPUnit\TextUI\CliArguments\Exception();
67113        }
67114        return $this->listTestsXml;
67115    }
67116    public function hasLoader() : bool
67117    {
67118        return $this->loader !== null;
67119    }
67120    /**
67121     * @throws Exception
67122     */
67123    public function loader() : string
67124    {
67125        if ($this->loader === null) {
67126            throw new \PHPUnit\TextUI\CliArguments\Exception();
67127        }
67128        return $this->loader;
67129    }
67130    public function hasNoCoverage() : bool
67131    {
67132        return $this->noCoverage !== null;
67133    }
67134    /**
67135     * @throws Exception
67136     */
67137    public function noCoverage() : bool
67138    {
67139        if ($this->noCoverage === null) {
67140            throw new \PHPUnit\TextUI\CliArguments\Exception();
67141        }
67142        return $this->noCoverage;
67143    }
67144    public function hasNoExtensions() : bool
67145    {
67146        return $this->noExtensions !== null;
67147    }
67148    /**
67149     * @throws Exception
67150     */
67151    public function noExtensions() : bool
67152    {
67153        if ($this->noExtensions === null) {
67154            throw new \PHPUnit\TextUI\CliArguments\Exception();
67155        }
67156        return $this->noExtensions;
67157    }
67158    public function hasExtensions() : bool
67159    {
67160        return $this->extensions !== null;
67161    }
67162    /**
67163     * @throws Exception
67164     */
67165    public function extensions() : array
67166    {
67167        if ($this->extensions === null) {
67168            throw new \PHPUnit\TextUI\CliArguments\Exception();
67169        }
67170        return $this->extensions;
67171    }
67172    public function hasUnavailableExtensions() : bool
67173    {
67174        return $this->unavailableExtensions !== null;
67175    }
67176    /**
67177     * @throws Exception
67178     */
67179    public function unavailableExtensions() : array
67180    {
67181        if ($this->unavailableExtensions === null) {
67182            throw new \PHPUnit\TextUI\CliArguments\Exception();
67183        }
67184        return $this->unavailableExtensions;
67185    }
67186    public function hasNoInteraction() : bool
67187    {
67188        return $this->noInteraction !== null;
67189    }
67190    /**
67191     * @throws Exception
67192     */
67193    public function noInteraction() : bool
67194    {
67195        if ($this->noInteraction === null) {
67196            throw new \PHPUnit\TextUI\CliArguments\Exception();
67197        }
67198        return $this->noInteraction;
67199    }
67200    public function hasNoLogging() : bool
67201    {
67202        return $this->noLogging !== null;
67203    }
67204    /**
67205     * @throws Exception
67206     */
67207    public function noLogging() : bool
67208    {
67209        if ($this->noLogging === null) {
67210            throw new \PHPUnit\TextUI\CliArguments\Exception();
67211        }
67212        return $this->noLogging;
67213    }
67214    public function hasPrinter() : bool
67215    {
67216        return $this->printer !== null;
67217    }
67218    /**
67219     * @throws Exception
67220     */
67221    public function printer() : string
67222    {
67223        if ($this->printer === null) {
67224            throw new \PHPUnit\TextUI\CliArguments\Exception();
67225        }
67226        return $this->printer;
67227    }
67228    public function hasProcessIsolation() : bool
67229    {
67230        return $this->processIsolation !== null;
67231    }
67232    /**
67233     * @throws Exception
67234     */
67235    public function processIsolation() : bool
67236    {
67237        if ($this->processIsolation === null) {
67238            throw new \PHPUnit\TextUI\CliArguments\Exception();
67239        }
67240        return $this->processIsolation;
67241    }
67242    public function hasRandomOrderSeed() : bool
67243    {
67244        return $this->randomOrderSeed !== null;
67245    }
67246    /**
67247     * @throws Exception
67248     */
67249    public function randomOrderSeed() : int
67250    {
67251        if ($this->randomOrderSeed === null) {
67252            throw new \PHPUnit\TextUI\CliArguments\Exception();
67253        }
67254        return $this->randomOrderSeed;
67255    }
67256    public function hasRepeat() : bool
67257    {
67258        return $this->repeat !== null;
67259    }
67260    /**
67261     * @throws Exception
67262     */
67263    public function repeat() : int
67264    {
67265        if ($this->repeat === null) {
67266            throw new \PHPUnit\TextUI\CliArguments\Exception();
67267        }
67268        return $this->repeat;
67269    }
67270    public function hasReportUselessTests() : bool
67271    {
67272        return $this->reportUselessTests !== null;
67273    }
67274    /**
67275     * @throws Exception
67276     */
67277    public function reportUselessTests() : bool
67278    {
67279        if ($this->reportUselessTests === null) {
67280            throw new \PHPUnit\TextUI\CliArguments\Exception();
67281        }
67282        return $this->reportUselessTests;
67283    }
67284    public function hasResolveDependencies() : bool
67285    {
67286        return $this->resolveDependencies !== null;
67287    }
67288    /**
67289     * @throws Exception
67290     */
67291    public function resolveDependencies() : bool
67292    {
67293        if ($this->resolveDependencies === null) {
67294            throw new \PHPUnit\TextUI\CliArguments\Exception();
67295        }
67296        return $this->resolveDependencies;
67297    }
67298    public function hasReverseList() : bool
67299    {
67300        return $this->reverseList !== null;
67301    }
67302    /**
67303     * @throws Exception
67304     */
67305    public function reverseList() : bool
67306    {
67307        if ($this->reverseList === null) {
67308            throw new \PHPUnit\TextUI\CliArguments\Exception();
67309        }
67310        return $this->reverseList;
67311    }
67312    public function hasStderr() : bool
67313    {
67314        return $this->stderr !== null;
67315    }
67316    /**
67317     * @throws Exception
67318     */
67319    public function stderr() : bool
67320    {
67321        if ($this->stderr === null) {
67322            throw new \PHPUnit\TextUI\CliArguments\Exception();
67323        }
67324        return $this->stderr;
67325    }
67326    public function hasStrictCoverage() : bool
67327    {
67328        return $this->strictCoverage !== null;
67329    }
67330    /**
67331     * @throws Exception
67332     */
67333    public function strictCoverage() : bool
67334    {
67335        if ($this->strictCoverage === null) {
67336            throw new \PHPUnit\TextUI\CliArguments\Exception();
67337        }
67338        return $this->strictCoverage;
67339    }
67340    public function hasStopOnDefect() : bool
67341    {
67342        return $this->stopOnDefect !== null;
67343    }
67344    /**
67345     * @throws Exception
67346     */
67347    public function stopOnDefect() : bool
67348    {
67349        if ($this->stopOnDefect === null) {
67350            throw new \PHPUnit\TextUI\CliArguments\Exception();
67351        }
67352        return $this->stopOnDefect;
67353    }
67354    public function hasStopOnError() : bool
67355    {
67356        return $this->stopOnError !== null;
67357    }
67358    /**
67359     * @throws Exception
67360     */
67361    public function stopOnError() : bool
67362    {
67363        if ($this->stopOnError === null) {
67364            throw new \PHPUnit\TextUI\CliArguments\Exception();
67365        }
67366        return $this->stopOnError;
67367    }
67368    public function hasStopOnFailure() : bool
67369    {
67370        return $this->stopOnFailure !== null;
67371    }
67372    /**
67373     * @throws Exception
67374     */
67375    public function stopOnFailure() : bool
67376    {
67377        if ($this->stopOnFailure === null) {
67378            throw new \PHPUnit\TextUI\CliArguments\Exception();
67379        }
67380        return $this->stopOnFailure;
67381    }
67382    public function hasStopOnIncomplete() : bool
67383    {
67384        return $this->stopOnIncomplete !== null;
67385    }
67386    /**
67387     * @throws Exception
67388     */
67389    public function stopOnIncomplete() : bool
67390    {
67391        if ($this->stopOnIncomplete === null) {
67392            throw new \PHPUnit\TextUI\CliArguments\Exception();
67393        }
67394        return $this->stopOnIncomplete;
67395    }
67396    public function hasStopOnRisky() : bool
67397    {
67398        return $this->stopOnRisky !== null;
67399    }
67400    /**
67401     * @throws Exception
67402     */
67403    public function stopOnRisky() : bool
67404    {
67405        if ($this->stopOnRisky === null) {
67406            throw new \PHPUnit\TextUI\CliArguments\Exception();
67407        }
67408        return $this->stopOnRisky;
67409    }
67410    public function hasStopOnSkipped() : bool
67411    {
67412        return $this->stopOnSkipped !== null;
67413    }
67414    /**
67415     * @throws Exception
67416     */
67417    public function stopOnSkipped() : bool
67418    {
67419        if ($this->stopOnSkipped === null) {
67420            throw new \PHPUnit\TextUI\CliArguments\Exception();
67421        }
67422        return $this->stopOnSkipped;
67423    }
67424    public function hasStopOnWarning() : bool
67425    {
67426        return $this->stopOnWarning !== null;
67427    }
67428    /**
67429     * @throws Exception
67430     */
67431    public function stopOnWarning() : bool
67432    {
67433        if ($this->stopOnWarning === null) {
67434            throw new \PHPUnit\TextUI\CliArguments\Exception();
67435        }
67436        return $this->stopOnWarning;
67437    }
67438    public function hasTeamcityLogfile() : bool
67439    {
67440        return $this->teamcityLogfile !== null;
67441    }
67442    /**
67443     * @throws Exception
67444     */
67445    public function teamcityLogfile() : string
67446    {
67447        if ($this->teamcityLogfile === null) {
67448            throw new \PHPUnit\TextUI\CliArguments\Exception();
67449        }
67450        return $this->teamcityLogfile;
67451    }
67452    public function hasTestdoxExcludeGroups() : bool
67453    {
67454        return $this->testdoxExcludeGroups !== null;
67455    }
67456    /**
67457     * @throws Exception
67458     */
67459    public function testdoxExcludeGroups() : array
67460    {
67461        if ($this->testdoxExcludeGroups === null) {
67462            throw new \PHPUnit\TextUI\CliArguments\Exception();
67463        }
67464        return $this->testdoxExcludeGroups;
67465    }
67466    public function hasTestdoxGroups() : bool
67467    {
67468        return $this->testdoxGroups !== null;
67469    }
67470    /**
67471     * @throws Exception
67472     */
67473    public function testdoxGroups() : array
67474    {
67475        if ($this->testdoxGroups === null) {
67476            throw new \PHPUnit\TextUI\CliArguments\Exception();
67477        }
67478        return $this->testdoxGroups;
67479    }
67480    public function hasTestdoxHtmlFile() : bool
67481    {
67482        return $this->testdoxHtmlFile !== null;
67483    }
67484    /**
67485     * @throws Exception
67486     */
67487    public function testdoxHtmlFile() : string
67488    {
67489        if ($this->testdoxHtmlFile === null) {
67490            throw new \PHPUnit\TextUI\CliArguments\Exception();
67491        }
67492        return $this->testdoxHtmlFile;
67493    }
67494    public function hasTestdoxTextFile() : bool
67495    {
67496        return $this->testdoxTextFile !== null;
67497    }
67498    /**
67499     * @throws Exception
67500     */
67501    public function testdoxTextFile() : string
67502    {
67503        if ($this->testdoxTextFile === null) {
67504            throw new \PHPUnit\TextUI\CliArguments\Exception();
67505        }
67506        return $this->testdoxTextFile;
67507    }
67508    public function hasTestdoxXmlFile() : bool
67509    {
67510        return $this->testdoxXmlFile !== null;
67511    }
67512    /**
67513     * @throws Exception
67514     */
67515    public function testdoxXmlFile() : string
67516    {
67517        if ($this->testdoxXmlFile === null) {
67518            throw new \PHPUnit\TextUI\CliArguments\Exception();
67519        }
67520        return $this->testdoxXmlFile;
67521    }
67522    public function hasTestSuffixes() : bool
67523    {
67524        return $this->testSuffixes !== null;
67525    }
67526    /**
67527     * @throws Exception
67528     */
67529    public function testSuffixes() : array
67530    {
67531        if ($this->testSuffixes === null) {
67532            throw new \PHPUnit\TextUI\CliArguments\Exception();
67533        }
67534        return $this->testSuffixes;
67535    }
67536    public function hasTestSuite() : bool
67537    {
67538        return $this->testSuite !== null;
67539    }
67540    /**
67541     * @throws Exception
67542     */
67543    public function testSuite() : string
67544    {
67545        if ($this->testSuite === null) {
67546            throw new \PHPUnit\TextUI\CliArguments\Exception();
67547        }
67548        return $this->testSuite;
67549    }
67550    public function unrecognizedOptions() : array
67551    {
67552        return $this->unrecognizedOptions;
67553    }
67554    public function hasUnrecognizedOrderBy() : bool
67555    {
67556        return $this->unrecognizedOrderBy !== null;
67557    }
67558    /**
67559     * @throws Exception
67560     */
67561    public function unrecognizedOrderBy() : string
67562    {
67563        if ($this->unrecognizedOrderBy === null) {
67564            throw new \PHPUnit\TextUI\CliArguments\Exception();
67565        }
67566        return $this->unrecognizedOrderBy;
67567    }
67568    public function hasUseDefaultConfiguration() : bool
67569    {
67570        return $this->useDefaultConfiguration !== null;
67571    }
67572    /**
67573     * @throws Exception
67574     */
67575    public function useDefaultConfiguration() : bool
67576    {
67577        if ($this->useDefaultConfiguration === null) {
67578            throw new \PHPUnit\TextUI\CliArguments\Exception();
67579        }
67580        return $this->useDefaultConfiguration;
67581    }
67582    public function hasVerbose() : bool
67583    {
67584        return $this->verbose !== null;
67585    }
67586    /**
67587     * @throws Exception
67588     */
67589    public function verbose() : bool
67590    {
67591        if ($this->verbose === null) {
67592            throw new \PHPUnit\TextUI\CliArguments\Exception();
67593        }
67594        return $this->verbose;
67595    }
67596    public function hasVersion() : bool
67597    {
67598        return $this->version !== null;
67599    }
67600    /**
67601     * @throws Exception
67602     */
67603    public function version() : bool
67604    {
67605        if ($this->version === null) {
67606            throw new \PHPUnit\TextUI\CliArguments\Exception();
67607        }
67608        return $this->version;
67609    }
67610    public function hasXdebugFilterFile() : bool
67611    {
67612        return $this->xdebugFilterFile !== null;
67613    }
67614    /**
67615     * @throws Exception
67616     */
67617    public function xdebugFilterFile() : string
67618    {
67619        if ($this->xdebugFilterFile === null) {
67620            throw new \PHPUnit\TextUI\CliArguments\Exception();
67621        }
67622        return $this->xdebugFilterFile;
67623    }
67624}
67625<?php
67626
67627declare (strict_types=1);
67628/*
67629 * This file is part of PHPUnit.
67630 *
67631 * (c) Sebastian Bergmann <sebastian@phpunit.de>
67632 *
67633 * For the full copyright and license information, please view the LICENSE
67634 * file that was distributed with this source code.
67635 */
67636namespace PHPUnit\TextUI\CliArguments;
67637
67638use function array_map;
67639use function array_merge;
67640use function class_exists;
67641use function explode;
67642use function is_numeric;
67643use function str_replace;
67644use PHPUnit\Runner\TestSuiteSorter;
67645use PHPUnit\TextUI\DefaultResultPrinter;
67646use PHPUnit\TextUI\XmlConfiguration\Extension;
67647use PHPUnit\Util\Log\TeamCity;
67648use PHPUnit\Util\TestDox\CliTestDoxPrinter;
67649use PHPUnit\SebastianBergmann\CliParser\Exception as CliParserException;
67650use PHPUnit\SebastianBergmann\CliParser\Parser as CliParser;
67651/**
67652 * @internal This class is not covered by the backward compatibility promise for PHPUnit
67653 */
67654final class Builder
67655{
67656    private const LONG_OPTIONS = ['atleast-version=', 'prepend=', 'bootstrap=', 'cache-result', 'do-not-cache-result', 'cache-result-file=', 'check-version', 'colors==', 'columns=', 'configuration=', 'coverage-cache=', 'warm-coverage-cache', 'coverage-filter=', 'coverage-clover=', 'coverage-cobertura=', 'coverage-crap4j=', 'coverage-html=', 'coverage-php=', 'coverage-text==', 'coverage-xml=', 'path-coverage', 'debug', 'disallow-test-output', 'disallow-resource-usage', 'disallow-todo-tests', 'default-time-limit=', 'enforce-time-limit', 'exclude-group=', 'extensions=', 'filter=', 'generate-configuration', 'globals-backup', 'group=', 'covers=', 'uses=', 'help', 'resolve-dependencies', 'ignore-dependencies', 'include-path=', 'list-groups', 'list-suites', 'list-tests', 'list-tests-xml=', 'loader=', 'log-junit=', 'log-teamcity=', 'migrate-configuration', 'no-configuration', 'no-coverage', 'no-logging', 'no-interaction', 'no-extensions', 'order-by=', 'printer=', 'process-isolation', 'repeat=', 'dont-report-useless-tests', 'random-order', 'random-order-seed=', 'reverse-order', 'reverse-list', 'static-backup', 'stderr', 'stop-on-defect', 'stop-on-error', 'stop-on-failure', 'stop-on-warning', 'stop-on-incomplete', 'stop-on-risky', 'stop-on-skipped', 'fail-on-empty-test-suite', 'fail-on-incomplete', 'fail-on-risky', 'fail-on-skipped', 'fail-on-warning', 'strict-coverage', 'disable-coverage-ignore', 'strict-global-state', 'teamcity', 'testdox', 'testdox-group=', 'testdox-exclude-group=', 'testdox-html=', 'testdox-text=', 'testdox-xml=', 'test-suffix=', 'testsuite=', 'verbose', 'version', 'whitelist=', 'dump-xdebug-filter='];
67657    private const SHORT_OPTIONS = 'd:c:hv';
67658    public function fromParameters(array $parameters, array $additionalLongOptions) : \PHPUnit\TextUI\CliArguments\Configuration
67659    {
67660        try {
67661            $options = (new CliParser())->parse($parameters, self::SHORT_OPTIONS, array_merge(self::LONG_OPTIONS, $additionalLongOptions));
67662        } catch (CliParserException $e) {
67663            throw new \PHPUnit\TextUI\CliArguments\Exception($e->getMessage(), (int) $e->getCode(), $e);
67664        }
67665        $argument = null;
67666        $atLeastVersion = null;
67667        $backupGlobals = null;
67668        $backupStaticAttributes = null;
67669        $beStrictAboutChangesToGlobalState = null;
67670        $beStrictAboutResourceUsageDuringSmallTests = null;
67671        $bootstrap = null;
67672        $cacheResult = null;
67673        $cacheResultFile = null;
67674        $checkVersion = null;
67675        $colors = null;
67676        $columns = null;
67677        $configuration = null;
67678        $coverageCacheDirectory = null;
67679        $warmCoverageCache = null;
67680        $coverageFilter = null;
67681        $coverageClover = null;
67682        $coverageCobertura = null;
67683        $coverageCrap4J = null;
67684        $coverageHtml = null;
67685        $coveragePhp = null;
67686        $coverageText = null;
67687        $coverageTextShowUncoveredFiles = null;
67688        $coverageTextShowOnlySummary = null;
67689        $coverageXml = null;
67690        $pathCoverage = null;
67691        $debug = null;
67692        $defaultTimeLimit = null;
67693        $disableCodeCoverageIgnore = null;
67694        $disallowTestOutput = null;
67695        $disallowTodoAnnotatedTests = null;
67696        $enforceTimeLimit = null;
67697        $excludeGroups = null;
67698        $executionOrder = null;
67699        $executionOrderDefects = null;
67700        $extensions = [];
67701        $unavailableExtensions = [];
67702        $failOnEmptyTestSuite = null;
67703        $failOnIncomplete = null;
67704        $failOnRisky = null;
67705        $failOnSkipped = null;
67706        $failOnWarning = null;
67707        $filter = null;
67708        $generateConfiguration = null;
67709        $migrateConfiguration = null;
67710        $groups = null;
67711        $testsCovering = null;
67712        $testsUsing = null;
67713        $help = null;
67714        $includePath = null;
67715        $iniSettings = [];
67716        $junitLogfile = null;
67717        $listGroups = null;
67718        $listSuites = null;
67719        $listTests = null;
67720        $listTestsXml = null;
67721        $loader = null;
67722        $noCoverage = null;
67723        $noExtensions = null;
67724        $noInteraction = null;
67725        $noLogging = null;
67726        $printer = null;
67727        $processIsolation = null;
67728        $randomOrderSeed = null;
67729        $repeat = null;
67730        $reportUselessTests = null;
67731        $resolveDependencies = null;
67732        $reverseList = null;
67733        $stderr = null;
67734        $strictCoverage = null;
67735        $stopOnDefect = null;
67736        $stopOnError = null;
67737        $stopOnFailure = null;
67738        $stopOnIncomplete = null;
67739        $stopOnRisky = null;
67740        $stopOnSkipped = null;
67741        $stopOnWarning = null;
67742        $teamcityLogfile = null;
67743        $testdoxExcludeGroups = null;
67744        $testdoxGroups = null;
67745        $testdoxHtmlFile = null;
67746        $testdoxTextFile = null;
67747        $testdoxXmlFile = null;
67748        $testSuffixes = null;
67749        $testSuite = null;
67750        $unrecognizedOptions = [];
67751        $unrecognizedOrderBy = null;
67752        $useDefaultConfiguration = null;
67753        $verbose = null;
67754        $version = null;
67755        $xdebugFilterFile = null;
67756        if (isset($options[1][0])) {
67757            $argument = $options[1][0];
67758        }
67759        foreach ($options[0] as $option) {
67760            switch ($option[0]) {
67761                case '--colors':
67762                    $colors = $option[1] ?: DefaultResultPrinter::COLOR_AUTO;
67763                    break;
67764                case '--bootstrap':
67765                    $bootstrap = $option[1];
67766                    break;
67767                case '--cache-result':
67768                    $cacheResult = \true;
67769                    break;
67770                case '--do-not-cache-result':
67771                    $cacheResult = \false;
67772                    break;
67773                case '--cache-result-file':
67774                    $cacheResultFile = $option[1];
67775                    break;
67776                case '--columns':
67777                    if (is_numeric($option[1])) {
67778                        $columns = (int) $option[1];
67779                    } elseif ($option[1] === 'max') {
67780                        $columns = 'max';
67781                    }
67782                    break;
67783                case 'c':
67784                case '--configuration':
67785                    $configuration = $option[1];
67786                    break;
67787                case '--coverage-cache':
67788                    $coverageCacheDirectory = $option[1];
67789                    break;
67790                case '--warm-coverage-cache':
67791                    $warmCoverageCache = \true;
67792                    break;
67793                case '--coverage-clover':
67794                    $coverageClover = $option[1];
67795                    break;
67796                case '--coverage-cobertura':
67797                    $coverageCobertura = $option[1];
67798                    break;
67799                case '--coverage-crap4j':
67800                    $coverageCrap4J = $option[1];
67801                    break;
67802                case '--coverage-html':
67803                    $coverageHtml = $option[1];
67804                    break;
67805                case '--coverage-php':
67806                    $coveragePhp = $option[1];
67807                    break;
67808                case '--coverage-text':
67809                    if ($option[1] === null) {
67810                        $option[1] = 'php://stdout';
67811                    }
67812                    $coverageText = $option[1];
67813                    $coverageTextShowUncoveredFiles = \false;
67814                    $coverageTextShowOnlySummary = \false;
67815                    break;
67816                case '--coverage-xml':
67817                    $coverageXml = $option[1];
67818                    break;
67819                case '--path-coverage':
67820                    $pathCoverage = \true;
67821                    break;
67822                case 'd':
67823                    $tmp = explode('=', $option[1]);
67824                    if (isset($tmp[0])) {
67825                        if (isset($tmp[1])) {
67826                            $iniSettings[$tmp[0]] = $tmp[1];
67827                        } else {
67828                            $iniSettings[$tmp[0]] = '1';
67829                        }
67830                    }
67831                    break;
67832                case '--debug':
67833                    $debug = \true;
67834                    break;
67835                case 'h':
67836                case '--help':
67837                    $help = \true;
67838                    break;
67839                case '--filter':
67840                    $filter = $option[1];
67841                    break;
67842                case '--testsuite':
67843                    $testSuite = $option[1];
67844                    break;
67845                case '--generate-configuration':
67846                    $generateConfiguration = \true;
67847                    break;
67848                case '--migrate-configuration':
67849                    $migrateConfiguration = \true;
67850                    break;
67851                case '--group':
67852                    $groups = explode(',', $option[1]);
67853                    break;
67854                case '--exclude-group':
67855                    $excludeGroups = explode(',', $option[1]);
67856                    break;
67857                case '--covers':
67858                    $testsCovering = array_map('strtolower', explode(',', $option[1]));
67859                    break;
67860                case '--uses':
67861                    $testsUsing = array_map('strtolower', explode(',', $option[1]));
67862                    break;
67863                case '--test-suffix':
67864                    $testSuffixes = explode(',', $option[1]);
67865                    break;
67866                case '--include-path':
67867                    $includePath = $option[1];
67868                    break;
67869                case '--list-groups':
67870                    $listGroups = \true;
67871                    break;
67872                case '--list-suites':
67873                    $listSuites = \true;
67874                    break;
67875                case '--list-tests':
67876                    $listTests = \true;
67877                    break;
67878                case '--list-tests-xml':
67879                    $listTestsXml = $option[1];
67880                    break;
67881                case '--printer':
67882                    $printer = $option[1];
67883                    break;
67884                case '--loader':
67885                    $loader = $option[1];
67886                    break;
67887                case '--log-junit':
67888                    $junitLogfile = $option[1];
67889                    break;
67890                case '--log-teamcity':
67891                    $teamcityLogfile = $option[1];
67892                    break;
67893                case '--order-by':
67894                    foreach (explode(',', $option[1]) as $order) {
67895                        switch ($order) {
67896                            case 'default':
67897                                $executionOrder = TestSuiteSorter::ORDER_DEFAULT;
67898                                $executionOrderDefects = TestSuiteSorter::ORDER_DEFAULT;
67899                                $resolveDependencies = \true;
67900                                break;
67901                            case 'defects':
67902                                $executionOrderDefects = TestSuiteSorter::ORDER_DEFECTS_FIRST;
67903                                break;
67904                            case 'depends':
67905                                $resolveDependencies = \true;
67906                                break;
67907                            case 'duration':
67908                                $executionOrder = TestSuiteSorter::ORDER_DURATION;
67909                                break;
67910                            case 'no-depends':
67911                                $resolveDependencies = \false;
67912                                break;
67913                            case 'random':
67914                                $executionOrder = TestSuiteSorter::ORDER_RANDOMIZED;
67915                                break;
67916                            case 'reverse':
67917                                $executionOrder = TestSuiteSorter::ORDER_REVERSED;
67918                                break;
67919                            case 'size':
67920                                $executionOrder = TestSuiteSorter::ORDER_SIZE;
67921                                break;
67922                            default:
67923                                $unrecognizedOrderBy = $order;
67924                        }
67925                    }
67926                    break;
67927                case '--process-isolation':
67928                    $processIsolation = \true;
67929                    break;
67930                case '--repeat':
67931                    $repeat = (int) $option[1];
67932                    break;
67933                case '--stderr':
67934                    $stderr = \true;
67935                    break;
67936                case '--stop-on-defect':
67937                    $stopOnDefect = \true;
67938                    break;
67939                case '--stop-on-error':
67940                    $stopOnError = \true;
67941                    break;
67942                case '--stop-on-failure':
67943                    $stopOnFailure = \true;
67944                    break;
67945                case '--stop-on-warning':
67946                    $stopOnWarning = \true;
67947                    break;
67948                case '--stop-on-incomplete':
67949                    $stopOnIncomplete = \true;
67950                    break;
67951                case '--stop-on-risky':
67952                    $stopOnRisky = \true;
67953                    break;
67954                case '--stop-on-skipped':
67955                    $stopOnSkipped = \true;
67956                    break;
67957                case '--fail-on-empty-test-suite':
67958                    $failOnEmptyTestSuite = \true;
67959                    break;
67960                case '--fail-on-incomplete':
67961                    $failOnIncomplete = \true;
67962                    break;
67963                case '--fail-on-risky':
67964                    $failOnRisky = \true;
67965                    break;
67966                case '--fail-on-skipped':
67967                    $failOnSkipped = \true;
67968                    break;
67969                case '--fail-on-warning':
67970                    $failOnWarning = \true;
67971                    break;
67972                case '--teamcity':
67973                    $printer = TeamCity::class;
67974                    break;
67975                case '--testdox':
67976                    $printer = CliTestDoxPrinter::class;
67977                    break;
67978                case '--testdox-group':
67979                    $testdoxGroups = explode(',', $option[1]);
67980                    break;
67981                case '--testdox-exclude-group':
67982                    $testdoxExcludeGroups = explode(',', $option[1]);
67983                    break;
67984                case '--testdox-html':
67985                    $testdoxHtmlFile = $option[1];
67986                    break;
67987                case '--testdox-text':
67988                    $testdoxTextFile = $option[1];
67989                    break;
67990                case '--testdox-xml':
67991                    $testdoxXmlFile = $option[1];
67992                    break;
67993                case '--no-configuration':
67994                    $useDefaultConfiguration = \false;
67995                    break;
67996                case '--extensions':
67997                    foreach (explode(',', $option[1]) as $extensionClass) {
67998                        if (!class_exists($extensionClass)) {
67999                            $unavailableExtensions[] = $extensionClass;
68000                            continue;
68001                        }
68002                        $extensions[] = new Extension($extensionClass, '', []);
68003                    }
68004                    break;
68005                case '--no-extensions':
68006                    $noExtensions = \true;
68007                    break;
68008                case '--no-coverage':
68009                    $noCoverage = \true;
68010                    break;
68011                case '--no-logging':
68012                    $noLogging = \true;
68013                    break;
68014                case '--no-interaction':
68015                    $noInteraction = \true;
68016                    break;
68017                case '--globals-backup':
68018                    $backupGlobals = \true;
68019                    break;
68020                case '--static-backup':
68021                    $backupStaticAttributes = \true;
68022                    break;
68023                case 'v':
68024                case '--verbose':
68025                    $verbose = \true;
68026                    break;
68027                case '--atleast-version':
68028                    $atLeastVersion = $option[1];
68029                    break;
68030                case '--version':
68031                    $version = \true;
68032                    break;
68033                case '--dont-report-useless-tests':
68034                    $reportUselessTests = \false;
68035                    break;
68036                case '--strict-coverage':
68037                    $strictCoverage = \true;
68038                    break;
68039                case '--disable-coverage-ignore':
68040                    $disableCodeCoverageIgnore = \true;
68041                    break;
68042                case '--strict-global-state':
68043                    $beStrictAboutChangesToGlobalState = \true;
68044                    break;
68045                case '--disallow-test-output':
68046                    $disallowTestOutput = \true;
68047                    break;
68048                case '--disallow-resource-usage':
68049                    $beStrictAboutResourceUsageDuringSmallTests = \true;
68050                    break;
68051                case '--default-time-limit':
68052                    $defaultTimeLimit = (int) $option[1];
68053                    break;
68054                case '--enforce-time-limit':
68055                    $enforceTimeLimit = \true;
68056                    break;
68057                case '--disallow-todo-tests':
68058                    $disallowTodoAnnotatedTests = \true;
68059                    break;
68060                case '--reverse-list':
68061                    $reverseList = \true;
68062                    break;
68063                case '--check-version':
68064                    $checkVersion = \true;
68065                    break;
68066                case '--coverage-filter':
68067                case '--whitelist':
68068                    if ($coverageFilter === null) {
68069                        $coverageFilter = [];
68070                    }
68071                    $coverageFilter[] = $option[1];
68072                    break;
68073                case '--random-order':
68074                    $executionOrder = TestSuiteSorter::ORDER_RANDOMIZED;
68075                    break;
68076                case '--random-order-seed':
68077                    $randomOrderSeed = (int) $option[1];
68078                    break;
68079                case '--resolve-dependencies':
68080                    $resolveDependencies = \true;
68081                    break;
68082                case '--ignore-dependencies':
68083                    $resolveDependencies = \false;
68084                    break;
68085                case '--reverse-order':
68086                    $executionOrder = TestSuiteSorter::ORDER_REVERSED;
68087                    break;
68088                case '--dump-xdebug-filter':
68089                    $xdebugFilterFile = $option[1];
68090                    break;
68091                default:
68092                    $unrecognizedOptions[str_replace('--', '', $option[0])] = $option[1];
68093            }
68094        }
68095        if (empty($extensions)) {
68096            $extensions = null;
68097        }
68098        if (empty($unavailableExtensions)) {
68099            $unavailableExtensions = null;
68100        }
68101        if (empty($iniSettings)) {
68102            $iniSettings = null;
68103        }
68104        if (empty($coverageFilter)) {
68105            $coverageFilter = null;
68106        }
68107        return new \PHPUnit\TextUI\CliArguments\Configuration($argument, $atLeastVersion, $backupGlobals, $backupStaticAttributes, $beStrictAboutChangesToGlobalState, $beStrictAboutResourceUsageDuringSmallTests, $bootstrap, $cacheResult, $cacheResultFile, $checkVersion, $colors, $columns, $configuration, $coverageClover, $coverageCobertura, $coverageCrap4J, $coverageHtml, $coveragePhp, $coverageText, $coverageTextShowUncoveredFiles, $coverageTextShowOnlySummary, $coverageXml, $pathCoverage, $coverageCacheDirectory, $warmCoverageCache, $debug, $defaultTimeLimit, $disableCodeCoverageIgnore, $disallowTestOutput, $disallowTodoAnnotatedTests, $enforceTimeLimit, $excludeGroups, $executionOrder, $executionOrderDefects, $extensions, $unavailableExtensions, $failOnEmptyTestSuite, $failOnIncomplete, $failOnRisky, $failOnSkipped, $failOnWarning, $filter, $generateConfiguration, $migrateConfiguration, $groups, $testsCovering, $testsUsing, $help, $includePath, $iniSettings, $junitLogfile, $listGroups, $listSuites, $listTests, $listTestsXml, $loader, $noCoverage, $noExtensions, $noInteraction, $noLogging, $printer, $processIsolation, $randomOrderSeed, $repeat, $reportUselessTests, $resolveDependencies, $reverseList, $stderr, $strictCoverage, $stopOnDefect, $stopOnError, $stopOnFailure, $stopOnIncomplete, $stopOnRisky, $stopOnSkipped, $stopOnWarning, $teamcityLogfile, $testdoxExcludeGroups, $testdoxGroups, $testdoxHtmlFile, $testdoxTextFile, $testdoxXmlFile, $testSuffixes, $testSuite, $unrecognizedOptions, $unrecognizedOrderBy, $useDefaultConfiguration, $verbose, $version, $coverageFilter, $xdebugFilterFile);
68108    }
68109}
68110<?php
68111
68112declare (strict_types=1);
68113/*
68114 * This file is part of PHPUnit.
68115 *
68116 * (c) Sebastian Bergmann <sebastian@phpunit.de>
68117 *
68118 * For the full copyright and license information, please view the LICENSE
68119 * file that was distributed with this source code.
68120 */
68121namespace PHPUnit\TextUI\CliArguments;
68122
68123use RuntimeException;
68124/**
68125 * @internal This class is not covered by the backward compatibility promise for PHPUnit
68126 */
68127final class Exception extends RuntimeException implements \PHPUnit\Exception
68128{
68129}
68130<?php
68131
68132declare (strict_types=1);
68133/*
68134 * This file is part of PHPUnit.
68135 *
68136 * (c) Sebastian Bergmann <sebastian@phpunit.de>
68137 *
68138 * For the full copyright and license information, please view the LICENSE
68139 * file that was distributed with this source code.
68140 */
68141namespace PHPUnit\TextUI;
68142
68143use const PATH_SEPARATOR;
68144use const PHP_EOL;
68145use const STDIN;
68146use function array_keys;
68147use function assert;
68148use function class_exists;
68149use function copy;
68150use function extension_loaded;
68151use function fgets;
68152use function file_get_contents;
68153use function file_put_contents;
68154use function get_class;
68155use function getcwd;
68156use function ini_get;
68157use function ini_set;
68158use function is_callable;
68159use function is_dir;
68160use function is_file;
68161use function is_string;
68162use function printf;
68163use function realpath;
68164use function sort;
68165use function sprintf;
68166use function stream_resolve_include_path;
68167use function strpos;
68168use function trim;
68169use function version_compare;
68170use PHPUnit\Framework\TestSuite;
68171use PHPUnit\Runner\Extension\PharLoader;
68172use PHPUnit\Runner\StandardTestSuiteLoader;
68173use PHPUnit\Runner\TestSuiteLoader;
68174use PHPUnit\Runner\Version;
68175use PHPUnit\TextUI\CliArguments\Builder;
68176use PHPUnit\TextUI\CliArguments\Configuration;
68177use PHPUnit\TextUI\CliArguments\Exception as ArgumentsException;
68178use PHPUnit\TextUI\CliArguments\Mapper;
68179use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\FilterMapper;
68180use PHPUnit\TextUI\XmlConfiguration\Generator;
68181use PHPUnit\TextUI\XmlConfiguration\Loader;
68182use PHPUnit\TextUI\XmlConfiguration\Migrator;
68183use PHPUnit\TextUI\XmlConfiguration\PhpHandler;
68184use PHPUnit\Util\FileLoader;
68185use PHPUnit\Util\Filesystem;
68186use PHPUnit\Util\Printer;
68187use PHPUnit\Util\TextTestListRenderer;
68188use PHPUnit\Util\Xml\SchemaDetector;
68189use PHPUnit\Util\XmlTestListRenderer;
68190use ReflectionClass;
68191use PHPUnit\SebastianBergmann\CodeCoverage\Filter;
68192use PHPUnit\SebastianBergmann\CodeCoverage\StaticAnalysis\CacheWarmer;
68193use PHPUnit\SebastianBergmann\Timer\Timer;
68194use Throwable;
68195/**
68196 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
68197 */
68198class Command
68199{
68200    /**
68201     * @var array<string,mixed>
68202     */
68203    protected $arguments = [];
68204    /**
68205     * @var array<string,mixed>
68206     */
68207    protected $longOptions = [];
68208    /**
68209     * @var bool
68210     */
68211    private $versionStringPrinted = \false;
68212    /**
68213     * @psalm-var list<string>
68214     */
68215    private $warnings = [];
68216    /**
68217     * @throws Exception
68218     */
68219    public static function main(bool $exit = \true) : int
68220    {
68221        try {
68222            return (new static())->run($_SERVER['argv'], $exit);
68223        } catch (Throwable $t) {
68224            throw new \PHPUnit\TextUI\RuntimeException($t->getMessage(), (int) $t->getCode(), $t);
68225        }
68226    }
68227    /**
68228     * @throws Exception
68229     */
68230    public function run(array $argv, bool $exit = \true) : int
68231    {
68232        $this->handleArguments($argv);
68233        $runner = $this->createRunner();
68234        if ($this->arguments['test'] instanceof TestSuite) {
68235            $suite = $this->arguments['test'];
68236        } else {
68237            $suite = $runner->getTest($this->arguments['test'], $this->arguments['testSuffixes']);
68238        }
68239        if ($this->arguments['listGroups']) {
68240            return $this->handleListGroups($suite, $exit);
68241        }
68242        if ($this->arguments['listSuites']) {
68243            return $this->handleListSuites($exit);
68244        }
68245        if ($this->arguments['listTests']) {
68246            return $this->handleListTests($suite, $exit);
68247        }
68248        if ($this->arguments['listTestsXml']) {
68249            return $this->handleListTestsXml($suite, $this->arguments['listTestsXml'], $exit);
68250        }
68251        unset($this->arguments['test'], $this->arguments['testFile']);
68252        try {
68253            $result = $runner->run($suite, $this->arguments, $this->warnings, $exit);
68254        } catch (Throwable $t) {
68255            print $t->getMessage() . \PHP_EOL;
68256        }
68257        $return = \PHPUnit\TextUI\TestRunner::FAILURE_EXIT;
68258        if (isset($result) && $result->wasSuccessful()) {
68259            $return = \PHPUnit\TextUI\TestRunner::SUCCESS_EXIT;
68260        } elseif (!isset($result) || $result->errorCount() > 0) {
68261            $return = \PHPUnit\TextUI\TestRunner::EXCEPTION_EXIT;
68262        }
68263        if ($exit) {
68264            exit($return);
68265        }
68266        return $return;
68267    }
68268    /**
68269     * Create a TestRunner, override in subclasses.
68270     */
68271    protected function createRunner() : \PHPUnit\TextUI\TestRunner
68272    {
68273        return new \PHPUnit\TextUI\TestRunner($this->arguments['loader']);
68274    }
68275    /**
68276     * Handles the command-line arguments.
68277     *
68278     * A child class of PHPUnit\TextUI\Command can hook into the argument
68279     * parsing by adding the switch(es) to the $longOptions array and point to a
68280     * callback method that handles the switch(es) in the child class like this
68281     *
68282     * <code>
68283     * <?php
68284     * class MyCommand extends PHPUnit\TextUI\Command
68285     * {
68286     *     public function __construct()
68287     *     {
68288     *         // my-switch won't accept a value, it's an on/off
68289     *         $this->longOptions['my-switch'] = 'myHandler';
68290     *         // my-secondswitch will accept a value - note the equals sign
68291     *         $this->longOptions['my-secondswitch='] = 'myOtherHandler';
68292     *     }
68293     *
68294     *     // --my-switch  -> myHandler()
68295     *     protected function myHandler()
68296     *     {
68297     *     }
68298     *
68299     *     // --my-secondswitch foo -> myOtherHandler('foo')
68300     *     protected function myOtherHandler ($value)
68301     *     {
68302     *     }
68303     *
68304     *     // You will also need this - the static keyword in the
68305     *     // PHPUnit\TextUI\Command will mean that it'll be
68306     *     // PHPUnit\TextUI\Command that gets instantiated,
68307     *     // not MyCommand
68308     *     public static function main($exit = true)
68309     *     {
68310     *         $command = new static;
68311     *
68312     *         return $command->run($_SERVER['argv'], $exit);
68313     *     }
68314     *
68315     * }
68316     * </code>
68317     *
68318     * @throws Exception
68319     */
68320    protected function handleArguments(array $argv) : void
68321    {
68322        try {
68323            $arguments = (new Builder())->fromParameters($argv, array_keys($this->longOptions));
68324        } catch (ArgumentsException $e) {
68325            $this->exitWithErrorMessage($e->getMessage());
68326        }
68327        assert(isset($arguments) && $arguments instanceof Configuration);
68328        if ($arguments->hasGenerateConfiguration() && $arguments->generateConfiguration()) {
68329            $this->generateConfiguration();
68330        }
68331        if ($arguments->hasAtLeastVersion()) {
68332            if (version_compare(Version::id(), $arguments->atLeastVersion(), '>=')) {
68333                exit(\PHPUnit\TextUI\TestRunner::SUCCESS_EXIT);
68334            }
68335            exit(\PHPUnit\TextUI\TestRunner::FAILURE_EXIT);
68336        }
68337        if ($arguments->hasVersion() && $arguments->version()) {
68338            $this->printVersionString();
68339            exit(\PHPUnit\TextUI\TestRunner::SUCCESS_EXIT);
68340        }
68341        if ($arguments->hasCheckVersion() && $arguments->checkVersion()) {
68342            $this->handleVersionCheck();
68343        }
68344        if ($arguments->hasHelp()) {
68345            $this->showHelp();
68346            exit(\PHPUnit\TextUI\TestRunner::SUCCESS_EXIT);
68347        }
68348        if ($arguments->hasUnrecognizedOrderBy()) {
68349            $this->exitWithErrorMessage(sprintf('unrecognized --order-by option: %s', $arguments->unrecognizedOrderBy()));
68350        }
68351        if ($arguments->hasIniSettings()) {
68352            foreach ($arguments->iniSettings() as $name => $value) {
68353                ini_set($name, $value);
68354            }
68355        }
68356        if ($arguments->hasIncludePath()) {
68357            ini_set('include_path', $arguments->includePath() . \PATH_SEPARATOR . ini_get('include_path'));
68358        }
68359        $this->arguments = (new Mapper())->mapToLegacyArray($arguments);
68360        $this->handleCustomOptions($arguments->unrecognizedOptions());
68361        $this->handleCustomTestSuite();
68362        if (!isset($this->arguments['testSuffixes'])) {
68363            $this->arguments['testSuffixes'] = ['Test.php', '.phpt'];
68364        }
68365        if (!isset($this->arguments['test']) && $arguments->hasArgument()) {
68366            $this->arguments['test'] = realpath($arguments->argument());
68367            if ($this->arguments['test'] === \false) {
68368                $this->exitWithErrorMessage(sprintf('Cannot open file "%s".', $arguments->argument()));
68369            }
68370        }
68371        if ($this->arguments['loader'] !== null) {
68372            $this->arguments['loader'] = $this->handleLoader($this->arguments['loader']);
68373        }
68374        if (isset($this->arguments['configuration'])) {
68375            if (is_dir($this->arguments['configuration'])) {
68376                $candidate = $this->configurationFileInDirectory($this->arguments['configuration']);
68377                if ($candidate !== null) {
68378                    $this->arguments['configuration'] = $candidate;
68379                }
68380            }
68381        } elseif ($this->arguments['useDefaultConfiguration']) {
68382            $candidate = $this->configurationFileInDirectory(getcwd());
68383            if ($candidate !== null) {
68384                $this->arguments['configuration'] = $candidate;
68385            }
68386        }
68387        if ($arguments->hasMigrateConfiguration() && $arguments->migrateConfiguration()) {
68388            if (!isset($this->arguments['configuration'])) {
68389                print 'No configuration file found to migrate.' . \PHP_EOL;
68390                exit(\PHPUnit\TextUI\TestRunner::EXCEPTION_EXIT);
68391            }
68392            $this->migrateConfiguration(realpath($this->arguments['configuration']));
68393        }
68394        if (isset($this->arguments['configuration'])) {
68395            try {
68396                $this->arguments['configurationObject'] = (new Loader())->load($this->arguments['configuration']);
68397            } catch (Throwable $e) {
68398                print $e->getMessage() . \PHP_EOL;
68399                exit(\PHPUnit\TextUI\TestRunner::FAILURE_EXIT);
68400            }
68401            $phpunitConfiguration = $this->arguments['configurationObject']->phpunit();
68402            (new PhpHandler())->handle($this->arguments['configurationObject']->php());
68403            if (isset($this->arguments['bootstrap'])) {
68404                $this->handleBootstrap($this->arguments['bootstrap']);
68405            } elseif ($phpunitConfiguration->hasBootstrap()) {
68406                $this->handleBootstrap($phpunitConfiguration->bootstrap());
68407            }
68408            if (!isset($this->arguments['stderr'])) {
68409                $this->arguments['stderr'] = $phpunitConfiguration->stderr();
68410            }
68411            if (!isset($this->arguments['noExtensions']) && $phpunitConfiguration->hasExtensionsDirectory() && extension_loaded('phar')) {
68412                $result = (new PharLoader())->loadPharExtensionsInDirectory($phpunitConfiguration->extensionsDirectory());
68413                $this->arguments['loadedExtensions'] = $result['loadedExtensions'];
68414                $this->arguments['notLoadedExtensions'] = $result['notLoadedExtensions'];
68415                unset($result);
68416            }
68417            if (!isset($this->arguments['columns'])) {
68418                $this->arguments['columns'] = $phpunitConfiguration->columns();
68419            }
68420            if (!isset($this->arguments['printer']) && $phpunitConfiguration->hasPrinterClass()) {
68421                $file = $phpunitConfiguration->hasPrinterFile() ? $phpunitConfiguration->printerFile() : '';
68422                $this->arguments['printer'] = $this->handlePrinter($phpunitConfiguration->printerClass(), $file);
68423            }
68424            if ($phpunitConfiguration->hasTestSuiteLoaderClass()) {
68425                $file = $phpunitConfiguration->hasTestSuiteLoaderFile() ? $phpunitConfiguration->testSuiteLoaderFile() : '';
68426                $this->arguments['loader'] = $this->handleLoader($phpunitConfiguration->testSuiteLoaderClass(), $file);
68427            }
68428            if (!isset($this->arguments['testsuite']) && $phpunitConfiguration->hasDefaultTestSuite()) {
68429                $this->arguments['testsuite'] = $phpunitConfiguration->defaultTestSuite();
68430            }
68431            if (!isset($this->arguments['test'])) {
68432                try {
68433                    $this->arguments['test'] = (new \PHPUnit\TextUI\TestSuiteMapper())->map($this->arguments['configurationObject']->testSuite(), $this->arguments['testsuite'] ?? '');
68434                } catch (\PHPUnit\TextUI\Exception $e) {
68435                    $this->printVersionString();
68436                    print $e->getMessage() . \PHP_EOL;
68437                    exit(\PHPUnit\TextUI\TestRunner::EXCEPTION_EXIT);
68438                }
68439            }
68440        } elseif (isset($this->arguments['bootstrap'])) {
68441            $this->handleBootstrap($this->arguments['bootstrap']);
68442        }
68443        if (isset($this->arguments['printer']) && is_string($this->arguments['printer'])) {
68444            $this->arguments['printer'] = $this->handlePrinter($this->arguments['printer']);
68445        }
68446        if (isset($this->arguments['configurationObject'], $this->arguments['warmCoverageCache'])) {
68447            $this->handleWarmCoverageCache($this->arguments['configurationObject']);
68448        }
68449        if (!isset($this->arguments['test'])) {
68450            $this->showHelp();
68451            exit(\PHPUnit\TextUI\TestRunner::EXCEPTION_EXIT);
68452        }
68453    }
68454    /**
68455     * Handles the loading of the PHPUnit\Runner\TestSuiteLoader implementation.
68456     *
68457     * @deprecated see https://github.com/sebastianbergmann/phpunit/issues/4039
68458     */
68459    protected function handleLoader(string $loaderClass, string $loaderFile = '') : ?TestSuiteLoader
68460    {
68461        $this->warnings[] = 'Using a custom test suite loader is deprecated';
68462        if (!class_exists($loaderClass, \false)) {
68463            if ($loaderFile == '') {
68464                $loaderFile = Filesystem::classNameToFilename($loaderClass);
68465            }
68466            $loaderFile = stream_resolve_include_path($loaderFile);
68467            if ($loaderFile) {
68468                /**
68469                 * @noinspection PhpIncludeInspection
68470                 * @psalm-suppress UnresolvableInclude
68471                 */
68472                require $loaderFile;
68473            }
68474        }
68475        if (class_exists($loaderClass, \false)) {
68476            try {
68477                $class = new ReflectionClass($loaderClass);
68478                // @codeCoverageIgnoreStart
68479            } catch (\ReflectionException $e) {
68480                throw new \PHPUnit\TextUI\ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
68481            }
68482            // @codeCoverageIgnoreEnd
68483            if ($class->implementsInterface(TestSuiteLoader::class) && $class->isInstantiable()) {
68484                $object = $class->newInstance();
68485                assert($object instanceof TestSuiteLoader);
68486                return $object;
68487            }
68488        }
68489        if ($loaderClass == StandardTestSuiteLoader::class) {
68490            return null;
68491        }
68492        $this->exitWithErrorMessage(sprintf('Could not use "%s" as loader.', $loaderClass));
68493        return null;
68494    }
68495    /**
68496     * Handles the loading of the PHPUnit\Util\Printer implementation.
68497     *
68498     * @return null|Printer|string
68499     */
68500    protected function handlePrinter(string $printerClass, string $printerFile = '')
68501    {
68502        if (!class_exists($printerClass, \false)) {
68503            if ($printerFile === '') {
68504                $printerFile = Filesystem::classNameToFilename($printerClass);
68505            }
68506            $printerFile = stream_resolve_include_path($printerFile);
68507            if ($printerFile) {
68508                /**
68509                 * @noinspection PhpIncludeInspection
68510                 * @psalm-suppress UnresolvableInclude
68511                 */
68512                require $printerFile;
68513            }
68514        }
68515        if (!class_exists($printerClass)) {
68516            $this->exitWithErrorMessage(sprintf('Could not use "%s" as printer: class does not exist', $printerClass));
68517        }
68518        try {
68519            $class = new ReflectionClass($printerClass);
68520            // @codeCoverageIgnoreStart
68521        } catch (\ReflectionException $e) {
68522            throw new \PHPUnit\TextUI\ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
68523            // @codeCoverageIgnoreEnd
68524        }
68525        if (!$class->implementsInterface(\PHPUnit\TextUI\ResultPrinter::class)) {
68526            $this->exitWithErrorMessage(sprintf('Could not use "%s" as printer: class does not implement %s', $printerClass, \PHPUnit\TextUI\ResultPrinter::class));
68527        }
68528        if (!$class->isInstantiable()) {
68529            $this->exitWithErrorMessage(sprintf('Could not use "%s" as printer: class cannot be instantiated', $printerClass));
68530        }
68531        if ($class->isSubclassOf(\PHPUnit\TextUI\ResultPrinter::class)) {
68532            return $printerClass;
68533        }
68534        $outputStream = isset($this->arguments['stderr']) ? 'php://stderr' : null;
68535        return $class->newInstance($outputStream);
68536    }
68537    /**
68538     * Loads a bootstrap file.
68539     */
68540    protected function handleBootstrap(string $filename) : void
68541    {
68542        try {
68543            FileLoader::checkAndLoad($filename);
68544        } catch (Throwable $t) {
68545            if ($t instanceof \PHPUnit\Exception) {
68546                $this->exitWithErrorMessage($t->getMessage());
68547            }
68548            $this->exitWithErrorMessage(sprintf('Error in bootstrap script: %s:%s%s', get_class($t), \PHP_EOL, $t->getMessage()));
68549        }
68550    }
68551    protected function handleVersionCheck() : void
68552    {
68553        $this->printVersionString();
68554        $latestVersion = file_get_contents('https://phar.phpunit.de/latest-version-of/phpunit');
68555        $isOutdated = version_compare($latestVersion, Version::id(), '>');
68556        if ($isOutdated) {
68557            printf('You are not using the latest version of PHPUnit.' . \PHP_EOL . 'The latest version is PHPUnit %s.' . \PHP_EOL, $latestVersion);
68558        } else {
68559            print 'You are using the latest version of PHPUnit.' . \PHP_EOL;
68560        }
68561        exit(\PHPUnit\TextUI\TestRunner::SUCCESS_EXIT);
68562    }
68563    /**
68564     * Show the help message.
68565     */
68566    protected function showHelp() : void
68567    {
68568        $this->printVersionString();
68569        (new \PHPUnit\TextUI\Help())->writeToConsole();
68570    }
68571    /**
68572     * Custom callback for test suite discovery.
68573     */
68574    protected function handleCustomTestSuite() : void
68575    {
68576    }
68577    private function printVersionString() : void
68578    {
68579        if ($this->versionStringPrinted) {
68580            return;
68581        }
68582        print Version::getVersionString() . \PHP_EOL . \PHP_EOL;
68583        $this->versionStringPrinted = \true;
68584    }
68585    private function exitWithErrorMessage(string $message) : void
68586    {
68587        $this->printVersionString();
68588        print $message . \PHP_EOL;
68589        exit(\PHPUnit\TextUI\TestRunner::FAILURE_EXIT);
68590    }
68591    private function handleListGroups(TestSuite $suite, bool $exit) : int
68592    {
68593        $this->printVersionString();
68594        print 'Available test group(s):' . \PHP_EOL;
68595        $groups = $suite->getGroups();
68596        sort($groups);
68597        foreach ($groups as $group) {
68598            if (strpos($group, '__phpunit_') === 0) {
68599                continue;
68600            }
68601            printf(' - %s' . \PHP_EOL, $group);
68602        }
68603        if ($exit) {
68604            exit(\PHPUnit\TextUI\TestRunner::SUCCESS_EXIT);
68605        }
68606        return \PHPUnit\TextUI\TestRunner::SUCCESS_EXIT;
68607    }
68608    /**
68609     * @throws \PHPUnit\Framework\Exception
68610     * @throws \PHPUnit\TextUI\XmlConfiguration\Exception
68611     */
68612    private function handleListSuites(bool $exit) : int
68613    {
68614        $this->printVersionString();
68615        print 'Available test suite(s):' . \PHP_EOL;
68616        foreach ($this->arguments['configurationObject']->testSuite() as $testSuite) {
68617            printf(' - %s' . \PHP_EOL, $testSuite->name());
68618        }
68619        if ($exit) {
68620            exit(\PHPUnit\TextUI\TestRunner::SUCCESS_EXIT);
68621        }
68622        return \PHPUnit\TextUI\TestRunner::SUCCESS_EXIT;
68623    }
68624    /**
68625     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
68626     */
68627    private function handleListTests(TestSuite $suite, bool $exit) : int
68628    {
68629        $this->printVersionString();
68630        $renderer = new TextTestListRenderer();
68631        print $renderer->render($suite);
68632        if ($exit) {
68633            exit(\PHPUnit\TextUI\TestRunner::SUCCESS_EXIT);
68634        }
68635        return \PHPUnit\TextUI\TestRunner::SUCCESS_EXIT;
68636    }
68637    /**
68638     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
68639     */
68640    private function handleListTestsXml(TestSuite $suite, string $target, bool $exit) : int
68641    {
68642        $this->printVersionString();
68643        $renderer = new XmlTestListRenderer();
68644        file_put_contents($target, $renderer->render($suite));
68645        printf('Wrote list of tests that would have been run to %s' . \PHP_EOL, $target);
68646        if ($exit) {
68647            exit(\PHPUnit\TextUI\TestRunner::SUCCESS_EXIT);
68648        }
68649        return \PHPUnit\TextUI\TestRunner::SUCCESS_EXIT;
68650    }
68651    private function generateConfiguration() : void
68652    {
68653        $this->printVersionString();
68654        print 'Generating phpunit.xml in ' . getcwd() . \PHP_EOL . \PHP_EOL;
68655        print 'Bootstrap script (relative to path shown above; default: vendor/autoload.php): ';
68656        $bootstrapScript = trim(fgets(\STDIN));
68657        print 'Tests directory (relative to path shown above; default: tests): ';
68658        $testsDirectory = trim(fgets(\STDIN));
68659        print 'Source directory (relative to path shown above; default: src): ';
68660        $src = trim(fgets(\STDIN));
68661        print 'Cache directory (relative to path shown above; default: .phpunit.cache): ';
68662        $cacheDirectory = trim(fgets(\STDIN));
68663        if ($bootstrapScript === '') {
68664            $bootstrapScript = 'vendor/autoload.php';
68665        }
68666        if ($testsDirectory === '') {
68667            $testsDirectory = 'tests';
68668        }
68669        if ($src === '') {
68670            $src = 'src';
68671        }
68672        if ($cacheDirectory === '') {
68673            $cacheDirectory = '.phpunit.cache';
68674        }
68675        $generator = new Generator();
68676        file_put_contents('phpunit.xml', $generator->generateDefaultConfiguration(Version::series(), $bootstrapScript, $testsDirectory, $src, $cacheDirectory));
68677        print \PHP_EOL . 'Generated phpunit.xml in ' . getcwd() . '.' . \PHP_EOL;
68678        print 'Make sure to exclude the ' . $cacheDirectory . ' directory from version control.' . \PHP_EOL;
68679        exit(\PHPUnit\TextUI\TestRunner::SUCCESS_EXIT);
68680    }
68681    private function migrateConfiguration(string $filename) : void
68682    {
68683        $this->printVersionString();
68684        if (!(new SchemaDetector())->detect($filename)->detected()) {
68685            print $filename . ' does not need to be migrated.' . \PHP_EOL;
68686            exit(\PHPUnit\TextUI\TestRunner::EXCEPTION_EXIT);
68687        }
68688        copy($filename, $filename . '.bak');
68689        print 'Created backup:         ' . $filename . '.bak' . \PHP_EOL;
68690        try {
68691            file_put_contents($filename, (new Migrator())->migrate($filename));
68692            print 'Migrated configuration: ' . $filename . \PHP_EOL;
68693        } catch (Throwable $t) {
68694            print 'Migration failed: ' . $t->getMessage() . \PHP_EOL;
68695            exit(\PHPUnit\TextUI\TestRunner::EXCEPTION_EXIT);
68696        }
68697        exit(\PHPUnit\TextUI\TestRunner::SUCCESS_EXIT);
68698    }
68699    private function handleCustomOptions(array $unrecognizedOptions) : void
68700    {
68701        foreach ($unrecognizedOptions as $name => $value) {
68702            if (isset($this->longOptions[$name])) {
68703                $handler = $this->longOptions[$name];
68704            }
68705            $name .= '=';
68706            if (isset($this->longOptions[$name])) {
68707                $handler = $this->longOptions[$name];
68708            }
68709            if (isset($handler) && is_callable([$this, $handler])) {
68710                $this->{$handler}($value);
68711                unset($handler);
68712            }
68713        }
68714    }
68715    private function handleWarmCoverageCache(\PHPUnit\TextUI\XmlConfiguration\Configuration $configuration) : void
68716    {
68717        $this->printVersionString();
68718        if (isset($this->arguments['coverageCacheDirectory'])) {
68719            $cacheDirectory = $this->arguments['coverageCacheDirectory'];
68720        } elseif ($configuration->codeCoverage()->hasCacheDirectory()) {
68721            $cacheDirectory = $configuration->codeCoverage()->cacheDirectory()->path();
68722        } else {
68723            print 'Cache for static analysis has not been configured' . \PHP_EOL;
68724            exit(\PHPUnit\TextUI\TestRunner::EXCEPTION_EXIT);
68725        }
68726        $filter = new Filter();
68727        if ($configuration->codeCoverage()->hasNonEmptyListOfFilesToBeIncludedInCodeCoverageReport()) {
68728            (new FilterMapper())->map($filter, $configuration->codeCoverage());
68729        } elseif (isset($this->arguments['coverageFilter'])) {
68730            if (!\is_array($this->arguments['coverageFilter'])) {
68731                $coverageFilterDirectories = [$this->arguments['coverageFilter']];
68732            } else {
68733                $coverageFilterDirectories = $this->arguments['coverageFilter'];
68734            }
68735            foreach ($coverageFilterDirectories as $coverageFilterDirectory) {
68736                $filter->includeDirectory($coverageFilterDirectory);
68737            }
68738        } else {
68739            print 'Filter for code coverage has not been configured' . \PHP_EOL;
68740            exit(\PHPUnit\TextUI\TestRunner::EXCEPTION_EXIT);
68741        }
68742        $timer = new Timer();
68743        $timer->start();
68744        print 'Warming cache for static analysis ... ';
68745        (new CacheWarmer())->warmCache($cacheDirectory, !$configuration->codeCoverage()->disableCodeCoverageIgnore(), $configuration->codeCoverage()->ignoreDeprecatedCodeUnits(), $filter);
68746        print 'done [' . $timer->stop()->asString() . ']' . \PHP_EOL;
68747        exit(\PHPUnit\TextUI\TestRunner::SUCCESS_EXIT);
68748    }
68749    private function configurationFileInDirectory(string $directory) : ?string
68750    {
68751        $candidates = [$directory . '/phpunit.xml', $directory . '/phpunit.xml.dist'];
68752        foreach ($candidates as $candidate) {
68753            if (is_file($candidate)) {
68754                return realpath($candidate);
68755            }
68756        }
68757        return null;
68758    }
68759}
68760<?php
68761
68762declare (strict_types=1);
68763/*
68764 * This file is part of PHPUnit.
68765 *
68766 * (c) Sebastian Bergmann <sebastian@phpunit.de>
68767 *
68768 * For the full copyright and license information, please view the LICENSE
68769 * file that was distributed with this source code.
68770 */
68771namespace PHPUnit\TextUI;
68772
68773use const PHP_VERSION;
68774use function explode;
68775use function in_array;
68776use function is_dir;
68777use function is_file;
68778use function strpos;
68779use function version_compare;
68780use PHPUnit\Framework\Exception as FrameworkException;
68781use PHPUnit\Framework\TestSuite as TestSuiteObject;
68782use PHPUnit\TextUI\XmlConfiguration\TestSuiteCollection;
68783use PHPUnit\SebastianBergmann\FileIterator\Facade;
68784/**
68785 * @internal This class is not covered by the backward compatibility promise for PHPUnit
68786 */
68787final class TestSuiteMapper
68788{
68789    /**
68790     * @throws RuntimeException
68791     * @throws TestDirectoryNotFoundException
68792     * @throws TestFileNotFoundException
68793     */
68794    public function map(TestSuiteCollection $configuration, string $filter) : TestSuiteObject
68795    {
68796        try {
68797            $filterAsArray = $filter ? explode(',', $filter) : [];
68798            $result = new TestSuiteObject();
68799            foreach ($configuration as $testSuiteConfiguration) {
68800                if (!empty($filterAsArray) && !in_array($testSuiteConfiguration->name(), $filterAsArray, \true)) {
68801                    continue;
68802                }
68803                $testSuite = new TestSuiteObject($testSuiteConfiguration->name());
68804                $testSuiteEmpty = \true;
68805                foreach ($testSuiteConfiguration->directories() as $directory) {
68806                    if (!version_compare(\PHP_VERSION, $directory->phpVersion(), $directory->phpVersionOperator()->asString())) {
68807                        continue;
68808                    }
68809                    $exclude = [];
68810                    foreach ($testSuiteConfiguration->exclude()->asArray() as $file) {
68811                        $exclude[] = $file->path();
68812                    }
68813                    $files = (new Facade())->getFilesAsArray($directory->path(), $directory->suffix(), $directory->prefix(), $exclude);
68814                    if (!empty($files)) {
68815                        $testSuite->addTestFiles($files);
68816                        $testSuiteEmpty = \false;
68817                    } elseif (strpos($directory->path(), '*') === \false && !is_dir($directory->path())) {
68818                        throw new \PHPUnit\TextUI\TestDirectoryNotFoundException($directory->path());
68819                    }
68820                }
68821                foreach ($testSuiteConfiguration->files() as $file) {
68822                    if (!is_file($file->path())) {
68823                        throw new \PHPUnit\TextUI\TestFileNotFoundException($file->path());
68824                    }
68825                    if (!version_compare(\PHP_VERSION, $file->phpVersion(), $file->phpVersionOperator()->asString())) {
68826                        continue;
68827                    }
68828                    $testSuite->addTestFile($file->path());
68829                    $testSuiteEmpty = \false;
68830                }
68831                if (!$testSuiteEmpty) {
68832                    $result->addTest($testSuite);
68833                }
68834            }
68835            return $result;
68836        } catch (FrameworkException $e) {
68837            throw new \PHPUnit\TextUI\RuntimeException($e->getMessage(), (int) $e->getCode(), $e);
68838        }
68839    }
68840}
68841<?php
68842
68843declare (strict_types=1);
68844/*
68845 * This file is part of PHPUnit.
68846 *
68847 * (c) Sebastian Bergmann <sebastian@phpunit.de>
68848 *
68849 * For the full copyright and license information, please view the LICENSE
68850 * file that was distributed with this source code.
68851 */
68852namespace PHPUnit\Framework;
68853
68854/**
68855 * @internal This class is not covered by the backward compatibility promise for PHPUnit
68856 */
68857final class ErrorTestCase extends \PHPUnit\Framework\TestCase
68858{
68859    /**
68860     * @var bool
68861     */
68862    protected $backupGlobals = \false;
68863    /**
68864     * @var bool
68865     */
68866    protected $backupStaticAttributes = \false;
68867    /**
68868     * @var bool
68869     */
68870    protected $runTestInSeparateProcess = \false;
68871    /**
68872     * @var string
68873     */
68874    private $message;
68875    public function __construct(string $message = '')
68876    {
68877        $this->message = $message;
68878        parent::__construct('Error');
68879    }
68880    public function getMessage() : string
68881    {
68882        return $this->message;
68883    }
68884    /**
68885     * Returns a string representation of the test case.
68886     */
68887    public function toString() : string
68888    {
68889        return 'Error';
68890    }
68891    /**
68892     * @throws Exception
68893     *
68894     * @psalm-return never-return
68895     */
68896    protected function runTest() : void
68897    {
68898        throw new \PHPUnit\Framework\Error($this->message);
68899    }
68900}
68901<?php
68902
68903declare (strict_types=1);
68904/*
68905 * This file is part of PHPUnit.
68906 *
68907 * (c) Sebastian Bergmann <sebastian@phpunit.de>
68908 *
68909 * For the full copyright and license information, please view the LICENSE
68910 * file that was distributed with this source code.
68911 */
68912namespace PHPUnit\Framework;
68913
68914use Throwable;
68915/**
68916 * @internal This class is not covered by the backward compatibility promise for PHPUnit
68917 */
68918interface SkippedTest extends Throwable
68919{
68920}
68921<?php
68922
68923declare (strict_types=1);
68924/*
68925 * This file is part of PHPUnit.
68926 *
68927 * (c) Sebastian Bergmann <sebastian@phpunit.de>
68928 *
68929 * For the full copyright and license information, please view the LICENSE
68930 * file that was distributed with this source code.
68931 */
68932namespace PHPUnit\Framework;
68933
68934use const PHP_EOL;
68935use function array_diff;
68936use function array_keys;
68937use function array_map;
68938use function array_merge;
68939use function array_unique;
68940use function basename;
68941use function call_user_func;
68942use function class_exists;
68943use function count;
68944use function dirname;
68945use function get_declared_classes;
68946use function implode;
68947use function is_bool;
68948use function is_callable;
68949use function is_file;
68950use function is_object;
68951use function is_string;
68952use function method_exists;
68953use function preg_match;
68954use function preg_quote;
68955use function sprintf;
68956use function strpos;
68957use function substr;
68958use Iterator;
68959use IteratorAggregate;
68960use PHPUnit\Runner\BaseTestRunner;
68961use PHPUnit\Runner\Filter\Factory;
68962use PHPUnit\Runner\PhptTestCase;
68963use PHPUnit\Util\FileLoader;
68964use PHPUnit\Util\Test as TestUtil;
68965use ReflectionClass;
68966use ReflectionException;
68967use ReflectionMethod;
68968use Throwable;
68969/**
68970 * @internal This class is not covered by the backward compatibility promise for PHPUnit
68971 */
68972class TestSuite implements IteratorAggregate, \PHPUnit\Framework\Reorderable, \PHPUnit\Framework\SelfDescribing, \PHPUnit\Framework\Test
68973{
68974    /**
68975     * Enable or disable the backup and restoration of the $GLOBALS array.
68976     *
68977     * @var bool
68978     */
68979    protected $backupGlobals;
68980    /**
68981     * Enable or disable the backup and restoration of static attributes.
68982     *
68983     * @var bool
68984     */
68985    protected $backupStaticAttributes;
68986    /**
68987     * @var bool
68988     */
68989    protected $runTestInSeparateProcess = \false;
68990    /**
68991     * The name of the test suite.
68992     *
68993     * @var string
68994     */
68995    protected $name = '';
68996    /**
68997     * The test groups of the test suite.
68998     *
68999     * @psalm-var array<string,list<Test>>
69000     */
69001    protected $groups = [];
69002    /**
69003     * The tests in the test suite.
69004     *
69005     * @var Test[]
69006     */
69007    protected $tests = [];
69008    /**
69009     * The number of tests in the test suite.
69010     *
69011     * @var int
69012     */
69013    protected $numTests = -1;
69014    /**
69015     * @var bool
69016     */
69017    protected $testCase = \false;
69018    /**
69019     * @var string[]
69020     */
69021    protected $foundClasses = [];
69022    /**
69023     * @var null|list<ExecutionOrderDependency>
69024     */
69025    protected $providedTests;
69026    /**
69027     * @var null|list<ExecutionOrderDependency>
69028     */
69029    protected $requiredTests;
69030    /**
69031     * @var bool
69032     */
69033    private $beStrictAboutChangesToGlobalState;
69034    /**
69035     * @var Factory
69036     */
69037    private $iteratorFilter;
69038    /**
69039     * @var string[]
69040     */
69041    private $declaredClasses;
69042    /**
69043     * @psalm-var array<int,string>
69044     */
69045    private $warnings = [];
69046    /**
69047     * Constructs a new TestSuite.
69048     *
69049     *   - PHPUnit\Framework\TestSuite() constructs an empty TestSuite.
69050     *
69051     *   - PHPUnit\Framework\TestSuite(ReflectionClass) constructs a
69052     *     TestSuite from the given class.
69053     *
69054     *   - PHPUnit\Framework\TestSuite(ReflectionClass, String)
69055     *     constructs a TestSuite from the given class with the given
69056     *     name.
69057     *
69058     *   - PHPUnit\Framework\TestSuite(String) either constructs a
69059     *     TestSuite from the given class (if the passed string is the
69060     *     name of an existing class) or constructs an empty TestSuite
69061     *     with the given name.
69062     *
69063     * @param ReflectionClass|string $theClass
69064     *
69065     * @throws Exception
69066     */
69067    public function __construct($theClass = '', string $name = '')
69068    {
69069        if (!is_string($theClass) && !$theClass instanceof ReflectionClass) {
69070            throw \PHPUnit\Framework\InvalidArgumentException::create(1, 'ReflectionClass object or string');
69071        }
69072        $this->declaredClasses = get_declared_classes();
69073        if (!$theClass instanceof ReflectionClass) {
69074            if (class_exists($theClass, \true)) {
69075                if ($name === '') {
69076                    $name = $theClass;
69077                }
69078                try {
69079                    $theClass = new ReflectionClass($theClass);
69080                } catch (ReflectionException $e) {
69081                    throw new \PHPUnit\Framework\Exception($e->getMessage(), (int) $e->getCode(), $e);
69082                }
69083                // @codeCoverageIgnoreEnd
69084            } else {
69085                $this->setName($theClass);
69086                return;
69087            }
69088        }
69089        if (!$theClass->isSubclassOf(\PHPUnit\Framework\TestCase::class)) {
69090            $this->setName((string) $theClass);
69091            return;
69092        }
69093        if ($name !== '') {
69094            $this->setName($name);
69095        } else {
69096            $this->setName($theClass->getName());
69097        }
69098        $constructor = $theClass->getConstructor();
69099        if ($constructor !== null && !$constructor->isPublic()) {
69100            $this->addTest(new \PHPUnit\Framework\WarningTestCase(sprintf('Class "%s" has no public constructor.', $theClass->getName())));
69101            return;
69102        }
69103        foreach ($theClass->getMethods() as $method) {
69104            if ($method->getDeclaringClass()->getName() === \PHPUnit\Framework\Assert::class) {
69105                continue;
69106            }
69107            if ($method->getDeclaringClass()->getName() === \PHPUnit\Framework\TestCase::class) {
69108                continue;
69109            }
69110            if (!TestUtil::isTestMethod($method)) {
69111                continue;
69112            }
69113            $this->addTestMethod($theClass, $method);
69114        }
69115        if (empty($this->tests)) {
69116            $this->addTest(new \PHPUnit\Framework\WarningTestCase(sprintf('No tests found in class "%s".', $theClass->getName())));
69117        }
69118        $this->testCase = \true;
69119    }
69120    /**
69121     * Returns a string representation of the test suite.
69122     */
69123    public function toString() : string
69124    {
69125        return $this->getName();
69126    }
69127    /**
69128     * Adds a test to the suite.
69129     *
69130     * @param array $groups
69131     */
69132    public function addTest(\PHPUnit\Framework\Test $test, $groups = []) : void
69133    {
69134        try {
69135            $class = new ReflectionClass($test);
69136            // @codeCoverageIgnoreStart
69137        } catch (ReflectionException $e) {
69138            throw new \PHPUnit\Framework\Exception($e->getMessage(), (int) $e->getCode(), $e);
69139        }
69140        // @codeCoverageIgnoreEnd
69141        if (!$class->isAbstract()) {
69142            $this->tests[] = $test;
69143            $this->clearCaches();
69144            if ($test instanceof self && empty($groups)) {
69145                $groups = $test->getGroups();
69146            }
69147            if ($this->containsOnlyVirtualGroups($groups)) {
69148                $groups[] = 'default';
69149            }
69150            foreach ($groups as $group) {
69151                if (!isset($this->groups[$group])) {
69152                    $this->groups[$group] = [$test];
69153                } else {
69154                    $this->groups[$group][] = $test;
69155                }
69156            }
69157            if ($test instanceof \PHPUnit\Framework\TestCase) {
69158                $test->setGroups($groups);
69159            }
69160        }
69161    }
69162    /**
69163     * Adds the tests from the given class to the suite.
69164     *
69165     * @psalm-param object|class-string $testClass
69166     *
69167     * @throws Exception
69168     */
69169    public function addTestSuite($testClass) : void
69170    {
69171        if (!(is_object($testClass) || is_string($testClass) && class_exists($testClass))) {
69172            throw \PHPUnit\Framework\InvalidArgumentException::create(1, 'class name or object');
69173        }
69174        if (!is_object($testClass)) {
69175            try {
69176                $testClass = new ReflectionClass($testClass);
69177                // @codeCoverageIgnoreStart
69178            } catch (ReflectionException $e) {
69179                throw new \PHPUnit\Framework\Exception($e->getMessage(), (int) $e->getCode(), $e);
69180            }
69181            // @codeCoverageIgnoreEnd
69182        }
69183        if ($testClass instanceof self) {
69184            $this->addTest($testClass);
69185        } elseif ($testClass instanceof ReflectionClass) {
69186            $suiteMethod = \false;
69187            if (!$testClass->isAbstract() && $testClass->hasMethod(BaseTestRunner::SUITE_METHODNAME)) {
69188                try {
69189                    $method = $testClass->getMethod(BaseTestRunner::SUITE_METHODNAME);
69190                    // @codeCoverageIgnoreStart
69191                } catch (ReflectionException $e) {
69192                    throw new \PHPUnit\Framework\Exception($e->getMessage(), (int) $e->getCode(), $e);
69193                }
69194                // @codeCoverageIgnoreEnd
69195                if ($method->isStatic()) {
69196                    $this->addTest($method->invoke(null, $testClass->getName()));
69197                    $suiteMethod = \true;
69198                }
69199            }
69200            if (!$suiteMethod && !$testClass->isAbstract() && $testClass->isSubclassOf(\PHPUnit\Framework\TestCase::class)) {
69201                $this->addTest(new self($testClass));
69202            }
69203        } else {
69204            throw new \PHPUnit\Framework\Exception();
69205        }
69206    }
69207    public function addWarning(string $warning) : void
69208    {
69209        $this->warnings[] = $warning;
69210    }
69211    /**
69212     * Wraps both <code>addTest()</code> and <code>addTestSuite</code>
69213     * as well as the separate import statements for the user's convenience.
69214     *
69215     * If the named file cannot be read or there are no new tests that can be
69216     * added, a <code>PHPUnit\Framework\WarningTestCase</code> will be created instead,
69217     * leaving the current test run untouched.
69218     *
69219     * @throws Exception
69220     */
69221    public function addTestFile(string $filename) : void
69222    {
69223        if (is_file($filename) && substr($filename, -5) === '.phpt') {
69224            $this->addTest(new PhptTestCase($filename));
69225            $this->declaredClasses = get_declared_classes();
69226            return;
69227        }
69228        $numTests = count($this->tests);
69229        // The given file may contain further stub classes in addition to the
69230        // test class itself. Figure out the actual test class.
69231        $filename = FileLoader::checkAndLoad($filename);
69232        $newClasses = array_diff(get_declared_classes(), $this->declaredClasses);
69233        // The diff is empty in case a parent class (with test methods) is added
69234        // AFTER a child class that inherited from it. To account for that case,
69235        // accumulate all discovered classes, so the parent class may be found in
69236        // a later invocation.
69237        if (!empty($newClasses)) {
69238            // On the assumption that test classes are defined first in files,
69239            // process discovered classes in approximate LIFO order, so as to
69240            // avoid unnecessary reflection.
69241            $this->foundClasses = array_merge($newClasses, $this->foundClasses);
69242            $this->declaredClasses = get_declared_classes();
69243        }
69244        // The test class's name must match the filename, either in full, or as
69245        // a PEAR/PSR-0 prefixed short name ('NameSpace_ShortName'), or as a
69246        // PSR-1 local short name ('NameSpace\ShortName'). The comparison must be
69247        // anchored to prevent false-positive matches (e.g., 'OtherShortName').
69248        $shortName = basename($filename, '.php');
69249        $shortNameRegEx = '/(?:^|_|\\\\)' . preg_quote($shortName, '/') . '$/';
69250        foreach ($this->foundClasses as $i => $className) {
69251            if (preg_match($shortNameRegEx, $className)) {
69252                try {
69253                    $class = new ReflectionClass($className);
69254                    // @codeCoverageIgnoreStart
69255                } catch (ReflectionException $e) {
69256                    throw new \PHPUnit\Framework\Exception($e->getMessage(), (int) $e->getCode(), $e);
69257                }
69258                // @codeCoverageIgnoreEnd
69259                if ($class->getFileName() == $filename) {
69260                    $newClasses = [$className];
69261                    unset($this->foundClasses[$i]);
69262                    break;
69263                }
69264            }
69265        }
69266        foreach ($newClasses as $className) {
69267            try {
69268                $class = new ReflectionClass($className);
69269                // @codeCoverageIgnoreStart
69270            } catch (ReflectionException $e) {
69271                throw new \PHPUnit\Framework\Exception($e->getMessage(), (int) $e->getCode(), $e);
69272            }
69273            // @codeCoverageIgnoreEnd
69274            if (dirname($class->getFileName()) === __DIR__) {
69275                continue;
69276            }
69277            if (!$class->isAbstract()) {
69278                if ($class->hasMethod(BaseTestRunner::SUITE_METHODNAME)) {
69279                    try {
69280                        $method = $class->getMethod(BaseTestRunner::SUITE_METHODNAME);
69281                        // @codeCoverageIgnoreStart
69282                    } catch (ReflectionException $e) {
69283                        throw new \PHPUnit\Framework\Exception($e->getMessage(), (int) $e->getCode(), $e);
69284                    }
69285                    // @codeCoverageIgnoreEnd
69286                    if ($method->isStatic()) {
69287                        $this->addTest($method->invoke(null, $className));
69288                    }
69289                } elseif ($class->implementsInterface(\PHPUnit\Framework\Test::class)) {
69290                    $expectedClassName = $shortName;
69291                    if (($pos = strpos($expectedClassName, '.')) !== \false) {
69292                        $expectedClassName = substr($expectedClassName, 0, $pos);
69293                    }
69294                    if ($class->getShortName() !== $expectedClassName) {
69295                        $this->addWarning(sprintf("Test case class not matching filename is deprecated\n               in %s\n               Class name was '%s', expected '%s'", $filename, $class->getShortName(), $expectedClassName));
69296                    }
69297                    $this->addTestSuite($class);
69298                }
69299            }
69300        }
69301        if (count($this->tests) > ++$numTests) {
69302            $this->addWarning(sprintf("Multiple test case classes per file is deprecated\n               in %s", $filename));
69303        }
69304        $this->numTests = -1;
69305    }
69306    /**
69307     * Wrapper for addTestFile() that adds multiple test files.
69308     *
69309     * @throws Exception
69310     */
69311    public function addTestFiles(iterable $fileNames) : void
69312    {
69313        foreach ($fileNames as $filename) {
69314            $this->addTestFile((string) $filename);
69315        }
69316    }
69317    /**
69318     * Counts the number of test cases that will be run by this test.
69319     *
69320     * @todo refactor usage of numTests in DefaultResultPrinter
69321     */
69322    public function count() : int
69323    {
69324        $this->numTests = 0;
69325        foreach ($this as $test) {
69326            $this->numTests += count($test);
69327        }
69328        return $this->numTests;
69329    }
69330    /**
69331     * Returns the name of the suite.
69332     */
69333    public function getName() : string
69334    {
69335        return $this->name;
69336    }
69337    /**
69338     * Returns the test groups of the suite.
69339     *
69340     * @psalm-return list<string>
69341     */
69342    public function getGroups() : array
69343    {
69344        return array_map(static function ($key) : string {
69345            return (string) $key;
69346        }, array_keys($this->groups));
69347    }
69348    public function getGroupDetails() : array
69349    {
69350        return $this->groups;
69351    }
69352    /**
69353     * Set tests groups of the test case.
69354     */
69355    public function setGroupDetails(array $groups) : void
69356    {
69357        $this->groups = $groups;
69358    }
69359    /**
69360     * Runs the tests and collects their result in a TestResult.
69361     *
69362     * @throws \PHPUnit\Framework\CodeCoverageException
69363     * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException
69364     * @throws \SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException
69365     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
69366     * @throws Warning
69367     */
69368    public function run(\PHPUnit\Framework\TestResult $result = null) : \PHPUnit\Framework\TestResult
69369    {
69370        if ($result === null) {
69371            $result = $this->createResult();
69372        }
69373        if (count($this) === 0) {
69374            return $result;
69375        }
69376        /** @psalm-var class-string $className */
69377        $className = $this->name;
69378        $hookMethods = TestUtil::getHookMethods($className);
69379        $result->startTestSuite($this);
69380        $test = null;
69381        if ($this->testCase && class_exists($this->name, \false)) {
69382            try {
69383                foreach ($hookMethods['beforeClass'] as $beforeClassMethod) {
69384                    if (method_exists($this->name, $beforeClassMethod)) {
69385                        if ($missingRequirements = TestUtil::getMissingRequirements($this->name, $beforeClassMethod)) {
69386                            $this->markTestSuiteSkipped(implode(\PHP_EOL, $missingRequirements));
69387                        }
69388                        call_user_func([$this->name, $beforeClassMethod]);
69389                    }
69390                }
69391            } catch (\PHPUnit\Framework\SkippedTestSuiteError $error) {
69392                foreach ($this->tests() as $test) {
69393                    $result->startTest($test);
69394                    $result->addFailure($test, $error, 0);
69395                    $result->endTest($test, 0);
69396                }
69397                $result->endTestSuite($this);
69398                return $result;
69399            } catch (Throwable $t) {
69400                $errorAdded = \false;
69401                foreach ($this->tests() as $test) {
69402                    if ($result->shouldStop()) {
69403                        break;
69404                    }
69405                    $result->startTest($test);
69406                    if (!$errorAdded) {
69407                        $result->addError($test, $t, 0);
69408                        $errorAdded = \true;
69409                    } else {
69410                        $result->addFailure($test, new \PHPUnit\Framework\SkippedTestError('Test skipped because of an error in hook method'), 0);
69411                    }
69412                    $result->endTest($test, 0);
69413                }
69414                $result->endTestSuite($this);
69415                return $result;
69416            }
69417        }
69418        foreach ($this as $test) {
69419            if ($result->shouldStop()) {
69420                break;
69421            }
69422            if ($test instanceof \PHPUnit\Framework\TestCase || $test instanceof self) {
69423                $test->setBeStrictAboutChangesToGlobalState($this->beStrictAboutChangesToGlobalState);
69424                $test->setBackupGlobals($this->backupGlobals);
69425                $test->setBackupStaticAttributes($this->backupStaticAttributes);
69426                $test->setRunTestInSeparateProcess($this->runTestInSeparateProcess);
69427            }
69428            $test->run($result);
69429        }
69430        if ($this->testCase && class_exists($this->name, \false)) {
69431            foreach ($hookMethods['afterClass'] as $afterClassMethod) {
69432                if (method_exists($this->name, $afterClassMethod)) {
69433                    try {
69434                        call_user_func([$this->name, $afterClassMethod]);
69435                    } catch (Throwable $t) {
69436                        $message = "Exception in {$this->name}::{$afterClassMethod}" . \PHP_EOL . $t->getMessage();
69437                        $error = new \PHPUnit\Framework\SyntheticError($message, 0, $t->getFile(), $t->getLine(), $t->getTrace());
69438                        $placeholderTest = clone $test;
69439                        $placeholderTest->setName($afterClassMethod);
69440                        $result->startTest($placeholderTest);
69441                        $result->addFailure($placeholderTest, $error, 0);
69442                        $result->endTest($placeholderTest, 0);
69443                    }
69444                }
69445            }
69446        }
69447        $result->endTestSuite($this);
69448        return $result;
69449    }
69450    public function setRunTestInSeparateProcess(bool $runTestInSeparateProcess) : void
69451    {
69452        $this->runTestInSeparateProcess = $runTestInSeparateProcess;
69453    }
69454    public function setName(string $name) : void
69455    {
69456        $this->name = $name;
69457    }
69458    /**
69459     * Returns the tests as an enumeration.
69460     *
69461     * @return Test[]
69462     */
69463    public function tests() : array
69464    {
69465        return $this->tests;
69466    }
69467    /**
69468     * Set tests of the test suite.
69469     *
69470     * @param Test[] $tests
69471     */
69472    public function setTests(array $tests) : void
69473    {
69474        $this->tests = $tests;
69475    }
69476    /**
69477     * Mark the test suite as skipped.
69478     *
69479     * @param string $message
69480     *
69481     * @throws SkippedTestSuiteError
69482     *
69483     * @psalm-return never-return
69484     */
69485    public function markTestSuiteSkipped($message = '') : void
69486    {
69487        throw new \PHPUnit\Framework\SkippedTestSuiteError($message);
69488    }
69489    /**
69490     * @param bool $beStrictAboutChangesToGlobalState
69491     */
69492    public function setBeStrictAboutChangesToGlobalState($beStrictAboutChangesToGlobalState) : void
69493    {
69494        if (null === $this->beStrictAboutChangesToGlobalState && is_bool($beStrictAboutChangesToGlobalState)) {
69495            $this->beStrictAboutChangesToGlobalState = $beStrictAboutChangesToGlobalState;
69496        }
69497    }
69498    /**
69499     * @param bool $backupGlobals
69500     */
69501    public function setBackupGlobals($backupGlobals) : void
69502    {
69503        if (null === $this->backupGlobals && is_bool($backupGlobals)) {
69504            $this->backupGlobals = $backupGlobals;
69505        }
69506    }
69507    /**
69508     * @param bool $backupStaticAttributes
69509     */
69510    public function setBackupStaticAttributes($backupStaticAttributes) : void
69511    {
69512        if (null === $this->backupStaticAttributes && is_bool($backupStaticAttributes)) {
69513            $this->backupStaticAttributes = $backupStaticAttributes;
69514        }
69515    }
69516    /**
69517     * Returns an iterator for this test suite.
69518     */
69519    public function getIterator() : Iterator
69520    {
69521        $iterator = new \PHPUnit\Framework\TestSuiteIterator($this);
69522        if ($this->iteratorFilter !== null) {
69523            $iterator = $this->iteratorFilter->factory($iterator, $this);
69524        }
69525        return $iterator;
69526    }
69527    public function injectFilter(Factory $filter) : void
69528    {
69529        $this->iteratorFilter = $filter;
69530        foreach ($this as $test) {
69531            if ($test instanceof self) {
69532                $test->injectFilter($filter);
69533            }
69534        }
69535    }
69536    /**
69537     * @psalm-return array<int,string>
69538     */
69539    public function warnings() : array
69540    {
69541        return array_unique($this->warnings);
69542    }
69543    /**
69544     * @return list<ExecutionOrderDependency>
69545     */
69546    public function provides() : array
69547    {
69548        if ($this->providedTests === null) {
69549            $this->providedTests = [];
69550            if (is_callable($this->sortId(), \true)) {
69551                $this->providedTests[] = new \PHPUnit\Framework\ExecutionOrderDependency($this->sortId());
69552            }
69553            foreach ($this->tests as $test) {
69554                if (!$test instanceof \PHPUnit\Framework\Reorderable) {
69555                    // @codeCoverageIgnoreStart
69556                    continue;
69557                    // @codeCoverageIgnoreEnd
69558                }
69559                $this->providedTests = \PHPUnit\Framework\ExecutionOrderDependency::mergeUnique($this->providedTests, $test->provides());
69560            }
69561        }
69562        return $this->providedTests;
69563    }
69564    /**
69565     * @return list<ExecutionOrderDependency>
69566     */
69567    public function requires() : array
69568    {
69569        if ($this->requiredTests === null) {
69570            $this->requiredTests = [];
69571            foreach ($this->tests as $test) {
69572                if (!$test instanceof \PHPUnit\Framework\Reorderable) {
69573                    // @codeCoverageIgnoreStart
69574                    continue;
69575                    // @codeCoverageIgnoreEnd
69576                }
69577                $this->requiredTests = \PHPUnit\Framework\ExecutionOrderDependency::mergeUnique(\PHPUnit\Framework\ExecutionOrderDependency::filterInvalid($this->requiredTests), $test->requires());
69578            }
69579            $this->requiredTests = \PHPUnit\Framework\ExecutionOrderDependency::diff($this->requiredTests, $this->provides());
69580        }
69581        return $this->requiredTests;
69582    }
69583    public function sortId() : string
69584    {
69585        return $this->getName() . '::class';
69586    }
69587    /**
69588     * Creates a default TestResult object.
69589     */
69590    protected function createResult() : \PHPUnit\Framework\TestResult
69591    {
69592        return new \PHPUnit\Framework\TestResult();
69593    }
69594    /**
69595     * @throws Exception
69596     */
69597    protected function addTestMethod(ReflectionClass $class, ReflectionMethod $method) : void
69598    {
69599        $methodName = $method->getName();
69600        $test = (new \PHPUnit\Framework\TestBuilder())->build($class, $methodName);
69601        if ($test instanceof \PHPUnit\Framework\TestCase || $test instanceof \PHPUnit\Framework\DataProviderTestSuite) {
69602            $test->setDependencies(TestUtil::getDependencies($class->getName(), $methodName));
69603        }
69604        $this->addTest($test, TestUtil::getGroups($class->getName(), $methodName));
69605    }
69606    private function clearCaches() : void
69607    {
69608        $this->numTests = -1;
69609        $this->providedTests = null;
69610        $this->requiredTests = null;
69611    }
69612    private function containsOnlyVirtualGroups(array $groups) : bool
69613    {
69614        foreach ($groups as $group) {
69615            if (strpos($group, '__phpunit_') !== 0) {
69616                return \false;
69617            }
69618        }
69619        return \true;
69620    }
69621}
69622<?php
69623
69624declare (strict_types=1);
69625/*
69626 * This file is part of PHPUnit.
69627 *
69628 * (c) Sebastian Bergmann <sebastian@phpunit.de>
69629 *
69630 * For the full copyright and license information, please view the LICENSE
69631 * file that was distributed with this source code.
69632 */
69633namespace PHPUnit\Framework;
69634
69635use function explode;
69636use PHPUnit\Util\Test as TestUtil;
69637/**
69638 * @internal This class is not covered by the backward compatibility promise for PHPUnit
69639 */
69640final class DataProviderTestSuite extends \PHPUnit\Framework\TestSuite
69641{
69642    /**
69643     * @var list<ExecutionOrderDependency>
69644     */
69645    private $dependencies = [];
69646    /**
69647     * @param list<ExecutionOrderDependency> $dependencies
69648     */
69649    public function setDependencies(array $dependencies) : void
69650    {
69651        $this->dependencies = $dependencies;
69652        foreach ($this->tests as $test) {
69653            if (!$test instanceof \PHPUnit\Framework\TestCase) {
69654                // @codeCoverageIgnoreStart
69655                continue;
69656                // @codeCoverageIgnoreStart
69657            }
69658            $test->setDependencies($dependencies);
69659        }
69660    }
69661    /**
69662     * @return list<ExecutionOrderDependency>
69663     */
69664    public function provides() : array
69665    {
69666        if ($this->providedTests === null) {
69667            $this->providedTests = [new \PHPUnit\Framework\ExecutionOrderDependency($this->getName())];
69668        }
69669        return $this->providedTests;
69670    }
69671    /**
69672     * @return list<ExecutionOrderDependency>
69673     */
69674    public function requires() : array
69675    {
69676        // A DataProviderTestSuite does not have to traverse its child tests
69677        // as these are inherited and cannot reference dataProvider rows directly
69678        return $this->dependencies;
69679    }
69680    /**
69681     * Returns the size of the each test created using the data provider(s).
69682     *
69683     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
69684     */
69685    public function getSize() : int
69686    {
69687        [$className, $methodName] = explode('::', $this->getName());
69688        return TestUtil::getSize($className, $methodName);
69689    }
69690}
69691<?php
69692
69693declare (strict_types=1);
69694/*
69695 * This file is part of PHPUnit.
69696 *
69697 * (c) Sebastian Bergmann <sebastian@phpunit.de>
69698 *
69699 * For the full copyright and license information, please view the LICENSE
69700 * file that was distributed with this source code.
69701 */
69702namespace PHPUnit\Framework;
69703
69704use Throwable;
69705/**
69706 * @internal This class is not covered by the backward compatibility promise for PHPUnit
69707 */
69708interface IncompleteTest extends Throwable
69709{
69710}
69711<?php
69712
69713declare (strict_types=1);
69714/*
69715 * This file is part of PHPUnit.
69716 *
69717 * (c) Sebastian Bergmann <sebastian@phpunit.de>
69718 *
69719 * For the full copyright and license information, please view the LICENSE
69720 * file that was distributed with this source code.
69721 */
69722namespace PHPUnit\Framework;
69723
69724use function get_class;
69725use function sprintf;
69726use function trim;
69727use PHPUnit\Framework\Error\Error;
69728use Throwable;
69729/**
69730 * @internal This class is not covered by the backward compatibility promise for PHPUnit
69731 */
69732final class TestFailure
69733{
69734    /**
69735     * @var null|Test
69736     */
69737    private $failedTest;
69738    /**
69739     * @var Throwable
69740     */
69741    private $thrownException;
69742    /**
69743     * @var string
69744     */
69745    private $testName;
69746    /**
69747     * Returns a description for an exception.
69748     */
69749    public static function exceptionToString(Throwable $e) : string
69750    {
69751        if ($e instanceof \PHPUnit\Framework\SelfDescribing) {
69752            $buffer = $e->toString();
69753            if ($e instanceof \PHPUnit\Framework\ExpectationFailedException && $e->getComparisonFailure()) {
69754                $buffer .= $e->getComparisonFailure()->getDiff();
69755            }
69756            if ($e instanceof \PHPUnit\Framework\PHPTAssertionFailedError) {
69757                $buffer .= $e->getDiff();
69758            }
69759            if (!empty($buffer)) {
69760                $buffer = trim($buffer) . "\n";
69761            }
69762            return $buffer;
69763        }
69764        if ($e instanceof Error) {
69765            return $e->getMessage() . "\n";
69766        }
69767        if ($e instanceof \PHPUnit\Framework\ExceptionWrapper) {
69768            return $e->getClassName() . ': ' . $e->getMessage() . "\n";
69769        }
69770        return get_class($e) . ': ' . $e->getMessage() . "\n";
69771    }
69772    /**
69773     * Constructs a TestFailure with the given test and exception.
69774     */
69775    public function __construct(\PHPUnit\Framework\Test $failedTest, Throwable $t)
69776    {
69777        if ($failedTest instanceof \PHPUnit\Framework\SelfDescribing) {
69778            $this->testName = $failedTest->toString();
69779        } else {
69780            $this->testName = get_class($failedTest);
69781        }
69782        if (!$failedTest instanceof \PHPUnit\Framework\TestCase || !$failedTest->isInIsolation()) {
69783            $this->failedTest = $failedTest;
69784        }
69785        $this->thrownException = $t;
69786    }
69787    /**
69788     * Returns a short description of the failure.
69789     */
69790    public function toString() : string
69791    {
69792        return sprintf('%s: %s', $this->testName, $this->thrownException->getMessage());
69793    }
69794    /**
69795     * Returns a description for the thrown exception.
69796     */
69797    public function getExceptionAsString() : string
69798    {
69799        return self::exceptionToString($this->thrownException);
69800    }
69801    /**
69802     * Returns the name of the failing test (including data set, if any).
69803     */
69804    public function getTestName() : string
69805    {
69806        return $this->testName;
69807    }
69808    /**
69809     * Returns the failing test.
69810     *
69811     * Note: The test object is not set when the test is executed in process
69812     * isolation.
69813     *
69814     * @see Exception
69815     */
69816    public function failedTest() : ?\PHPUnit\Framework\Test
69817    {
69818        return $this->failedTest;
69819    }
69820    /**
69821     * Gets the thrown exception.
69822     */
69823    public function thrownException() : Throwable
69824    {
69825        return $this->thrownException;
69826    }
69827    /**
69828     * Returns the exception's message.
69829     */
69830    public function exceptionMessage() : string
69831    {
69832        return $this->thrownException()->getMessage();
69833    }
69834    /**
69835     * Returns true if the thrown exception
69836     * is of type AssertionFailedError.
69837     */
69838    public function isFailure() : bool
69839    {
69840        return $this->thrownException() instanceof \PHPUnit\Framework\AssertionFailedError;
69841    }
69842}
69843<?php
69844
69845declare (strict_types=1);
69846/*
69847 * This file is part of PHPUnit.
69848 *
69849 * (c) Sebastian Bergmann <sebastian@phpunit.de>
69850 *
69851 * For the full copyright and license information, please view the LICENSE
69852 * file that was distributed with this source code.
69853 */
69854namespace PHPUnit\Framework;
69855
69856/**
69857 * @internal This class is not covered by the backward compatibility promise for PHPUnit
69858 */
69859final class SkippedTestCase extends \PHPUnit\Framework\TestCase
69860{
69861    /**
69862     * @var bool
69863     */
69864    protected $backupGlobals = \false;
69865    /**
69866     * @var bool
69867     */
69868    protected $backupStaticAttributes = \false;
69869    /**
69870     * @var bool
69871     */
69872    protected $runTestInSeparateProcess = \false;
69873    /**
69874     * @var string
69875     */
69876    private $message;
69877    public function __construct(string $className, string $methodName, string $message = '')
69878    {
69879        parent::__construct($className . '::' . $methodName);
69880        $this->message = $message;
69881    }
69882    public function getMessage() : string
69883    {
69884        return $this->message;
69885    }
69886    /**
69887     * Returns a string representation of the test case.
69888     *
69889     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
69890     */
69891    public function toString() : string
69892    {
69893        return $this->getName();
69894    }
69895    /**
69896     * @throws Exception
69897     */
69898    protected function runTest() : void
69899    {
69900        $this->markTestSkipped($this->message);
69901    }
69902}
69903<?php
69904
69905declare (strict_types=1);
69906/*
69907 * This file is part of PHPUnit.
69908 *
69909 * (c) Sebastian Bergmann <sebastian@phpunit.de>
69910 *
69911 * For the full copyright and license information, please view the LICENSE
69912 * file that was distributed with this source code.
69913 */
69914namespace PHPUnit\Framework;
69915
69916/**
69917 * @internal This class is not covered by the backward compatibility promise for PHPUnit
69918 */
69919final class PHPTAssertionFailedError extends \PHPUnit\Framework\SyntheticError
69920{
69921    /**
69922     * @var string
69923     */
69924    private $diff;
69925    public function __construct(string $message, int $code, string $file, int $line, array $trace, string $diff)
69926    {
69927        parent::__construct($message, $code, $file, $line, $trace);
69928        $this->diff = $diff;
69929    }
69930    public function getDiff() : string
69931    {
69932        return $this->diff;
69933    }
69934}
69935<?php
69936
69937declare (strict_types=1);
69938/*
69939 * This file is part of PHPUnit.
69940 *
69941 * (c) Sebastian Bergmann <sebastian@phpunit.de>
69942 *
69943 * For the full copyright and license information, please view the LICENSE
69944 * file that was distributed with this source code.
69945 */
69946namespace PHPUnit\Framework;
69947
69948use const PHP_EOL;
69949use function sprintf;
69950/**
69951 * @internal This class is not covered by the backward compatibility promise for PHPUnit
69952 */
69953final class ComparisonMethodDoesNotAcceptParameterTypeException extends \PHPUnit\Framework\Exception
69954{
69955    public function __construct(string $className, string $methodName, string $type)
69956    {
69957        parent::__construct(sprintf('%s is not an accepted argument type for comparison method %s::%s().', $type, $className, $methodName), 0, null);
69958    }
69959    public function __toString() : string
69960    {
69961        return $this->getMessage() . \PHP_EOL;
69962    }
69963}
69964<?php
69965
69966declare (strict_types=1);
69967/*
69968 * This file is part of PHPUnit.
69969 *
69970 * (c) Sebastian Bergmann <sebastian@phpunit.de>
69971 *
69972 * For the full copyright and license information, please view the LICENSE
69973 * file that was distributed with this source code.
69974 */
69975namespace PHPUnit\Framework;
69976
69977/**
69978 * @internal This class is not covered by the backward compatibility promise for PHPUnit
69979 */
69980final class SyntheticSkippedError extends \PHPUnit\Framework\SyntheticError implements \PHPUnit\Framework\SkippedTest
69981{
69982}
69983<?php
69984
69985declare (strict_types=1);
69986/*
69987 * This file is part of PHPUnit.
69988 *
69989 * (c) Sebastian Bergmann <sebastian@phpunit.de>
69990 *
69991 * For the full copyright and license information, please view the LICENSE
69992 * file that was distributed with this source code.
69993 */
69994namespace PHPUnit\Framework;
69995
69996use const PHP_EOL;
69997use function sprintf;
69998/**
69999 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70000 */
70001final class ComparisonMethodDoesNotExistException extends \PHPUnit\Framework\Exception
70002{
70003    public function __construct(string $className, string $methodName)
70004    {
70005        parent::__construct(sprintf('Comparison method %s::%s() does not exist.', $className, $methodName), 0, null);
70006    }
70007    public function __toString() : string
70008    {
70009        return $this->getMessage() . \PHP_EOL;
70010    }
70011}
70012<?php
70013
70014declare (strict_types=1);
70015/*
70016 * This file is part of PHPUnit.
70017 *
70018 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70019 *
70020 * For the full copyright and license information, please view the LICENSE
70021 * file that was distributed with this source code.
70022 */
70023namespace PHPUnit\Framework;
70024
70025/**
70026 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70027 */
70028final class OutputError extends \PHPUnit\Framework\AssertionFailedError
70029{
70030}
70031<?php
70032
70033declare (strict_types=1);
70034/*
70035 * This file is part of PHPUnit.
70036 *
70037 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70038 *
70039 * For the full copyright and license information, please view the LICENSE
70040 * file that was distributed with this source code.
70041 */
70042namespace PHPUnit\Framework;
70043
70044/**
70045 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70046 */
70047final class IncompleteTestError extends \PHPUnit\Framework\AssertionFailedError implements \PHPUnit\Framework\IncompleteTest
70048{
70049}
70050<?php
70051
70052declare (strict_types=1);
70053/*
70054 * This file is part of PHPUnit.
70055 *
70056 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70057 *
70058 * For the full copyright and license information, please view the LICENSE
70059 * file that was distributed with this source code.
70060 */
70061namespace PHPUnit\Framework;
70062
70063/**
70064 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70065 */
70066class CodeCoverageException extends \PHPUnit\Framework\Exception
70067{
70068}
70069<?php
70070
70071declare (strict_types=1);
70072/*
70073 * This file is part of PHPUnit.
70074 *
70075 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70076 *
70077 * For the full copyright and license information, please view the LICENSE
70078 * file that was distributed with this source code.
70079 */
70080namespace PHPUnit\Framework;
70081
70082/**
70083 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70084 */
70085class RiskyTestError extends \PHPUnit\Framework\AssertionFailedError
70086{
70087}
70088<?php
70089
70090declare (strict_types=1);
70091/*
70092 * This file is part of PHPUnit.
70093 *
70094 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70095 *
70096 * For the full copyright and license information, please view the LICENSE
70097 * file that was distributed with this source code.
70098 */
70099namespace PHPUnit\Framework;
70100
70101/**
70102 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70103 */
70104final class Error extends \PHPUnit\Framework\Exception implements \PHPUnit\Framework\SelfDescribing
70105{
70106    /**
70107     * Wrapper for getMessage() which is declared as final.
70108     */
70109    public function toString() : string
70110    {
70111        return $this->getMessage();
70112    }
70113}
70114<?php
70115
70116declare (strict_types=1);
70117/*
70118 * This file is part of PHPUnit.
70119 *
70120 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70121 *
70122 * For the full copyright and license information, please view the LICENSE
70123 * file that was distributed with this source code.
70124 */
70125namespace PHPUnit\Framework;
70126
70127/**
70128 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70129 */
70130final class SkippedTestError extends \PHPUnit\Framework\AssertionFailedError implements \PHPUnit\Framework\SkippedTest
70131{
70132}
70133<?php
70134
70135declare (strict_types=1);
70136/*
70137 * This file is part of PHPUnit.
70138 *
70139 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70140 *
70141 * For the full copyright and license information, please view the LICENSE
70142 * file that was distributed with this source code.
70143 */
70144namespace PHPUnit\Framework;
70145
70146/**
70147 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70148 */
70149final class CoveredCodeNotExecutedException extends \PHPUnit\Framework\RiskyTestError
70150{
70151}
70152<?php
70153
70154declare (strict_types=1);
70155/*
70156 * This file is part of PHPUnit.
70157 *
70158 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70159 *
70160 * For the full copyright and license information, please view the LICENSE
70161 * file that was distributed with this source code.
70162 */
70163namespace PHPUnit\Framework;
70164
70165/**
70166 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70167 */
70168final class NoChildTestSuiteException extends \PHPUnit\Framework\Exception
70169{
70170}
70171<?php
70172
70173declare (strict_types=1);
70174/*
70175 * This file is part of PHPUnit.
70176 *
70177 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70178 *
70179 * For the full copyright and license information, please view the LICENSE
70180 * file that was distributed with this source code.
70181 */
70182namespace PHPUnit\Framework;
70183
70184/**
70185 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70186 */
70187final class Warning extends \PHPUnit\Framework\Exception implements \PHPUnit\Framework\SelfDescribing
70188{
70189    /**
70190     * Wrapper for getMessage() which is declared as final.
70191     */
70192    public function toString() : string
70193    {
70194        return $this->getMessage();
70195    }
70196}
70197<?php
70198
70199declare (strict_types=1);
70200/*
70201 * This file is part of PHPUnit.
70202 *
70203 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70204 *
70205 * For the full copyright and license information, please view the LICENSE
70206 * file that was distributed with this source code.
70207 */
70208namespace PHPUnit\Framework;
70209
70210use const PHP_EOL;
70211use function sprintf;
70212/**
70213 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70214 */
70215final class ComparisonMethodDoesNotDeclareExactlyOneParameterException extends \PHPUnit\Framework\Exception
70216{
70217    public function __construct(string $className, string $methodName)
70218    {
70219        parent::__construct(sprintf('Comparison method %s::%s() does not declare exactly one parameter.', $className, $methodName), 0, null);
70220    }
70221    public function __toString() : string
70222    {
70223        return $this->getMessage() . \PHP_EOL;
70224    }
70225}
70226<?php
70227
70228declare (strict_types=1);
70229/*
70230 * This file is part of PHPUnit.
70231 *
70232 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70233 *
70234 * For the full copyright and license information, please view the LICENSE
70235 * file that was distributed with this source code.
70236 */
70237namespace PHPUnit\Framework;
70238
70239use Exception;
70240use PHPUnit\SebastianBergmann\Comparator\ComparisonFailure;
70241/**
70242 * Exception for expectations which failed their check.
70243 *
70244 * The exception contains the error message and optionally a
70245 * SebastianBergmann\Comparator\ComparisonFailure which is used to
70246 * generate diff output of the failed expectations.
70247 *
70248 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70249 */
70250final class ExpectationFailedException extends \PHPUnit\Framework\AssertionFailedError
70251{
70252    /**
70253     * @var ComparisonFailure
70254     */
70255    protected $comparisonFailure;
70256    public function __construct(string $message, ComparisonFailure $comparisonFailure = null, Exception $previous = null)
70257    {
70258        $this->comparisonFailure = $comparisonFailure;
70259        parent::__construct($message, 0, $previous);
70260    }
70261    public function getComparisonFailure() : ?ComparisonFailure
70262    {
70263        return $this->comparisonFailure;
70264    }
70265}
70266<?php
70267
70268declare (strict_types=1);
70269/*
70270 * This file is part of PHPUnit.
70271 *
70272 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70273 *
70274 * For the full copyright and license information, please view the LICENSE
70275 * file that was distributed with this source code.
70276 */
70277namespace PHPUnit\Framework;
70278
70279/**
70280 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70281 */
70282final class SkippedTestSuiteError extends \PHPUnit\Framework\AssertionFailedError implements \PHPUnit\Framework\SkippedTest
70283{
70284}
70285<?php
70286
70287declare (strict_types=1);
70288/*
70289 * This file is part of PHPUnit.
70290 *
70291 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70292 *
70293 * For the full copyright and license information, please view the LICENSE
70294 * file that was distributed with this source code.
70295 */
70296namespace PHPUnit\Framework;
70297
70298/**
70299 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70300 */
70301final class MissingCoversAnnotationException extends \PHPUnit\Framework\RiskyTestError
70302{
70303}
70304<?php
70305
70306declare (strict_types=1);
70307/*
70308 * This file is part of PHPUnit.
70309 *
70310 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70311 *
70312 * For the full copyright and license information, please view the LICENSE
70313 * file that was distributed with this source code.
70314 */
70315namespace PHPUnit\Framework;
70316
70317use const PHP_EOL;
70318/**
70319 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70320 */
70321final class ActualValueIsNotAnObjectException extends \PHPUnit\Framework\Exception
70322{
70323    public function __construct()
70324    {
70325        parent::__construct('Actual value is not an object', 0, null);
70326    }
70327    public function __toString() : string
70328    {
70329        return $this->getMessage() . \PHP_EOL;
70330    }
70331}
70332<?php
70333
70334declare (strict_types=1);
70335/*
70336 * This file is part of PHPUnit.
70337 *
70338 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70339 *
70340 * For the full copyright and license information, please view the LICENSE
70341 * file that was distributed with this source code.
70342 */
70343namespace PHPUnit\Framework;
70344
70345/**
70346 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70347 */
70348class SyntheticError extends \PHPUnit\Framework\AssertionFailedError
70349{
70350    /**
70351     * The synthetic file.
70352     *
70353     * @var string
70354     */
70355    protected $syntheticFile = '';
70356    /**
70357     * The synthetic line number.
70358     *
70359     * @var int
70360     */
70361    protected $syntheticLine = 0;
70362    /**
70363     * The synthetic trace.
70364     *
70365     * @var array
70366     */
70367    protected $syntheticTrace = [];
70368    public function __construct(string $message, int $code, string $file, int $line, array $trace)
70369    {
70370        parent::__construct($message, $code);
70371        $this->syntheticFile = $file;
70372        $this->syntheticLine = $line;
70373        $this->syntheticTrace = $trace;
70374    }
70375    public function getSyntheticFile() : string
70376    {
70377        return $this->syntheticFile;
70378    }
70379    public function getSyntheticLine() : int
70380    {
70381        return $this->syntheticLine;
70382    }
70383    public function getSyntheticTrace() : array
70384    {
70385        return $this->syntheticTrace;
70386    }
70387}
70388<?php
70389
70390declare (strict_types=1);
70391/*
70392 * This file is part of PHPUnit.
70393 *
70394 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70395 *
70396 * For the full copyright and license information, please view the LICENSE
70397 * file that was distributed with this source code.
70398 */
70399namespace PHPUnit\Framework;
70400
70401/**
70402 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70403 */
70404final class UnintentionallyCoveredCodeError extends \PHPUnit\Framework\RiskyTestError
70405{
70406}
70407<?php
70408
70409declare (strict_types=1);
70410/*
70411 * This file is part of PHPUnit.
70412 *
70413 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70414 *
70415 * For the full copyright and license information, please view the LICENSE
70416 * file that was distributed with this source code.
70417 */
70418namespace PHPUnit\Framework;
70419
70420/**
70421 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70422 */
70423final class InvalidDataProviderException extends \PHPUnit\Framework\Exception
70424{
70425}
70426<?php
70427
70428declare (strict_types=1);
70429/*
70430 * This file is part of PHPUnit.
70431 *
70432 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70433 *
70434 * For the full copyright and license information, please view the LICENSE
70435 * file that was distributed with this source code.
70436 */
70437namespace PHPUnit\Framework;
70438
70439use function array_keys;
70440use function get_object_vars;
70441use PHPUnit\Util\Filter;
70442use RuntimeException;
70443use Throwable;
70444/**
70445 * Base class for all PHPUnit Framework exceptions.
70446 *
70447 * Ensures that exceptions thrown during a test run do not leave stray
70448 * references behind.
70449 *
70450 * Every Exception contains a stack trace. Each stack frame contains the 'args'
70451 * of the called function. The function arguments can contain references to
70452 * instantiated objects. The references prevent the objects from being
70453 * destructed (until test results are eventually printed), so memory cannot be
70454 * freed up.
70455 *
70456 * With enabled process isolation, test results are serialized in the child
70457 * process and unserialized in the parent process. The stack trace of Exceptions
70458 * may contain objects that cannot be serialized or unserialized (e.g., PDO
70459 * connections). Unserializing user-space objects from the child process into
70460 * the parent would break the intended encapsulation of process isolation.
70461 *
70462 * @see http://fabien.potencier.org/article/9/php-serialization-stack-traces-and-exceptions
70463 *
70464 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70465 */
70466class Exception extends RuntimeException implements \PHPUnit\Exception
70467{
70468    /**
70469     * @var array
70470     */
70471    protected $serializableTrace;
70472    public function __construct($message = '', $code = 0, Throwable $previous = null)
70473    {
70474        parent::__construct($message, $code, $previous);
70475        $this->serializableTrace = $this->getTrace();
70476        foreach (array_keys($this->serializableTrace) as $key) {
70477            unset($this->serializableTrace[$key]['args']);
70478        }
70479    }
70480    public function __toString() : string
70481    {
70482        $string = \PHPUnit\Framework\TestFailure::exceptionToString($this);
70483        if ($trace = Filter::getFilteredStacktrace($this)) {
70484            $string .= "\n" . $trace;
70485        }
70486        return $string;
70487    }
70488    public function __sleep() : array
70489    {
70490        return array_keys(get_object_vars($this));
70491    }
70492    /**
70493     * Returns the serializable trace (without 'args').
70494     */
70495    public function getSerializableTrace() : array
70496    {
70497        return $this->serializableTrace;
70498    }
70499}
70500<?php
70501
70502declare (strict_types=1);
70503/*
70504 * This file is part of PHPUnit.
70505 *
70506 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70507 *
70508 * For the full copyright and license information, please view the LICENSE
70509 * file that was distributed with this source code.
70510 */
70511namespace PHPUnit\Framework;
70512
70513/**
70514 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70515 */
70516class AssertionFailedError extends \PHPUnit\Framework\Exception implements \PHPUnit\Framework\SelfDescribing
70517{
70518    /**
70519     * Wrapper for getMessage() which is declared as final.
70520     */
70521    public function toString() : string
70522    {
70523        return $this->getMessage();
70524    }
70525}
70526<?php
70527
70528declare (strict_types=1);
70529/*
70530 * This file is part of PHPUnit.
70531 *
70532 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70533 *
70534 * For the full copyright and license information, please view the LICENSE
70535 * file that was distributed with this source code.
70536 */
70537namespace PHPUnit\Framework;
70538
70539use const PHP_EOL;
70540use function sprintf;
70541/**
70542 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70543 */
70544final class ComparisonMethodDoesNotDeclareBoolReturnTypeException extends \PHPUnit\Framework\Exception
70545{
70546    public function __construct(string $className, string $methodName)
70547    {
70548        parent::__construct(sprintf('Comparison method %s::%s() does not declare bool return type.', $className, $methodName), 0, null);
70549    }
70550    public function __toString() : string
70551    {
70552        return $this->getMessage() . \PHP_EOL;
70553    }
70554}
70555<?php
70556
70557declare (strict_types=1);
70558/*
70559 * This file is part of PHPUnit.
70560 *
70561 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70562 *
70563 * For the full copyright and license information, please view the LICENSE
70564 * file that was distributed with this source code.
70565 */
70566namespace PHPUnit\Framework;
70567
70568/**
70569 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70570 */
70571final class InvalidCoversTargetException extends \PHPUnit\Framework\CodeCoverageException
70572{
70573}
70574<?php
70575
70576declare (strict_types=1);
70577/*
70578 * This file is part of PHPUnit.
70579 *
70580 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70581 *
70582 * For the full copyright and license information, please view the LICENSE
70583 * file that was distributed with this source code.
70584 */
70585namespace PHPUnit\Framework;
70586
70587use const PHP_EOL;
70588use function sprintf;
70589/**
70590 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70591 */
70592final class ComparisonMethodDoesNotDeclareParameterTypeException extends \PHPUnit\Framework\Exception
70593{
70594    public function __construct(string $className, string $methodName)
70595    {
70596        parent::__construct(sprintf('Parameter of comparison method %s::%s() does not have a declared type.', $className, $methodName), 0, null);
70597    }
70598    public function __toString() : string
70599    {
70600        return $this->getMessage() . \PHP_EOL;
70601    }
70602}
70603<?php
70604
70605declare (strict_types=1);
70606/*
70607 * This file is part of PHPUnit.
70608 *
70609 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70610 *
70611 * For the full copyright and license information, please view the LICENSE
70612 * file that was distributed with this source code.
70613 */
70614namespace PHPUnit\Framework;
70615
70616use function debug_backtrace;
70617use function in_array;
70618use function lcfirst;
70619use function sprintf;
70620/**
70621 * @internal This class is not covered by the backward compatibility promise for PHPUnit
70622 */
70623final class InvalidArgumentException extends \PHPUnit\Framework\Exception
70624{
70625    public static function create(int $argument, string $type) : self
70626    {
70627        $stack = debug_backtrace();
70628        return new self(sprintf('Argument #%d of %s::%s() must be %s %s', $argument, $stack[1]['class'], $stack[1]['function'], in_array(lcfirst($type)[0], ['a', 'e', 'i', 'o', 'u'], \true) ? 'an' : 'a', $type));
70629    }
70630    private function __construct(string $message = '', int $code = 0, \Exception $previous = null)
70631    {
70632        parent::__construct($message, $code, $previous);
70633    }
70634}
70635<?php
70636
70637declare (strict_types=1);
70638/*
70639 * This file is part of PHPUnit.
70640 *
70641 * (c) Sebastian Bergmann <sebastian@phpunit.de>
70642 *
70643 * For the full copyright and license information, please view the LICENSE
70644 * file that was distributed with this source code.
70645 */
70646namespace PHPUnit\Framework;
70647
70648use function func_get_args;
70649use ArrayAccess;
70650use Countable;
70651use DOMDocument;
70652use DOMElement;
70653use PHPUnit\Framework\Constraint\ArrayHasKey;
70654use PHPUnit\Framework\Constraint\Callback;
70655use PHPUnit\Framework\Constraint\ClassHasAttribute;
70656use PHPUnit\Framework\Constraint\ClassHasStaticAttribute;
70657use PHPUnit\Framework\Constraint\Constraint;
70658use PHPUnit\Framework\Constraint\Count;
70659use PHPUnit\Framework\Constraint\DirectoryExists;
70660use PHPUnit\Framework\Constraint\FileExists;
70661use PHPUnit\Framework\Constraint\GreaterThan;
70662use PHPUnit\Framework\Constraint\IsAnything;
70663use PHPUnit\Framework\Constraint\IsEmpty;
70664use PHPUnit\Framework\Constraint\IsEqual;
70665use PHPUnit\Framework\Constraint\IsEqualCanonicalizing;
70666use PHPUnit\Framework\Constraint\IsEqualIgnoringCase;
70667use PHPUnit\Framework\Constraint\IsEqualWithDelta;
70668use PHPUnit\Framework\Constraint\IsFalse;
70669use PHPUnit\Framework\Constraint\IsFinite;
70670use PHPUnit\Framework\Constraint\IsIdentical;
70671use PHPUnit\Framework\Constraint\IsInfinite;
70672use PHPUnit\Framework\Constraint\IsInstanceOf;
70673use PHPUnit\Framework\Constraint\IsJson;
70674use PHPUnit\Framework\Constraint\IsNan;
70675use PHPUnit\Framework\Constraint\IsNull;
70676use PHPUnit\Framework\Constraint\IsReadable;
70677use PHPUnit\Framework\Constraint\IsTrue;
70678use PHPUnit\Framework\Constraint\IsType;
70679use PHPUnit\Framework\Constraint\IsWritable;
70680use PHPUnit\Framework\Constraint\LessThan;
70681use PHPUnit\Framework\Constraint\LogicalAnd;
70682use PHPUnit\Framework\Constraint\LogicalNot;
70683use PHPUnit\Framework\Constraint\LogicalOr;
70684use PHPUnit\Framework\Constraint\LogicalXor;
70685use PHPUnit\Framework\Constraint\ObjectEquals;
70686use PHPUnit\Framework\Constraint\ObjectHasAttribute;
70687use PHPUnit\Framework\Constraint\RegularExpression;
70688use PHPUnit\Framework\Constraint\StringContains;
70689use PHPUnit\Framework\Constraint\StringEndsWith;
70690use PHPUnit\Framework\Constraint\StringMatchesFormatDescription;
70691use PHPUnit\Framework\Constraint\StringStartsWith;
70692use PHPUnit\Framework\Constraint\TraversableContainsEqual;
70693use PHPUnit\Framework\Constraint\TraversableContainsIdentical;
70694use PHPUnit\Framework\Constraint\TraversableContainsOnly;
70695use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount as AnyInvokedCountMatcher;
70696use PHPUnit\Framework\MockObject\Rule\InvokedAtIndex as InvokedAtIndexMatcher;
70697use PHPUnit\Framework\MockObject\Rule\InvokedAtLeastCount as InvokedAtLeastCountMatcher;
70698use PHPUnit\Framework\MockObject\Rule\InvokedAtLeastOnce as InvokedAtLeastOnceMatcher;
70699use PHPUnit\Framework\MockObject\Rule\InvokedAtMostCount as InvokedAtMostCountMatcher;
70700use PHPUnit\Framework\MockObject\Rule\InvokedCount as InvokedCountMatcher;
70701use PHPUnit\Framework\MockObject\Stub\ConsecutiveCalls as ConsecutiveCallsStub;
70702use PHPUnit\Framework\MockObject\Stub\Exception as ExceptionStub;
70703use PHPUnit\Framework\MockObject\Stub\ReturnArgument as ReturnArgumentStub;
70704use PHPUnit\Framework\MockObject\Stub\ReturnCallback as ReturnCallbackStub;
70705use PHPUnit\Framework\MockObject\Stub\ReturnSelf as ReturnSelfStub;
70706use PHPUnit\Framework\MockObject\Stub\ReturnStub;
70707use PHPUnit\Framework\MockObject\Stub\ReturnValueMap as ReturnValueMapStub;
70708use Throwable;
70709if (!\function_exists('PHPUnit\\Framework\\assertArrayHasKey')) {
70710    /**
70711     * Asserts that an array has a specified key.
70712     *
70713     * @param int|string        $key
70714     * @param array|ArrayAccess $array
70715     *
70716     * @throws ExpectationFailedException
70717     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
70718     * @throws Exception
70719     *
70720     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
70721     *
70722     * @see Assert::assertArrayHasKey
70723     */
70724    function assertArrayHasKey($key, $array, string $message = '') : void
70725    {
70726        \PHPUnit\Framework\Assert::assertArrayHasKey(...func_get_args());
70727    }
70728}
70729if (!\function_exists('PHPUnit\\Framework\\assertArrayNotHasKey')) {
70730    /**
70731     * Asserts that an array does not have a specified key.
70732     *
70733     * @param int|string        $key
70734     * @param array|ArrayAccess $array
70735     *
70736     * @throws ExpectationFailedException
70737     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
70738     * @throws Exception
70739     *
70740     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
70741     *
70742     * @see Assert::assertArrayNotHasKey
70743     */
70744    function assertArrayNotHasKey($key, $array, string $message = '') : void
70745    {
70746        \PHPUnit\Framework\Assert::assertArrayNotHasKey(...func_get_args());
70747    }
70748}
70749if (!\function_exists('PHPUnit\\Framework\\assertContains')) {
70750    /**
70751     * Asserts that a haystack contains a needle.
70752     *
70753     * @throws ExpectationFailedException
70754     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
70755     * @throws Exception
70756     *
70757     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
70758     *
70759     * @see Assert::assertContains
70760     */
70761    function assertContains($needle, iterable $haystack, string $message = '') : void
70762    {
70763        \PHPUnit\Framework\Assert::assertContains(...func_get_args());
70764    }
70765}
70766if (!\function_exists('PHPUnit\\Framework\\assertContainsEquals')) {
70767    function assertContainsEquals($needle, iterable $haystack, string $message = '') : void
70768    {
70769        \PHPUnit\Framework\Assert::assertContainsEquals(...func_get_args());
70770    }
70771}
70772if (!\function_exists('PHPUnit\\Framework\\assertNotContains')) {
70773    /**
70774     * Asserts that a haystack does not contain a needle.
70775     *
70776     * @throws ExpectationFailedException
70777     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
70778     * @throws Exception
70779     *
70780     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
70781     *
70782     * @see Assert::assertNotContains
70783     */
70784    function assertNotContains($needle, iterable $haystack, string $message = '') : void
70785    {
70786        \PHPUnit\Framework\Assert::assertNotContains(...func_get_args());
70787    }
70788}
70789if (!\function_exists('PHPUnit\\Framework\\assertNotContainsEquals')) {
70790    function assertNotContainsEquals($needle, iterable $haystack, string $message = '') : void
70791    {
70792        \PHPUnit\Framework\Assert::assertNotContainsEquals(...func_get_args());
70793    }
70794}
70795if (!\function_exists('PHPUnit\\Framework\\assertContainsOnly')) {
70796    /**
70797     * Asserts that a haystack contains only values of a given type.
70798     *
70799     * @throws ExpectationFailedException
70800     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
70801     *
70802     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
70803     *
70804     * @see Assert::assertContainsOnly
70805     */
70806    function assertContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = null, string $message = '') : void
70807    {
70808        \PHPUnit\Framework\Assert::assertContainsOnly(...func_get_args());
70809    }
70810}
70811if (!\function_exists('PHPUnit\\Framework\\assertContainsOnlyInstancesOf')) {
70812    /**
70813     * Asserts that a haystack contains only instances of a given class name.
70814     *
70815     * @throws ExpectationFailedException
70816     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
70817     *
70818     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
70819     *
70820     * @see Assert::assertContainsOnlyInstancesOf
70821     */
70822    function assertContainsOnlyInstancesOf(string $className, iterable $haystack, string $message = '') : void
70823    {
70824        \PHPUnit\Framework\Assert::assertContainsOnlyInstancesOf(...func_get_args());
70825    }
70826}
70827if (!\function_exists('PHPUnit\\Framework\\assertNotContainsOnly')) {
70828    /**
70829     * Asserts that a haystack does not contain only values of a given type.
70830     *
70831     * @throws ExpectationFailedException
70832     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
70833     *
70834     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
70835     *
70836     * @see Assert::assertNotContainsOnly
70837     */
70838    function assertNotContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = null, string $message = '') : void
70839    {
70840        \PHPUnit\Framework\Assert::assertNotContainsOnly(...func_get_args());
70841    }
70842}
70843if (!\function_exists('PHPUnit\\Framework\\assertCount')) {
70844    /**
70845     * Asserts the number of elements of an array, Countable or Traversable.
70846     *
70847     * @param Countable|iterable $haystack
70848     *
70849     * @throws ExpectationFailedException
70850     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
70851     * @throws Exception
70852     *
70853     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
70854     *
70855     * @see Assert::assertCount
70856     */
70857    function assertCount(int $expectedCount, $haystack, string $message = '') : void
70858    {
70859        \PHPUnit\Framework\Assert::assertCount(...func_get_args());
70860    }
70861}
70862if (!\function_exists('PHPUnit\\Framework\\assertNotCount')) {
70863    /**
70864     * Asserts the number of elements of an array, Countable or Traversable.
70865     *
70866     * @param Countable|iterable $haystack
70867     *
70868     * @throws ExpectationFailedException
70869     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
70870     * @throws Exception
70871     *
70872     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
70873     *
70874     * @see Assert::assertNotCount
70875     */
70876    function assertNotCount(int $expectedCount, $haystack, string $message = '') : void
70877    {
70878        \PHPUnit\Framework\Assert::assertNotCount(...func_get_args());
70879    }
70880}
70881if (!\function_exists('PHPUnit\\Framework\\assertEquals')) {
70882    /**
70883     * Asserts that two variables are equal.
70884     *
70885     * @throws ExpectationFailedException
70886     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
70887     *
70888     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
70889     *
70890     * @see Assert::assertEquals
70891     */
70892    function assertEquals($expected, $actual, string $message = '') : void
70893    {
70894        \PHPUnit\Framework\Assert::assertEquals(...func_get_args());
70895    }
70896}
70897if (!\function_exists('PHPUnit\\Framework\\assertEqualsCanonicalizing')) {
70898    /**
70899     * Asserts that two variables are equal (canonicalizing).
70900     *
70901     * @throws ExpectationFailedException
70902     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
70903     *
70904     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
70905     *
70906     * @see Assert::assertEqualsCanonicalizing
70907     */
70908    function assertEqualsCanonicalizing($expected, $actual, string $message = '') : void
70909    {
70910        \PHPUnit\Framework\Assert::assertEqualsCanonicalizing(...func_get_args());
70911    }
70912}
70913if (!\function_exists('PHPUnit\\Framework\\assertEqualsIgnoringCase')) {
70914    /**
70915     * Asserts that two variables are equal (ignoring case).
70916     *
70917     * @throws ExpectationFailedException
70918     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
70919     *
70920     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
70921     *
70922     * @see Assert::assertEqualsIgnoringCase
70923     */
70924    function assertEqualsIgnoringCase($expected, $actual, string $message = '') : void
70925    {
70926        \PHPUnit\Framework\Assert::assertEqualsIgnoringCase(...func_get_args());
70927    }
70928}
70929if (!\function_exists('PHPUnit\\Framework\\assertEqualsWithDelta')) {
70930    /**
70931     * Asserts that two variables are equal (with delta).
70932     *
70933     * @throws ExpectationFailedException
70934     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
70935     *
70936     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
70937     *
70938     * @see Assert::assertEqualsWithDelta
70939     */
70940    function assertEqualsWithDelta($expected, $actual, float $delta, string $message = '') : void
70941    {
70942        \PHPUnit\Framework\Assert::assertEqualsWithDelta(...func_get_args());
70943    }
70944}
70945if (!\function_exists('PHPUnit\\Framework\\assertNotEquals')) {
70946    /**
70947     * Asserts that two variables are not equal.
70948     *
70949     * @throws ExpectationFailedException
70950     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
70951     *
70952     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
70953     *
70954     * @see Assert::assertNotEquals
70955     */
70956    function assertNotEquals($expected, $actual, string $message = '') : void
70957    {
70958        \PHPUnit\Framework\Assert::assertNotEquals(...func_get_args());
70959    }
70960}
70961if (!\function_exists('PHPUnit\\Framework\\assertNotEqualsCanonicalizing')) {
70962    /**
70963     * Asserts that two variables are not equal (canonicalizing).
70964     *
70965     * @throws ExpectationFailedException
70966     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
70967     *
70968     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
70969     *
70970     * @see Assert::assertNotEqualsCanonicalizing
70971     */
70972    function assertNotEqualsCanonicalizing($expected, $actual, string $message = '') : void
70973    {
70974        \PHPUnit\Framework\Assert::assertNotEqualsCanonicalizing(...func_get_args());
70975    }
70976}
70977if (!\function_exists('PHPUnit\\Framework\\assertNotEqualsIgnoringCase')) {
70978    /**
70979     * Asserts that two variables are not equal (ignoring case).
70980     *
70981     * @throws ExpectationFailedException
70982     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
70983     *
70984     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
70985     *
70986     * @see Assert::assertNotEqualsIgnoringCase
70987     */
70988    function assertNotEqualsIgnoringCase($expected, $actual, string $message = '') : void
70989    {
70990        \PHPUnit\Framework\Assert::assertNotEqualsIgnoringCase(...func_get_args());
70991    }
70992}
70993if (!\function_exists('PHPUnit\\Framework\\assertNotEqualsWithDelta')) {
70994    /**
70995     * Asserts that two variables are not equal (with delta).
70996     *
70997     * @throws ExpectationFailedException
70998     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
70999     *
71000     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71001     *
71002     * @see Assert::assertNotEqualsWithDelta
71003     */
71004    function assertNotEqualsWithDelta($expected, $actual, float $delta, string $message = '') : void
71005    {
71006        \PHPUnit\Framework\Assert::assertNotEqualsWithDelta(...func_get_args());
71007    }
71008}
71009if (!\function_exists('PHPUnit\\Framework\\assertObjectEquals')) {
71010    /**
71011     * @throws ExpectationFailedException
71012     *
71013     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71014     *
71015     * @see Assert::assertObjectEquals
71016     */
71017    function assertObjectEquals(object $expected, object $actual, string $method = 'equals', string $message = '') : void
71018    {
71019        \PHPUnit\Framework\Assert::assertObjectEquals(...func_get_args());
71020    }
71021}
71022if (!\function_exists('PHPUnit\\Framework\\assertEmpty')) {
71023    /**
71024     * Asserts that a variable is empty.
71025     *
71026     * @throws ExpectationFailedException
71027     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71028     *
71029     * @psalm-assert empty $actual
71030     *
71031     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71032     *
71033     * @see Assert::assertEmpty
71034     */
71035    function assertEmpty($actual, string $message = '') : void
71036    {
71037        \PHPUnit\Framework\Assert::assertEmpty(...func_get_args());
71038    }
71039}
71040if (!\function_exists('PHPUnit\\Framework\\assertNotEmpty')) {
71041    /**
71042     * Asserts that a variable is not empty.
71043     *
71044     * @throws ExpectationFailedException
71045     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71046     *
71047     * @psalm-assert !empty $actual
71048     *
71049     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71050     *
71051     * @see Assert::assertNotEmpty
71052     */
71053    function assertNotEmpty($actual, string $message = '') : void
71054    {
71055        \PHPUnit\Framework\Assert::assertNotEmpty(...func_get_args());
71056    }
71057}
71058if (!\function_exists('PHPUnit\\Framework\\assertGreaterThan')) {
71059    /**
71060     * Asserts that a value is greater than another value.
71061     *
71062     * @throws ExpectationFailedException
71063     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71064     *
71065     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71066     *
71067     * @see Assert::assertGreaterThan
71068     */
71069    function assertGreaterThan($expected, $actual, string $message = '') : void
71070    {
71071        \PHPUnit\Framework\Assert::assertGreaterThan(...func_get_args());
71072    }
71073}
71074if (!\function_exists('PHPUnit\\Framework\\assertGreaterThanOrEqual')) {
71075    /**
71076     * Asserts that a value is greater than or equal to another value.
71077     *
71078     * @throws ExpectationFailedException
71079     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71080     *
71081     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71082     *
71083     * @see Assert::assertGreaterThanOrEqual
71084     */
71085    function assertGreaterThanOrEqual($expected, $actual, string $message = '') : void
71086    {
71087        \PHPUnit\Framework\Assert::assertGreaterThanOrEqual(...func_get_args());
71088    }
71089}
71090if (!\function_exists('PHPUnit\\Framework\\assertLessThan')) {
71091    /**
71092     * Asserts that a value is smaller than another value.
71093     *
71094     * @throws ExpectationFailedException
71095     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71096     *
71097     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71098     *
71099     * @see Assert::assertLessThan
71100     */
71101    function assertLessThan($expected, $actual, string $message = '') : void
71102    {
71103        \PHPUnit\Framework\Assert::assertLessThan(...func_get_args());
71104    }
71105}
71106if (!\function_exists('PHPUnit\\Framework\\assertLessThanOrEqual')) {
71107    /**
71108     * Asserts that a value is smaller than or equal to another value.
71109     *
71110     * @throws ExpectationFailedException
71111     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71112     *
71113     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71114     *
71115     * @see Assert::assertLessThanOrEqual
71116     */
71117    function assertLessThanOrEqual($expected, $actual, string $message = '') : void
71118    {
71119        \PHPUnit\Framework\Assert::assertLessThanOrEqual(...func_get_args());
71120    }
71121}
71122if (!\function_exists('PHPUnit\\Framework\\assertFileEquals')) {
71123    /**
71124     * Asserts that the contents of one file is equal to the contents of another
71125     * file.
71126     *
71127     * @throws ExpectationFailedException
71128     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71129     *
71130     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71131     *
71132     * @see Assert::assertFileEquals
71133     */
71134    function assertFileEquals(string $expected, string $actual, string $message = '') : void
71135    {
71136        \PHPUnit\Framework\Assert::assertFileEquals(...func_get_args());
71137    }
71138}
71139if (!\function_exists('PHPUnit\\Framework\\assertFileEqualsCanonicalizing')) {
71140    /**
71141     * Asserts that the contents of one file is equal to the contents of another
71142     * file (canonicalizing).
71143     *
71144     * @throws ExpectationFailedException
71145     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71146     *
71147     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71148     *
71149     * @see Assert::assertFileEqualsCanonicalizing
71150     */
71151    function assertFileEqualsCanonicalizing(string $expected, string $actual, string $message = '') : void
71152    {
71153        \PHPUnit\Framework\Assert::assertFileEqualsCanonicalizing(...func_get_args());
71154    }
71155}
71156if (!\function_exists('PHPUnit\\Framework\\assertFileEqualsIgnoringCase')) {
71157    /**
71158     * Asserts that the contents of one file is equal to the contents of another
71159     * file (ignoring case).
71160     *
71161     * @throws ExpectationFailedException
71162     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71163     *
71164     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71165     *
71166     * @see Assert::assertFileEqualsIgnoringCase
71167     */
71168    function assertFileEqualsIgnoringCase(string $expected, string $actual, string $message = '') : void
71169    {
71170        \PHPUnit\Framework\Assert::assertFileEqualsIgnoringCase(...func_get_args());
71171    }
71172}
71173if (!\function_exists('PHPUnit\\Framework\\assertFileNotEquals')) {
71174    /**
71175     * Asserts that the contents of one file is not equal to the contents of
71176     * another file.
71177     *
71178     * @throws ExpectationFailedException
71179     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71180     *
71181     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71182     *
71183     * @see Assert::assertFileNotEquals
71184     */
71185    function assertFileNotEquals(string $expected, string $actual, string $message = '') : void
71186    {
71187        \PHPUnit\Framework\Assert::assertFileNotEquals(...func_get_args());
71188    }
71189}
71190if (!\function_exists('PHPUnit\\Framework\\assertFileNotEqualsCanonicalizing')) {
71191    /**
71192     * Asserts that the contents of one file is not equal to the contents of another
71193     * file (canonicalizing).
71194     *
71195     * @throws ExpectationFailedException
71196     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71197     *
71198     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71199     *
71200     * @see Assert::assertFileNotEqualsCanonicalizing
71201     */
71202    function assertFileNotEqualsCanonicalizing(string $expected, string $actual, string $message = '') : void
71203    {
71204        \PHPUnit\Framework\Assert::assertFileNotEqualsCanonicalizing(...func_get_args());
71205    }
71206}
71207if (!\function_exists('PHPUnit\\Framework\\assertFileNotEqualsIgnoringCase')) {
71208    /**
71209     * Asserts that the contents of one file is not equal to the contents of another
71210     * file (ignoring case).
71211     *
71212     * @throws ExpectationFailedException
71213     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71214     *
71215     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71216     *
71217     * @see Assert::assertFileNotEqualsIgnoringCase
71218     */
71219    function assertFileNotEqualsIgnoringCase(string $expected, string $actual, string $message = '') : void
71220    {
71221        \PHPUnit\Framework\Assert::assertFileNotEqualsIgnoringCase(...func_get_args());
71222    }
71223}
71224if (!\function_exists('PHPUnit\\Framework\\assertStringEqualsFile')) {
71225    /**
71226     * Asserts that the contents of a string is equal
71227     * to the contents of a file.
71228     *
71229     * @throws ExpectationFailedException
71230     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71231     *
71232     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71233     *
71234     * @see Assert::assertStringEqualsFile
71235     */
71236    function assertStringEqualsFile(string $expectedFile, string $actualString, string $message = '') : void
71237    {
71238        \PHPUnit\Framework\Assert::assertStringEqualsFile(...func_get_args());
71239    }
71240}
71241if (!\function_exists('PHPUnit\\Framework\\assertStringEqualsFileCanonicalizing')) {
71242    /**
71243     * Asserts that the contents of a string is equal
71244     * to the contents of a file (canonicalizing).
71245     *
71246     * @throws ExpectationFailedException
71247     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71248     *
71249     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71250     *
71251     * @see Assert::assertStringEqualsFileCanonicalizing
71252     */
71253    function assertStringEqualsFileCanonicalizing(string $expectedFile, string $actualString, string $message = '') : void
71254    {
71255        \PHPUnit\Framework\Assert::assertStringEqualsFileCanonicalizing(...func_get_args());
71256    }
71257}
71258if (!\function_exists('PHPUnit\\Framework\\assertStringEqualsFileIgnoringCase')) {
71259    /**
71260     * Asserts that the contents of a string is equal
71261     * to the contents of a file (ignoring case).
71262     *
71263     * @throws ExpectationFailedException
71264     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71265     *
71266     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71267     *
71268     * @see Assert::assertStringEqualsFileIgnoringCase
71269     */
71270    function assertStringEqualsFileIgnoringCase(string $expectedFile, string $actualString, string $message = '') : void
71271    {
71272        \PHPUnit\Framework\Assert::assertStringEqualsFileIgnoringCase(...func_get_args());
71273    }
71274}
71275if (!\function_exists('PHPUnit\\Framework\\assertStringNotEqualsFile')) {
71276    /**
71277     * Asserts that the contents of a string is not equal
71278     * to the contents of a file.
71279     *
71280     * @throws ExpectationFailedException
71281     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71282     *
71283     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71284     *
71285     * @see Assert::assertStringNotEqualsFile
71286     */
71287    function assertStringNotEqualsFile(string $expectedFile, string $actualString, string $message = '') : void
71288    {
71289        \PHPUnit\Framework\Assert::assertStringNotEqualsFile(...func_get_args());
71290    }
71291}
71292if (!\function_exists('PHPUnit\\Framework\\assertStringNotEqualsFileCanonicalizing')) {
71293    /**
71294     * Asserts that the contents of a string is not equal
71295     * to the contents of a file (canonicalizing).
71296     *
71297     * @throws ExpectationFailedException
71298     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71299     *
71300     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71301     *
71302     * @see Assert::assertStringNotEqualsFileCanonicalizing
71303     */
71304    function assertStringNotEqualsFileCanonicalizing(string $expectedFile, string $actualString, string $message = '') : void
71305    {
71306        \PHPUnit\Framework\Assert::assertStringNotEqualsFileCanonicalizing(...func_get_args());
71307    }
71308}
71309if (!\function_exists('PHPUnit\\Framework\\assertStringNotEqualsFileIgnoringCase')) {
71310    /**
71311     * Asserts that the contents of a string is not equal
71312     * to the contents of a file (ignoring case).
71313     *
71314     * @throws ExpectationFailedException
71315     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71316     *
71317     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71318     *
71319     * @see Assert::assertStringNotEqualsFileIgnoringCase
71320     */
71321    function assertStringNotEqualsFileIgnoringCase(string $expectedFile, string $actualString, string $message = '') : void
71322    {
71323        \PHPUnit\Framework\Assert::assertStringNotEqualsFileIgnoringCase(...func_get_args());
71324    }
71325}
71326if (!\function_exists('PHPUnit\\Framework\\assertIsReadable')) {
71327    /**
71328     * Asserts that a file/dir is readable.
71329     *
71330     * @throws ExpectationFailedException
71331     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71332     *
71333     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71334     *
71335     * @see Assert::assertIsReadable
71336     */
71337    function assertIsReadable(string $filename, string $message = '') : void
71338    {
71339        \PHPUnit\Framework\Assert::assertIsReadable(...func_get_args());
71340    }
71341}
71342if (!\function_exists('PHPUnit\\Framework\\assertIsNotReadable')) {
71343    /**
71344     * Asserts that a file/dir exists and is not readable.
71345     *
71346     * @throws ExpectationFailedException
71347     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71348     *
71349     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71350     *
71351     * @see Assert::assertIsNotReadable
71352     */
71353    function assertIsNotReadable(string $filename, string $message = '') : void
71354    {
71355        \PHPUnit\Framework\Assert::assertIsNotReadable(...func_get_args());
71356    }
71357}
71358if (!\function_exists('PHPUnit\\Framework\\assertNotIsReadable')) {
71359    /**
71360     * Asserts that a file/dir exists and is not readable.
71361     *
71362     * @throws ExpectationFailedException
71363     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71364     *
71365     * @codeCoverageIgnore
71366     *
71367     * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4062
71368     *
71369     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71370     *
71371     * @see Assert::assertNotIsReadable
71372     */
71373    function assertNotIsReadable(string $filename, string $message = '') : void
71374    {
71375        \PHPUnit\Framework\Assert::assertNotIsReadable(...func_get_args());
71376    }
71377}
71378if (!\function_exists('PHPUnit\\Framework\\assertIsWritable')) {
71379    /**
71380     * Asserts that a file/dir exists and is writable.
71381     *
71382     * @throws ExpectationFailedException
71383     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71384     *
71385     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71386     *
71387     * @see Assert::assertIsWritable
71388     */
71389    function assertIsWritable(string $filename, string $message = '') : void
71390    {
71391        \PHPUnit\Framework\Assert::assertIsWritable(...func_get_args());
71392    }
71393}
71394if (!\function_exists('PHPUnit\\Framework\\assertIsNotWritable')) {
71395    /**
71396     * Asserts that a file/dir exists and is not writable.
71397     *
71398     * @throws ExpectationFailedException
71399     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71400     *
71401     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71402     *
71403     * @see Assert::assertIsNotWritable
71404     */
71405    function assertIsNotWritable(string $filename, string $message = '') : void
71406    {
71407        \PHPUnit\Framework\Assert::assertIsNotWritable(...func_get_args());
71408    }
71409}
71410if (!\function_exists('PHPUnit\\Framework\\assertNotIsWritable')) {
71411    /**
71412     * Asserts that a file/dir exists and is not writable.
71413     *
71414     * @throws ExpectationFailedException
71415     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71416     *
71417     * @codeCoverageIgnore
71418     *
71419     * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4065
71420     *
71421     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71422     *
71423     * @see Assert::assertNotIsWritable
71424     */
71425    function assertNotIsWritable(string $filename, string $message = '') : void
71426    {
71427        \PHPUnit\Framework\Assert::assertNotIsWritable(...func_get_args());
71428    }
71429}
71430if (!\function_exists('PHPUnit\\Framework\\assertDirectoryExists')) {
71431    /**
71432     * Asserts that a directory exists.
71433     *
71434     * @throws ExpectationFailedException
71435     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71436     *
71437     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71438     *
71439     * @see Assert::assertDirectoryExists
71440     */
71441    function assertDirectoryExists(string $directory, string $message = '') : void
71442    {
71443        \PHPUnit\Framework\Assert::assertDirectoryExists(...func_get_args());
71444    }
71445}
71446if (!\function_exists('PHPUnit\\Framework\\assertDirectoryDoesNotExist')) {
71447    /**
71448     * Asserts that a directory does not exist.
71449     *
71450     * @throws ExpectationFailedException
71451     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71452     *
71453     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71454     *
71455     * @see Assert::assertDirectoryDoesNotExist
71456     */
71457    function assertDirectoryDoesNotExist(string $directory, string $message = '') : void
71458    {
71459        \PHPUnit\Framework\Assert::assertDirectoryDoesNotExist(...func_get_args());
71460    }
71461}
71462if (!\function_exists('PHPUnit\\Framework\\assertDirectoryNotExists')) {
71463    /**
71464     * Asserts that a directory does not exist.
71465     *
71466     * @throws ExpectationFailedException
71467     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71468     *
71469     * @codeCoverageIgnore
71470     *
71471     * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4068
71472     *
71473     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71474     *
71475     * @see Assert::assertDirectoryNotExists
71476     */
71477    function assertDirectoryNotExists(string $directory, string $message = '') : void
71478    {
71479        \PHPUnit\Framework\Assert::assertDirectoryNotExists(...func_get_args());
71480    }
71481}
71482if (!\function_exists('PHPUnit\\Framework\\assertDirectoryIsReadable')) {
71483    /**
71484     * Asserts that a directory exists and is readable.
71485     *
71486     * @throws ExpectationFailedException
71487     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71488     *
71489     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71490     *
71491     * @see Assert::assertDirectoryIsReadable
71492     */
71493    function assertDirectoryIsReadable(string $directory, string $message = '') : void
71494    {
71495        \PHPUnit\Framework\Assert::assertDirectoryIsReadable(...func_get_args());
71496    }
71497}
71498if (!\function_exists('PHPUnit\\Framework\\assertDirectoryIsNotReadable')) {
71499    /**
71500     * Asserts that a directory exists and is not readable.
71501     *
71502     * @throws ExpectationFailedException
71503     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71504     *
71505     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71506     *
71507     * @see Assert::assertDirectoryIsNotReadable
71508     */
71509    function assertDirectoryIsNotReadable(string $directory, string $message = '') : void
71510    {
71511        \PHPUnit\Framework\Assert::assertDirectoryIsNotReadable(...func_get_args());
71512    }
71513}
71514if (!\function_exists('PHPUnit\\Framework\\assertDirectoryNotIsReadable')) {
71515    /**
71516     * Asserts that a directory exists and is not readable.
71517     *
71518     * @throws ExpectationFailedException
71519     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71520     *
71521     * @codeCoverageIgnore
71522     *
71523     * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4071
71524     *
71525     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71526     *
71527     * @see Assert::assertDirectoryNotIsReadable
71528     */
71529    function assertDirectoryNotIsReadable(string $directory, string $message = '') : void
71530    {
71531        \PHPUnit\Framework\Assert::assertDirectoryNotIsReadable(...func_get_args());
71532    }
71533}
71534if (!\function_exists('PHPUnit\\Framework\\assertDirectoryIsWritable')) {
71535    /**
71536     * Asserts that a directory exists and is writable.
71537     *
71538     * @throws ExpectationFailedException
71539     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71540     *
71541     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71542     *
71543     * @see Assert::assertDirectoryIsWritable
71544     */
71545    function assertDirectoryIsWritable(string $directory, string $message = '') : void
71546    {
71547        \PHPUnit\Framework\Assert::assertDirectoryIsWritable(...func_get_args());
71548    }
71549}
71550if (!\function_exists('PHPUnit\\Framework\\assertDirectoryIsNotWritable')) {
71551    /**
71552     * Asserts that a directory exists and is not writable.
71553     *
71554     * @throws ExpectationFailedException
71555     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71556     *
71557     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71558     *
71559     * @see Assert::assertDirectoryIsNotWritable
71560     */
71561    function assertDirectoryIsNotWritable(string $directory, string $message = '') : void
71562    {
71563        \PHPUnit\Framework\Assert::assertDirectoryIsNotWritable(...func_get_args());
71564    }
71565}
71566if (!\function_exists('PHPUnit\\Framework\\assertDirectoryNotIsWritable')) {
71567    /**
71568     * Asserts that a directory exists and is not writable.
71569     *
71570     * @throws ExpectationFailedException
71571     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71572     *
71573     * @codeCoverageIgnore
71574     *
71575     * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4074
71576     *
71577     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71578     *
71579     * @see Assert::assertDirectoryNotIsWritable
71580     */
71581    function assertDirectoryNotIsWritable(string $directory, string $message = '') : void
71582    {
71583        \PHPUnit\Framework\Assert::assertDirectoryNotIsWritable(...func_get_args());
71584    }
71585}
71586if (!\function_exists('PHPUnit\\Framework\\assertFileExists')) {
71587    /**
71588     * Asserts that a file exists.
71589     *
71590     * @throws ExpectationFailedException
71591     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71592     *
71593     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71594     *
71595     * @see Assert::assertFileExists
71596     */
71597    function assertFileExists(string $filename, string $message = '') : void
71598    {
71599        \PHPUnit\Framework\Assert::assertFileExists(...func_get_args());
71600    }
71601}
71602if (!\function_exists('PHPUnit\\Framework\\assertFileDoesNotExist')) {
71603    /**
71604     * Asserts that a file does not exist.
71605     *
71606     * @throws ExpectationFailedException
71607     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71608     *
71609     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71610     *
71611     * @see Assert::assertFileDoesNotExist
71612     */
71613    function assertFileDoesNotExist(string $filename, string $message = '') : void
71614    {
71615        \PHPUnit\Framework\Assert::assertFileDoesNotExist(...func_get_args());
71616    }
71617}
71618if (!\function_exists('PHPUnit\\Framework\\assertFileNotExists')) {
71619    /**
71620     * Asserts that a file does not exist.
71621     *
71622     * @throws ExpectationFailedException
71623     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71624     *
71625     * @codeCoverageIgnore
71626     *
71627     * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4077
71628     *
71629     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71630     *
71631     * @see Assert::assertFileNotExists
71632     */
71633    function assertFileNotExists(string $filename, string $message = '') : void
71634    {
71635        \PHPUnit\Framework\Assert::assertFileNotExists(...func_get_args());
71636    }
71637}
71638if (!\function_exists('PHPUnit\\Framework\\assertFileIsReadable')) {
71639    /**
71640     * Asserts that a file exists and is readable.
71641     *
71642     * @throws ExpectationFailedException
71643     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71644     *
71645     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71646     *
71647     * @see Assert::assertFileIsReadable
71648     */
71649    function assertFileIsReadable(string $file, string $message = '') : void
71650    {
71651        \PHPUnit\Framework\Assert::assertFileIsReadable(...func_get_args());
71652    }
71653}
71654if (!\function_exists('PHPUnit\\Framework\\assertFileIsNotReadable')) {
71655    /**
71656     * Asserts that a file exists and is not readable.
71657     *
71658     * @throws ExpectationFailedException
71659     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71660     *
71661     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71662     *
71663     * @see Assert::assertFileIsNotReadable
71664     */
71665    function assertFileIsNotReadable(string $file, string $message = '') : void
71666    {
71667        \PHPUnit\Framework\Assert::assertFileIsNotReadable(...func_get_args());
71668    }
71669}
71670if (!\function_exists('PHPUnit\\Framework\\assertFileNotIsReadable')) {
71671    /**
71672     * Asserts that a file exists and is not readable.
71673     *
71674     * @throws ExpectationFailedException
71675     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71676     *
71677     * @codeCoverageIgnore
71678     *
71679     * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4080
71680     *
71681     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71682     *
71683     * @see Assert::assertFileNotIsReadable
71684     */
71685    function assertFileNotIsReadable(string $file, string $message = '') : void
71686    {
71687        \PHPUnit\Framework\Assert::assertFileNotIsReadable(...func_get_args());
71688    }
71689}
71690if (!\function_exists('PHPUnit\\Framework\\assertFileIsWritable')) {
71691    /**
71692     * Asserts that a file exists and is writable.
71693     *
71694     * @throws ExpectationFailedException
71695     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71696     *
71697     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71698     *
71699     * @see Assert::assertFileIsWritable
71700     */
71701    function assertFileIsWritable(string $file, string $message = '') : void
71702    {
71703        \PHPUnit\Framework\Assert::assertFileIsWritable(...func_get_args());
71704    }
71705}
71706if (!\function_exists('PHPUnit\\Framework\\assertFileIsNotWritable')) {
71707    /**
71708     * Asserts that a file exists and is not writable.
71709     *
71710     * @throws ExpectationFailedException
71711     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71712     *
71713     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71714     *
71715     * @see Assert::assertFileIsNotWritable
71716     */
71717    function assertFileIsNotWritable(string $file, string $message = '') : void
71718    {
71719        \PHPUnit\Framework\Assert::assertFileIsNotWritable(...func_get_args());
71720    }
71721}
71722if (!\function_exists('PHPUnit\\Framework\\assertFileNotIsWritable')) {
71723    /**
71724     * Asserts that a file exists and is not writable.
71725     *
71726     * @throws ExpectationFailedException
71727     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71728     *
71729     * @codeCoverageIgnore
71730     *
71731     * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4083
71732     *
71733     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71734     *
71735     * @see Assert::assertFileNotIsWritable
71736     */
71737    function assertFileNotIsWritable(string $file, string $message = '') : void
71738    {
71739        \PHPUnit\Framework\Assert::assertFileNotIsWritable(...func_get_args());
71740    }
71741}
71742if (!\function_exists('PHPUnit\\Framework\\assertTrue')) {
71743    /**
71744     * Asserts that a condition is true.
71745     *
71746     * @throws ExpectationFailedException
71747     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71748     *
71749     * @psalm-assert true $condition
71750     *
71751     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71752     *
71753     * @see Assert::assertTrue
71754     */
71755    function assertTrue($condition, string $message = '') : void
71756    {
71757        \PHPUnit\Framework\Assert::assertTrue(...func_get_args());
71758    }
71759}
71760if (!\function_exists('PHPUnit\\Framework\\assertNotTrue')) {
71761    /**
71762     * Asserts that a condition is not true.
71763     *
71764     * @throws ExpectationFailedException
71765     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71766     *
71767     * @psalm-assert !true $condition
71768     *
71769     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71770     *
71771     * @see Assert::assertNotTrue
71772     */
71773    function assertNotTrue($condition, string $message = '') : void
71774    {
71775        \PHPUnit\Framework\Assert::assertNotTrue(...func_get_args());
71776    }
71777}
71778if (!\function_exists('PHPUnit\\Framework\\assertFalse')) {
71779    /**
71780     * Asserts that a condition is false.
71781     *
71782     * @throws ExpectationFailedException
71783     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71784     *
71785     * @psalm-assert false $condition
71786     *
71787     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71788     *
71789     * @see Assert::assertFalse
71790     */
71791    function assertFalse($condition, string $message = '') : void
71792    {
71793        \PHPUnit\Framework\Assert::assertFalse(...func_get_args());
71794    }
71795}
71796if (!\function_exists('PHPUnit\\Framework\\assertNotFalse')) {
71797    /**
71798     * Asserts that a condition is not false.
71799     *
71800     * @throws ExpectationFailedException
71801     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71802     *
71803     * @psalm-assert !false $condition
71804     *
71805     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71806     *
71807     * @see Assert::assertNotFalse
71808     */
71809    function assertNotFalse($condition, string $message = '') : void
71810    {
71811        \PHPUnit\Framework\Assert::assertNotFalse(...func_get_args());
71812    }
71813}
71814if (!\function_exists('PHPUnit\\Framework\\assertNull')) {
71815    /**
71816     * Asserts that a variable is null.
71817     *
71818     * @throws ExpectationFailedException
71819     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71820     *
71821     * @psalm-assert null $actual
71822     *
71823     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71824     *
71825     * @see Assert::assertNull
71826     */
71827    function assertNull($actual, string $message = '') : void
71828    {
71829        \PHPUnit\Framework\Assert::assertNull(...func_get_args());
71830    }
71831}
71832if (!\function_exists('PHPUnit\\Framework\\assertNotNull')) {
71833    /**
71834     * Asserts that a variable is not null.
71835     *
71836     * @throws ExpectationFailedException
71837     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71838     *
71839     * @psalm-assert !null $actual
71840     *
71841     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71842     *
71843     * @see Assert::assertNotNull
71844     */
71845    function assertNotNull($actual, string $message = '') : void
71846    {
71847        \PHPUnit\Framework\Assert::assertNotNull(...func_get_args());
71848    }
71849}
71850if (!\function_exists('PHPUnit\\Framework\\assertFinite')) {
71851    /**
71852     * Asserts that a variable is finite.
71853     *
71854     * @throws ExpectationFailedException
71855     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71856     *
71857     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71858     *
71859     * @see Assert::assertFinite
71860     */
71861    function assertFinite($actual, string $message = '') : void
71862    {
71863        \PHPUnit\Framework\Assert::assertFinite(...func_get_args());
71864    }
71865}
71866if (!\function_exists('PHPUnit\\Framework\\assertInfinite')) {
71867    /**
71868     * Asserts that a variable is infinite.
71869     *
71870     * @throws ExpectationFailedException
71871     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71872     *
71873     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71874     *
71875     * @see Assert::assertInfinite
71876     */
71877    function assertInfinite($actual, string $message = '') : void
71878    {
71879        \PHPUnit\Framework\Assert::assertInfinite(...func_get_args());
71880    }
71881}
71882if (!\function_exists('PHPUnit\\Framework\\assertNan')) {
71883    /**
71884     * Asserts that a variable is nan.
71885     *
71886     * @throws ExpectationFailedException
71887     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71888     *
71889     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71890     *
71891     * @see Assert::assertNan
71892     */
71893    function assertNan($actual, string $message = '') : void
71894    {
71895        \PHPUnit\Framework\Assert::assertNan(...func_get_args());
71896    }
71897}
71898if (!\function_exists('PHPUnit\\Framework\\assertClassHasAttribute')) {
71899    /**
71900     * Asserts that a class has a specified attribute.
71901     *
71902     * @throws ExpectationFailedException
71903     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71904     * @throws Exception
71905     *
71906     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71907     *
71908     * @see Assert::assertClassHasAttribute
71909     */
71910    function assertClassHasAttribute(string $attributeName, string $className, string $message = '') : void
71911    {
71912        \PHPUnit\Framework\Assert::assertClassHasAttribute(...func_get_args());
71913    }
71914}
71915if (!\function_exists('PHPUnit\\Framework\\assertClassNotHasAttribute')) {
71916    /**
71917     * Asserts that a class does not have a specified attribute.
71918     *
71919     * @throws ExpectationFailedException
71920     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71921     * @throws Exception
71922     *
71923     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71924     *
71925     * @see Assert::assertClassNotHasAttribute
71926     */
71927    function assertClassNotHasAttribute(string $attributeName, string $className, string $message = '') : void
71928    {
71929        \PHPUnit\Framework\Assert::assertClassNotHasAttribute(...func_get_args());
71930    }
71931}
71932if (!\function_exists('PHPUnit\\Framework\\assertClassHasStaticAttribute')) {
71933    /**
71934     * Asserts that a class has a specified static attribute.
71935     *
71936     * @throws ExpectationFailedException
71937     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71938     * @throws Exception
71939     *
71940     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71941     *
71942     * @see Assert::assertClassHasStaticAttribute
71943     */
71944    function assertClassHasStaticAttribute(string $attributeName, string $className, string $message = '') : void
71945    {
71946        \PHPUnit\Framework\Assert::assertClassHasStaticAttribute(...func_get_args());
71947    }
71948}
71949if (!\function_exists('PHPUnit\\Framework\\assertClassNotHasStaticAttribute')) {
71950    /**
71951     * Asserts that a class does not have a specified static attribute.
71952     *
71953     * @throws ExpectationFailedException
71954     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71955     * @throws Exception
71956     *
71957     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71958     *
71959     * @see Assert::assertClassNotHasStaticAttribute
71960     */
71961    function assertClassNotHasStaticAttribute(string $attributeName, string $className, string $message = '') : void
71962    {
71963        \PHPUnit\Framework\Assert::assertClassNotHasStaticAttribute(...func_get_args());
71964    }
71965}
71966if (!\function_exists('PHPUnit\\Framework\\assertObjectHasAttribute')) {
71967    /**
71968     * Asserts that an object has a specified attribute.
71969     *
71970     * @param object $object
71971     *
71972     * @throws ExpectationFailedException
71973     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71974     * @throws Exception
71975     *
71976     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71977     *
71978     * @see Assert::assertObjectHasAttribute
71979     */
71980    function assertObjectHasAttribute(string $attributeName, $object, string $message = '') : void
71981    {
71982        \PHPUnit\Framework\Assert::assertObjectHasAttribute(...func_get_args());
71983    }
71984}
71985if (!\function_exists('PHPUnit\\Framework\\assertObjectNotHasAttribute')) {
71986    /**
71987     * Asserts that an object does not have a specified attribute.
71988     *
71989     * @param object $object
71990     *
71991     * @throws ExpectationFailedException
71992     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
71993     * @throws Exception
71994     *
71995     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
71996     *
71997     * @see Assert::assertObjectNotHasAttribute
71998     */
71999    function assertObjectNotHasAttribute(string $attributeName, $object, string $message = '') : void
72000    {
72001        \PHPUnit\Framework\Assert::assertObjectNotHasAttribute(...func_get_args());
72002    }
72003}
72004if (!\function_exists('PHPUnit\\Framework\\assertSame')) {
72005    /**
72006     * Asserts that two variables have the same type and value.
72007     * Used on objects, it asserts that two variables reference
72008     * the same object.
72009     *
72010     * @throws ExpectationFailedException
72011     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72012     *
72013     * @psalm-template ExpectedType
72014     * @psalm-param ExpectedType $expected
72015     * @psalm-assert =ExpectedType $actual
72016     *
72017     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72018     *
72019     * @see Assert::assertSame
72020     */
72021    function assertSame($expected, $actual, string $message = '') : void
72022    {
72023        \PHPUnit\Framework\Assert::assertSame(...func_get_args());
72024    }
72025}
72026if (!\function_exists('PHPUnit\\Framework\\assertNotSame')) {
72027    /**
72028     * Asserts that two variables do not have the same type and value.
72029     * Used on objects, it asserts that two variables do not reference
72030     * the same object.
72031     *
72032     * @throws ExpectationFailedException
72033     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72034     *
72035     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72036     *
72037     * @see Assert::assertNotSame
72038     */
72039    function assertNotSame($expected, $actual, string $message = '') : void
72040    {
72041        \PHPUnit\Framework\Assert::assertNotSame(...func_get_args());
72042    }
72043}
72044if (!\function_exists('PHPUnit\\Framework\\assertInstanceOf')) {
72045    /**
72046     * Asserts that a variable is of a given type.
72047     *
72048     * @throws ExpectationFailedException
72049     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72050     * @throws Exception
72051     *
72052     * @psalm-template ExpectedType of object
72053     * @psalm-param class-string<ExpectedType> $expected
72054     * @psalm-assert =ExpectedType $actual
72055     *
72056     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72057     *
72058     * @see Assert::assertInstanceOf
72059     */
72060    function assertInstanceOf(string $expected, $actual, string $message = '') : void
72061    {
72062        \PHPUnit\Framework\Assert::assertInstanceOf(...func_get_args());
72063    }
72064}
72065if (!\function_exists('PHPUnit\\Framework\\assertNotInstanceOf')) {
72066    /**
72067     * Asserts that a variable is not of a given type.
72068     *
72069     * @throws ExpectationFailedException
72070     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72071     * @throws Exception
72072     *
72073     * @psalm-template ExpectedType of object
72074     * @psalm-param class-string<ExpectedType> $expected
72075     * @psalm-assert !ExpectedType $actual
72076     *
72077     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72078     *
72079     * @see Assert::assertNotInstanceOf
72080     */
72081    function assertNotInstanceOf(string $expected, $actual, string $message = '') : void
72082    {
72083        \PHPUnit\Framework\Assert::assertNotInstanceOf(...func_get_args());
72084    }
72085}
72086if (!\function_exists('PHPUnit\\Framework\\assertIsArray')) {
72087    /**
72088     * Asserts that a variable is of type array.
72089     *
72090     * @throws ExpectationFailedException
72091     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72092     *
72093     * @psalm-assert array $actual
72094     *
72095     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72096     *
72097     * @see Assert::assertIsArray
72098     */
72099    function assertIsArray($actual, string $message = '') : void
72100    {
72101        \PHPUnit\Framework\Assert::assertIsArray(...func_get_args());
72102    }
72103}
72104if (!\function_exists('PHPUnit\\Framework\\assertIsBool')) {
72105    /**
72106     * Asserts that a variable is of type bool.
72107     *
72108     * @throws ExpectationFailedException
72109     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72110     *
72111     * @psalm-assert bool $actual
72112     *
72113     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72114     *
72115     * @see Assert::assertIsBool
72116     */
72117    function assertIsBool($actual, string $message = '') : void
72118    {
72119        \PHPUnit\Framework\Assert::assertIsBool(...func_get_args());
72120    }
72121}
72122if (!\function_exists('PHPUnit\\Framework\\assertIsFloat')) {
72123    /**
72124     * Asserts that a variable is of type float.
72125     *
72126     * @throws ExpectationFailedException
72127     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72128     *
72129     * @psalm-assert float $actual
72130     *
72131     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72132     *
72133     * @see Assert::assertIsFloat
72134     */
72135    function assertIsFloat($actual, string $message = '') : void
72136    {
72137        \PHPUnit\Framework\Assert::assertIsFloat(...func_get_args());
72138    }
72139}
72140if (!\function_exists('PHPUnit\\Framework\\assertIsInt')) {
72141    /**
72142     * Asserts that a variable is of type int.
72143     *
72144     * @throws ExpectationFailedException
72145     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72146     *
72147     * @psalm-assert int $actual
72148     *
72149     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72150     *
72151     * @see Assert::assertIsInt
72152     */
72153    function assertIsInt($actual, string $message = '') : void
72154    {
72155        \PHPUnit\Framework\Assert::assertIsInt(...func_get_args());
72156    }
72157}
72158if (!\function_exists('PHPUnit\\Framework\\assertIsNumeric')) {
72159    /**
72160     * Asserts that a variable is of type numeric.
72161     *
72162     * @throws ExpectationFailedException
72163     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72164     *
72165     * @psalm-assert numeric $actual
72166     *
72167     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72168     *
72169     * @see Assert::assertIsNumeric
72170     */
72171    function assertIsNumeric($actual, string $message = '') : void
72172    {
72173        \PHPUnit\Framework\Assert::assertIsNumeric(...func_get_args());
72174    }
72175}
72176if (!\function_exists('PHPUnit\\Framework\\assertIsObject')) {
72177    /**
72178     * Asserts that a variable is of type object.
72179     *
72180     * @throws ExpectationFailedException
72181     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72182     *
72183     * @psalm-assert object $actual
72184     *
72185     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72186     *
72187     * @see Assert::assertIsObject
72188     */
72189    function assertIsObject($actual, string $message = '') : void
72190    {
72191        \PHPUnit\Framework\Assert::assertIsObject(...func_get_args());
72192    }
72193}
72194if (!\function_exists('PHPUnit\\Framework\\assertIsResource')) {
72195    /**
72196     * Asserts that a variable is of type resource.
72197     *
72198     * @throws ExpectationFailedException
72199     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72200     *
72201     * @psalm-assert resource $actual
72202     *
72203     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72204     *
72205     * @see Assert::assertIsResource
72206     */
72207    function assertIsResource($actual, string $message = '') : void
72208    {
72209        \PHPUnit\Framework\Assert::assertIsResource(...func_get_args());
72210    }
72211}
72212if (!\function_exists('PHPUnit\\Framework\\assertIsClosedResource')) {
72213    /**
72214     * Asserts that a variable is of type resource and is closed.
72215     *
72216     * @throws ExpectationFailedException
72217     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72218     *
72219     * @psalm-assert resource $actual
72220     *
72221     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72222     *
72223     * @see Assert::assertIsClosedResource
72224     */
72225    function assertIsClosedResource($actual, string $message = '') : void
72226    {
72227        \PHPUnit\Framework\Assert::assertIsClosedResource(...func_get_args());
72228    }
72229}
72230if (!\function_exists('PHPUnit\\Framework\\assertIsString')) {
72231    /**
72232     * Asserts that a variable is of type string.
72233     *
72234     * @throws ExpectationFailedException
72235     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72236     *
72237     * @psalm-assert string $actual
72238     *
72239     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72240     *
72241     * @see Assert::assertIsString
72242     */
72243    function assertIsString($actual, string $message = '') : void
72244    {
72245        \PHPUnit\Framework\Assert::assertIsString(...func_get_args());
72246    }
72247}
72248if (!\function_exists('PHPUnit\\Framework\\assertIsScalar')) {
72249    /**
72250     * Asserts that a variable is of type scalar.
72251     *
72252     * @throws ExpectationFailedException
72253     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72254     *
72255     * @psalm-assert scalar $actual
72256     *
72257     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72258     *
72259     * @see Assert::assertIsScalar
72260     */
72261    function assertIsScalar($actual, string $message = '') : void
72262    {
72263        \PHPUnit\Framework\Assert::assertIsScalar(...func_get_args());
72264    }
72265}
72266if (!\function_exists('PHPUnit\\Framework\\assertIsCallable')) {
72267    /**
72268     * Asserts that a variable is of type callable.
72269     *
72270     * @throws ExpectationFailedException
72271     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72272     *
72273     * @psalm-assert callable $actual
72274     *
72275     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72276     *
72277     * @see Assert::assertIsCallable
72278     */
72279    function assertIsCallable($actual, string $message = '') : void
72280    {
72281        \PHPUnit\Framework\Assert::assertIsCallable(...func_get_args());
72282    }
72283}
72284if (!\function_exists('PHPUnit\\Framework\\assertIsIterable')) {
72285    /**
72286     * Asserts that a variable is of type iterable.
72287     *
72288     * @throws ExpectationFailedException
72289     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72290     *
72291     * @psalm-assert iterable $actual
72292     *
72293     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72294     *
72295     * @see Assert::assertIsIterable
72296     */
72297    function assertIsIterable($actual, string $message = '') : void
72298    {
72299        \PHPUnit\Framework\Assert::assertIsIterable(...func_get_args());
72300    }
72301}
72302if (!\function_exists('PHPUnit\\Framework\\assertIsNotArray')) {
72303    /**
72304     * Asserts that a variable is not of type array.
72305     *
72306     * @throws ExpectationFailedException
72307     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72308     *
72309     * @psalm-assert !array $actual
72310     *
72311     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72312     *
72313     * @see Assert::assertIsNotArray
72314     */
72315    function assertIsNotArray($actual, string $message = '') : void
72316    {
72317        \PHPUnit\Framework\Assert::assertIsNotArray(...func_get_args());
72318    }
72319}
72320if (!\function_exists('PHPUnit\\Framework\\assertIsNotBool')) {
72321    /**
72322     * Asserts that a variable is not of type bool.
72323     *
72324     * @throws ExpectationFailedException
72325     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72326     *
72327     * @psalm-assert !bool $actual
72328     *
72329     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72330     *
72331     * @see Assert::assertIsNotBool
72332     */
72333    function assertIsNotBool($actual, string $message = '') : void
72334    {
72335        \PHPUnit\Framework\Assert::assertIsNotBool(...func_get_args());
72336    }
72337}
72338if (!\function_exists('PHPUnit\\Framework\\assertIsNotFloat')) {
72339    /**
72340     * Asserts that a variable is not of type float.
72341     *
72342     * @throws ExpectationFailedException
72343     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72344     *
72345     * @psalm-assert !float $actual
72346     *
72347     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72348     *
72349     * @see Assert::assertIsNotFloat
72350     */
72351    function assertIsNotFloat($actual, string $message = '') : void
72352    {
72353        \PHPUnit\Framework\Assert::assertIsNotFloat(...func_get_args());
72354    }
72355}
72356if (!\function_exists('PHPUnit\\Framework\\assertIsNotInt')) {
72357    /**
72358     * Asserts that a variable is not of type int.
72359     *
72360     * @throws ExpectationFailedException
72361     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72362     *
72363     * @psalm-assert !int $actual
72364     *
72365     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72366     *
72367     * @see Assert::assertIsNotInt
72368     */
72369    function assertIsNotInt($actual, string $message = '') : void
72370    {
72371        \PHPUnit\Framework\Assert::assertIsNotInt(...func_get_args());
72372    }
72373}
72374if (!\function_exists('PHPUnit\\Framework\\assertIsNotNumeric')) {
72375    /**
72376     * Asserts that a variable is not of type numeric.
72377     *
72378     * @throws ExpectationFailedException
72379     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72380     *
72381     * @psalm-assert !numeric $actual
72382     *
72383     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72384     *
72385     * @see Assert::assertIsNotNumeric
72386     */
72387    function assertIsNotNumeric($actual, string $message = '') : void
72388    {
72389        \PHPUnit\Framework\Assert::assertIsNotNumeric(...func_get_args());
72390    }
72391}
72392if (!\function_exists('PHPUnit\\Framework\\assertIsNotObject')) {
72393    /**
72394     * Asserts that a variable is not of type object.
72395     *
72396     * @throws ExpectationFailedException
72397     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72398     *
72399     * @psalm-assert !object $actual
72400     *
72401     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72402     *
72403     * @see Assert::assertIsNotObject
72404     */
72405    function assertIsNotObject($actual, string $message = '') : void
72406    {
72407        \PHPUnit\Framework\Assert::assertIsNotObject(...func_get_args());
72408    }
72409}
72410if (!\function_exists('PHPUnit\\Framework\\assertIsNotResource')) {
72411    /**
72412     * Asserts that a variable is not of type resource.
72413     *
72414     * @throws ExpectationFailedException
72415     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72416     *
72417     * @psalm-assert !resource $actual
72418     *
72419     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72420     *
72421     * @see Assert::assertIsNotResource
72422     */
72423    function assertIsNotResource($actual, string $message = '') : void
72424    {
72425        \PHPUnit\Framework\Assert::assertIsNotResource(...func_get_args());
72426    }
72427}
72428if (!\function_exists('PHPUnit\\Framework\\assertIsNotClosedResource')) {
72429    /**
72430     * Asserts that a variable is not of type resource.
72431     *
72432     * @throws ExpectationFailedException
72433     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72434     *
72435     * @psalm-assert !resource $actual
72436     *
72437     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72438     *
72439     * @see Assert::assertIsNotClosedResource
72440     */
72441    function assertIsNotClosedResource($actual, string $message = '') : void
72442    {
72443        \PHPUnit\Framework\Assert::assertIsNotClosedResource(...func_get_args());
72444    }
72445}
72446if (!\function_exists('PHPUnit\\Framework\\assertIsNotString')) {
72447    /**
72448     * Asserts that a variable is not of type string.
72449     *
72450     * @throws ExpectationFailedException
72451     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72452     *
72453     * @psalm-assert !string $actual
72454     *
72455     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72456     *
72457     * @see Assert::assertIsNotString
72458     */
72459    function assertIsNotString($actual, string $message = '') : void
72460    {
72461        \PHPUnit\Framework\Assert::assertIsNotString(...func_get_args());
72462    }
72463}
72464if (!\function_exists('PHPUnit\\Framework\\assertIsNotScalar')) {
72465    /**
72466     * Asserts that a variable is not of type scalar.
72467     *
72468     * @throws ExpectationFailedException
72469     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72470     *
72471     * @psalm-assert !scalar $actual
72472     *
72473     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72474     *
72475     * @see Assert::assertIsNotScalar
72476     */
72477    function assertIsNotScalar($actual, string $message = '') : void
72478    {
72479        \PHPUnit\Framework\Assert::assertIsNotScalar(...func_get_args());
72480    }
72481}
72482if (!\function_exists('PHPUnit\\Framework\\assertIsNotCallable')) {
72483    /**
72484     * Asserts that a variable is not of type callable.
72485     *
72486     * @throws ExpectationFailedException
72487     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72488     *
72489     * @psalm-assert !callable $actual
72490     *
72491     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72492     *
72493     * @see Assert::assertIsNotCallable
72494     */
72495    function assertIsNotCallable($actual, string $message = '') : void
72496    {
72497        \PHPUnit\Framework\Assert::assertIsNotCallable(...func_get_args());
72498    }
72499}
72500if (!\function_exists('PHPUnit\\Framework\\assertIsNotIterable')) {
72501    /**
72502     * Asserts that a variable is not of type iterable.
72503     *
72504     * @throws ExpectationFailedException
72505     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72506     *
72507     * @psalm-assert !iterable $actual
72508     *
72509     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72510     *
72511     * @see Assert::assertIsNotIterable
72512     */
72513    function assertIsNotIterable($actual, string $message = '') : void
72514    {
72515        \PHPUnit\Framework\Assert::assertIsNotIterable(...func_get_args());
72516    }
72517}
72518if (!\function_exists('PHPUnit\\Framework\\assertMatchesRegularExpression')) {
72519    /**
72520     * Asserts that a string matches a given regular expression.
72521     *
72522     * @throws ExpectationFailedException
72523     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72524     *
72525     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72526     *
72527     * @see Assert::assertMatchesRegularExpression
72528     */
72529    function assertMatchesRegularExpression(string $pattern, string $string, string $message = '') : void
72530    {
72531        \PHPUnit\Framework\Assert::assertMatchesRegularExpression(...func_get_args());
72532    }
72533}
72534if (!\function_exists('PHPUnit\\Framework\\assertRegExp')) {
72535    /**
72536     * Asserts that a string matches a given regular expression.
72537     *
72538     * @throws ExpectationFailedException
72539     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72540     *
72541     * @codeCoverageIgnore
72542     *
72543     * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4086
72544     *
72545     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72546     *
72547     * @see Assert::assertRegExp
72548     */
72549    function assertRegExp(string $pattern, string $string, string $message = '') : void
72550    {
72551        \PHPUnit\Framework\Assert::assertRegExp(...func_get_args());
72552    }
72553}
72554if (!\function_exists('PHPUnit\\Framework\\assertDoesNotMatchRegularExpression')) {
72555    /**
72556     * Asserts that a string does not match a given regular expression.
72557     *
72558     * @throws ExpectationFailedException
72559     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72560     *
72561     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72562     *
72563     * @see Assert::assertDoesNotMatchRegularExpression
72564     */
72565    function assertDoesNotMatchRegularExpression(string $pattern, string $string, string $message = '') : void
72566    {
72567        \PHPUnit\Framework\Assert::assertDoesNotMatchRegularExpression(...func_get_args());
72568    }
72569}
72570if (!\function_exists('PHPUnit\\Framework\\assertNotRegExp')) {
72571    /**
72572     * Asserts that a string does not match a given regular expression.
72573     *
72574     * @throws ExpectationFailedException
72575     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72576     *
72577     * @codeCoverageIgnore
72578     *
72579     * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4089
72580     *
72581     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72582     *
72583     * @see Assert::assertNotRegExp
72584     */
72585    function assertNotRegExp(string $pattern, string $string, string $message = '') : void
72586    {
72587        \PHPUnit\Framework\Assert::assertNotRegExp(...func_get_args());
72588    }
72589}
72590if (!\function_exists('PHPUnit\\Framework\\assertSameSize')) {
72591    /**
72592     * Assert that the size of two arrays (or `Countable` or `Traversable` objects)
72593     * is the same.
72594     *
72595     * @param Countable|iterable $expected
72596     * @param Countable|iterable $actual
72597     *
72598     * @throws ExpectationFailedException
72599     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72600     * @throws Exception
72601     *
72602     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72603     *
72604     * @see Assert::assertSameSize
72605     */
72606    function assertSameSize($expected, $actual, string $message = '') : void
72607    {
72608        \PHPUnit\Framework\Assert::assertSameSize(...func_get_args());
72609    }
72610}
72611if (!\function_exists('PHPUnit\\Framework\\assertNotSameSize')) {
72612    /**
72613     * Assert that the size of two arrays (or `Countable` or `Traversable` objects)
72614     * is not the same.
72615     *
72616     * @param Countable|iterable $expected
72617     * @param Countable|iterable $actual
72618     *
72619     * @throws ExpectationFailedException
72620     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72621     * @throws Exception
72622     *
72623     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72624     *
72625     * @see Assert::assertNotSameSize
72626     */
72627    function assertNotSameSize($expected, $actual, string $message = '') : void
72628    {
72629        \PHPUnit\Framework\Assert::assertNotSameSize(...func_get_args());
72630    }
72631}
72632if (!\function_exists('PHPUnit\\Framework\\assertStringMatchesFormat')) {
72633    /**
72634     * Asserts that a string matches a given format string.
72635     *
72636     * @throws ExpectationFailedException
72637     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72638     *
72639     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72640     *
72641     * @see Assert::assertStringMatchesFormat
72642     */
72643    function assertStringMatchesFormat(string $format, string $string, string $message = '') : void
72644    {
72645        \PHPUnit\Framework\Assert::assertStringMatchesFormat(...func_get_args());
72646    }
72647}
72648if (!\function_exists('PHPUnit\\Framework\\assertStringNotMatchesFormat')) {
72649    /**
72650     * Asserts that a string does not match a given format string.
72651     *
72652     * @throws ExpectationFailedException
72653     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72654     *
72655     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72656     *
72657     * @see Assert::assertStringNotMatchesFormat
72658     */
72659    function assertStringNotMatchesFormat(string $format, string $string, string $message = '') : void
72660    {
72661        \PHPUnit\Framework\Assert::assertStringNotMatchesFormat(...func_get_args());
72662    }
72663}
72664if (!\function_exists('PHPUnit\\Framework\\assertStringMatchesFormatFile')) {
72665    /**
72666     * Asserts that a string matches a given format file.
72667     *
72668     * @throws ExpectationFailedException
72669     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72670     *
72671     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72672     *
72673     * @see Assert::assertStringMatchesFormatFile
72674     */
72675    function assertStringMatchesFormatFile(string $formatFile, string $string, string $message = '') : void
72676    {
72677        \PHPUnit\Framework\Assert::assertStringMatchesFormatFile(...func_get_args());
72678    }
72679}
72680if (!\function_exists('PHPUnit\\Framework\\assertStringNotMatchesFormatFile')) {
72681    /**
72682     * Asserts that a string does not match a given format string.
72683     *
72684     * @throws ExpectationFailedException
72685     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72686     *
72687     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72688     *
72689     * @see Assert::assertStringNotMatchesFormatFile
72690     */
72691    function assertStringNotMatchesFormatFile(string $formatFile, string $string, string $message = '') : void
72692    {
72693        \PHPUnit\Framework\Assert::assertStringNotMatchesFormatFile(...func_get_args());
72694    }
72695}
72696if (!\function_exists('PHPUnit\\Framework\\assertStringStartsWith')) {
72697    /**
72698     * Asserts that a string starts with a given prefix.
72699     *
72700     * @throws ExpectationFailedException
72701     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72702     *
72703     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72704     *
72705     * @see Assert::assertStringStartsWith
72706     */
72707    function assertStringStartsWith(string $prefix, string $string, string $message = '') : void
72708    {
72709        \PHPUnit\Framework\Assert::assertStringStartsWith(...func_get_args());
72710    }
72711}
72712if (!\function_exists('PHPUnit\\Framework\\assertStringStartsNotWith')) {
72713    /**
72714     * Asserts that a string starts not with a given prefix.
72715     *
72716     * @param string $prefix
72717     * @param string $string
72718     *
72719     * @throws ExpectationFailedException
72720     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72721     *
72722     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72723     *
72724     * @see Assert::assertStringStartsNotWith
72725     */
72726    function assertStringStartsNotWith($prefix, $string, string $message = '') : void
72727    {
72728        \PHPUnit\Framework\Assert::assertStringStartsNotWith(...func_get_args());
72729    }
72730}
72731if (!\function_exists('PHPUnit\\Framework\\assertStringContainsString')) {
72732    /**
72733     * @throws ExpectationFailedException
72734     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72735     *
72736     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72737     *
72738     * @see Assert::assertStringContainsString
72739     */
72740    function assertStringContainsString(string $needle, string $haystack, string $message = '') : void
72741    {
72742        \PHPUnit\Framework\Assert::assertStringContainsString(...func_get_args());
72743    }
72744}
72745if (!\function_exists('PHPUnit\\Framework\\assertStringContainsStringIgnoringCase')) {
72746    /**
72747     * @throws ExpectationFailedException
72748     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72749     *
72750     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72751     *
72752     * @see Assert::assertStringContainsStringIgnoringCase
72753     */
72754    function assertStringContainsStringIgnoringCase(string $needle, string $haystack, string $message = '') : void
72755    {
72756        \PHPUnit\Framework\Assert::assertStringContainsStringIgnoringCase(...func_get_args());
72757    }
72758}
72759if (!\function_exists('PHPUnit\\Framework\\assertStringNotContainsString')) {
72760    /**
72761     * @throws ExpectationFailedException
72762     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72763     *
72764     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72765     *
72766     * @see Assert::assertStringNotContainsString
72767     */
72768    function assertStringNotContainsString(string $needle, string $haystack, string $message = '') : void
72769    {
72770        \PHPUnit\Framework\Assert::assertStringNotContainsString(...func_get_args());
72771    }
72772}
72773if (!\function_exists('PHPUnit\\Framework\\assertStringNotContainsStringIgnoringCase')) {
72774    /**
72775     * @throws ExpectationFailedException
72776     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72777     *
72778     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72779     *
72780     * @see Assert::assertStringNotContainsStringIgnoringCase
72781     */
72782    function assertStringNotContainsStringIgnoringCase(string $needle, string $haystack, string $message = '') : void
72783    {
72784        \PHPUnit\Framework\Assert::assertStringNotContainsStringIgnoringCase(...func_get_args());
72785    }
72786}
72787if (!\function_exists('PHPUnit\\Framework\\assertStringEndsWith')) {
72788    /**
72789     * Asserts that a string ends with a given suffix.
72790     *
72791     * @throws ExpectationFailedException
72792     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72793     *
72794     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72795     *
72796     * @see Assert::assertStringEndsWith
72797     */
72798    function assertStringEndsWith(string $suffix, string $string, string $message = '') : void
72799    {
72800        \PHPUnit\Framework\Assert::assertStringEndsWith(...func_get_args());
72801    }
72802}
72803if (!\function_exists('PHPUnit\\Framework\\assertStringEndsNotWith')) {
72804    /**
72805     * Asserts that a string ends not with a given suffix.
72806     *
72807     * @throws ExpectationFailedException
72808     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72809     *
72810     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72811     *
72812     * @see Assert::assertStringEndsNotWith
72813     */
72814    function assertStringEndsNotWith(string $suffix, string $string, string $message = '') : void
72815    {
72816        \PHPUnit\Framework\Assert::assertStringEndsNotWith(...func_get_args());
72817    }
72818}
72819if (!\function_exists('PHPUnit\\Framework\\assertXmlFileEqualsXmlFile')) {
72820    /**
72821     * Asserts that two XML files are equal.
72822     *
72823     * @throws ExpectationFailedException
72824     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72825     * @throws Exception
72826     *
72827     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72828     *
72829     * @see Assert::assertXmlFileEqualsXmlFile
72830     */
72831    function assertXmlFileEqualsXmlFile(string $expectedFile, string $actualFile, string $message = '') : void
72832    {
72833        \PHPUnit\Framework\Assert::assertXmlFileEqualsXmlFile(...func_get_args());
72834    }
72835}
72836if (!\function_exists('PHPUnit\\Framework\\assertXmlFileNotEqualsXmlFile')) {
72837    /**
72838     * Asserts that two XML files are not equal.
72839     *
72840     * @throws ExpectationFailedException
72841     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72842     * @throws \PHPUnit\Util\Exception
72843     *
72844     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72845     *
72846     * @see Assert::assertXmlFileNotEqualsXmlFile
72847     */
72848    function assertXmlFileNotEqualsXmlFile(string $expectedFile, string $actualFile, string $message = '') : void
72849    {
72850        \PHPUnit\Framework\Assert::assertXmlFileNotEqualsXmlFile(...func_get_args());
72851    }
72852}
72853if (!\function_exists('PHPUnit\\Framework\\assertXmlStringEqualsXmlFile')) {
72854    /**
72855     * Asserts that two XML documents are equal.
72856     *
72857     * @param DOMDocument|string $actualXml
72858     *
72859     * @throws ExpectationFailedException
72860     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72861     * @throws \PHPUnit\Util\Xml\Exception
72862     *
72863     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72864     *
72865     * @see Assert::assertXmlStringEqualsXmlFile
72866     */
72867    function assertXmlStringEqualsXmlFile(string $expectedFile, $actualXml, string $message = '') : void
72868    {
72869        \PHPUnit\Framework\Assert::assertXmlStringEqualsXmlFile(...func_get_args());
72870    }
72871}
72872if (!\function_exists('PHPUnit\\Framework\\assertXmlStringNotEqualsXmlFile')) {
72873    /**
72874     * Asserts that two XML documents are not equal.
72875     *
72876     * @param DOMDocument|string $actualXml
72877     *
72878     * @throws ExpectationFailedException
72879     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72880     * @throws \PHPUnit\Util\Xml\Exception
72881     *
72882     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72883     *
72884     * @see Assert::assertXmlStringNotEqualsXmlFile
72885     */
72886    function assertXmlStringNotEqualsXmlFile(string $expectedFile, $actualXml, string $message = '') : void
72887    {
72888        \PHPUnit\Framework\Assert::assertXmlStringNotEqualsXmlFile(...func_get_args());
72889    }
72890}
72891if (!\function_exists('PHPUnit\\Framework\\assertXmlStringEqualsXmlString')) {
72892    /**
72893     * Asserts that two XML documents are equal.
72894     *
72895     * @param DOMDocument|string $expectedXml
72896     * @param DOMDocument|string $actualXml
72897     *
72898     * @throws ExpectationFailedException
72899     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72900     * @throws \PHPUnit\Util\Xml\Exception
72901     *
72902     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72903     *
72904     * @see Assert::assertXmlStringEqualsXmlString
72905     */
72906    function assertXmlStringEqualsXmlString($expectedXml, $actualXml, string $message = '') : void
72907    {
72908        \PHPUnit\Framework\Assert::assertXmlStringEqualsXmlString(...func_get_args());
72909    }
72910}
72911if (!\function_exists('PHPUnit\\Framework\\assertXmlStringNotEqualsXmlString')) {
72912    /**
72913     * Asserts that two XML documents are not equal.
72914     *
72915     * @param DOMDocument|string $expectedXml
72916     * @param DOMDocument|string $actualXml
72917     *
72918     * @throws ExpectationFailedException
72919     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72920     * @throws \PHPUnit\Util\Xml\Exception
72921     *
72922     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72923     *
72924     * @see Assert::assertXmlStringNotEqualsXmlString
72925     */
72926    function assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, string $message = '') : void
72927    {
72928        \PHPUnit\Framework\Assert::assertXmlStringNotEqualsXmlString(...func_get_args());
72929    }
72930}
72931if (!\function_exists('PHPUnit\\Framework\\assertEqualXMLStructure')) {
72932    /**
72933     * Asserts that a hierarchy of DOMElements matches.
72934     *
72935     * @throws AssertionFailedError
72936     * @throws ExpectationFailedException
72937     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72938     *
72939     * @codeCoverageIgnore
72940     *
72941     * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4091
72942     *
72943     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72944     *
72945     * @see Assert::assertEqualXMLStructure
72946     */
72947    function assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actualElement, bool $checkAttributes = \false, string $message = '') : void
72948    {
72949        \PHPUnit\Framework\Assert::assertEqualXMLStructure(...func_get_args());
72950    }
72951}
72952if (!\function_exists('PHPUnit\\Framework\\assertThat')) {
72953    /**
72954     * Evaluates a PHPUnit\Framework\Constraint matcher object.
72955     *
72956     * @throws ExpectationFailedException
72957     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72958     *
72959     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72960     *
72961     * @see Assert::assertThat
72962     */
72963    function assertThat($value, Constraint $constraint, string $message = '') : void
72964    {
72965        \PHPUnit\Framework\Assert::assertThat(...func_get_args());
72966    }
72967}
72968if (!\function_exists('PHPUnit\\Framework\\assertJson')) {
72969    /**
72970     * Asserts that a string is a valid JSON string.
72971     *
72972     * @throws ExpectationFailedException
72973     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72974     *
72975     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72976     *
72977     * @see Assert::assertJson
72978     */
72979    function assertJson(string $actualJson, string $message = '') : void
72980    {
72981        \PHPUnit\Framework\Assert::assertJson(...func_get_args());
72982    }
72983}
72984if (!\function_exists('PHPUnit\\Framework\\assertJsonStringEqualsJsonString')) {
72985    /**
72986     * Asserts that two given JSON encoded objects or arrays are equal.
72987     *
72988     * @throws ExpectationFailedException
72989     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
72990     *
72991     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
72992     *
72993     * @see Assert::assertJsonStringEqualsJsonString
72994     */
72995    function assertJsonStringEqualsJsonString(string $expectedJson, string $actualJson, string $message = '') : void
72996    {
72997        \PHPUnit\Framework\Assert::assertJsonStringEqualsJsonString(...func_get_args());
72998    }
72999}
73000if (!\function_exists('PHPUnit\\Framework\\assertJsonStringNotEqualsJsonString')) {
73001    /**
73002     * Asserts that two given JSON encoded objects or arrays are not equal.
73003     *
73004     * @param string $expectedJson
73005     * @param string $actualJson
73006     *
73007     * @throws ExpectationFailedException
73008     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73009     *
73010     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
73011     *
73012     * @see Assert::assertJsonStringNotEqualsJsonString
73013     */
73014    function assertJsonStringNotEqualsJsonString($expectedJson, $actualJson, string $message = '') : void
73015    {
73016        \PHPUnit\Framework\Assert::assertJsonStringNotEqualsJsonString(...func_get_args());
73017    }
73018}
73019if (!\function_exists('PHPUnit\\Framework\\assertJsonStringEqualsJsonFile')) {
73020    /**
73021     * Asserts that the generated JSON encoded object and the content of the given file are equal.
73022     *
73023     * @throws ExpectationFailedException
73024     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73025     *
73026     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
73027     *
73028     * @see Assert::assertJsonStringEqualsJsonFile
73029     */
73030    function assertJsonStringEqualsJsonFile(string $expectedFile, string $actualJson, string $message = '') : void
73031    {
73032        \PHPUnit\Framework\Assert::assertJsonStringEqualsJsonFile(...func_get_args());
73033    }
73034}
73035if (!\function_exists('PHPUnit\\Framework\\assertJsonStringNotEqualsJsonFile')) {
73036    /**
73037     * Asserts that the generated JSON encoded object and the content of the given file are not equal.
73038     *
73039     * @throws ExpectationFailedException
73040     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73041     *
73042     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
73043     *
73044     * @see Assert::assertJsonStringNotEqualsJsonFile
73045     */
73046    function assertJsonStringNotEqualsJsonFile(string $expectedFile, string $actualJson, string $message = '') : void
73047    {
73048        \PHPUnit\Framework\Assert::assertJsonStringNotEqualsJsonFile(...func_get_args());
73049    }
73050}
73051if (!\function_exists('PHPUnit\\Framework\\assertJsonFileEqualsJsonFile')) {
73052    /**
73053     * Asserts that two JSON files are equal.
73054     *
73055     * @throws ExpectationFailedException
73056     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73057     *
73058     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
73059     *
73060     * @see Assert::assertJsonFileEqualsJsonFile
73061     */
73062    function assertJsonFileEqualsJsonFile(string $expectedFile, string $actualFile, string $message = '') : void
73063    {
73064        \PHPUnit\Framework\Assert::assertJsonFileEqualsJsonFile(...func_get_args());
73065    }
73066}
73067if (!\function_exists('PHPUnit\\Framework\\assertJsonFileNotEqualsJsonFile')) {
73068    /**
73069     * Asserts that two JSON files are not equal.
73070     *
73071     * @throws ExpectationFailedException
73072     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73073     *
73074     * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
73075     *
73076     * @see Assert::assertJsonFileNotEqualsJsonFile
73077     */
73078    function assertJsonFileNotEqualsJsonFile(string $expectedFile, string $actualFile, string $message = '') : void
73079    {
73080        \PHPUnit\Framework\Assert::assertJsonFileNotEqualsJsonFile(...func_get_args());
73081    }
73082}
73083if (!\function_exists('PHPUnit\\Framework\\logicalAnd')) {
73084    function logicalAnd() : LogicalAnd
73085    {
73086        return \PHPUnit\Framework\Assert::logicalAnd(...func_get_args());
73087    }
73088}
73089if (!\function_exists('PHPUnit\\Framework\\logicalOr')) {
73090    function logicalOr() : LogicalOr
73091    {
73092        return \PHPUnit\Framework\Assert::logicalOr(...func_get_args());
73093    }
73094}
73095if (!\function_exists('PHPUnit\\Framework\\logicalNot')) {
73096    function logicalNot(Constraint $constraint) : LogicalNot
73097    {
73098        return \PHPUnit\Framework\Assert::logicalNot(...func_get_args());
73099    }
73100}
73101if (!\function_exists('PHPUnit\\Framework\\logicalXor')) {
73102    function logicalXor() : LogicalXor
73103    {
73104        return \PHPUnit\Framework\Assert::logicalXor(...func_get_args());
73105    }
73106}
73107if (!\function_exists('PHPUnit\\Framework\\anything')) {
73108    function anything() : IsAnything
73109    {
73110        return \PHPUnit\Framework\Assert::anything(...func_get_args());
73111    }
73112}
73113if (!\function_exists('PHPUnit\\Framework\\isTrue')) {
73114    function isTrue() : IsTrue
73115    {
73116        return \PHPUnit\Framework\Assert::isTrue(...func_get_args());
73117    }
73118}
73119if (!\function_exists('PHPUnit\\Framework\\callback')) {
73120    function callback(callable $callback) : Callback
73121    {
73122        return \PHPUnit\Framework\Assert::callback(...func_get_args());
73123    }
73124}
73125if (!\function_exists('PHPUnit\\Framework\\isFalse')) {
73126    function isFalse() : IsFalse
73127    {
73128        return \PHPUnit\Framework\Assert::isFalse(...func_get_args());
73129    }
73130}
73131if (!\function_exists('PHPUnit\\Framework\\isJson')) {
73132    function isJson() : IsJson
73133    {
73134        return \PHPUnit\Framework\Assert::isJson(...func_get_args());
73135    }
73136}
73137if (!\function_exists('PHPUnit\\Framework\\isNull')) {
73138    function isNull() : IsNull
73139    {
73140        return \PHPUnit\Framework\Assert::isNull(...func_get_args());
73141    }
73142}
73143if (!\function_exists('PHPUnit\\Framework\\isFinite')) {
73144    function isFinite() : IsFinite
73145    {
73146        return \PHPUnit\Framework\Assert::isFinite(...func_get_args());
73147    }
73148}
73149if (!\function_exists('PHPUnit\\Framework\\isInfinite')) {
73150    function isInfinite() : IsInfinite
73151    {
73152        return \PHPUnit\Framework\Assert::isInfinite(...func_get_args());
73153    }
73154}
73155if (!\function_exists('PHPUnit\\Framework\\isNan')) {
73156    function isNan() : IsNan
73157    {
73158        return \PHPUnit\Framework\Assert::isNan(...func_get_args());
73159    }
73160}
73161if (!\function_exists('PHPUnit\\Framework\\containsEqual')) {
73162    function containsEqual($value) : TraversableContainsEqual
73163    {
73164        return \PHPUnit\Framework\Assert::containsEqual(...func_get_args());
73165    }
73166}
73167if (!\function_exists('PHPUnit\\Framework\\containsIdentical')) {
73168    function containsIdentical($value) : TraversableContainsIdentical
73169    {
73170        return \PHPUnit\Framework\Assert::containsIdentical(...func_get_args());
73171    }
73172}
73173if (!\function_exists('PHPUnit\\Framework\\containsOnly')) {
73174    function containsOnly(string $type) : TraversableContainsOnly
73175    {
73176        return \PHPUnit\Framework\Assert::containsOnly(...func_get_args());
73177    }
73178}
73179if (!\function_exists('PHPUnit\\Framework\\containsOnlyInstancesOf')) {
73180    function containsOnlyInstancesOf(string $className) : TraversableContainsOnly
73181    {
73182        return \PHPUnit\Framework\Assert::containsOnlyInstancesOf(...func_get_args());
73183    }
73184}
73185if (!\function_exists('PHPUnit\\Framework\\arrayHasKey')) {
73186    function arrayHasKey($key) : ArrayHasKey
73187    {
73188        return \PHPUnit\Framework\Assert::arrayHasKey(...func_get_args());
73189    }
73190}
73191if (!\function_exists('PHPUnit\\Framework\\equalTo')) {
73192    function equalTo($value) : IsEqual
73193    {
73194        return \PHPUnit\Framework\Assert::equalTo(...func_get_args());
73195    }
73196}
73197if (!\function_exists('PHPUnit\\Framework\\equalToCanonicalizing')) {
73198    function equalToCanonicalizing($value) : IsEqualCanonicalizing
73199    {
73200        return \PHPUnit\Framework\Assert::equalToCanonicalizing(...func_get_args());
73201    }
73202}
73203if (!\function_exists('PHPUnit\\Framework\\equalToIgnoringCase')) {
73204    function equalToIgnoringCase($value) : IsEqualIgnoringCase
73205    {
73206        return \PHPUnit\Framework\Assert::equalToIgnoringCase(...func_get_args());
73207    }
73208}
73209if (!\function_exists('PHPUnit\\Framework\\equalToWithDelta')) {
73210    function equalToWithDelta($value, float $delta) : IsEqualWithDelta
73211    {
73212        return \PHPUnit\Framework\Assert::equalToWithDelta(...func_get_args());
73213    }
73214}
73215if (!\function_exists('PHPUnit\\Framework\\isEmpty')) {
73216    function isEmpty() : IsEmpty
73217    {
73218        return \PHPUnit\Framework\Assert::isEmpty(...func_get_args());
73219    }
73220}
73221if (!\function_exists('PHPUnit\\Framework\\isWritable')) {
73222    function isWritable() : IsWritable
73223    {
73224        return \PHPUnit\Framework\Assert::isWritable(...func_get_args());
73225    }
73226}
73227if (!\function_exists('PHPUnit\\Framework\\isReadable')) {
73228    function isReadable() : IsReadable
73229    {
73230        return \PHPUnit\Framework\Assert::isReadable(...func_get_args());
73231    }
73232}
73233if (!\function_exists('PHPUnit\\Framework\\directoryExists')) {
73234    function directoryExists() : DirectoryExists
73235    {
73236        return \PHPUnit\Framework\Assert::directoryExists(...func_get_args());
73237    }
73238}
73239if (!\function_exists('PHPUnit\\Framework\\fileExists')) {
73240    function fileExists() : FileExists
73241    {
73242        return \PHPUnit\Framework\Assert::fileExists(...func_get_args());
73243    }
73244}
73245if (!\function_exists('PHPUnit\\Framework\\greaterThan')) {
73246    function greaterThan($value) : GreaterThan
73247    {
73248        return \PHPUnit\Framework\Assert::greaterThan(...func_get_args());
73249    }
73250}
73251if (!\function_exists('PHPUnit\\Framework\\greaterThanOrEqual')) {
73252    function greaterThanOrEqual($value) : LogicalOr
73253    {
73254        return \PHPUnit\Framework\Assert::greaterThanOrEqual(...func_get_args());
73255    }
73256}
73257if (!\function_exists('PHPUnit\\Framework\\classHasAttribute')) {
73258    function classHasAttribute(string $attributeName) : ClassHasAttribute
73259    {
73260        return \PHPUnit\Framework\Assert::classHasAttribute(...func_get_args());
73261    }
73262}
73263if (!\function_exists('PHPUnit\\Framework\\classHasStaticAttribute')) {
73264    function classHasStaticAttribute(string $attributeName) : ClassHasStaticAttribute
73265    {
73266        return \PHPUnit\Framework\Assert::classHasStaticAttribute(...func_get_args());
73267    }
73268}
73269if (!\function_exists('PHPUnit\\Framework\\objectHasAttribute')) {
73270    function objectHasAttribute($attributeName) : ObjectHasAttribute
73271    {
73272        return \PHPUnit\Framework\Assert::objectHasAttribute(...func_get_args());
73273    }
73274}
73275if (!\function_exists('PHPUnit\\Framework\\identicalTo')) {
73276    function identicalTo($value) : IsIdentical
73277    {
73278        return \PHPUnit\Framework\Assert::identicalTo(...func_get_args());
73279    }
73280}
73281if (!\function_exists('PHPUnit\\Framework\\isInstanceOf')) {
73282    function isInstanceOf(string $className) : IsInstanceOf
73283    {
73284        return \PHPUnit\Framework\Assert::isInstanceOf(...func_get_args());
73285    }
73286}
73287if (!\function_exists('PHPUnit\\Framework\\isType')) {
73288    function isType(string $type) : IsType
73289    {
73290        return \PHPUnit\Framework\Assert::isType(...func_get_args());
73291    }
73292}
73293if (!\function_exists('PHPUnit\\Framework\\lessThan')) {
73294    function lessThan($value) : LessThan
73295    {
73296        return \PHPUnit\Framework\Assert::lessThan(...func_get_args());
73297    }
73298}
73299if (!\function_exists('PHPUnit\\Framework\\lessThanOrEqual')) {
73300    function lessThanOrEqual($value) : LogicalOr
73301    {
73302        return \PHPUnit\Framework\Assert::lessThanOrEqual(...func_get_args());
73303    }
73304}
73305if (!\function_exists('PHPUnit\\Framework\\matchesRegularExpression')) {
73306    function matchesRegularExpression(string $pattern) : RegularExpression
73307    {
73308        return \PHPUnit\Framework\Assert::matchesRegularExpression(...func_get_args());
73309    }
73310}
73311if (!\function_exists('PHPUnit\\Framework\\matches')) {
73312    function matches(string $string) : StringMatchesFormatDescription
73313    {
73314        return \PHPUnit\Framework\Assert::matches(...func_get_args());
73315    }
73316}
73317if (!\function_exists('PHPUnit\\Framework\\stringStartsWith')) {
73318    function stringStartsWith($prefix) : StringStartsWith
73319    {
73320        return \PHPUnit\Framework\Assert::stringStartsWith(...func_get_args());
73321    }
73322}
73323if (!\function_exists('PHPUnit\\Framework\\stringContains')) {
73324    function stringContains(string $string, bool $case = \true) : StringContains
73325    {
73326        return \PHPUnit\Framework\Assert::stringContains(...func_get_args());
73327    }
73328}
73329if (!\function_exists('PHPUnit\\Framework\\stringEndsWith')) {
73330    function stringEndsWith(string $suffix) : StringEndsWith
73331    {
73332        return \PHPUnit\Framework\Assert::stringEndsWith(...func_get_args());
73333    }
73334}
73335if (!\function_exists('PHPUnit\\Framework\\countOf')) {
73336    function countOf(int $count) : Count
73337    {
73338        return \PHPUnit\Framework\Assert::countOf(...func_get_args());
73339    }
73340}
73341if (!\function_exists('PHPUnit\\Framework\\objectEquals')) {
73342    function objectEquals(object $object, string $method = 'equals') : ObjectEquals
73343    {
73344        return \PHPUnit\Framework\Assert::objectEquals(...func_get_args());
73345    }
73346}
73347if (!\function_exists('PHPUnit\\Framework\\any')) {
73348    /**
73349     * Returns a matcher that matches when the method is executed
73350     * zero or more times.
73351     */
73352    function any() : AnyInvokedCountMatcher
73353    {
73354        return new AnyInvokedCountMatcher();
73355    }
73356}
73357if (!\function_exists('PHPUnit\\Framework\\never')) {
73358    /**
73359     * Returns a matcher that matches when the method is never executed.
73360     */
73361    function never() : InvokedCountMatcher
73362    {
73363        return new InvokedCountMatcher(0);
73364    }
73365}
73366if (!\function_exists('PHPUnit\\Framework\\atLeast')) {
73367    /**
73368     * Returns a matcher that matches when the method is executed
73369     * at least N times.
73370     */
73371    function atLeast(int $requiredInvocations) : InvokedAtLeastCountMatcher
73372    {
73373        return new InvokedAtLeastCountMatcher($requiredInvocations);
73374    }
73375}
73376if (!\function_exists('PHPUnit\\Framework\\atLeastOnce')) {
73377    /**
73378     * Returns a matcher that matches when the method is executed at least once.
73379     */
73380    function atLeastOnce() : InvokedAtLeastOnceMatcher
73381    {
73382        return new InvokedAtLeastOnceMatcher();
73383    }
73384}
73385if (!\function_exists('PHPUnit\\Framework\\once')) {
73386    /**
73387     * Returns a matcher that matches when the method is executed exactly once.
73388     */
73389    function once() : InvokedCountMatcher
73390    {
73391        return new InvokedCountMatcher(1);
73392    }
73393}
73394if (!\function_exists('PHPUnit\\Framework\\exactly')) {
73395    /**
73396     * Returns a matcher that matches when the method is executed
73397     * exactly $count times.
73398     */
73399    function exactly(int $count) : InvokedCountMatcher
73400    {
73401        return new InvokedCountMatcher($count);
73402    }
73403}
73404if (!\function_exists('PHPUnit\\Framework\\atMost')) {
73405    /**
73406     * Returns a matcher that matches when the method is executed
73407     * at most N times.
73408     */
73409    function atMost(int $allowedInvocations) : InvokedAtMostCountMatcher
73410    {
73411        return new InvokedAtMostCountMatcher($allowedInvocations);
73412    }
73413}
73414if (!\function_exists('PHPUnit\\Framework\\at')) {
73415    /**
73416     * Returns a matcher that matches when the method is executed
73417     * at the given index.
73418     */
73419    function at(int $index) : InvokedAtIndexMatcher
73420    {
73421        return new InvokedAtIndexMatcher($index);
73422    }
73423}
73424if (!\function_exists('PHPUnit\\Framework\\returnValue')) {
73425    function returnValue($value) : ReturnStub
73426    {
73427        return new ReturnStub($value);
73428    }
73429}
73430if (!\function_exists('PHPUnit\\Framework\\returnValueMap')) {
73431    function returnValueMap(array $valueMap) : ReturnValueMapStub
73432    {
73433        return new ReturnValueMapStub($valueMap);
73434    }
73435}
73436if (!\function_exists('PHPUnit\\Framework\\returnArgument')) {
73437    function returnArgument(int $argumentIndex) : ReturnArgumentStub
73438    {
73439        return new ReturnArgumentStub($argumentIndex);
73440    }
73441}
73442if (!\function_exists('PHPUnit\\Framework\\returnCallback')) {
73443    function returnCallback($callback) : ReturnCallbackStub
73444    {
73445        return new ReturnCallbackStub($callback);
73446    }
73447}
73448if (!\function_exists('PHPUnit\\Framework\\returnSelf')) {
73449    /**
73450     * Returns the current object.
73451     *
73452     * This method is useful when mocking a fluent interface.
73453     */
73454    function returnSelf() : ReturnSelfStub
73455    {
73456        return new ReturnSelfStub();
73457    }
73458}
73459if (!\function_exists('PHPUnit\\Framework\\throwException')) {
73460    function throwException(Throwable $exception) : ExceptionStub
73461    {
73462        return new ExceptionStub($exception);
73463    }
73464}
73465if (!\function_exists('PHPUnit\\Framework\\onConsecutiveCalls')) {
73466    function onConsecutiveCalls() : ConsecutiveCallsStub
73467    {
73468        $args = func_get_args();
73469        return new ConsecutiveCallsStub($args);
73470    }
73471}
73472<?php
73473
73474declare (strict_types=1);
73475/*
73476 * This file is part of PHPUnit.
73477 *
73478 * (c) Sebastian Bergmann <sebastian@phpunit.de>
73479 *
73480 * For the full copyright and license information, please view the LICENSE
73481 * file that was distributed with this source code.
73482 */
73483namespace PHPUnit\Framework;
73484
73485use Countable;
73486/**
73487 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
73488 */
73489interface Test extends Countable
73490{
73491    /**
73492     * Runs a test and collects its result in a TestResult instance.
73493     */
73494    public function run(\PHPUnit\Framework\TestResult $result = null) : \PHPUnit\Framework\TestResult;
73495}
73496<?php
73497
73498declare (strict_types=1);
73499/*
73500 * This file is part of PHPUnit.
73501 *
73502 * (c) Sebastian Bergmann <sebastian@phpunit.de>
73503 *
73504 * For the full copyright and license information, please view the LICENSE
73505 * file that was distributed with this source code.
73506 */
73507namespace PHPUnit\Framework;
73508
73509use const DEBUG_BACKTRACE_IGNORE_ARGS;
73510use const PHP_EOL;
73511use function array_shift;
73512use function array_unshift;
73513use function assert;
73514use function class_exists;
73515use function count;
73516use function debug_backtrace;
73517use function explode;
73518use function file_get_contents;
73519use function func_get_args;
73520use function implode;
73521use function interface_exists;
73522use function is_array;
73523use function is_bool;
73524use function is_int;
73525use function is_iterable;
73526use function is_object;
73527use function is_string;
73528use function preg_match;
73529use function preg_split;
73530use function sprintf;
73531use function strpos;
73532use ArrayAccess;
73533use Countable;
73534use DOMAttr;
73535use DOMDocument;
73536use DOMElement;
73537use PHPUnit\Framework\Constraint\ArrayHasKey;
73538use PHPUnit\Framework\Constraint\Callback;
73539use PHPUnit\Framework\Constraint\ClassHasAttribute;
73540use PHPUnit\Framework\Constraint\ClassHasStaticAttribute;
73541use PHPUnit\Framework\Constraint\Constraint;
73542use PHPUnit\Framework\Constraint\Count;
73543use PHPUnit\Framework\Constraint\DirectoryExists;
73544use PHPUnit\Framework\Constraint\FileExists;
73545use PHPUnit\Framework\Constraint\GreaterThan;
73546use PHPUnit\Framework\Constraint\IsAnything;
73547use PHPUnit\Framework\Constraint\IsEmpty;
73548use PHPUnit\Framework\Constraint\IsEqual;
73549use PHPUnit\Framework\Constraint\IsEqualCanonicalizing;
73550use PHPUnit\Framework\Constraint\IsEqualIgnoringCase;
73551use PHPUnit\Framework\Constraint\IsEqualWithDelta;
73552use PHPUnit\Framework\Constraint\IsFalse;
73553use PHPUnit\Framework\Constraint\IsFinite;
73554use PHPUnit\Framework\Constraint\IsIdentical;
73555use PHPUnit\Framework\Constraint\IsInfinite;
73556use PHPUnit\Framework\Constraint\IsInstanceOf;
73557use PHPUnit\Framework\Constraint\IsJson;
73558use PHPUnit\Framework\Constraint\IsNan;
73559use PHPUnit\Framework\Constraint\IsNull;
73560use PHPUnit\Framework\Constraint\IsReadable;
73561use PHPUnit\Framework\Constraint\IsTrue;
73562use PHPUnit\Framework\Constraint\IsType;
73563use PHPUnit\Framework\Constraint\IsWritable;
73564use PHPUnit\Framework\Constraint\JsonMatches;
73565use PHPUnit\Framework\Constraint\LessThan;
73566use PHPUnit\Framework\Constraint\LogicalAnd;
73567use PHPUnit\Framework\Constraint\LogicalNot;
73568use PHPUnit\Framework\Constraint\LogicalOr;
73569use PHPUnit\Framework\Constraint\LogicalXor;
73570use PHPUnit\Framework\Constraint\ObjectEquals;
73571use PHPUnit\Framework\Constraint\ObjectHasAttribute;
73572use PHPUnit\Framework\Constraint\RegularExpression;
73573use PHPUnit\Framework\Constraint\SameSize;
73574use PHPUnit\Framework\Constraint\StringContains;
73575use PHPUnit\Framework\Constraint\StringEndsWith;
73576use PHPUnit\Framework\Constraint\StringMatchesFormatDescription;
73577use PHPUnit\Framework\Constraint\StringStartsWith;
73578use PHPUnit\Framework\Constraint\TraversableContainsEqual;
73579use PHPUnit\Framework\Constraint\TraversableContainsIdentical;
73580use PHPUnit\Framework\Constraint\TraversableContainsOnly;
73581use PHPUnit\Util\Type;
73582use PHPUnit\Util\Xml;
73583use PHPUnit\Util\Xml\Loader as XmlLoader;
73584/**
73585 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
73586 */
73587abstract class Assert
73588{
73589    /**
73590     * @var int
73591     */
73592    private static $count = 0;
73593    /**
73594     * Asserts that an array has a specified key.
73595     *
73596     * @param int|string        $key
73597     * @param array|ArrayAccess $array
73598     *
73599     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73600     * @throws Exception
73601     * @throws ExpectationFailedException
73602     */
73603    public static function assertArrayHasKey($key, $array, string $message = '') : void
73604    {
73605        if (!(is_int($key) || is_string($key))) {
73606            throw \PHPUnit\Framework\InvalidArgumentException::create(1, 'integer or string');
73607        }
73608        if (!(is_array($array) || $array instanceof ArrayAccess)) {
73609            throw \PHPUnit\Framework\InvalidArgumentException::create(2, 'array or ArrayAccess');
73610        }
73611        $constraint = new ArrayHasKey($key);
73612        static::assertThat($array, $constraint, $message);
73613    }
73614    /**
73615     * Asserts that an array does not have a specified key.
73616     *
73617     * @param int|string        $key
73618     * @param array|ArrayAccess $array
73619     *
73620     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73621     * @throws Exception
73622     * @throws ExpectationFailedException
73623     */
73624    public static function assertArrayNotHasKey($key, $array, string $message = '') : void
73625    {
73626        if (!(is_int($key) || is_string($key))) {
73627            throw \PHPUnit\Framework\InvalidArgumentException::create(1, 'integer or string');
73628        }
73629        if (!(is_array($array) || $array instanceof ArrayAccess)) {
73630            throw \PHPUnit\Framework\InvalidArgumentException::create(2, 'array or ArrayAccess');
73631        }
73632        $constraint = new LogicalNot(new ArrayHasKey($key));
73633        static::assertThat($array, $constraint, $message);
73634    }
73635    /**
73636     * Asserts that a haystack contains a needle.
73637     *
73638     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73639     * @throws Exception
73640     * @throws ExpectationFailedException
73641     */
73642    public static function assertContains($needle, iterable $haystack, string $message = '') : void
73643    {
73644        $constraint = new TraversableContainsIdentical($needle);
73645        static::assertThat($haystack, $constraint, $message);
73646    }
73647    public static function assertContainsEquals($needle, iterable $haystack, string $message = '') : void
73648    {
73649        $constraint = new TraversableContainsEqual($needle);
73650        static::assertThat($haystack, $constraint, $message);
73651    }
73652    /**
73653     * Asserts that a haystack does not contain a needle.
73654     *
73655     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73656     * @throws Exception
73657     * @throws ExpectationFailedException
73658     */
73659    public static function assertNotContains($needle, iterable $haystack, string $message = '') : void
73660    {
73661        $constraint = new LogicalNot(new TraversableContainsIdentical($needle));
73662        static::assertThat($haystack, $constraint, $message);
73663    }
73664    public static function assertNotContainsEquals($needle, iterable $haystack, string $message = '') : void
73665    {
73666        $constraint = new LogicalNot(new TraversableContainsEqual($needle));
73667        static::assertThat($haystack, $constraint, $message);
73668    }
73669    /**
73670     * Asserts that a haystack contains only values of a given type.
73671     *
73672     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73673     * @throws ExpectationFailedException
73674     */
73675    public static function assertContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = null, string $message = '') : void
73676    {
73677        if ($isNativeType === null) {
73678            $isNativeType = Type::isType($type);
73679        }
73680        static::assertThat($haystack, new TraversableContainsOnly($type, $isNativeType), $message);
73681    }
73682    /**
73683     * Asserts that a haystack contains only instances of a given class name.
73684     *
73685     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73686     * @throws ExpectationFailedException
73687     */
73688    public static function assertContainsOnlyInstancesOf(string $className, iterable $haystack, string $message = '') : void
73689    {
73690        static::assertThat($haystack, new TraversableContainsOnly($className, \false), $message);
73691    }
73692    /**
73693     * Asserts that a haystack does not contain only values of a given type.
73694     *
73695     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73696     * @throws ExpectationFailedException
73697     */
73698    public static function assertNotContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = null, string $message = '') : void
73699    {
73700        if ($isNativeType === null) {
73701            $isNativeType = Type::isType($type);
73702        }
73703        static::assertThat($haystack, new LogicalNot(new TraversableContainsOnly($type, $isNativeType)), $message);
73704    }
73705    /**
73706     * Asserts the number of elements of an array, Countable or Traversable.
73707     *
73708     * @param Countable|iterable $haystack
73709     *
73710     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73711     * @throws Exception
73712     * @throws ExpectationFailedException
73713     */
73714    public static function assertCount(int $expectedCount, $haystack, string $message = '') : void
73715    {
73716        if (!$haystack instanceof Countable && !is_iterable($haystack)) {
73717            throw \PHPUnit\Framework\InvalidArgumentException::create(2, 'countable or iterable');
73718        }
73719        static::assertThat($haystack, new Count($expectedCount), $message);
73720    }
73721    /**
73722     * Asserts the number of elements of an array, Countable or Traversable.
73723     *
73724     * @param Countable|iterable $haystack
73725     *
73726     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73727     * @throws Exception
73728     * @throws ExpectationFailedException
73729     */
73730    public static function assertNotCount(int $expectedCount, $haystack, string $message = '') : void
73731    {
73732        if (!$haystack instanceof Countable && !is_iterable($haystack)) {
73733            throw \PHPUnit\Framework\InvalidArgumentException::create(2, 'countable or iterable');
73734        }
73735        $constraint = new LogicalNot(new Count($expectedCount));
73736        static::assertThat($haystack, $constraint, $message);
73737    }
73738    /**
73739     * Asserts that two variables are equal.
73740     *
73741     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73742     * @throws ExpectationFailedException
73743     */
73744    public static function assertEquals($expected, $actual, string $message = '') : void
73745    {
73746        $constraint = new IsEqual($expected);
73747        static::assertThat($actual, $constraint, $message);
73748    }
73749    /**
73750     * Asserts that two variables are equal (canonicalizing).
73751     *
73752     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73753     * @throws ExpectationFailedException
73754     */
73755    public static function assertEqualsCanonicalizing($expected, $actual, string $message = '') : void
73756    {
73757        $constraint = new IsEqualCanonicalizing($expected);
73758        static::assertThat($actual, $constraint, $message);
73759    }
73760    /**
73761     * Asserts that two variables are equal (ignoring case).
73762     *
73763     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73764     * @throws ExpectationFailedException
73765     */
73766    public static function assertEqualsIgnoringCase($expected, $actual, string $message = '') : void
73767    {
73768        $constraint = new IsEqualIgnoringCase($expected);
73769        static::assertThat($actual, $constraint, $message);
73770    }
73771    /**
73772     * Asserts that two variables are equal (with delta).
73773     *
73774     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73775     * @throws ExpectationFailedException
73776     */
73777    public static function assertEqualsWithDelta($expected, $actual, float $delta, string $message = '') : void
73778    {
73779        $constraint = new IsEqualWithDelta($expected, $delta);
73780        static::assertThat($actual, $constraint, $message);
73781    }
73782    /**
73783     * Asserts that two variables are not equal.
73784     *
73785     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73786     * @throws ExpectationFailedException
73787     */
73788    public static function assertNotEquals($expected, $actual, string $message = '') : void
73789    {
73790        $constraint = new LogicalNot(new IsEqual($expected));
73791        static::assertThat($actual, $constraint, $message);
73792    }
73793    /**
73794     * Asserts that two variables are not equal (canonicalizing).
73795     *
73796     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73797     * @throws ExpectationFailedException
73798     */
73799    public static function assertNotEqualsCanonicalizing($expected, $actual, string $message = '') : void
73800    {
73801        $constraint = new LogicalNot(new IsEqualCanonicalizing($expected));
73802        static::assertThat($actual, $constraint, $message);
73803    }
73804    /**
73805     * Asserts that two variables are not equal (ignoring case).
73806     *
73807     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73808     * @throws ExpectationFailedException
73809     */
73810    public static function assertNotEqualsIgnoringCase($expected, $actual, string $message = '') : void
73811    {
73812        $constraint = new LogicalNot(new IsEqualIgnoringCase($expected));
73813        static::assertThat($actual, $constraint, $message);
73814    }
73815    /**
73816     * Asserts that two variables are not equal (with delta).
73817     *
73818     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73819     * @throws ExpectationFailedException
73820     */
73821    public static function assertNotEqualsWithDelta($expected, $actual, float $delta, string $message = '') : void
73822    {
73823        $constraint = new LogicalNot(new IsEqualWithDelta($expected, $delta));
73824        static::assertThat($actual, $constraint, $message);
73825    }
73826    /**
73827     * @throws ExpectationFailedException
73828     */
73829    public static function assertObjectEquals(object $expected, object $actual, string $method = 'equals', string $message = '') : void
73830    {
73831        static::assertThat($actual, static::objectEquals($expected, $method), $message);
73832    }
73833    /**
73834     * Asserts that a variable is empty.
73835     *
73836     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73837     * @throws ExpectationFailedException
73838     *
73839     * @psalm-assert empty $actual
73840     */
73841    public static function assertEmpty($actual, string $message = '') : void
73842    {
73843        static::assertThat($actual, static::isEmpty(), $message);
73844    }
73845    /**
73846     * Asserts that a variable is not empty.
73847     *
73848     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73849     * @throws ExpectationFailedException
73850     *
73851     * @psalm-assert !empty $actual
73852     */
73853    public static function assertNotEmpty($actual, string $message = '') : void
73854    {
73855        static::assertThat($actual, static::logicalNot(static::isEmpty()), $message);
73856    }
73857    /**
73858     * Asserts that a value is greater than another value.
73859     *
73860     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73861     * @throws ExpectationFailedException
73862     */
73863    public static function assertGreaterThan($expected, $actual, string $message = '') : void
73864    {
73865        static::assertThat($actual, static::greaterThan($expected), $message);
73866    }
73867    /**
73868     * Asserts that a value is greater than or equal to another value.
73869     *
73870     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73871     * @throws ExpectationFailedException
73872     */
73873    public static function assertGreaterThanOrEqual($expected, $actual, string $message = '') : void
73874    {
73875        static::assertThat($actual, static::greaterThanOrEqual($expected), $message);
73876    }
73877    /**
73878     * Asserts that a value is smaller than another value.
73879     *
73880     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73881     * @throws ExpectationFailedException
73882     */
73883    public static function assertLessThan($expected, $actual, string $message = '') : void
73884    {
73885        static::assertThat($actual, static::lessThan($expected), $message);
73886    }
73887    /**
73888     * Asserts that a value is smaller than or equal to another value.
73889     *
73890     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73891     * @throws ExpectationFailedException
73892     */
73893    public static function assertLessThanOrEqual($expected, $actual, string $message = '') : void
73894    {
73895        static::assertThat($actual, static::lessThanOrEqual($expected), $message);
73896    }
73897    /**
73898     * Asserts that the contents of one file is equal to the contents of another
73899     * file.
73900     *
73901     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73902     * @throws ExpectationFailedException
73903     */
73904    public static function assertFileEquals(string $expected, string $actual, string $message = '') : void
73905    {
73906        static::assertFileExists($expected, $message);
73907        static::assertFileExists($actual, $message);
73908        $constraint = new IsEqual(file_get_contents($expected));
73909        static::assertThat(file_get_contents($actual), $constraint, $message);
73910    }
73911    /**
73912     * Asserts that the contents of one file is equal to the contents of another
73913     * file (canonicalizing).
73914     *
73915     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73916     * @throws ExpectationFailedException
73917     */
73918    public static function assertFileEqualsCanonicalizing(string $expected, string $actual, string $message = '') : void
73919    {
73920        static::assertFileExists($expected, $message);
73921        static::assertFileExists($actual, $message);
73922        $constraint = new IsEqualCanonicalizing(file_get_contents($expected));
73923        static::assertThat(file_get_contents($actual), $constraint, $message);
73924    }
73925    /**
73926     * Asserts that the contents of one file is equal to the contents of another
73927     * file (ignoring case).
73928     *
73929     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73930     * @throws ExpectationFailedException
73931     */
73932    public static function assertFileEqualsIgnoringCase(string $expected, string $actual, string $message = '') : void
73933    {
73934        static::assertFileExists($expected, $message);
73935        static::assertFileExists($actual, $message);
73936        $constraint = new IsEqualIgnoringCase(file_get_contents($expected));
73937        static::assertThat(file_get_contents($actual), $constraint, $message);
73938    }
73939    /**
73940     * Asserts that the contents of one file is not equal to the contents of
73941     * another file.
73942     *
73943     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73944     * @throws ExpectationFailedException
73945     */
73946    public static function assertFileNotEquals(string $expected, string $actual, string $message = '') : void
73947    {
73948        static::assertFileExists($expected, $message);
73949        static::assertFileExists($actual, $message);
73950        $constraint = new LogicalNot(new IsEqual(file_get_contents($expected)));
73951        static::assertThat(file_get_contents($actual), $constraint, $message);
73952    }
73953    /**
73954     * Asserts that the contents of one file is not equal to the contents of another
73955     * file (canonicalizing).
73956     *
73957     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73958     * @throws ExpectationFailedException
73959     */
73960    public static function assertFileNotEqualsCanonicalizing(string $expected, string $actual, string $message = '') : void
73961    {
73962        static::assertFileExists($expected, $message);
73963        static::assertFileExists($actual, $message);
73964        $constraint = new LogicalNot(new IsEqualCanonicalizing(file_get_contents($expected)));
73965        static::assertThat(file_get_contents($actual), $constraint, $message);
73966    }
73967    /**
73968     * Asserts that the contents of one file is not equal to the contents of another
73969     * file (ignoring case).
73970     *
73971     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73972     * @throws ExpectationFailedException
73973     */
73974    public static function assertFileNotEqualsIgnoringCase(string $expected, string $actual, string $message = '') : void
73975    {
73976        static::assertFileExists($expected, $message);
73977        static::assertFileExists($actual, $message);
73978        $constraint = new LogicalNot(new IsEqualIgnoringCase(file_get_contents($expected)));
73979        static::assertThat(file_get_contents($actual), $constraint, $message);
73980    }
73981    /**
73982     * Asserts that the contents of a string is equal
73983     * to the contents of a file.
73984     *
73985     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73986     * @throws ExpectationFailedException
73987     */
73988    public static function assertStringEqualsFile(string $expectedFile, string $actualString, string $message = '') : void
73989    {
73990        static::assertFileExists($expectedFile, $message);
73991        $constraint = new IsEqual(file_get_contents($expectedFile));
73992        static::assertThat($actualString, $constraint, $message);
73993    }
73994    /**
73995     * Asserts that the contents of a string is equal
73996     * to the contents of a file (canonicalizing).
73997     *
73998     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
73999     * @throws ExpectationFailedException
74000     */
74001    public static function assertStringEqualsFileCanonicalizing(string $expectedFile, string $actualString, string $message = '') : void
74002    {
74003        static::assertFileExists($expectedFile, $message);
74004        $constraint = new IsEqualCanonicalizing(file_get_contents($expectedFile));
74005        static::assertThat($actualString, $constraint, $message);
74006    }
74007    /**
74008     * Asserts that the contents of a string is equal
74009     * to the contents of a file (ignoring case).
74010     *
74011     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74012     * @throws ExpectationFailedException
74013     */
74014    public static function assertStringEqualsFileIgnoringCase(string $expectedFile, string $actualString, string $message = '') : void
74015    {
74016        static::assertFileExists($expectedFile, $message);
74017        $constraint = new IsEqualIgnoringCase(file_get_contents($expectedFile));
74018        static::assertThat($actualString, $constraint, $message);
74019    }
74020    /**
74021     * Asserts that the contents of a string is not equal
74022     * to the contents of a file.
74023     *
74024     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74025     * @throws ExpectationFailedException
74026     */
74027    public static function assertStringNotEqualsFile(string $expectedFile, string $actualString, string $message = '') : void
74028    {
74029        static::assertFileExists($expectedFile, $message);
74030        $constraint = new LogicalNot(new IsEqual(file_get_contents($expectedFile)));
74031        static::assertThat($actualString, $constraint, $message);
74032    }
74033    /**
74034     * Asserts that the contents of a string is not equal
74035     * to the contents of a file (canonicalizing).
74036     *
74037     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74038     * @throws ExpectationFailedException
74039     */
74040    public static function assertStringNotEqualsFileCanonicalizing(string $expectedFile, string $actualString, string $message = '') : void
74041    {
74042        static::assertFileExists($expectedFile, $message);
74043        $constraint = new LogicalNot(new IsEqualCanonicalizing(file_get_contents($expectedFile)));
74044        static::assertThat($actualString, $constraint, $message);
74045    }
74046    /**
74047     * Asserts that the contents of a string is not equal
74048     * to the contents of a file (ignoring case).
74049     *
74050     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74051     * @throws ExpectationFailedException
74052     */
74053    public static function assertStringNotEqualsFileIgnoringCase(string $expectedFile, string $actualString, string $message = '') : void
74054    {
74055        static::assertFileExists($expectedFile, $message);
74056        $constraint = new LogicalNot(new IsEqualIgnoringCase(file_get_contents($expectedFile)));
74057        static::assertThat($actualString, $constraint, $message);
74058    }
74059    /**
74060     * Asserts that a file/dir is readable.
74061     *
74062     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74063     * @throws ExpectationFailedException
74064     */
74065    public static function assertIsReadable(string $filename, string $message = '') : void
74066    {
74067        static::assertThat($filename, new IsReadable(), $message);
74068    }
74069    /**
74070     * Asserts that a file/dir exists and is not readable.
74071     *
74072     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74073     * @throws ExpectationFailedException
74074     */
74075    public static function assertIsNotReadable(string $filename, string $message = '') : void
74076    {
74077        static::assertThat($filename, new LogicalNot(new IsReadable()), $message);
74078    }
74079    /**
74080     * Asserts that a file/dir exists and is not readable.
74081     *
74082     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74083     * @throws ExpectationFailedException
74084     *
74085     * @codeCoverageIgnore
74086     *
74087     * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4062
74088     */
74089    public static function assertNotIsReadable(string $filename, string $message = '') : void
74090    {
74091        self::createWarning('assertNotIsReadable() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertIsNotReadable() instead.');
74092        static::assertThat($filename, new LogicalNot(new IsReadable()), $message);
74093    }
74094    /**
74095     * Asserts that a file/dir exists and is writable.
74096     *
74097     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74098     * @throws ExpectationFailedException
74099     */
74100    public static function assertIsWritable(string $filename, string $message = '') : void
74101    {
74102        static::assertThat($filename, new IsWritable(), $message);
74103    }
74104    /**
74105     * Asserts that a file/dir exists and is not writable.
74106     *
74107     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74108     * @throws ExpectationFailedException
74109     */
74110    public static function assertIsNotWritable(string $filename, string $message = '') : void
74111    {
74112        static::assertThat($filename, new LogicalNot(new IsWritable()), $message);
74113    }
74114    /**
74115     * Asserts that a file/dir exists and is not writable.
74116     *
74117     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74118     * @throws ExpectationFailedException
74119     *
74120     * @codeCoverageIgnore
74121     *
74122     * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4065
74123     */
74124    public static function assertNotIsWritable(string $filename, string $message = '') : void
74125    {
74126        self::createWarning('assertNotIsWritable() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertIsNotWritable() instead.');
74127        static::assertThat($filename, new LogicalNot(new IsWritable()), $message);
74128    }
74129    /**
74130     * Asserts that a directory exists.
74131     *
74132     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74133     * @throws ExpectationFailedException
74134     */
74135    public static function assertDirectoryExists(string $directory, string $message = '') : void
74136    {
74137        static::assertThat($directory, new DirectoryExists(), $message);
74138    }
74139    /**
74140     * Asserts that a directory does not exist.
74141     *
74142     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74143     * @throws ExpectationFailedException
74144     */
74145    public static function assertDirectoryDoesNotExist(string $directory, string $message = '') : void
74146    {
74147        static::assertThat($directory, new LogicalNot(new DirectoryExists()), $message);
74148    }
74149    /**
74150     * Asserts that a directory does not exist.
74151     *
74152     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74153     * @throws ExpectationFailedException
74154     *
74155     * @codeCoverageIgnore
74156     *
74157     * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4068
74158     */
74159    public static function assertDirectoryNotExists(string $directory, string $message = '') : void
74160    {
74161        self::createWarning('assertDirectoryNotExists() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertDirectoryDoesNotExist() instead.');
74162        static::assertThat($directory, new LogicalNot(new DirectoryExists()), $message);
74163    }
74164    /**
74165     * Asserts that a directory exists and is readable.
74166     *
74167     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74168     * @throws ExpectationFailedException
74169     */
74170    public static function assertDirectoryIsReadable(string $directory, string $message = '') : void
74171    {
74172        self::assertDirectoryExists($directory, $message);
74173        self::assertIsReadable($directory, $message);
74174    }
74175    /**
74176     * Asserts that a directory exists and is not readable.
74177     *
74178     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74179     * @throws ExpectationFailedException
74180     */
74181    public static function assertDirectoryIsNotReadable(string $directory, string $message = '') : void
74182    {
74183        self::assertDirectoryExists($directory, $message);
74184        self::assertIsNotReadable($directory, $message);
74185    }
74186    /**
74187     * Asserts that a directory exists and is not readable.
74188     *
74189     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74190     * @throws ExpectationFailedException
74191     *
74192     * @codeCoverageIgnore
74193     *
74194     * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4071
74195     */
74196    public static function assertDirectoryNotIsReadable(string $directory, string $message = '') : void
74197    {
74198        self::createWarning('assertDirectoryNotIsReadable() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertDirectoryIsNotReadable() instead.');
74199        self::assertDirectoryExists($directory, $message);
74200        self::assertIsNotReadable($directory, $message);
74201    }
74202    /**
74203     * Asserts that a directory exists and is writable.
74204     *
74205     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74206     * @throws ExpectationFailedException
74207     */
74208    public static function assertDirectoryIsWritable(string $directory, string $message = '') : void
74209    {
74210        self::assertDirectoryExists($directory, $message);
74211        self::assertIsWritable($directory, $message);
74212    }
74213    /**
74214     * Asserts that a directory exists and is not writable.
74215     *
74216     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74217     * @throws ExpectationFailedException
74218     */
74219    public static function assertDirectoryIsNotWritable(string $directory, string $message = '') : void
74220    {
74221        self::assertDirectoryExists($directory, $message);
74222        self::assertIsNotWritable($directory, $message);
74223    }
74224    /**
74225     * Asserts that a directory exists and is not writable.
74226     *
74227     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74228     * @throws ExpectationFailedException
74229     *
74230     * @codeCoverageIgnore
74231     *
74232     * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4074
74233     */
74234    public static function assertDirectoryNotIsWritable(string $directory, string $message = '') : void
74235    {
74236        self::createWarning('assertDirectoryNotIsWritable() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertDirectoryIsNotWritable() instead.');
74237        self::assertDirectoryExists($directory, $message);
74238        self::assertIsNotWritable($directory, $message);
74239    }
74240    /**
74241     * Asserts that a file exists.
74242     *
74243     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74244     * @throws ExpectationFailedException
74245     */
74246    public static function assertFileExists(string $filename, string $message = '') : void
74247    {
74248        static::assertThat($filename, new FileExists(), $message);
74249    }
74250    /**
74251     * Asserts that a file does not exist.
74252     *
74253     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74254     * @throws ExpectationFailedException
74255     */
74256    public static function assertFileDoesNotExist(string $filename, string $message = '') : void
74257    {
74258        static::assertThat($filename, new LogicalNot(new FileExists()), $message);
74259    }
74260    /**
74261     * Asserts that a file does not exist.
74262     *
74263     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74264     * @throws ExpectationFailedException
74265     *
74266     * @codeCoverageIgnore
74267     *
74268     * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4077
74269     */
74270    public static function assertFileNotExists(string $filename, string $message = '') : void
74271    {
74272        self::createWarning('assertFileNotExists() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertFileDoesNotExist() instead.');
74273        static::assertThat($filename, new LogicalNot(new FileExists()), $message);
74274    }
74275    /**
74276     * Asserts that a file exists and is readable.
74277     *
74278     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74279     * @throws ExpectationFailedException
74280     */
74281    public static function assertFileIsReadable(string $file, string $message = '') : void
74282    {
74283        self::assertFileExists($file, $message);
74284        self::assertIsReadable($file, $message);
74285    }
74286    /**
74287     * Asserts that a file exists and is not readable.
74288     *
74289     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74290     * @throws ExpectationFailedException
74291     */
74292    public static function assertFileIsNotReadable(string $file, string $message = '') : void
74293    {
74294        self::assertFileExists($file, $message);
74295        self::assertIsNotReadable($file, $message);
74296    }
74297    /**
74298     * Asserts that a file exists and is not readable.
74299     *
74300     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74301     * @throws ExpectationFailedException
74302     *
74303     * @codeCoverageIgnore
74304     *
74305     * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4080
74306     */
74307    public static function assertFileNotIsReadable(string $file, string $message = '') : void
74308    {
74309        self::createWarning('assertFileNotIsReadable() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertFileIsNotReadable() instead.');
74310        self::assertFileExists($file, $message);
74311        self::assertIsNotReadable($file, $message);
74312    }
74313    /**
74314     * Asserts that a file exists and is writable.
74315     *
74316     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74317     * @throws ExpectationFailedException
74318     */
74319    public static function assertFileIsWritable(string $file, string $message = '') : void
74320    {
74321        self::assertFileExists($file, $message);
74322        self::assertIsWritable($file, $message);
74323    }
74324    /**
74325     * Asserts that a file exists and is not writable.
74326     *
74327     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74328     * @throws ExpectationFailedException
74329     */
74330    public static function assertFileIsNotWritable(string $file, string $message = '') : void
74331    {
74332        self::assertFileExists($file, $message);
74333        self::assertIsNotWritable($file, $message);
74334    }
74335    /**
74336     * Asserts that a file exists and is not writable.
74337     *
74338     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74339     * @throws ExpectationFailedException
74340     *
74341     * @codeCoverageIgnore
74342     *
74343     * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4083
74344     */
74345    public static function assertFileNotIsWritable(string $file, string $message = '') : void
74346    {
74347        self::createWarning('assertFileNotIsWritable() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertFileIsNotWritable() instead.');
74348        self::assertFileExists($file, $message);
74349        self::assertIsNotWritable($file, $message);
74350    }
74351    /**
74352     * Asserts that a condition is true.
74353     *
74354     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74355     * @throws ExpectationFailedException
74356     *
74357     * @psalm-assert true $condition
74358     */
74359    public static function assertTrue($condition, string $message = '') : void
74360    {
74361        static::assertThat($condition, static::isTrue(), $message);
74362    }
74363    /**
74364     * Asserts that a condition is not true.
74365     *
74366     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74367     * @throws ExpectationFailedException
74368     *
74369     * @psalm-assert !true $condition
74370     */
74371    public static function assertNotTrue($condition, string $message = '') : void
74372    {
74373        static::assertThat($condition, static::logicalNot(static::isTrue()), $message);
74374    }
74375    /**
74376     * Asserts that a condition is false.
74377     *
74378     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74379     * @throws ExpectationFailedException
74380     *
74381     * @psalm-assert false $condition
74382     */
74383    public static function assertFalse($condition, string $message = '') : void
74384    {
74385        static::assertThat($condition, static::isFalse(), $message);
74386    }
74387    /**
74388     * Asserts that a condition is not false.
74389     *
74390     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74391     * @throws ExpectationFailedException
74392     *
74393     * @psalm-assert !false $condition
74394     */
74395    public static function assertNotFalse($condition, string $message = '') : void
74396    {
74397        static::assertThat($condition, static::logicalNot(static::isFalse()), $message);
74398    }
74399    /**
74400     * Asserts that a variable is null.
74401     *
74402     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74403     * @throws ExpectationFailedException
74404     *
74405     * @psalm-assert null $actual
74406     */
74407    public static function assertNull($actual, string $message = '') : void
74408    {
74409        static::assertThat($actual, static::isNull(), $message);
74410    }
74411    /**
74412     * Asserts that a variable is not null.
74413     *
74414     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74415     * @throws ExpectationFailedException
74416     *
74417     * @psalm-assert !null $actual
74418     */
74419    public static function assertNotNull($actual, string $message = '') : void
74420    {
74421        static::assertThat($actual, static::logicalNot(static::isNull()), $message);
74422    }
74423    /**
74424     * Asserts that a variable is finite.
74425     *
74426     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74427     * @throws ExpectationFailedException
74428     */
74429    public static function assertFinite($actual, string $message = '') : void
74430    {
74431        static::assertThat($actual, static::isFinite(), $message);
74432    }
74433    /**
74434     * Asserts that a variable is infinite.
74435     *
74436     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74437     * @throws ExpectationFailedException
74438     */
74439    public static function assertInfinite($actual, string $message = '') : void
74440    {
74441        static::assertThat($actual, static::isInfinite(), $message);
74442    }
74443    /**
74444     * Asserts that a variable is nan.
74445     *
74446     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74447     * @throws ExpectationFailedException
74448     */
74449    public static function assertNan($actual, string $message = '') : void
74450    {
74451        static::assertThat($actual, static::isNan(), $message);
74452    }
74453    /**
74454     * Asserts that a class has a specified attribute.
74455     *
74456     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74457     * @throws Exception
74458     * @throws ExpectationFailedException
74459     */
74460    public static function assertClassHasAttribute(string $attributeName, string $className, string $message = '') : void
74461    {
74462        if (!self::isValidClassAttributeName($attributeName)) {
74463            throw \PHPUnit\Framework\InvalidArgumentException::create(1, 'valid attribute name');
74464        }
74465        if (!class_exists($className)) {
74466            throw \PHPUnit\Framework\InvalidArgumentException::create(2, 'class name');
74467        }
74468        static::assertThat($className, new ClassHasAttribute($attributeName), $message);
74469    }
74470    /**
74471     * Asserts that a class does not have a specified attribute.
74472     *
74473     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74474     * @throws Exception
74475     * @throws ExpectationFailedException
74476     */
74477    public static function assertClassNotHasAttribute(string $attributeName, string $className, string $message = '') : void
74478    {
74479        if (!self::isValidClassAttributeName($attributeName)) {
74480            throw \PHPUnit\Framework\InvalidArgumentException::create(1, 'valid attribute name');
74481        }
74482        if (!class_exists($className)) {
74483            throw \PHPUnit\Framework\InvalidArgumentException::create(2, 'class name');
74484        }
74485        static::assertThat($className, new LogicalNot(new ClassHasAttribute($attributeName)), $message);
74486    }
74487    /**
74488     * Asserts that a class has a specified static attribute.
74489     *
74490     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74491     * @throws Exception
74492     * @throws ExpectationFailedException
74493     */
74494    public static function assertClassHasStaticAttribute(string $attributeName, string $className, string $message = '') : void
74495    {
74496        if (!self::isValidClassAttributeName($attributeName)) {
74497            throw \PHPUnit\Framework\InvalidArgumentException::create(1, 'valid attribute name');
74498        }
74499        if (!class_exists($className)) {
74500            throw \PHPUnit\Framework\InvalidArgumentException::create(2, 'class name');
74501        }
74502        static::assertThat($className, new ClassHasStaticAttribute($attributeName), $message);
74503    }
74504    /**
74505     * Asserts that a class does not have a specified static attribute.
74506     *
74507     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74508     * @throws Exception
74509     * @throws ExpectationFailedException
74510     */
74511    public static function assertClassNotHasStaticAttribute(string $attributeName, string $className, string $message = '') : void
74512    {
74513        if (!self::isValidClassAttributeName($attributeName)) {
74514            throw \PHPUnit\Framework\InvalidArgumentException::create(1, 'valid attribute name');
74515        }
74516        if (!class_exists($className)) {
74517            throw \PHPUnit\Framework\InvalidArgumentException::create(2, 'class name');
74518        }
74519        static::assertThat($className, new LogicalNot(new ClassHasStaticAttribute($attributeName)), $message);
74520    }
74521    /**
74522     * Asserts that an object has a specified attribute.
74523     *
74524     * @param object $object
74525     *
74526     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74527     * @throws Exception
74528     * @throws ExpectationFailedException
74529     */
74530    public static function assertObjectHasAttribute(string $attributeName, $object, string $message = '') : void
74531    {
74532        if (!self::isValidObjectAttributeName($attributeName)) {
74533            throw \PHPUnit\Framework\InvalidArgumentException::create(1, 'valid attribute name');
74534        }
74535        if (!is_object($object)) {
74536            throw \PHPUnit\Framework\InvalidArgumentException::create(2, 'object');
74537        }
74538        static::assertThat($object, new ObjectHasAttribute($attributeName), $message);
74539    }
74540    /**
74541     * Asserts that an object does not have a specified attribute.
74542     *
74543     * @param object $object
74544     *
74545     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74546     * @throws Exception
74547     * @throws ExpectationFailedException
74548     */
74549    public static function assertObjectNotHasAttribute(string $attributeName, $object, string $message = '') : void
74550    {
74551        if (!self::isValidObjectAttributeName($attributeName)) {
74552            throw \PHPUnit\Framework\InvalidArgumentException::create(1, 'valid attribute name');
74553        }
74554        if (!is_object($object)) {
74555            throw \PHPUnit\Framework\InvalidArgumentException::create(2, 'object');
74556        }
74557        static::assertThat($object, new LogicalNot(new ObjectHasAttribute($attributeName)), $message);
74558    }
74559    /**
74560     * Asserts that two variables have the same type and value.
74561     * Used on objects, it asserts that two variables reference
74562     * the same object.
74563     *
74564     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74565     * @throws ExpectationFailedException
74566     *
74567     * @psalm-template ExpectedType
74568     * @psalm-param ExpectedType $expected
74569     * @psalm-assert =ExpectedType $actual
74570     */
74571    public static function assertSame($expected, $actual, string $message = '') : void
74572    {
74573        static::assertThat($actual, new IsIdentical($expected), $message);
74574    }
74575    /**
74576     * Asserts that two variables do not have the same type and value.
74577     * Used on objects, it asserts that two variables do not reference
74578     * the same object.
74579     *
74580     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74581     * @throws ExpectationFailedException
74582     */
74583    public static function assertNotSame($expected, $actual, string $message = '') : void
74584    {
74585        if (is_bool($expected) && is_bool($actual)) {
74586            static::assertNotEquals($expected, $actual, $message);
74587        }
74588        static::assertThat($actual, new LogicalNot(new IsIdentical($expected)), $message);
74589    }
74590    /**
74591     * Asserts that a variable is of a given type.
74592     *
74593     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74594     * @throws Exception
74595     * @throws ExpectationFailedException
74596     *
74597     * @psalm-template ExpectedType of object
74598     * @psalm-param class-string<ExpectedType> $expected
74599     * @psalm-assert =ExpectedType $actual
74600     */
74601    public static function assertInstanceOf(string $expected, $actual, string $message = '') : void
74602    {
74603        if (!class_exists($expected) && !interface_exists($expected)) {
74604            throw \PHPUnit\Framework\InvalidArgumentException::create(1, 'class or interface name');
74605        }
74606        static::assertThat($actual, new IsInstanceOf($expected), $message);
74607    }
74608    /**
74609     * Asserts that a variable is not of a given type.
74610     *
74611     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74612     * @throws Exception
74613     * @throws ExpectationFailedException
74614     *
74615     * @psalm-template ExpectedType of object
74616     * @psalm-param class-string<ExpectedType> $expected
74617     * @psalm-assert !ExpectedType $actual
74618     */
74619    public static function assertNotInstanceOf(string $expected, $actual, string $message = '') : void
74620    {
74621        if (!class_exists($expected) && !interface_exists($expected)) {
74622            throw \PHPUnit\Framework\InvalidArgumentException::create(1, 'class or interface name');
74623        }
74624        static::assertThat($actual, new LogicalNot(new IsInstanceOf($expected)), $message);
74625    }
74626    /**
74627     * Asserts that a variable is of type array.
74628     *
74629     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74630     * @throws ExpectationFailedException
74631     *
74632     * @psalm-assert array $actual
74633     */
74634    public static function assertIsArray($actual, string $message = '') : void
74635    {
74636        static::assertThat($actual, new IsType(IsType::TYPE_ARRAY), $message);
74637    }
74638    /**
74639     * Asserts that a variable is of type bool.
74640     *
74641     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74642     * @throws ExpectationFailedException
74643     *
74644     * @psalm-assert bool $actual
74645     */
74646    public static function assertIsBool($actual, string $message = '') : void
74647    {
74648        static::assertThat($actual, new IsType(IsType::TYPE_BOOL), $message);
74649    }
74650    /**
74651     * Asserts that a variable is of type float.
74652     *
74653     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74654     * @throws ExpectationFailedException
74655     *
74656     * @psalm-assert float $actual
74657     */
74658    public static function assertIsFloat($actual, string $message = '') : void
74659    {
74660        static::assertThat($actual, new IsType(IsType::TYPE_FLOAT), $message);
74661    }
74662    /**
74663     * Asserts that a variable is of type int.
74664     *
74665     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74666     * @throws ExpectationFailedException
74667     *
74668     * @psalm-assert int $actual
74669     */
74670    public static function assertIsInt($actual, string $message = '') : void
74671    {
74672        static::assertThat($actual, new IsType(IsType::TYPE_INT), $message);
74673    }
74674    /**
74675     * Asserts that a variable is of type numeric.
74676     *
74677     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74678     * @throws ExpectationFailedException
74679     *
74680     * @psalm-assert numeric $actual
74681     */
74682    public static function assertIsNumeric($actual, string $message = '') : void
74683    {
74684        static::assertThat($actual, new IsType(IsType::TYPE_NUMERIC), $message);
74685    }
74686    /**
74687     * Asserts that a variable is of type object.
74688     *
74689     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74690     * @throws ExpectationFailedException
74691     *
74692     * @psalm-assert object $actual
74693     */
74694    public static function assertIsObject($actual, string $message = '') : void
74695    {
74696        static::assertThat($actual, new IsType(IsType::TYPE_OBJECT), $message);
74697    }
74698    /**
74699     * Asserts that a variable is of type resource.
74700     *
74701     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74702     * @throws ExpectationFailedException
74703     *
74704     * @psalm-assert resource $actual
74705     */
74706    public static function assertIsResource($actual, string $message = '') : void
74707    {
74708        static::assertThat($actual, new IsType(IsType::TYPE_RESOURCE), $message);
74709    }
74710    /**
74711     * Asserts that a variable is of type resource and is closed.
74712     *
74713     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74714     * @throws ExpectationFailedException
74715     *
74716     * @psalm-assert resource $actual
74717     */
74718    public static function assertIsClosedResource($actual, string $message = '') : void
74719    {
74720        static::assertThat($actual, new IsType(IsType::TYPE_CLOSED_RESOURCE), $message);
74721    }
74722    /**
74723     * Asserts that a variable is of type string.
74724     *
74725     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74726     * @throws ExpectationFailedException
74727     *
74728     * @psalm-assert string $actual
74729     */
74730    public static function assertIsString($actual, string $message = '') : void
74731    {
74732        static::assertThat($actual, new IsType(IsType::TYPE_STRING), $message);
74733    }
74734    /**
74735     * Asserts that a variable is of type scalar.
74736     *
74737     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74738     * @throws ExpectationFailedException
74739     *
74740     * @psalm-assert scalar $actual
74741     */
74742    public static function assertIsScalar($actual, string $message = '') : void
74743    {
74744        static::assertThat($actual, new IsType(IsType::TYPE_SCALAR), $message);
74745    }
74746    /**
74747     * Asserts that a variable is of type callable.
74748     *
74749     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74750     * @throws ExpectationFailedException
74751     *
74752     * @psalm-assert callable $actual
74753     */
74754    public static function assertIsCallable($actual, string $message = '') : void
74755    {
74756        static::assertThat($actual, new IsType(IsType::TYPE_CALLABLE), $message);
74757    }
74758    /**
74759     * Asserts that a variable is of type iterable.
74760     *
74761     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74762     * @throws ExpectationFailedException
74763     *
74764     * @psalm-assert iterable $actual
74765     */
74766    public static function assertIsIterable($actual, string $message = '') : void
74767    {
74768        static::assertThat($actual, new IsType(IsType::TYPE_ITERABLE), $message);
74769    }
74770    /**
74771     * Asserts that a variable is not of type array.
74772     *
74773     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74774     * @throws ExpectationFailedException
74775     *
74776     * @psalm-assert !array $actual
74777     */
74778    public static function assertIsNotArray($actual, string $message = '') : void
74779    {
74780        static::assertThat($actual, new LogicalNot(new IsType(IsType::TYPE_ARRAY)), $message);
74781    }
74782    /**
74783     * Asserts that a variable is not of type bool.
74784     *
74785     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74786     * @throws ExpectationFailedException
74787     *
74788     * @psalm-assert !bool $actual
74789     */
74790    public static function assertIsNotBool($actual, string $message = '') : void
74791    {
74792        static::assertThat($actual, new LogicalNot(new IsType(IsType::TYPE_BOOL)), $message);
74793    }
74794    /**
74795     * Asserts that a variable is not of type float.
74796     *
74797     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74798     * @throws ExpectationFailedException
74799     *
74800     * @psalm-assert !float $actual
74801     */
74802    public static function assertIsNotFloat($actual, string $message = '') : void
74803    {
74804        static::assertThat($actual, new LogicalNot(new IsType(IsType::TYPE_FLOAT)), $message);
74805    }
74806    /**
74807     * Asserts that a variable is not of type int.
74808     *
74809     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74810     * @throws ExpectationFailedException
74811     *
74812     * @psalm-assert !int $actual
74813     */
74814    public static function assertIsNotInt($actual, string $message = '') : void
74815    {
74816        static::assertThat($actual, new LogicalNot(new IsType(IsType::TYPE_INT)), $message);
74817    }
74818    /**
74819     * Asserts that a variable is not of type numeric.
74820     *
74821     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74822     * @throws ExpectationFailedException
74823     *
74824     * @psalm-assert !numeric $actual
74825     */
74826    public static function assertIsNotNumeric($actual, string $message = '') : void
74827    {
74828        static::assertThat($actual, new LogicalNot(new IsType(IsType::TYPE_NUMERIC)), $message);
74829    }
74830    /**
74831     * Asserts that a variable is not of type object.
74832     *
74833     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74834     * @throws ExpectationFailedException
74835     *
74836     * @psalm-assert !object $actual
74837     */
74838    public static function assertIsNotObject($actual, string $message = '') : void
74839    {
74840        static::assertThat($actual, new LogicalNot(new IsType(IsType::TYPE_OBJECT)), $message);
74841    }
74842    /**
74843     * Asserts that a variable is not of type resource.
74844     *
74845     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74846     * @throws ExpectationFailedException
74847     *
74848     * @psalm-assert !resource $actual
74849     */
74850    public static function assertIsNotResource($actual, string $message = '') : void
74851    {
74852        static::assertThat($actual, new LogicalNot(new IsType(IsType::TYPE_RESOURCE)), $message);
74853    }
74854    /**
74855     * Asserts that a variable is not of type resource.
74856     *
74857     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74858     * @throws ExpectationFailedException
74859     *
74860     * @psalm-assert !resource $actual
74861     */
74862    public static function assertIsNotClosedResource($actual, string $message = '') : void
74863    {
74864        static::assertThat($actual, new LogicalNot(new IsType(IsType::TYPE_CLOSED_RESOURCE)), $message);
74865    }
74866    /**
74867     * Asserts that a variable is not of type string.
74868     *
74869     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74870     * @throws ExpectationFailedException
74871     *
74872     * @psalm-assert !string $actual
74873     */
74874    public static function assertIsNotString($actual, string $message = '') : void
74875    {
74876        static::assertThat($actual, new LogicalNot(new IsType(IsType::TYPE_STRING)), $message);
74877    }
74878    /**
74879     * Asserts that a variable is not of type scalar.
74880     *
74881     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74882     * @throws ExpectationFailedException
74883     *
74884     * @psalm-assert !scalar $actual
74885     */
74886    public static function assertIsNotScalar($actual, string $message = '') : void
74887    {
74888        static::assertThat($actual, new LogicalNot(new IsType(IsType::TYPE_SCALAR)), $message);
74889    }
74890    /**
74891     * Asserts that a variable is not of type callable.
74892     *
74893     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74894     * @throws ExpectationFailedException
74895     *
74896     * @psalm-assert !callable $actual
74897     */
74898    public static function assertIsNotCallable($actual, string $message = '') : void
74899    {
74900        static::assertThat($actual, new LogicalNot(new IsType(IsType::TYPE_CALLABLE)), $message);
74901    }
74902    /**
74903     * Asserts that a variable is not of type iterable.
74904     *
74905     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74906     * @throws ExpectationFailedException
74907     *
74908     * @psalm-assert !iterable $actual
74909     */
74910    public static function assertIsNotIterable($actual, string $message = '') : void
74911    {
74912        static::assertThat($actual, new LogicalNot(new IsType(IsType::TYPE_ITERABLE)), $message);
74913    }
74914    /**
74915     * Asserts that a string matches a given regular expression.
74916     *
74917     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74918     * @throws ExpectationFailedException
74919     */
74920    public static function assertMatchesRegularExpression(string $pattern, string $string, string $message = '') : void
74921    {
74922        static::assertThat($string, new RegularExpression($pattern), $message);
74923    }
74924    /**
74925     * Asserts that a string matches a given regular expression.
74926     *
74927     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74928     * @throws ExpectationFailedException
74929     *
74930     * @codeCoverageIgnore
74931     *
74932     * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4086
74933     */
74934    public static function assertRegExp(string $pattern, string $string, string $message = '') : void
74935    {
74936        self::createWarning('assertRegExp() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertMatchesRegularExpression() instead.');
74937        static::assertThat($string, new RegularExpression($pattern), $message);
74938    }
74939    /**
74940     * Asserts that a string does not match a given regular expression.
74941     *
74942     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74943     * @throws ExpectationFailedException
74944     */
74945    public static function assertDoesNotMatchRegularExpression(string $pattern, string $string, string $message = '') : void
74946    {
74947        static::assertThat($string, new LogicalNot(new RegularExpression($pattern)), $message);
74948    }
74949    /**
74950     * Asserts that a string does not match a given regular expression.
74951     *
74952     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74953     * @throws ExpectationFailedException
74954     *
74955     * @codeCoverageIgnore
74956     *
74957     * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4089
74958     */
74959    public static function assertNotRegExp(string $pattern, string $string, string $message = '') : void
74960    {
74961        self::createWarning('assertNotRegExp() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertDoesNotMatchRegularExpression() instead.');
74962        static::assertThat($string, new LogicalNot(new RegularExpression($pattern)), $message);
74963    }
74964    /**
74965     * Assert that the size of two arrays (or `Countable` or `Traversable` objects)
74966     * is the same.
74967     *
74968     * @param Countable|iterable $expected
74969     * @param Countable|iterable $actual
74970     *
74971     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74972     * @throws Exception
74973     * @throws ExpectationFailedException
74974     */
74975    public static function assertSameSize($expected, $actual, string $message = '') : void
74976    {
74977        if (!$expected instanceof Countable && !is_iterable($expected)) {
74978            throw \PHPUnit\Framework\InvalidArgumentException::create(1, 'countable or iterable');
74979        }
74980        if (!$actual instanceof Countable && !is_iterable($actual)) {
74981            throw \PHPUnit\Framework\InvalidArgumentException::create(2, 'countable or iterable');
74982        }
74983        static::assertThat($actual, new SameSize($expected), $message);
74984    }
74985    /**
74986     * Assert that the size of two arrays (or `Countable` or `Traversable` objects)
74987     * is not the same.
74988     *
74989     * @param Countable|iterable $expected
74990     * @param Countable|iterable $actual
74991     *
74992     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
74993     * @throws Exception
74994     * @throws ExpectationFailedException
74995     */
74996    public static function assertNotSameSize($expected, $actual, string $message = '') : void
74997    {
74998        if (!$expected instanceof Countable && !is_iterable($expected)) {
74999            throw \PHPUnit\Framework\InvalidArgumentException::create(1, 'countable or iterable');
75000        }
75001        if (!$actual instanceof Countable && !is_iterable($actual)) {
75002            throw \PHPUnit\Framework\InvalidArgumentException::create(2, 'countable or iterable');
75003        }
75004        static::assertThat($actual, new LogicalNot(new SameSize($expected)), $message);
75005    }
75006    /**
75007     * Asserts that a string matches a given format string.
75008     *
75009     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75010     * @throws ExpectationFailedException
75011     */
75012    public static function assertStringMatchesFormat(string $format, string $string, string $message = '') : void
75013    {
75014        static::assertThat($string, new StringMatchesFormatDescription($format), $message);
75015    }
75016    /**
75017     * Asserts that a string does not match a given format string.
75018     *
75019     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75020     * @throws ExpectationFailedException
75021     */
75022    public static function assertStringNotMatchesFormat(string $format, string $string, string $message = '') : void
75023    {
75024        static::assertThat($string, new LogicalNot(new StringMatchesFormatDescription($format)), $message);
75025    }
75026    /**
75027     * Asserts that a string matches a given format file.
75028     *
75029     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75030     * @throws ExpectationFailedException
75031     */
75032    public static function assertStringMatchesFormatFile(string $formatFile, string $string, string $message = '') : void
75033    {
75034        static::assertFileExists($formatFile, $message);
75035        static::assertThat($string, new StringMatchesFormatDescription(file_get_contents($formatFile)), $message);
75036    }
75037    /**
75038     * Asserts that a string does not match a given format string.
75039     *
75040     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75041     * @throws ExpectationFailedException
75042     */
75043    public static function assertStringNotMatchesFormatFile(string $formatFile, string $string, string $message = '') : void
75044    {
75045        static::assertFileExists($formatFile, $message);
75046        static::assertThat($string, new LogicalNot(new StringMatchesFormatDescription(file_get_contents($formatFile))), $message);
75047    }
75048    /**
75049     * Asserts that a string starts with a given prefix.
75050     *
75051     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75052     * @throws ExpectationFailedException
75053     */
75054    public static function assertStringStartsWith(string $prefix, string $string, string $message = '') : void
75055    {
75056        static::assertThat($string, new StringStartsWith($prefix), $message);
75057    }
75058    /**
75059     * Asserts that a string starts not with a given prefix.
75060     *
75061     * @param string $prefix
75062     * @param string $string
75063     *
75064     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75065     * @throws ExpectationFailedException
75066     */
75067    public static function assertStringStartsNotWith($prefix, $string, string $message = '') : void
75068    {
75069        static::assertThat($string, new LogicalNot(new StringStartsWith($prefix)), $message);
75070    }
75071    /**
75072     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75073     * @throws ExpectationFailedException
75074     */
75075    public static function assertStringContainsString(string $needle, string $haystack, string $message = '') : void
75076    {
75077        $constraint = new StringContains($needle, \false);
75078        static::assertThat($haystack, $constraint, $message);
75079    }
75080    /**
75081     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75082     * @throws ExpectationFailedException
75083     */
75084    public static function assertStringContainsStringIgnoringCase(string $needle, string $haystack, string $message = '') : void
75085    {
75086        $constraint = new StringContains($needle, \true);
75087        static::assertThat($haystack, $constraint, $message);
75088    }
75089    /**
75090     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75091     * @throws ExpectationFailedException
75092     */
75093    public static function assertStringNotContainsString(string $needle, string $haystack, string $message = '') : void
75094    {
75095        $constraint = new LogicalNot(new StringContains($needle));
75096        static::assertThat($haystack, $constraint, $message);
75097    }
75098    /**
75099     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75100     * @throws ExpectationFailedException
75101     */
75102    public static function assertStringNotContainsStringIgnoringCase(string $needle, string $haystack, string $message = '') : void
75103    {
75104        $constraint = new LogicalNot(new StringContains($needle, \true));
75105        static::assertThat($haystack, $constraint, $message);
75106    }
75107    /**
75108     * Asserts that a string ends with a given suffix.
75109     *
75110     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75111     * @throws ExpectationFailedException
75112     */
75113    public static function assertStringEndsWith(string $suffix, string $string, string $message = '') : void
75114    {
75115        static::assertThat($string, new StringEndsWith($suffix), $message);
75116    }
75117    /**
75118     * Asserts that a string ends not with a given suffix.
75119     *
75120     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75121     * @throws ExpectationFailedException
75122     */
75123    public static function assertStringEndsNotWith(string $suffix, string $string, string $message = '') : void
75124    {
75125        static::assertThat($string, new LogicalNot(new StringEndsWith($suffix)), $message);
75126    }
75127    /**
75128     * Asserts that two XML files are equal.
75129     *
75130     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75131     * @throws Exception
75132     * @throws ExpectationFailedException
75133     */
75134    public static function assertXmlFileEqualsXmlFile(string $expectedFile, string $actualFile, string $message = '') : void
75135    {
75136        $expected = (new XmlLoader())->loadFile($expectedFile);
75137        $actual = (new XmlLoader())->loadFile($actualFile);
75138        static::assertEquals($expected, $actual, $message);
75139    }
75140    /**
75141     * Asserts that two XML files are not equal.
75142     *
75143     * @throws \PHPUnit\Util\Exception
75144     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75145     * @throws ExpectationFailedException
75146     */
75147    public static function assertXmlFileNotEqualsXmlFile(string $expectedFile, string $actualFile, string $message = '') : void
75148    {
75149        $expected = (new XmlLoader())->loadFile($expectedFile);
75150        $actual = (new XmlLoader())->loadFile($actualFile);
75151        static::assertNotEquals($expected, $actual, $message);
75152    }
75153    /**
75154     * Asserts that two XML documents are equal.
75155     *
75156     * @param DOMDocument|string $actualXml
75157     *
75158     * @throws \PHPUnit\Util\Xml\Exception
75159     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75160     * @throws ExpectationFailedException
75161     */
75162    public static function assertXmlStringEqualsXmlFile(string $expectedFile, $actualXml, string $message = '') : void
75163    {
75164        if (!is_string($actualXml)) {
75165            self::createWarning('Passing an argument of type DOMDocument for the $actualXml parameter is deprecated. Support for this will be removed in PHPUnit 10.');
75166            $actual = $actualXml;
75167        } else {
75168            $actual = (new XmlLoader())->load($actualXml);
75169        }
75170        $expected = (new XmlLoader())->loadFile($expectedFile);
75171        static::assertEquals($expected, $actual, $message);
75172    }
75173    /**
75174     * Asserts that two XML documents are not equal.
75175     *
75176     * @param DOMDocument|string $actualXml
75177     *
75178     * @throws \PHPUnit\Util\Xml\Exception
75179     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75180     * @throws ExpectationFailedException
75181     */
75182    public static function assertXmlStringNotEqualsXmlFile(string $expectedFile, $actualXml, string $message = '') : void
75183    {
75184        if (!is_string($actualXml)) {
75185            self::createWarning('Passing an argument of type DOMDocument for the $actualXml parameter is deprecated. Support for this will be removed in PHPUnit 10.');
75186            $actual = $actualXml;
75187        } else {
75188            $actual = (new XmlLoader())->load($actualXml);
75189        }
75190        $expected = (new XmlLoader())->loadFile($expectedFile);
75191        static::assertNotEquals($expected, $actual, $message);
75192    }
75193    /**
75194     * Asserts that two XML documents are equal.
75195     *
75196     * @param DOMDocument|string $expectedXml
75197     * @param DOMDocument|string $actualXml
75198     *
75199     * @throws \PHPUnit\Util\Xml\Exception
75200     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75201     * @throws ExpectationFailedException
75202     */
75203    public static function assertXmlStringEqualsXmlString($expectedXml, $actualXml, string $message = '') : void
75204    {
75205        if (!is_string($expectedXml)) {
75206            self::createWarning('Passing an argument of type DOMDocument for the $expectedXml parameter is deprecated. Support for this will be removed in PHPUnit 10.');
75207            $expected = $expectedXml;
75208        } else {
75209            $expected = (new XmlLoader())->load($expectedXml);
75210        }
75211        if (!is_string($actualXml)) {
75212            self::createWarning('Passing an argument of type DOMDocument for the $actualXml parameter is deprecated. Support for this will be removed in PHPUnit 10.');
75213            $actual = $actualXml;
75214        } else {
75215            $actual = (new XmlLoader())->load($actualXml);
75216        }
75217        static::assertEquals($expected, $actual, $message);
75218    }
75219    /**
75220     * Asserts that two XML documents are not equal.
75221     *
75222     * @param DOMDocument|string $expectedXml
75223     * @param DOMDocument|string $actualXml
75224     *
75225     * @throws \PHPUnit\Util\Xml\Exception
75226     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75227     * @throws ExpectationFailedException
75228     */
75229    public static function assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, string $message = '') : void
75230    {
75231        if (!is_string($expectedXml)) {
75232            self::createWarning('Passing an argument of type DOMDocument for the $expectedXml parameter is deprecated. Support for this will be removed in PHPUnit 10.');
75233            $expected = $expectedXml;
75234        } else {
75235            $expected = (new XmlLoader())->load($expectedXml);
75236        }
75237        if (!is_string($actualXml)) {
75238            self::createWarning('Passing an argument of type DOMDocument for the $actualXml parameter is deprecated. Support for this will be removed in PHPUnit 10.');
75239            $actual = $actualXml;
75240        } else {
75241            $actual = (new XmlLoader())->load($actualXml);
75242        }
75243        static::assertNotEquals($expected, $actual, $message);
75244    }
75245    /**
75246     * Asserts that a hierarchy of DOMElements matches.
75247     *
75248     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75249     * @throws AssertionFailedError
75250     * @throws ExpectationFailedException
75251     *
75252     * @codeCoverageIgnore
75253     *
75254     * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4091
75255     */
75256    public static function assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actualElement, bool $checkAttributes = \false, string $message = '') : void
75257    {
75258        self::createWarning('assertEqualXMLStructure() is deprecated and will be removed in PHPUnit 10.');
75259        $expectedElement = Xml::import($expectedElement);
75260        $actualElement = Xml::import($actualElement);
75261        static::assertSame($expectedElement->tagName, $actualElement->tagName, $message);
75262        if ($checkAttributes) {
75263            static::assertSame($expectedElement->attributes->length, $actualElement->attributes->length, sprintf('%s%sNumber of attributes on node "%s" does not match', $message, !empty($message) ? "\n" : '', $expectedElement->tagName));
75264            for ($i = 0; $i < $expectedElement->attributes->length; $i++) {
75265                $expectedAttribute = $expectedElement->attributes->item($i);
75266                $actualAttribute = $actualElement->attributes->getNamedItem($expectedAttribute->name);
75267                assert($expectedAttribute instanceof DOMAttr);
75268                if (!$actualAttribute) {
75269                    static::fail(sprintf('%s%sCould not find attribute "%s" on node "%s"', $message, !empty($message) ? "\n" : '', $expectedAttribute->name, $expectedElement->tagName));
75270                }
75271            }
75272        }
75273        Xml::removeCharacterDataNodes($expectedElement);
75274        Xml::removeCharacterDataNodes($actualElement);
75275        static::assertSame($expectedElement->childNodes->length, $actualElement->childNodes->length, sprintf('%s%sNumber of child nodes of "%s" differs', $message, !empty($message) ? "\n" : '', $expectedElement->tagName));
75276        for ($i = 0; $i < $expectedElement->childNodes->length; $i++) {
75277            static::assertEqualXMLStructure($expectedElement->childNodes->item($i), $actualElement->childNodes->item($i), $checkAttributes, $message);
75278        }
75279    }
75280    /**
75281     * Evaluates a PHPUnit\Framework\Constraint matcher object.
75282     *
75283     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75284     * @throws ExpectationFailedException
75285     */
75286    public static function assertThat($value, Constraint $constraint, string $message = '') : void
75287    {
75288        self::$count += count($constraint);
75289        $constraint->evaluate($value, $message);
75290    }
75291    /**
75292     * Asserts that a string is a valid JSON string.
75293     *
75294     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75295     * @throws ExpectationFailedException
75296     */
75297    public static function assertJson(string $actualJson, string $message = '') : void
75298    {
75299        static::assertThat($actualJson, static::isJson(), $message);
75300    }
75301    /**
75302     * Asserts that two given JSON encoded objects or arrays are equal.
75303     *
75304     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75305     * @throws ExpectationFailedException
75306     */
75307    public static function assertJsonStringEqualsJsonString(string $expectedJson, string $actualJson, string $message = '') : void
75308    {
75309        static::assertJson($expectedJson, $message);
75310        static::assertJson($actualJson, $message);
75311        static::assertThat($actualJson, new JsonMatches($expectedJson), $message);
75312    }
75313    /**
75314     * Asserts that two given JSON encoded objects or arrays are not equal.
75315     *
75316     * @param string $expectedJson
75317     * @param string $actualJson
75318     *
75319     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75320     * @throws ExpectationFailedException
75321     */
75322    public static function assertJsonStringNotEqualsJsonString($expectedJson, $actualJson, string $message = '') : void
75323    {
75324        static::assertJson($expectedJson, $message);
75325        static::assertJson($actualJson, $message);
75326        static::assertThat($actualJson, new LogicalNot(new JsonMatches($expectedJson)), $message);
75327    }
75328    /**
75329     * Asserts that the generated JSON encoded object and the content of the given file are equal.
75330     *
75331     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75332     * @throws ExpectationFailedException
75333     */
75334    public static function assertJsonStringEqualsJsonFile(string $expectedFile, string $actualJson, string $message = '') : void
75335    {
75336        static::assertFileExists($expectedFile, $message);
75337        $expectedJson = file_get_contents($expectedFile);
75338        static::assertJson($expectedJson, $message);
75339        static::assertJson($actualJson, $message);
75340        static::assertThat($actualJson, new JsonMatches($expectedJson), $message);
75341    }
75342    /**
75343     * Asserts that the generated JSON encoded object and the content of the given file are not equal.
75344     *
75345     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75346     * @throws ExpectationFailedException
75347     */
75348    public static function assertJsonStringNotEqualsJsonFile(string $expectedFile, string $actualJson, string $message = '') : void
75349    {
75350        static::assertFileExists($expectedFile, $message);
75351        $expectedJson = file_get_contents($expectedFile);
75352        static::assertJson($expectedJson, $message);
75353        static::assertJson($actualJson, $message);
75354        static::assertThat($actualJson, new LogicalNot(new JsonMatches($expectedJson)), $message);
75355    }
75356    /**
75357     * Asserts that two JSON files are equal.
75358     *
75359     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75360     * @throws ExpectationFailedException
75361     */
75362    public static function assertJsonFileEqualsJsonFile(string $expectedFile, string $actualFile, string $message = '') : void
75363    {
75364        static::assertFileExists($expectedFile, $message);
75365        static::assertFileExists($actualFile, $message);
75366        $actualJson = file_get_contents($actualFile);
75367        $expectedJson = file_get_contents($expectedFile);
75368        static::assertJson($expectedJson, $message);
75369        static::assertJson($actualJson, $message);
75370        $constraintExpected = new JsonMatches($expectedJson);
75371        $constraintActual = new JsonMatches($actualJson);
75372        static::assertThat($expectedJson, $constraintActual, $message);
75373        static::assertThat($actualJson, $constraintExpected, $message);
75374    }
75375    /**
75376     * Asserts that two JSON files are not equal.
75377     *
75378     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
75379     * @throws ExpectationFailedException
75380     */
75381    public static function assertJsonFileNotEqualsJsonFile(string $expectedFile, string $actualFile, string $message = '') : void
75382    {
75383        static::assertFileExists($expectedFile, $message);
75384        static::assertFileExists($actualFile, $message);
75385        $actualJson = file_get_contents($actualFile);
75386        $expectedJson = file_get_contents($expectedFile);
75387        static::assertJson($expectedJson, $message);
75388        static::assertJson($actualJson, $message);
75389        $constraintExpected = new JsonMatches($expectedJson);
75390        $constraintActual = new JsonMatches($actualJson);
75391        static::assertThat($expectedJson, new LogicalNot($constraintActual), $message);
75392        static::assertThat($actualJson, new LogicalNot($constraintExpected), $message);
75393    }
75394    /**
75395     * @throws Exception
75396     */
75397    public static function logicalAnd() : LogicalAnd
75398    {
75399        $constraints = func_get_args();
75400        $constraint = new LogicalAnd();
75401        $constraint->setConstraints($constraints);
75402        return $constraint;
75403    }
75404    public static function logicalOr() : LogicalOr
75405    {
75406        $constraints = func_get_args();
75407        $constraint = new LogicalOr();
75408        $constraint->setConstraints($constraints);
75409        return $constraint;
75410    }
75411    public static function logicalNot(Constraint $constraint) : LogicalNot
75412    {
75413        return new LogicalNot($constraint);
75414    }
75415    public static function logicalXor() : LogicalXor
75416    {
75417        $constraints = func_get_args();
75418        $constraint = new LogicalXor();
75419        $constraint->setConstraints($constraints);
75420        return $constraint;
75421    }
75422    public static function anything() : IsAnything
75423    {
75424        return new IsAnything();
75425    }
75426    public static function isTrue() : IsTrue
75427    {
75428        return new IsTrue();
75429    }
75430    /**
75431     * @psalm-template CallbackInput of mixed
75432     *
75433     * @psalm-param callable(CallbackInput $callback): bool $callback
75434     *
75435     * @psalm-return Callback<CallbackInput>
75436     */
75437    public static function callback(callable $callback) : Callback
75438    {
75439        return new Callback($callback);
75440    }
75441    public static function isFalse() : IsFalse
75442    {
75443        return new IsFalse();
75444    }
75445    public static function isJson() : IsJson
75446    {
75447        return new IsJson();
75448    }
75449    public static function isNull() : IsNull
75450    {
75451        return new IsNull();
75452    }
75453    public static function isFinite() : IsFinite
75454    {
75455        return new IsFinite();
75456    }
75457    public static function isInfinite() : IsInfinite
75458    {
75459        return new IsInfinite();
75460    }
75461    public static function isNan() : IsNan
75462    {
75463        return new IsNan();
75464    }
75465    public static function containsEqual($value) : TraversableContainsEqual
75466    {
75467        return new TraversableContainsEqual($value);
75468    }
75469    public static function containsIdentical($value) : TraversableContainsIdentical
75470    {
75471        return new TraversableContainsIdentical($value);
75472    }
75473    public static function containsOnly(string $type) : TraversableContainsOnly
75474    {
75475        return new TraversableContainsOnly($type);
75476    }
75477    public static function containsOnlyInstancesOf(string $className) : TraversableContainsOnly
75478    {
75479        return new TraversableContainsOnly($className, \false);
75480    }
75481    /**
75482     * @param int|string $key
75483     */
75484    public static function arrayHasKey($key) : ArrayHasKey
75485    {
75486        return new ArrayHasKey($key);
75487    }
75488    public static function equalTo($value) : IsEqual
75489    {
75490        return new IsEqual($value, 0.0, \false, \false);
75491    }
75492    public static function equalToCanonicalizing($value) : IsEqualCanonicalizing
75493    {
75494        return new IsEqualCanonicalizing($value);
75495    }
75496    public static function equalToIgnoringCase($value) : IsEqualIgnoringCase
75497    {
75498        return new IsEqualIgnoringCase($value);
75499    }
75500    public static function equalToWithDelta($value, float $delta) : IsEqualWithDelta
75501    {
75502        return new IsEqualWithDelta($value, $delta);
75503    }
75504    public static function isEmpty() : IsEmpty
75505    {
75506        return new IsEmpty();
75507    }
75508    public static function isWritable() : IsWritable
75509    {
75510        return new IsWritable();
75511    }
75512    public static function isReadable() : IsReadable
75513    {
75514        return new IsReadable();
75515    }
75516    public static function directoryExists() : DirectoryExists
75517    {
75518        return new DirectoryExists();
75519    }
75520    public static function fileExists() : FileExists
75521    {
75522        return new FileExists();
75523    }
75524    public static function greaterThan($value) : GreaterThan
75525    {
75526        return new GreaterThan($value);
75527    }
75528    public static function greaterThanOrEqual($value) : LogicalOr
75529    {
75530        return static::logicalOr(new IsEqual($value), new GreaterThan($value));
75531    }
75532    public static function classHasAttribute(string $attributeName) : ClassHasAttribute
75533    {
75534        return new ClassHasAttribute($attributeName);
75535    }
75536    public static function classHasStaticAttribute(string $attributeName) : ClassHasStaticAttribute
75537    {
75538        return new ClassHasStaticAttribute($attributeName);
75539    }
75540    public static function objectHasAttribute($attributeName) : ObjectHasAttribute
75541    {
75542        return new ObjectHasAttribute($attributeName);
75543    }
75544    public static function identicalTo($value) : IsIdentical
75545    {
75546        return new IsIdentical($value);
75547    }
75548    public static function isInstanceOf(string $className) : IsInstanceOf
75549    {
75550        return new IsInstanceOf($className);
75551    }
75552    public static function isType(string $type) : IsType
75553    {
75554        return new IsType($type);
75555    }
75556    public static function lessThan($value) : LessThan
75557    {
75558        return new LessThan($value);
75559    }
75560    public static function lessThanOrEqual($value) : LogicalOr
75561    {
75562        return static::logicalOr(new IsEqual($value), new LessThan($value));
75563    }
75564    public static function matchesRegularExpression(string $pattern) : RegularExpression
75565    {
75566        return new RegularExpression($pattern);
75567    }
75568    public static function matches(string $string) : StringMatchesFormatDescription
75569    {
75570        return new StringMatchesFormatDescription($string);
75571    }
75572    public static function stringStartsWith($prefix) : StringStartsWith
75573    {
75574        return new StringStartsWith($prefix);
75575    }
75576    public static function stringContains(string $string, bool $case = \true) : StringContains
75577    {
75578        return new StringContains($string, $case);
75579    }
75580    public static function stringEndsWith(string $suffix) : StringEndsWith
75581    {
75582        return new StringEndsWith($suffix);
75583    }
75584    public static function countOf(int $count) : Count
75585    {
75586        return new Count($count);
75587    }
75588    public static function objectEquals(object $object, string $method = 'equals') : ObjectEquals
75589    {
75590        return new ObjectEquals($object, $method);
75591    }
75592    /**
75593     * Fails a test with the given message.
75594     *
75595     * @throws AssertionFailedError
75596     *
75597     * @psalm-return never-return
75598     */
75599    public static function fail(string $message = '') : void
75600    {
75601        self::$count++;
75602        throw new \PHPUnit\Framework\AssertionFailedError($message);
75603    }
75604    /**
75605     * Mark the test as incomplete.
75606     *
75607     * @throws IncompleteTestError
75608     *
75609     * @psalm-return never-return
75610     */
75611    public static function markTestIncomplete(string $message = '') : void
75612    {
75613        throw new \PHPUnit\Framework\IncompleteTestError($message);
75614    }
75615    /**
75616     * Mark the test as skipped.
75617     *
75618     * @throws SkippedTestError
75619     * @throws SyntheticSkippedError
75620     *
75621     * @psalm-return never-return
75622     */
75623    public static function markTestSkipped(string $message = '') : void
75624    {
75625        if ($hint = self::detectLocationHint($message)) {
75626            $trace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS);
75627            array_unshift($trace, $hint);
75628            throw new \PHPUnit\Framework\SyntheticSkippedError($hint['message'], 0, $hint['file'], (int) $hint['line'], $trace);
75629        }
75630        throw new \PHPUnit\Framework\SkippedTestError($message);
75631    }
75632    /**
75633     * Return the current assertion count.
75634     */
75635    public static function getCount() : int
75636    {
75637        return self::$count;
75638    }
75639    /**
75640     * Reset the assertion counter.
75641     */
75642    public static function resetCount() : void
75643    {
75644        self::$count = 0;
75645    }
75646    private static function detectLocationHint(string $message) : ?array
75647    {
75648        $hint = null;
75649        $lines = preg_split('/\\r\\n|\\r|\\n/', $message);
75650        while (strpos($lines[0], '__OFFSET') !== \false) {
75651            $offset = explode('=', array_shift($lines));
75652            if ($offset[0] === '__OFFSET_FILE') {
75653                $hint['file'] = $offset[1];
75654            }
75655            if ($offset[0] === '__OFFSET_LINE') {
75656                $hint['line'] = $offset[1];
75657            }
75658        }
75659        if ($hint) {
75660            $hint['message'] = implode(\PHP_EOL, $lines);
75661        }
75662        return $hint;
75663    }
75664    private static function isValidObjectAttributeName(string $attributeName) : bool
75665    {
75666        return (bool) preg_match('/[^\\x00-\\x1f\\x7f-\\x9f]+/', $attributeName);
75667    }
75668    private static function isValidClassAttributeName(string $attributeName) : bool
75669    {
75670        return (bool) preg_match('/[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*/', $attributeName);
75671    }
75672    /**
75673     * @codeCoverageIgnore
75674     */
75675    private static function createWarning(string $warning) : void
75676    {
75677        foreach (debug_backtrace() as $step) {
75678            if (isset($step['object']) && $step['object'] instanceof \PHPUnit\Framework\TestCase) {
75679                assert($step['object'] instanceof \PHPUnit\Framework\TestCase);
75680                $step['object']->addWarning($warning);
75681                break;
75682            }
75683        }
75684    }
75685}
75686<?php
75687
75688declare (strict_types=1);
75689/*
75690 * This file is part of PHPUnit.
75691 *
75692 * (c) Sebastian Bergmann <sebastian@phpunit.de>
75693 *
75694 * For the full copyright and license information, please view the LICENSE
75695 * file that was distributed with this source code.
75696 */
75697namespace PHPUnit\Framework;
75698
75699use function assert;
75700use function count;
75701use RecursiveIterator;
75702/**
75703 * @internal This class is not covered by the backward compatibility promise for PHPUnit
75704 */
75705final class TestSuiteIterator implements RecursiveIterator
75706{
75707    /**
75708     * @var int
75709     */
75710    private $position = 0;
75711    /**
75712     * @var Test[]
75713     */
75714    private $tests;
75715    public function __construct(\PHPUnit\Framework\TestSuite $testSuite)
75716    {
75717        $this->tests = $testSuite->tests();
75718    }
75719    public function rewind() : void
75720    {
75721        $this->position = 0;
75722    }
75723    public function valid() : bool
75724    {
75725        return $this->position < count($this->tests);
75726    }
75727    public function key() : int
75728    {
75729        return $this->position;
75730    }
75731    public function current() : \PHPUnit\Framework\Test
75732    {
75733        return $this->tests[$this->position];
75734    }
75735    public function next() : void
75736    {
75737        $this->position++;
75738    }
75739    /**
75740     * @throws NoChildTestSuiteException
75741     */
75742    public function getChildren() : self
75743    {
75744        if (!$this->hasChildren()) {
75745            throw new \PHPUnit\Framework\NoChildTestSuiteException('The current item is not a TestSuite instance and therefore does not have any children.');
75746        }
75747        $current = $this->current();
75748        assert($current instanceof \PHPUnit\Framework\TestSuite);
75749        return new self($current);
75750    }
75751    public function hasChildren() : bool
75752    {
75753        return $this->valid() && $this->current() instanceof \PHPUnit\Framework\TestSuite;
75754    }
75755}
75756<?php
75757
75758declare (strict_types=1);
75759/*
75760 * This file is part of PHPUnit.
75761 *
75762 * (c) Sebastian Bergmann <sebastian@phpunit.de>
75763 *
75764 * For the full copyright and license information, please view the LICENSE
75765 * file that was distributed with this source code.
75766 */
75767namespace PHPUnit\Framework\MockObject;
75768
75769use PHPUnit\Framework\MockObject\Builder\InvocationStubber;
75770/**
75771 * @method InvocationStubber method($constraint)
75772 *
75773 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
75774 */
75775interface Stub
75776{
75777    public function __phpunit_getInvocationHandler() : \PHPUnit\Framework\MockObject\InvocationHandler;
75778    public function __phpunit_hasMatchers() : bool;
75779    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration) : void;
75780}
75781<?php
75782
75783declare (strict_types=1);
75784/*
75785 * This file is part of PHPUnit.
75786 *
75787 * (c) Sebastian Bergmann <sebastian@phpunit.de>
75788 *
75789 * For the full copyright and license information, please view the LICENSE
75790 * file that was distributed with this source code.
75791 */
75792namespace PHPUnit\Framework\MockObject;
75793
75794use function call_user_func;
75795use function class_exists;
75796/**
75797 * @internal This class is not covered by the backward compatibility promise for PHPUnit
75798 */
75799final class MockClass implements \PHPUnit\Framework\MockObject\MockType
75800{
75801    /**
75802     * @var string
75803     */
75804    private $classCode;
75805    /**
75806     * @var class-string
75807     */
75808    private $mockName;
75809    /**
75810     * @var ConfigurableMethod[]
75811     */
75812    private $configurableMethods;
75813    /**
75814     * @psalm-param class-string $mockName
75815     */
75816    public function __construct(string $classCode, string $mockName, array $configurableMethods)
75817    {
75818        $this->classCode = $classCode;
75819        $this->mockName = $mockName;
75820        $this->configurableMethods = $configurableMethods;
75821    }
75822    /**
75823     * @psalm-return class-string
75824     */
75825    public function generate() : string
75826    {
75827        if (!class_exists($this->mockName, \false)) {
75828            eval($this->classCode);
75829            call_user_func([$this->mockName, '__phpunit_initConfigurableMethods'], ...$this->configurableMethods);
75830        }
75831        return $this->mockName;
75832    }
75833    public function getClassCode() : string
75834    {
75835        return $this->classCode;
75836    }
75837}
75838<?php
75839
75840declare (strict_types=1);
75841/*
75842 * This file is part of PHPUnit.
75843 *
75844 * (c) Sebastian Bergmann <sebastian@phpunit.de>
75845 *
75846 * For the full copyright and license information, please view the LICENSE
75847 * file that was distributed with this source code.
75848 */
75849namespace PHPUnit\Framework\MockObject;
75850
75851/**
75852 * @internal This class is not covered by the backward compatibility promise for PHPUnit
75853 */
75854interface MockType
75855{
75856    /**
75857     * @psalm-return class-string
75858     */
75859    public function generate() : string;
75860}
75861<?php
75862
75863declare (strict_types=1);
75864/*
75865 * This file is part of PHPUnit.
75866 *
75867 * (c) Sebastian Bergmann <sebastian@phpunit.de>
75868 *
75869 * For the full copyright and license information, please view the LICENSE
75870 * file that was distributed with this source code.
75871 */
75872namespace PHPUnit\Framework\MockObject\Builder;
75873
75874/**
75875 * @internal This class is not covered by the backward compatibility promise for PHPUnit
75876 */
75877interface MethodNameMatch extends \PHPUnit\Framework\MockObject\Builder\ParametersMatch
75878{
75879    /**
75880     * Adds a new method name match and returns the parameter match object for
75881     * further matching possibilities.
75882     *
75883     * @param \PHPUnit\Framework\Constraint\Constraint $constraint Constraint for matching method, if a string is passed it will use the PHPUnit_Framework_Constraint_IsEqual
75884     *
75885     * @return ParametersMatch
75886     */
75887    public function method($constraint);
75888}
75889<?php
75890
75891declare (strict_types=1);
75892/*
75893 * This file is part of PHPUnit.
75894 *
75895 * (c) Sebastian Bergmann <sebastian@phpunit.de>
75896 *
75897 * For the full copyright and license information, please view the LICENSE
75898 * file that was distributed with this source code.
75899 */
75900namespace PHPUnit\Framework\MockObject\Builder;
75901
75902use PHPUnit\Framework\MockObject\Stub\Stub as BaseStub;
75903/**
75904 * @internal This class is not covered by the backward compatibility promise for PHPUnit
75905 */
75906interface Stub extends \PHPUnit\Framework\MockObject\Builder\Identity
75907{
75908    /**
75909     * Stubs the matching method with the stub object $stub. Any invocations of
75910     * the matched method will now be handled by the stub instead.
75911     */
75912    public function will(BaseStub $stub) : \PHPUnit\Framework\MockObject\Builder\Identity;
75913}
75914<?php
75915
75916declare (strict_types=1);
75917/*
75918 * This file is part of PHPUnit.
75919 *
75920 * (c) Sebastian Bergmann <sebastian@phpunit.de>
75921 *
75922 * For the full copyright and license information, please view the LICENSE
75923 * file that was distributed with this source code.
75924 */
75925namespace PHPUnit\Framework\MockObject\Builder;
75926
75927use PHPUnit\Framework\MockObject\Stub\Stub;
75928use Throwable;
75929/**
75930 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
75931 */
75932interface InvocationStubber
75933{
75934    public function will(Stub $stub) : \PHPUnit\Framework\MockObject\Builder\Identity;
75935    /** @return self */
75936    public function willReturn($value, ...$nextValues);
75937    /**
75938     * @param mixed $reference
75939     *
75940     * @return self
75941     */
75942    public function willReturnReference(&$reference);
75943    /**
75944     * @param array<int, array<int, mixed>> $valueMap
75945     *
75946     * @return self
75947     */
75948    public function willReturnMap(array $valueMap);
75949    /**
75950     * @param int $argumentIndex
75951     *
75952     * @return self
75953     */
75954    public function willReturnArgument($argumentIndex);
75955    /**
75956     * @param callable $callback
75957     *
75958     * @return self
75959     */
75960    public function willReturnCallback($callback);
75961    /** @return self */
75962    public function willReturnSelf();
75963    /**
75964     * @param mixed $values
75965     *
75966     * @return self
75967     */
75968    public function willReturnOnConsecutiveCalls(...$values);
75969    /** @return self */
75970    public function willThrowException(Throwable $exception);
75971}
75972<?php
75973
75974declare (strict_types=1);
75975/*
75976 * This file is part of PHPUnit.
75977 *
75978 * (c) Sebastian Bergmann <sebastian@phpunit.de>
75979 *
75980 * For the full copyright and license information, please view the LICENSE
75981 * file that was distributed with this source code.
75982 */
75983namespace PHPUnit\Framework\MockObject\Builder;
75984
75985/**
75986 * @internal This class is not covered by the backward compatibility promise for PHPUnit
75987 */
75988interface Identity
75989{
75990    /**
75991     * Sets the identification of the expectation to $id.
75992     *
75993     * @note The identifier is unique per mock object.
75994     *
75995     * @param string $id unique identification of expectation
75996     */
75997    public function id($id);
75998}
75999<?php
76000
76001declare (strict_types=1);
76002/*
76003 * This file is part of PHPUnit.
76004 *
76005 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76006 *
76007 * For the full copyright and license information, please view the LICENSE
76008 * file that was distributed with this source code.
76009 */
76010namespace PHPUnit\Framework\MockObject\Builder;
76011
76012/**
76013 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76014 */
76015interface ParametersMatch extends \PHPUnit\Framework\MockObject\Builder\Stub
76016{
76017    /**
76018     * Defines the expectation which must occur before the current is valid.
76019     *
76020     * @param string $id the identification of the expectation that should
76021     *                   occur before this one
76022     *
76023     * @return Stub
76024     */
76025    public function after($id);
76026    /**
76027     * Sets the parameters to match for, each parameter to this function will
76028     * be part of match. To perform specific matches or constraints create a
76029     * new PHPUnit\Framework\Constraint\Constraint and use it for the parameter.
76030     * If the parameter value is not a constraint it will use the
76031     * PHPUnit\Framework\Constraint\IsEqual for the value.
76032     *
76033     * Some examples:
76034     * <code>
76035     * // match first parameter with value 2
76036     * $b->with(2);
76037     * // match first parameter with value 'smock' and second identical to 42
76038     * $b->with('smock', new PHPUnit\Framework\Constraint\IsEqual(42));
76039     * </code>
76040     *
76041     * @return ParametersMatch
76042     */
76043    public function with(...$arguments);
76044    /**
76045     * Sets a rule which allows any kind of parameters.
76046     *
76047     * Some examples:
76048     * <code>
76049     * // match any number of parameters
76050     * $b->withAnyParameters();
76051     * </code>
76052     *
76053     * @return ParametersMatch
76054     */
76055    public function withAnyParameters();
76056}
76057<?php
76058
76059declare (strict_types=1);
76060/*
76061 * This file is part of PHPUnit.
76062 *
76063 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76064 *
76065 * For the full copyright and license information, please view the LICENSE
76066 * file that was distributed with this source code.
76067 */
76068namespace PHPUnit\Framework\MockObject\Builder;
76069
76070use function array_map;
76071use function array_merge;
76072use function count;
76073use function in_array;
76074use function is_string;
76075use function strtolower;
76076use PHPUnit\Framework\Constraint\Constraint;
76077use PHPUnit\Framework\MockObject\ConfigurableMethod;
76078use PHPUnit\Framework\MockObject\IncompatibleReturnValueException;
76079use PHPUnit\Framework\MockObject\InvocationHandler;
76080use PHPUnit\Framework\MockObject\Matcher;
76081use PHPUnit\Framework\MockObject\MatcherAlreadyRegisteredException;
76082use PHPUnit\Framework\MockObject\MethodCannotBeConfiguredException;
76083use PHPUnit\Framework\MockObject\MethodNameAlreadyConfiguredException;
76084use PHPUnit\Framework\MockObject\MethodNameNotConfiguredException;
76085use PHPUnit\Framework\MockObject\MethodParametersAlreadyConfiguredException;
76086use PHPUnit\Framework\MockObject\Rule;
76087use PHPUnit\Framework\MockObject\Stub\ConsecutiveCalls;
76088use PHPUnit\Framework\MockObject\Stub\Exception;
76089use PHPUnit\Framework\MockObject\Stub\ReturnArgument;
76090use PHPUnit\Framework\MockObject\Stub\ReturnCallback;
76091use PHPUnit\Framework\MockObject\Stub\ReturnReference;
76092use PHPUnit\Framework\MockObject\Stub\ReturnSelf;
76093use PHPUnit\Framework\MockObject\Stub\ReturnStub;
76094use PHPUnit\Framework\MockObject\Stub\ReturnValueMap;
76095use PHPUnit\Framework\MockObject\Stub\Stub;
76096use Throwable;
76097/**
76098 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
76099 */
76100final class InvocationMocker implements \PHPUnit\Framework\MockObject\Builder\InvocationStubber, \PHPUnit\Framework\MockObject\Builder\MethodNameMatch
76101{
76102    /**
76103     * @var InvocationHandler
76104     */
76105    private $invocationHandler;
76106    /**
76107     * @var Matcher
76108     */
76109    private $matcher;
76110    /**
76111     * @var ConfigurableMethod[]
76112     */
76113    private $configurableMethods;
76114    public function __construct(InvocationHandler $handler, Matcher $matcher, ConfigurableMethod ...$configurableMethods)
76115    {
76116        $this->invocationHandler = $handler;
76117        $this->matcher = $matcher;
76118        $this->configurableMethods = $configurableMethods;
76119    }
76120    /**
76121     * @throws MatcherAlreadyRegisteredException
76122     *
76123     * @return $this
76124     */
76125    public function id($id) : self
76126    {
76127        $this->invocationHandler->registerMatcher($id, $this->matcher);
76128        return $this;
76129    }
76130    /**
76131     * @return $this
76132     */
76133    public function will(Stub $stub) : \PHPUnit\Framework\MockObject\Builder\Identity
76134    {
76135        $this->matcher->setStub($stub);
76136        return $this;
76137    }
76138    /**
76139     * @param mixed   $value
76140     * @param mixed[] $nextValues
76141     *
76142     * @throws IncompatibleReturnValueException
76143     */
76144    public function willReturn($value, ...$nextValues) : self
76145    {
76146        if (count($nextValues) === 0) {
76147            $this->ensureTypeOfReturnValues([$value]);
76148            $stub = $value instanceof Stub ? $value : new ReturnStub($value);
76149        } else {
76150            $values = array_merge([$value], $nextValues);
76151            $this->ensureTypeOfReturnValues($values);
76152            $stub = new ConsecutiveCalls($values);
76153        }
76154        return $this->will($stub);
76155    }
76156    public function willReturnReference(&$reference) : self
76157    {
76158        $stub = new ReturnReference($reference);
76159        return $this->will($stub);
76160    }
76161    public function willReturnMap(array $valueMap) : self
76162    {
76163        $stub = new ReturnValueMap($valueMap);
76164        return $this->will($stub);
76165    }
76166    public function willReturnArgument($argumentIndex) : self
76167    {
76168        $stub = new ReturnArgument($argumentIndex);
76169        return $this->will($stub);
76170    }
76171    public function willReturnCallback($callback) : self
76172    {
76173        $stub = new ReturnCallback($callback);
76174        return $this->will($stub);
76175    }
76176    public function willReturnSelf() : self
76177    {
76178        $stub = new ReturnSelf();
76179        return $this->will($stub);
76180    }
76181    public function willReturnOnConsecutiveCalls(...$values) : self
76182    {
76183        $stub = new ConsecutiveCalls($values);
76184        return $this->will($stub);
76185    }
76186    public function willThrowException(Throwable $exception) : self
76187    {
76188        $stub = new Exception($exception);
76189        return $this->will($stub);
76190    }
76191    /**
76192     * @return $this
76193     */
76194    public function after($id) : self
76195    {
76196        $this->matcher->setAfterMatchBuilderId($id);
76197        return $this;
76198    }
76199    /**
76200     * @param mixed[] $arguments
76201     *
76202     * @throws \PHPUnit\Framework\Exception
76203     * @throws MethodNameNotConfiguredException
76204     * @throws MethodParametersAlreadyConfiguredException
76205     *
76206     * @return $this
76207     */
76208    public function with(...$arguments) : self
76209    {
76210        $this->ensureParametersCanBeConfigured();
76211        $this->matcher->setParametersRule(new Rule\Parameters($arguments));
76212        return $this;
76213    }
76214    /**
76215     * @param array ...$arguments
76216     *
76217     * @throws \PHPUnit\Framework\Exception
76218     * @throws MethodNameNotConfiguredException
76219     * @throws MethodParametersAlreadyConfiguredException
76220     *
76221     * @return $this
76222     */
76223    public function withConsecutive(...$arguments) : self
76224    {
76225        $this->ensureParametersCanBeConfigured();
76226        $this->matcher->setParametersRule(new Rule\ConsecutiveParameters($arguments));
76227        return $this;
76228    }
76229    /**
76230     * @throws MethodNameNotConfiguredException
76231     * @throws MethodParametersAlreadyConfiguredException
76232     *
76233     * @return $this
76234     */
76235    public function withAnyParameters() : self
76236    {
76237        $this->ensureParametersCanBeConfigured();
76238        $this->matcher->setParametersRule(new Rule\AnyParameters());
76239        return $this;
76240    }
76241    /**
76242     * @param Constraint|string $constraint
76243     *
76244     * @throws \PHPUnit\Framework\InvalidArgumentException
76245     * @throws MethodCannotBeConfiguredException
76246     * @throws MethodNameAlreadyConfiguredException
76247     *
76248     * @return $this
76249     */
76250    public function method($constraint) : self
76251    {
76252        if ($this->matcher->hasMethodNameRule()) {
76253            throw new MethodNameAlreadyConfiguredException();
76254        }
76255        $configurableMethodNames = array_map(static function (ConfigurableMethod $configurable) {
76256            return strtolower($configurable->getName());
76257        }, $this->configurableMethods);
76258        if (is_string($constraint) && !in_array(strtolower($constraint), $configurableMethodNames, \true)) {
76259            throw new MethodCannotBeConfiguredException($constraint);
76260        }
76261        $this->matcher->setMethodNameRule(new Rule\MethodName($constraint));
76262        return $this;
76263    }
76264    /**
76265     * @throws MethodNameNotConfiguredException
76266     * @throws MethodParametersAlreadyConfiguredException
76267     */
76268    private function ensureParametersCanBeConfigured() : void
76269    {
76270        if (!$this->matcher->hasMethodNameRule()) {
76271            throw new MethodNameNotConfiguredException();
76272        }
76273        if ($this->matcher->hasParametersRule()) {
76274            throw new MethodParametersAlreadyConfiguredException();
76275        }
76276    }
76277    private function getConfiguredMethod() : ?ConfigurableMethod
76278    {
76279        $configuredMethod = null;
76280        foreach ($this->configurableMethods as $configurableMethod) {
76281            if ($this->matcher->getMethodNameRule()->matchesName($configurableMethod->getName())) {
76282                if ($configuredMethod !== null) {
76283                    return null;
76284                }
76285                $configuredMethod = $configurableMethod;
76286            }
76287        }
76288        return $configuredMethod;
76289    }
76290    /**
76291     * @throws IncompatibleReturnValueException
76292     */
76293    private function ensureTypeOfReturnValues(array $values) : void
76294    {
76295        $configuredMethod = $this->getConfiguredMethod();
76296        if ($configuredMethod === null) {
76297            return;
76298        }
76299        foreach ($values as $value) {
76300            if (!$configuredMethod->mayReturn($value)) {
76301                throw new IncompatibleReturnValueException($configuredMethod, $value);
76302            }
76303        }
76304    }
76305}
76306<?php
76307
76308declare (strict_types=1);
76309/*
76310 * This file is part of PHPUnit.
76311 *
76312 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76313 *
76314 * For the full copyright and license information, please view the LICENSE
76315 * file that was distributed with this source code.
76316 */
76317namespace PHPUnit\Framework\MockObject;
76318
76319use function sprintf;
76320/**
76321 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76322 */
76323final class MatcherAlreadyRegisteredException extends \PHPUnit\Framework\Exception implements \PHPUnit\Framework\MockObject\Exception
76324{
76325    public function __construct(string $id)
76326    {
76327        parent::__construct(sprintf('Matcher with id <%s> is already registered', $id));
76328    }
76329}
76330<?php
76331
76332declare (strict_types=1);
76333/*
76334 * This file is part of PHPUnit.
76335 *
76336 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76337 *
76338 * For the full copyright and license information, please view the LICENSE
76339 * file that was distributed with this source code.
76340 */
76341namespace PHPUnit\Framework\MockObject;
76342
76343/**
76344 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76345 */
76346final class ConfigurableMethodsAlreadyInitializedException extends \PHPUnit\Framework\Exception implements \PHPUnit\Framework\MockObject\Exception
76347{
76348}
76349<?php
76350
76351declare (strict_types=1);
76352/*
76353 * This file is part of PHPUnit.
76354 *
76355 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76356 *
76357 * For the full copyright and license information, please view the LICENSE
76358 * file that was distributed with this source code.
76359 */
76360namespace PHPUnit\Framework\MockObject;
76361
76362use function sprintf;
76363/**
76364 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76365 */
76366final class ClassAlreadyExistsException extends \PHPUnit\Framework\Exception implements \PHPUnit\Framework\MockObject\Exception
76367{
76368    public function __construct(string $className)
76369    {
76370        parent::__construct(sprintf('Class "%s" already exists', $className));
76371    }
76372}
76373<?php
76374
76375declare (strict_types=1);
76376/*
76377 * This file is part of PHPUnit.
76378 *
76379 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76380 *
76381 * For the full copyright and license information, please view the LICENSE
76382 * file that was distributed with this source code.
76383 */
76384namespace PHPUnit\Framework\MockObject;
76385
76386/**
76387 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76388 */
76389final class ReturnValueNotConfiguredException extends \PHPUnit\Framework\Exception implements \PHPUnit\Framework\MockObject\Exception
76390{
76391    public function __construct(\PHPUnit\Framework\MockObject\Invocation $invocation)
76392    {
76393        parent::__construct(\sprintf('Return value inference disabled and no expectation set up for %s::%s()', $invocation->getClassName(), $invocation->getMethodName()));
76394    }
76395}
76396<?php
76397
76398declare (strict_types=1);
76399/*
76400 * This file is part of PHPUnit.
76401 *
76402 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76403 *
76404 * For the full copyright and license information, please view the LICENSE
76405 * file that was distributed with this source code.
76406 */
76407namespace PHPUnit\Framework\MockObject;
76408
76409use function sprintf;
76410/**
76411 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76412 */
76413final class IncompatibleReturnValueException extends \PHPUnit\Framework\Exception implements \PHPUnit\Framework\MockObject\Exception
76414{
76415    /**
76416     * @param mixed $value
76417     */
76418    public function __construct(\PHPUnit\Framework\MockObject\ConfigurableMethod $method, $value)
76419    {
76420        parent::__construct(sprintf('Method %s may not return value of type %s, its declared return type is "%s"', $method->getName(), \is_object($value) ? \get_class($value) : \gettype($value), $method->getReturnTypeDeclaration()));
76421    }
76422}
76423<?php
76424
76425declare (strict_types=1);
76426/*
76427 * This file is part of PHPUnit.
76428 *
76429 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76430 *
76431 * For the full copyright and license information, please view the LICENSE
76432 * file that was distributed with this source code.
76433 */
76434namespace PHPUnit\Framework\MockObject;
76435
76436/**
76437 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76438 */
76439final class SoapExtensionNotAvailableException extends \PHPUnit\Framework\Exception implements \PHPUnit\Framework\MockObject\Exception
76440{
76441    public function __construct()
76442    {
76443        parent::__construct('The SOAP extension is required to generate a test double from WSDL');
76444    }
76445}
76446<?php
76447
76448declare (strict_types=1);
76449/*
76450 * This file is part of PHPUnit.
76451 *
76452 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76453 *
76454 * For the full copyright and license information, please view the LICENSE
76455 * file that was distributed with this source code.
76456 */
76457namespace PHPUnit\Framework\MockObject;
76458
76459use function sprintf;
76460/**
76461 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76462 */
76463final class CannotUseAddMethodsException extends \PHPUnit\Framework\Exception implements \PHPUnit\Framework\MockObject\Exception
76464{
76465    public function __construct(string $type, string $methodName)
76466    {
76467        parent::__construct(sprintf('Trying to configure method "%s" with addMethods(), but it exists in class "%s". Use onlyMethods() for methods that exist in the class', $methodName, $type));
76468    }
76469}
76470<?php
76471
76472declare (strict_types=1);
76473/*
76474 * This file is part of PHPUnit.
76475 *
76476 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76477 *
76478 * For the full copyright and license information, please view the LICENSE
76479 * file that was distributed with this source code.
76480 */
76481namespace PHPUnit\Framework\MockObject;
76482
76483/**
76484 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76485 */
76486final class MethodParametersAlreadyConfiguredException extends \PHPUnit\Framework\Exception implements \PHPUnit\Framework\MockObject\Exception
76487{
76488    public function __construct()
76489    {
76490        parent::__construct('Method parameters already configured');
76491    }
76492}
76493<?php
76494
76495declare (strict_types=1);
76496/*
76497 * This file is part of PHPUnit.
76498 *
76499 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76500 *
76501 * For the full copyright and license information, please view the LICENSE
76502 * file that was distributed with this source code.
76503 */
76504namespace PHPUnit\Framework\MockObject;
76505
76506use function sprintf;
76507/**
76508 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76509 */
76510final class MatchBuilderNotFoundException extends \PHPUnit\Framework\Exception implements \PHPUnit\Framework\MockObject\Exception
76511{
76512    public function __construct(string $id)
76513    {
76514        parent::__construct(sprintf('No builder found for match builder identification <%s>', $id));
76515    }
76516}
76517<?php
76518
76519declare (strict_types=1);
76520/*
76521 * This file is part of PHPUnit.
76522 *
76523 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76524 *
76525 * For the full copyright and license information, please view the LICENSE
76526 * file that was distributed with this source code.
76527 */
76528namespace PHPUnit\Framework\MockObject;
76529
76530/**
76531 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76532 */
76533final class OriginalConstructorInvocationRequiredException extends \PHPUnit\Framework\Exception implements \PHPUnit\Framework\MockObject\Exception
76534{
76535    public function __construct()
76536    {
76537        parent::__construct('Proxying to original methods requires invoking the original constructor');
76538    }
76539}
76540<?php
76541
76542declare (strict_types=1);
76543/*
76544 * This file is part of PHPUnit.
76545 *
76546 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76547 *
76548 * For the full copyright and license information, please view the LICENSE
76549 * file that was distributed with this source code.
76550 */
76551namespace PHPUnit\Framework\MockObject;
76552
76553use function sprintf;
76554/**
76555 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76556 */
76557final class UnknownTypeException extends \PHPUnit\Framework\Exception implements \PHPUnit\Framework\MockObject\Exception
76558{
76559    public function __construct(string $type)
76560    {
76561        parent::__construct(sprintf('Class or interface "%s" does not exist', $type));
76562    }
76563}
76564<?php
76565
76566declare (strict_types=1);
76567/*
76568 * This file is part of PHPUnit.
76569 *
76570 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76571 *
76572 * For the full copyright and license information, please view the LICENSE
76573 * file that was distributed with this source code.
76574 */
76575namespace PHPUnit\Framework\MockObject;
76576
76577use function sprintf;
76578/**
76579 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76580 */
76581final class CannotUseOnlyMethodsException extends \PHPUnit\Framework\Exception implements \PHPUnit\Framework\MockObject\Exception
76582{
76583    public function __construct(string $type, string $methodName)
76584    {
76585        parent::__construct(sprintf('Trying to configure method "%s" with onlyMethods(), but it does not exist in class "%s". Use addMethods() for methods that do not exist in the class', $methodName, $type));
76586    }
76587}
76588<?php
76589
76590declare (strict_types=1);
76591/*
76592 * This file is part of PHPUnit.
76593 *
76594 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76595 *
76596 * For the full copyright and license information, please view the LICENSE
76597 * file that was distributed with this source code.
76598 */
76599namespace PHPUnit\Framework\MockObject;
76600
76601use RuntimeException;
76602/**
76603 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76604 */
76605final class ReflectionException extends RuntimeException implements \PHPUnit\Framework\MockObject\Exception
76606{
76607}
76608<?php
76609
76610declare (strict_types=1);
76611/*
76612 * This file is part of PHPUnit.
76613 *
76614 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76615 *
76616 * For the full copyright and license information, please view the LICENSE
76617 * file that was distributed with this source code.
76618 */
76619namespace PHPUnit\Framework\MockObject;
76620
76621use function sprintf;
76622/**
76623 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76624 */
76625final class UnknownClassException extends \PHPUnit\Framework\Exception implements \PHPUnit\Framework\MockObject\Exception
76626{
76627    public function __construct(string $className)
76628    {
76629        parent::__construct(sprintf('Class "%s" does not exist', $className));
76630    }
76631}
76632<?php
76633
76634declare (strict_types=1);
76635/*
76636 * This file is part of PHPUnit.
76637 *
76638 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76639 *
76640 * For the full copyright and license information, please view the LICENSE
76641 * file that was distributed with this source code.
76642 */
76643namespace PHPUnit\Framework\MockObject;
76644
76645/**
76646 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76647 */
76648final class RuntimeException extends \RuntimeException implements \PHPUnit\Framework\MockObject\Exception
76649{
76650}
76651<?php
76652
76653declare (strict_types=1);
76654/*
76655 * This file is part of PHPUnit.
76656 *
76657 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76658 *
76659 * For the full copyright and license information, please view the LICENSE
76660 * file that was distributed with this source code.
76661 */
76662namespace PHPUnit\Framework\MockObject;
76663
76664/**
76665 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76666 */
76667final class BadMethodCallException extends \BadMethodCallException implements \PHPUnit\Framework\MockObject\Exception
76668{
76669}
76670<?php
76671
76672declare (strict_types=1);
76673/*
76674 * This file is part of PHPUnit.
76675 *
76676 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76677 *
76678 * For the full copyright and license information, please view the LICENSE
76679 * file that was distributed with this source code.
76680 */
76681namespace PHPUnit\Framework\MockObject;
76682
76683/**
76684 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76685 */
76686final class MethodNameAlreadyConfiguredException extends \PHPUnit\Framework\Exception implements \PHPUnit\Framework\MockObject\Exception
76687{
76688    public function __construct()
76689    {
76690        parent::__construct('Method name is already configured');
76691    }
76692}
76693<?php
76694
76695declare (strict_types=1);
76696/*
76697 * This file is part of PHPUnit.
76698 *
76699 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76700 *
76701 * For the full copyright and license information, please view the LICENSE
76702 * file that was distributed with this source code.
76703 */
76704namespace PHPUnit\Framework\MockObject;
76705
76706use Throwable;
76707/**
76708 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76709 */
76710interface Exception extends Throwable
76711{
76712}
76713<?php
76714
76715declare (strict_types=1);
76716/*
76717 * This file is part of PHPUnit.
76718 *
76719 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76720 *
76721 * For the full copyright and license information, please view the LICENSE
76722 * file that was distributed with this source code.
76723 */
76724namespace PHPUnit\Framework\MockObject;
76725
76726use function sprintf;
76727/**
76728 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76729 */
76730final class UnknownTraitException extends \PHPUnit\Framework\Exception implements \PHPUnit\Framework\MockObject\Exception
76731{
76732    public function __construct(string $traitName)
76733    {
76734        parent::__construct(sprintf('Trait "%s" does not exist', $traitName));
76735    }
76736}
76737<?php
76738
76739declare (strict_types=1);
76740/*
76741 * This file is part of PHPUnit.
76742 *
76743 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76744 *
76745 * For the full copyright and license information, please view the LICENSE
76746 * file that was distributed with this source code.
76747 */
76748namespace PHPUnit\Framework\MockObject;
76749
76750use function sprintf;
76751/**
76752 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76753 */
76754final class MethodCannotBeConfiguredException extends \PHPUnit\Framework\Exception implements \PHPUnit\Framework\MockObject\Exception
76755{
76756    public function __construct(string $method)
76757    {
76758        parent::__construct(sprintf('Trying to configure method "%s" which cannot be configured because it does not exist, has not been specified, is final, or is static', $method));
76759    }
76760}
76761<?php
76762
76763declare (strict_types=1);
76764/*
76765 * This file is part of PHPUnit.
76766 *
76767 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76768 *
76769 * For the full copyright and license information, please view the LICENSE
76770 * file that was distributed with this source code.
76771 */
76772namespace PHPUnit\Framework\MockObject;
76773
76774/**
76775 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76776 */
76777final class MethodNameNotConfiguredException extends \PHPUnit\Framework\Exception implements \PHPUnit\Framework\MockObject\Exception
76778{
76779    public function __construct()
76780    {
76781        parent::__construct('Method name is not configured');
76782    }
76783}
76784<?php
76785
76786declare (strict_types=1);
76787/*
76788 * This file is part of PHPUnit.
76789 *
76790 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76791 *
76792 * For the full copyright and license information, please view the LICENSE
76793 * file that was distributed with this source code.
76794 */
76795namespace PHPUnit\Framework\MockObject;
76796
76797use function sprintf;
76798/**
76799 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76800 */
76801final class DuplicateMethodException extends \PHPUnit\Framework\Exception implements \PHPUnit\Framework\MockObject\Exception
76802{
76803    /**
76804     * @psalm-param list<string> $methods
76805     */
76806    public function __construct(array $methods)
76807    {
76808        parent::__construct(sprintf('Cannot double using a method list that contains duplicates: "%s" (duplicate: "%s")', \implode(', ', $methods), \implode(', ', \array_unique(\array_diff_assoc($methods, \array_unique($methods))))));
76809    }
76810}
76811<?php
76812
76813declare (strict_types=1);
76814/*
76815 * This file is part of PHPUnit.
76816 *
76817 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76818 *
76819 * For the full copyright and license information, please view the LICENSE
76820 * file that was distributed with this source code.
76821 */
76822namespace PHPUnit\Framework\MockObject;
76823
76824use function sprintf;
76825/**
76826 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76827 */
76828final class InvalidMethodNameException extends \PHPUnit\Framework\Exception implements \PHPUnit\Framework\MockObject\Exception
76829{
76830    public function __construct(string $method)
76831    {
76832        parent::__construct(sprintf('Cannot double method with invalid name "%s"', $method));
76833    }
76834}
76835<?php
76836
76837declare (strict_types=1);
76838/*
76839 * This file is part of PHPUnit.
76840 *
76841 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76842 *
76843 * For the full copyright and license information, please view the LICENSE
76844 * file that was distributed with this source code.
76845 */
76846namespace PHPUnit\Framework\MockObject;
76847
76848use function sprintf;
76849/**
76850 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76851 */
76852final class ClassIsFinalException extends \PHPUnit\Framework\Exception implements \PHPUnit\Framework\MockObject\Exception
76853{
76854    public function __construct(string $className)
76855    {
76856        parent::__construct(sprintf('Class "%s" is declared "final" and cannot be doubled', $className));
76857    }
76858}
76859<?php
76860
76861declare (strict_types=1);
76862/*
76863 * This file is part of PHPUnit.
76864 *
76865 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76866 *
76867 * For the full copyright and license information, please view the LICENSE
76868 * file that was distributed with this source code.
76869 */
76870namespace PHPUnit\Framework\MockObject\Stub;
76871
76872use function sprintf;
76873use PHPUnit\Framework\MockObject\Invocation;
76874use PHPUnit\SebastianBergmann\Exporter\Exporter;
76875/**
76876 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76877 */
76878final class ReturnReference implements \PHPUnit\Framework\MockObject\Stub\Stub
76879{
76880    /**
76881     * @var mixed
76882     */
76883    private $reference;
76884    public function __construct(&$reference)
76885    {
76886        $this->reference =& $reference;
76887    }
76888    public function invoke(Invocation $invocation)
76889    {
76890        return $this->reference;
76891    }
76892    public function toString() : string
76893    {
76894        $exporter = new Exporter();
76895        return sprintf('return user-specified reference %s', $exporter->export($this->reference));
76896    }
76897}
76898<?php
76899
76900declare (strict_types=1);
76901/*
76902 * This file is part of PHPUnit.
76903 *
76904 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76905 *
76906 * For the full copyright and license information, please view the LICENSE
76907 * file that was distributed with this source code.
76908 */
76909namespace PHPUnit\Framework\MockObject\Stub;
76910
76911use PHPUnit\Framework\MockObject\Invocation;
76912use PHPUnit\Framework\SelfDescribing;
76913/**
76914 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76915 */
76916interface Stub extends SelfDescribing
76917{
76918    /**
76919     * Fakes the processing of the invocation $invocation by returning a
76920     * specific value.
76921     *
76922     * @param Invocation $invocation The invocation which was mocked and matched by the current method and argument matchers
76923     */
76924    public function invoke(Invocation $invocation);
76925}
76926<?php
76927
76928declare (strict_types=1);
76929/*
76930 * This file is part of PHPUnit.
76931 *
76932 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76933 *
76934 * For the full copyright and license information, please view the LICENSE
76935 * file that was distributed with this source code.
76936 */
76937namespace PHPUnit\Framework\MockObject\Stub;
76938
76939use function array_pop;
76940use function count;
76941use function is_array;
76942use PHPUnit\Framework\MockObject\Invocation;
76943/**
76944 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76945 */
76946final class ReturnValueMap implements \PHPUnit\Framework\MockObject\Stub\Stub
76947{
76948    /**
76949     * @var array
76950     */
76951    private $valueMap;
76952    public function __construct(array $valueMap)
76953    {
76954        $this->valueMap = $valueMap;
76955    }
76956    public function invoke(Invocation $invocation)
76957    {
76958        $parameterCount = count($invocation->getParameters());
76959        foreach ($this->valueMap as $map) {
76960            if (!is_array($map) || $parameterCount !== count($map) - 1) {
76961                continue;
76962            }
76963            $return = array_pop($map);
76964            if ($invocation->getParameters() === $map) {
76965                return $return;
76966            }
76967        }
76968    }
76969    public function toString() : string
76970    {
76971        return 'return value from a map';
76972    }
76973}
76974<?php
76975
76976declare (strict_types=1);
76977/*
76978 * This file is part of PHPUnit.
76979 *
76980 * (c) Sebastian Bergmann <sebastian@phpunit.de>
76981 *
76982 * For the full copyright and license information, please view the LICENSE
76983 * file that was distributed with this source code.
76984 */
76985namespace PHPUnit\Framework\MockObject\Stub;
76986
76987use function call_user_func_array;
76988use function get_class;
76989use function is_array;
76990use function is_object;
76991use function sprintf;
76992use PHPUnit\Framework\MockObject\Invocation;
76993/**
76994 * @internal This class is not covered by the backward compatibility promise for PHPUnit
76995 */
76996final class ReturnCallback implements \PHPUnit\Framework\MockObject\Stub\Stub
76997{
76998    private $callback;
76999    public function __construct($callback)
77000    {
77001        $this->callback = $callback;
77002    }
77003    public function invoke(Invocation $invocation)
77004    {
77005        return call_user_func_array($this->callback, $invocation->getParameters());
77006    }
77007    public function toString() : string
77008    {
77009        if (is_array($this->callback)) {
77010            if (is_object($this->callback[0])) {
77011                $class = get_class($this->callback[0]);
77012                $type = '->';
77013            } else {
77014                $class = $this->callback[0];
77015                $type = '::';
77016            }
77017            return sprintf('return result of user defined callback %s%s%s() with the ' . 'passed arguments', $class, $type, $this->callback[1]);
77018        }
77019        return 'return result of user defined callback ' . $this->callback . ' with the passed arguments';
77020    }
77021}
77022<?php
77023
77024declare (strict_types=1);
77025/*
77026 * This file is part of PHPUnit.
77027 *
77028 * (c) Sebastian Bergmann <sebastian@phpunit.de>
77029 *
77030 * For the full copyright and license information, please view the LICENSE
77031 * file that was distributed with this source code.
77032 */
77033namespace PHPUnit\Framework\MockObject\Stub;
77034
77035use PHPUnit\Framework\MockObject\Invocation;
77036use PHPUnit\Framework\MockObject\RuntimeException;
77037/**
77038 * @internal This class is not covered by the backward compatibility promise for PHPUnit
77039 */
77040final class ReturnSelf implements \PHPUnit\Framework\MockObject\Stub\Stub
77041{
77042    /**
77043     * @throws RuntimeException
77044     */
77045    public function invoke(Invocation $invocation)
77046    {
77047        return $invocation->getObject();
77048    }
77049    public function toString() : string
77050    {
77051        return 'return the current object';
77052    }
77053}
77054<?php
77055
77056declare (strict_types=1);
77057/*
77058 * This file is part of PHPUnit.
77059 *
77060 * (c) Sebastian Bergmann <sebastian@phpunit.de>
77061 *
77062 * For the full copyright and license information, please view the LICENSE
77063 * file that was distributed with this source code.
77064 */
77065namespace PHPUnit\Framework\MockObject\Stub;
77066
77067use function sprintf;
77068use PHPUnit\Framework\MockObject\Invocation;
77069use PHPUnit\SebastianBergmann\Exporter\Exporter;
77070use Throwable;
77071/**
77072 * @internal This class is not covered by the backward compatibility promise for PHPUnit
77073 */
77074final class Exception implements \PHPUnit\Framework\MockObject\Stub\Stub
77075{
77076    private $exception;
77077    public function __construct(Throwable $exception)
77078    {
77079        $this->exception = $exception;
77080    }
77081    /**
77082     * @throws Throwable
77083     */
77084    public function invoke(Invocation $invocation) : void
77085    {
77086        throw $this->exception;
77087    }
77088    public function toString() : string
77089    {
77090        $exporter = new Exporter();
77091        return sprintf('raise user-specified exception %s', $exporter->export($this->exception));
77092    }
77093}
77094<?php
77095
77096declare (strict_types=1);
77097/*
77098 * This file is part of PHPUnit.
77099 *
77100 * (c) Sebastian Bergmann <sebastian@phpunit.de>
77101 *
77102 * For the full copyright and license information, please view the LICENSE
77103 * file that was distributed with this source code.
77104 */
77105namespace PHPUnit\Framework\MockObject\Stub;
77106
77107use function sprintf;
77108use PHPUnit\Framework\MockObject\Invocation;
77109/**
77110 * @internal This class is not covered by the backward compatibility promise for PHPUnit
77111 */
77112final class ReturnArgument implements \PHPUnit\Framework\MockObject\Stub\Stub
77113{
77114    /**
77115     * @var int
77116     */
77117    private $argumentIndex;
77118    public function __construct($argumentIndex)
77119    {
77120        $this->argumentIndex = $argumentIndex;
77121    }
77122    public function invoke(Invocation $invocation)
77123    {
77124        if (isset($invocation->getParameters()[$this->argumentIndex])) {
77125            return $invocation->getParameters()[$this->argumentIndex];
77126        }
77127    }
77128    public function toString() : string
77129    {
77130        return sprintf('return argument #%d', $this->argumentIndex);
77131    }
77132}
77133<?php
77134
77135declare (strict_types=1);
77136/*
77137 * This file is part of PHPUnit.
77138 *
77139 * (c) Sebastian Bergmann <sebastian@phpunit.de>
77140 *
77141 * For the full copyright and license information, please view the LICENSE
77142 * file that was distributed with this source code.
77143 */
77144namespace PHPUnit\Framework\MockObject\Stub;
77145
77146use function sprintf;
77147use PHPUnit\Framework\MockObject\Invocation;
77148use PHPUnit\SebastianBergmann\Exporter\Exporter;
77149/**
77150 * @internal This class is not covered by the backward compatibility promise for PHPUnit
77151 */
77152final class ReturnStub implements \PHPUnit\Framework\MockObject\Stub\Stub
77153{
77154    /**
77155     * @var mixed
77156     */
77157    private $value;
77158    public function __construct($value)
77159    {
77160        $this->value = $value;
77161    }
77162    public function invoke(Invocation $invocation)
77163    {
77164        return $this->value;
77165    }
77166    public function toString() : string
77167    {
77168        $exporter = new Exporter();
77169        return sprintf('return user-specified value %s', $exporter->export($this->value));
77170    }
77171}
77172<?php
77173
77174declare (strict_types=1);
77175/*
77176 * This file is part of PHPUnit.
77177 *
77178 * (c) Sebastian Bergmann <sebastian@phpunit.de>
77179 *
77180 * For the full copyright and license information, please view the LICENSE
77181 * file that was distributed with this source code.
77182 */
77183namespace PHPUnit\Framework\MockObject\Stub;
77184
77185use function array_shift;
77186use function sprintf;
77187use PHPUnit\Framework\MockObject\Invocation;
77188use PHPUnit\SebastianBergmann\Exporter\Exporter;
77189/**
77190 * @internal This class is not covered by the backward compatibility promise for PHPUnit
77191 */
77192final class ConsecutiveCalls implements \PHPUnit\Framework\MockObject\Stub\Stub
77193{
77194    /**
77195     * @var array
77196     */
77197    private $stack;
77198    /**
77199     * @var mixed
77200     */
77201    private $value;
77202    public function __construct(array $stack)
77203    {
77204        $this->stack = $stack;
77205    }
77206    public function invoke(Invocation $invocation)
77207    {
77208        $this->value = array_shift($this->stack);
77209        if ($this->value instanceof \PHPUnit\Framework\MockObject\Stub\Stub) {
77210            $this->value = $this->value->invoke($invocation);
77211        }
77212        return $this->value;
77213    }
77214    public function toString() : string
77215    {
77216        $exporter = new Exporter();
77217        return sprintf('return user-specified value %s', $exporter->export($this->value));
77218    }
77219}
77220<?php
77221
77222declare (strict_types=1);
77223/*
77224 * This file is part of PHPUnit.
77225 *
77226 * (c) Sebastian Bergmann <sebastian@phpunit.de>
77227 *
77228 * For the full copyright and license information, please view the LICENSE
77229 * file that was distributed with this source code.
77230 */
77231namespace PHPUnit\Framework\MockObject;
77232
77233use const DIRECTORY_SEPARATOR;
77234use const PHP_EOL;
77235use const PHP_MAJOR_VERSION;
77236use const PREG_OFFSET_CAPTURE;
77237use const WSDL_CACHE_NONE;
77238use function array_merge;
77239use function array_pop;
77240use function array_unique;
77241use function class_exists;
77242use function count;
77243use function explode;
77244use function extension_loaded;
77245use function implode;
77246use function in_array;
77247use function interface_exists;
77248use function is_array;
77249use function is_object;
77250use function md5;
77251use function mt_rand;
77252use function preg_match;
77253use function preg_match_all;
77254use function range;
77255use function serialize;
77256use function sort;
77257use function sprintf;
77258use function str_replace;
77259use function strlen;
77260use function strpos;
77261use function strtolower;
77262use function substr;
77263use function trait_exists;
77264use PHPUnit\Doctrine\Instantiator\Exception\ExceptionInterface as InstantiatorException;
77265use PHPUnit\Doctrine\Instantiator\Instantiator;
77266use Exception;
77267use Iterator;
77268use IteratorAggregate;
77269use PHPUnit\Framework\InvalidArgumentException;
77270use ReflectionClass;
77271use ReflectionMethod;
77272use PHPUnit\SebastianBergmann\Template\Exception as TemplateException;
77273use PHPUnit\SebastianBergmann\Template\Template;
77274use SoapClient;
77275use SoapFault;
77276use Throwable;
77277use Traversable;
77278/**
77279 * @internal This class is not covered by the backward compatibility promise for PHPUnit
77280 */
77281final class Generator
77282{
77283    /**
77284     * @var array
77285     */
77286    private const EXCLUDED_METHOD_NAMES = ['__CLASS__' => \true, '__DIR__' => \true, '__FILE__' => \true, '__FUNCTION__' => \true, '__LINE__' => \true, '__METHOD__' => \true, '__NAMESPACE__' => \true, '__TRAIT__' => \true, '__clone' => \true, '__halt_compiler' => \true];
77287    /**
77288     * @var array
77289     */
77290    private static $cache = [];
77291    /**
77292     * @var Template[]
77293     */
77294    private static $templates = [];
77295    /**
77296     * Returns a mock object for the specified class.
77297     *
77298     * @param null|array $methods
77299     *
77300     * @throws \PHPUnit\Framework\InvalidArgumentException
77301     * @throws ClassAlreadyExistsException
77302     * @throws ClassIsFinalException
77303     * @throws DuplicateMethodException
77304     * @throws InvalidMethodNameException
77305     * @throws OriginalConstructorInvocationRequiredException
77306     * @throws ReflectionException
77307     * @throws RuntimeException
77308     * @throws UnknownTypeException
77309     */
77310    public function getMock(string $type, $methods = [], array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = \true, bool $callOriginalClone = \true, bool $callAutoload = \true, bool $cloneArguments = \true, bool $callOriginalMethods = \false, object $proxyTarget = null, bool $allowMockingUnknownTypes = \true, bool $returnValueGeneration = \true) : \PHPUnit\Framework\MockObject\MockObject
77311    {
77312        if (!is_array($methods) && null !== $methods) {
77313            throw InvalidArgumentException::create(2, 'array');
77314        }
77315        if ($type === 'Traversable' || $type === '\\Traversable') {
77316            $type = 'Iterator';
77317        }
77318        if (!$allowMockingUnknownTypes && !class_exists($type, $callAutoload) && !interface_exists($type, $callAutoload)) {
77319            throw new \PHPUnit\Framework\MockObject\UnknownTypeException($type);
77320        }
77321        if (null !== $methods) {
77322            foreach ($methods as $method) {
77323                if (!preg_match('~[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*~', (string) $method)) {
77324                    throw new \PHPUnit\Framework\MockObject\InvalidMethodNameException((string) $method);
77325                }
77326            }
77327            if ($methods !== array_unique($methods)) {
77328                throw new \PHPUnit\Framework\MockObject\DuplicateMethodException($methods);
77329            }
77330        }
77331        if ($mockClassName !== '' && class_exists($mockClassName, \false)) {
77332            try {
77333                $reflector = new ReflectionClass($mockClassName);
77334                // @codeCoverageIgnoreStart
77335            } catch (\ReflectionException $e) {
77336                throw new \PHPUnit\Framework\MockObject\ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
77337            }
77338            // @codeCoverageIgnoreEnd
77339            if (!$reflector->implementsInterface(\PHPUnit\Framework\MockObject\MockObject::class)) {
77340                throw new \PHPUnit\Framework\MockObject\ClassAlreadyExistsException($mockClassName);
77341            }
77342        }
77343        if (!$callOriginalConstructor && $callOriginalMethods) {
77344            throw new \PHPUnit\Framework\MockObject\OriginalConstructorInvocationRequiredException();
77345        }
77346        $mock = $this->generate($type, $methods, $mockClassName, $callOriginalClone, $callAutoload, $cloneArguments, $callOriginalMethods);
77347        return $this->getObject($mock, $type, $callOriginalConstructor, $callAutoload, $arguments, $callOriginalMethods, $proxyTarget, $returnValueGeneration);
77348    }
77349    /**
77350     * Returns a mock object for the specified abstract class with all abstract
77351     * methods of the class mocked.
77352     *
77353     * Concrete methods to mock can be specified with the $mockedMethods parameter.
77354     *
77355     * @psalm-template RealInstanceType of object
77356     * @psalm-param class-string<RealInstanceType> $originalClassName
77357     * @psalm-return MockObject&RealInstanceType
77358     *
77359     * @throws \PHPUnit\Framework\InvalidArgumentException
77360     * @throws ClassAlreadyExistsException
77361     * @throws ClassIsFinalException
77362     * @throws DuplicateMethodException
77363     * @throws InvalidMethodNameException
77364     * @throws OriginalConstructorInvocationRequiredException
77365     * @throws ReflectionException
77366     * @throws RuntimeException
77367     * @throws UnknownClassException
77368     * @throws UnknownTypeException
77369     */
77370    public function getMockForAbstractClass(string $originalClassName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = \true, bool $callOriginalClone = \true, bool $callAutoload = \true, array $mockedMethods = null, bool $cloneArguments = \true) : \PHPUnit\Framework\MockObject\MockObject
77371    {
77372        if (class_exists($originalClassName, $callAutoload) || interface_exists($originalClassName, $callAutoload)) {
77373            try {
77374                $reflector = new ReflectionClass($originalClassName);
77375                // @codeCoverageIgnoreStart
77376            } catch (\ReflectionException $e) {
77377                throw new \PHPUnit\Framework\MockObject\ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
77378            }
77379            // @codeCoverageIgnoreEnd
77380            $methods = $mockedMethods;
77381            foreach ($reflector->getMethods() as $method) {
77382                if ($method->isAbstract() && !in_array($method->getName(), $methods ?? [], \true)) {
77383                    $methods[] = $method->getName();
77384                }
77385            }
77386            if (empty($methods)) {
77387                $methods = null;
77388            }
77389            return $this->getMock($originalClassName, $methods, $arguments, $mockClassName, $callOriginalConstructor, $callOriginalClone, $callAutoload, $cloneArguments);
77390        }
77391        throw new \PHPUnit\Framework\MockObject\UnknownClassException($originalClassName);
77392    }
77393    /**
77394     * Returns a mock object for the specified trait with all abstract methods
77395     * of the trait mocked. Concrete methods to mock can be specified with the
77396     * `$mockedMethods` parameter.
77397     *
77398     * @psalm-param trait-string $traitName
77399     *
77400     * @throws \PHPUnit\Framework\InvalidArgumentException
77401     * @throws ClassAlreadyExistsException
77402     * @throws ClassIsFinalException
77403     * @throws DuplicateMethodException
77404     * @throws InvalidMethodNameException
77405     * @throws OriginalConstructorInvocationRequiredException
77406     * @throws ReflectionException
77407     * @throws RuntimeException
77408     * @throws UnknownClassException
77409     * @throws UnknownTraitException
77410     * @throws UnknownTypeException
77411     */
77412    public function getMockForTrait(string $traitName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = \true, bool $callOriginalClone = \true, bool $callAutoload = \true, array $mockedMethods = null, bool $cloneArguments = \true) : \PHPUnit\Framework\MockObject\MockObject
77413    {
77414        if (!trait_exists($traitName, $callAutoload)) {
77415            throw new \PHPUnit\Framework\MockObject\UnknownTraitException($traitName);
77416        }
77417        $className = $this->generateClassName($traitName, '', 'Trait_');
77418        $classTemplate = $this->getTemplate('trait_class.tpl');
77419        $classTemplate->setVar(['prologue' => 'abstract ', 'class_name' => $className['className'], 'trait_name' => $traitName]);
77420        $mockTrait = new \PHPUnit\Framework\MockObject\MockTrait($classTemplate->render(), $className['className']);
77421        $mockTrait->generate();
77422        return $this->getMockForAbstractClass($className['className'], $arguments, $mockClassName, $callOriginalConstructor, $callOriginalClone, $callAutoload, $mockedMethods, $cloneArguments);
77423    }
77424    /**
77425     * Returns an object for the specified trait.
77426     *
77427     * @psalm-param trait-string $traitName
77428     *
77429     * @throws ReflectionException
77430     * @throws RuntimeException
77431     * @throws UnknownTraitException
77432     */
77433    public function getObjectForTrait(string $traitName, string $traitClassName = '', bool $callAutoload = \true, bool $callOriginalConstructor = \false, array $arguments = []) : object
77434    {
77435        if (!trait_exists($traitName, $callAutoload)) {
77436            throw new \PHPUnit\Framework\MockObject\UnknownTraitException($traitName);
77437        }
77438        $className = $this->generateClassName($traitName, $traitClassName, 'Trait_');
77439        $classTemplate = $this->getTemplate('trait_class.tpl');
77440        $classTemplate->setVar(['prologue' => '', 'class_name' => $className['className'], 'trait_name' => $traitName]);
77441        return $this->getObject(new \PHPUnit\Framework\MockObject\MockTrait($classTemplate->render(), $className['className']), '', $callOriginalConstructor, $callAutoload, $arguments);
77442    }
77443    /**
77444     * @throws ClassIsFinalException
77445     * @throws ReflectionException
77446     * @throws RuntimeException
77447     */
77448    public function generate(string $type, array $methods = null, string $mockClassName = '', bool $callOriginalClone = \true, bool $callAutoload = \true, bool $cloneArguments = \true, bool $callOriginalMethods = \false) : \PHPUnit\Framework\MockObject\MockClass
77449    {
77450        if ($mockClassName !== '') {
77451            return $this->generateMock($type, $methods, $mockClassName, $callOriginalClone, $callAutoload, $cloneArguments, $callOriginalMethods);
77452        }
77453        $key = md5($type . serialize($methods) . serialize($callOriginalClone) . serialize($cloneArguments) . serialize($callOriginalMethods));
77454        if (!isset(self::$cache[$key])) {
77455            self::$cache[$key] = $this->generateMock($type, $methods, $mockClassName, $callOriginalClone, $callAutoload, $cloneArguments, $callOriginalMethods);
77456        }
77457        return self::$cache[$key];
77458    }
77459    /**
77460     * @throws RuntimeException
77461     * @throws SoapExtensionNotAvailableException
77462     */
77463    public function generateClassFromWsdl(string $wsdlFile, string $className, array $methods = [], array $options = []) : string
77464    {
77465        if (!extension_loaded('soap')) {
77466            throw new \PHPUnit\Framework\MockObject\SoapExtensionNotAvailableException();
77467        }
77468        $options = array_merge($options, ['cache_wsdl' => \WSDL_CACHE_NONE]);
77469        try {
77470            $client = new SoapClient($wsdlFile, $options);
77471            $_methods = array_unique($client->__getFunctions());
77472            unset($client);
77473        } catch (SoapFault $e) {
77474            throw new \PHPUnit\Framework\MockObject\RuntimeException($e->getMessage(), (int) $e->getCode(), $e);
77475        }
77476        sort($_methods);
77477        $methodTemplate = $this->getTemplate('wsdl_method.tpl');
77478        $methodsBuffer = '';
77479        foreach ($_methods as $method) {
77480            preg_match_all('/[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*\\(/', $method, $matches, \PREG_OFFSET_CAPTURE);
77481            $lastFunction = array_pop($matches[0]);
77482            $nameStart = $lastFunction[1];
77483            $nameEnd = $nameStart + strlen($lastFunction[0]) - 1;
77484            $name = str_replace('(', '', $lastFunction[0]);
77485            if (empty($methods) || in_array($name, $methods, \true)) {
77486                $args = explode(',', str_replace(')', '', substr($method, $nameEnd + 1)));
77487                foreach (range(0, count($args) - 1) as $i) {
77488                    $parameterStart = strpos($args[$i], '$');
77489                    if (!$parameterStart) {
77490                        continue;
77491                    }
77492                    $args[$i] = substr($args[$i], $parameterStart);
77493                }
77494                $methodTemplate->setVar(['method_name' => $name, 'arguments' => implode(', ', $args)]);
77495                $methodsBuffer .= $methodTemplate->render();
77496            }
77497        }
77498        $optionsBuffer = '[';
77499        foreach ($options as $key => $value) {
77500            $optionsBuffer .= $key . ' => ' . $value;
77501        }
77502        $optionsBuffer .= ']';
77503        $classTemplate = $this->getTemplate('wsdl_class.tpl');
77504        $namespace = '';
77505        if (strpos($className, '\\') !== \false) {
77506            $parts = explode('\\', $className);
77507            $className = array_pop($parts);
77508            $namespace = 'namespace ' . implode('\\', $parts) . ';' . "\n\n";
77509        }
77510        $classTemplate->setVar(['namespace' => $namespace, 'class_name' => $className, 'wsdl' => $wsdlFile, 'options' => $optionsBuffer, 'methods' => $methodsBuffer]);
77511        return $classTemplate->render();
77512    }
77513    /**
77514     * @throws ReflectionException
77515     *
77516     * @return string[]
77517     */
77518    public function getClassMethods(string $className) : array
77519    {
77520        try {
77521            $class = new ReflectionClass($className);
77522            // @codeCoverageIgnoreStart
77523        } catch (\ReflectionException $e) {
77524            throw new \PHPUnit\Framework\MockObject\ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
77525        }
77526        // @codeCoverageIgnoreEnd
77527        $methods = [];
77528        foreach ($class->getMethods() as $method) {
77529            if ($method->isPublic() || $method->isAbstract()) {
77530                $methods[] = $method->getName();
77531            }
77532        }
77533        return $methods;
77534    }
77535    /**
77536     * @throws ReflectionException
77537     *
77538     * @return MockMethod[]
77539     */
77540    public function mockClassMethods(string $className, bool $callOriginalMethods, bool $cloneArguments) : array
77541    {
77542        try {
77543            $class = new ReflectionClass($className);
77544            // @codeCoverageIgnoreStart
77545        } catch (\ReflectionException $e) {
77546            throw new \PHPUnit\Framework\MockObject\ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
77547        }
77548        // @codeCoverageIgnoreEnd
77549        $methods = [];
77550        foreach ($class->getMethods() as $method) {
77551            if (($method->isPublic() || $method->isAbstract()) && $this->canMockMethod($method)) {
77552                $methods[] = \PHPUnit\Framework\MockObject\MockMethod::fromReflection($method, $callOriginalMethods, $cloneArguments);
77553            }
77554        }
77555        return $methods;
77556    }
77557    /**
77558     * @throws ReflectionException
77559     *
77560     * @return MockMethod[]
77561     */
77562    public function mockInterfaceMethods(string $interfaceName, bool $cloneArguments) : array
77563    {
77564        try {
77565            $class = new ReflectionClass($interfaceName);
77566            // @codeCoverageIgnoreStart
77567        } catch (\ReflectionException $e) {
77568            throw new \PHPUnit\Framework\MockObject\ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
77569        }
77570        // @codeCoverageIgnoreEnd
77571        $methods = [];
77572        foreach ($class->getMethods() as $method) {
77573            $methods[] = \PHPUnit\Framework\MockObject\MockMethod::fromReflection($method, \false, $cloneArguments);
77574        }
77575        return $methods;
77576    }
77577    /**
77578     * @psalm-param class-string $interfaceName
77579     *
77580     * @throws ReflectionException
77581     *
77582     * @return ReflectionMethod[]
77583     */
77584    private function userDefinedInterfaceMethods(string $interfaceName) : array
77585    {
77586        try {
77587            // @codeCoverageIgnoreStart
77588            $interface = new ReflectionClass($interfaceName);
77589        } catch (\ReflectionException $e) {
77590            throw new \PHPUnit\Framework\MockObject\ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
77591        }
77592        // @codeCoverageIgnoreEnd
77593        $methods = [];
77594        foreach ($interface->getMethods() as $method) {
77595            if (!$method->isUserDefined()) {
77596                continue;
77597            }
77598            $methods[] = $method;
77599        }
77600        return $methods;
77601    }
77602    /**
77603     * @throws ReflectionException
77604     * @throws RuntimeException
77605     */
77606    private function getObject(\PHPUnit\Framework\MockObject\MockType $mockClass, $type = '', bool $callOriginalConstructor = \false, bool $callAutoload = \false, array $arguments = [], bool $callOriginalMethods = \false, object $proxyTarget = null, bool $returnValueGeneration = \true)
77607    {
77608        $className = $mockClass->generate();
77609        if ($callOriginalConstructor) {
77610            if (count($arguments) === 0) {
77611                $object = new $className();
77612            } else {
77613                try {
77614                    $class = new ReflectionClass($className);
77615                    // @codeCoverageIgnoreStart
77616                } catch (\ReflectionException $e) {
77617                    throw new \PHPUnit\Framework\MockObject\ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
77618                }
77619                // @codeCoverageIgnoreEnd
77620                $object = $class->newInstanceArgs($arguments);
77621            }
77622        } else {
77623            try {
77624                $object = (new Instantiator())->instantiate($className);
77625            } catch (InstantiatorException $e) {
77626                throw new \PHPUnit\Framework\MockObject\RuntimeException($e->getMessage());
77627            }
77628        }
77629        if ($callOriginalMethods) {
77630            if (!is_object($proxyTarget)) {
77631                if (count($arguments) === 0) {
77632                    $proxyTarget = new $type();
77633                } else {
77634                    try {
77635                        $class = new ReflectionClass($type);
77636                        // @codeCoverageIgnoreStart
77637                    } catch (\ReflectionException $e) {
77638                        throw new \PHPUnit\Framework\MockObject\ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
77639                    }
77640                    // @codeCoverageIgnoreEnd
77641                    $proxyTarget = $class->newInstanceArgs($arguments);
77642                }
77643            }
77644            $object->__phpunit_setOriginalObject($proxyTarget);
77645        }
77646        if ($object instanceof \PHPUnit\Framework\MockObject\MockObject) {
77647            $object->__phpunit_setReturnValueGeneration($returnValueGeneration);
77648        }
77649        return $object;
77650    }
77651    /**
77652     * @throws ClassIsFinalException
77653     * @throws ReflectionException
77654     * @throws RuntimeException
77655     */
77656    private function generateMock(string $type, ?array $explicitMethods, string $mockClassName, bool $callOriginalClone, bool $callAutoload, bool $cloneArguments, bool $callOriginalMethods) : \PHPUnit\Framework\MockObject\MockClass
77657    {
77658        $classTemplate = $this->getTemplate('mocked_class.tpl');
77659        $additionalInterfaces = [];
77660        $mockedCloneMethod = \false;
77661        $unmockedCloneMethod = \false;
77662        $isClass = \false;
77663        $isInterface = \false;
77664        $class = null;
77665        $mockMethods = new \PHPUnit\Framework\MockObject\MockMethodSet();
77666        $_mockClassName = $this->generateClassName($type, $mockClassName, 'Mock_');
77667        if (class_exists($_mockClassName['fullClassName'], $callAutoload)) {
77668            $isClass = \true;
77669        } elseif (interface_exists($_mockClassName['fullClassName'], $callAutoload)) {
77670            $isInterface = \true;
77671        }
77672        if (!$isClass && !$isInterface) {
77673            $prologue = 'class ' . $_mockClassName['originalClassName'] . "\n{\n}\n\n";
77674            if (!empty($_mockClassName['namespaceName'])) {
77675                $prologue = 'namespace ' . $_mockClassName['namespaceName'] . " {\n\n" . $prologue . "}\n\n" . "namespace {\n\n";
77676                $epilogue = "\n\n}";
77677            }
77678            $mockedCloneMethod = \true;
77679        } else {
77680            try {
77681                $class = new ReflectionClass($_mockClassName['fullClassName']);
77682                // @codeCoverageIgnoreStart
77683            } catch (\ReflectionException $e) {
77684                throw new \PHPUnit\Framework\MockObject\ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
77685            }
77686            // @codeCoverageIgnoreEnd
77687            if ($class->isFinal()) {
77688                throw new \PHPUnit\Framework\MockObject\ClassIsFinalException($_mockClassName['fullClassName']);
77689            }
77690            // @see https://github.com/sebastianbergmann/phpunit/issues/2995
77691            if ($isInterface && $class->implementsInterface(Throwable::class)) {
77692                $actualClassName = Exception::class;
77693                $additionalInterfaces[] = $class->getName();
77694                $isInterface = \false;
77695                try {
77696                    $class = new ReflectionClass($actualClassName);
77697                    // @codeCoverageIgnoreStart
77698                } catch (\ReflectionException $e) {
77699                    throw new \PHPUnit\Framework\MockObject\ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
77700                }
77701                // @codeCoverageIgnoreEnd
77702                foreach ($this->userDefinedInterfaceMethods($_mockClassName['fullClassName']) as $method) {
77703                    $methodName = $method->getName();
77704                    if ($class->hasMethod($methodName)) {
77705                        try {
77706                            $classMethod = $class->getMethod($methodName);
77707                            // @codeCoverageIgnoreStart
77708                        } catch (\ReflectionException $e) {
77709                            throw new \PHPUnit\Framework\MockObject\ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
77710                        }
77711                        // @codeCoverageIgnoreEnd
77712                        if (!$this->canMockMethod($classMethod)) {
77713                            continue;
77714                        }
77715                    }
77716                    $mockMethods->addMethods(\PHPUnit\Framework\MockObject\MockMethod::fromReflection($method, $callOriginalMethods, $cloneArguments));
77717                }
77718                $_mockClassName = $this->generateClassName($actualClassName, $_mockClassName['className'], 'Mock_');
77719            }
77720            // @see https://github.com/sebastianbergmann/phpunit-mock-objects/issues/103
77721            if ($isInterface && $class->implementsInterface(Traversable::class) && !$class->implementsInterface(Iterator::class) && !$class->implementsInterface(IteratorAggregate::class)) {
77722                $additionalInterfaces[] = Iterator::class;
77723                $mockMethods->addMethods(...$this->mockClassMethods(Iterator::class, $callOriginalMethods, $cloneArguments));
77724            }
77725            if ($class->hasMethod('__clone')) {
77726                try {
77727                    $cloneMethod = $class->getMethod('__clone');
77728                    // @codeCoverageIgnoreStart
77729                } catch (\ReflectionException $e) {
77730                    throw new \PHPUnit\Framework\MockObject\ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
77731                }
77732                // @codeCoverageIgnoreEnd
77733                if (!$cloneMethod->isFinal()) {
77734                    if ($callOriginalClone && !$isInterface) {
77735                        $unmockedCloneMethod = \true;
77736                    } else {
77737                        $mockedCloneMethod = \true;
77738                    }
77739                }
77740            } else {
77741                $mockedCloneMethod = \true;
77742            }
77743        }
77744        if ($isClass && $explicitMethods === []) {
77745            $mockMethods->addMethods(...$this->mockClassMethods($_mockClassName['fullClassName'], $callOriginalMethods, $cloneArguments));
77746        }
77747        if ($isInterface && ($explicitMethods === [] || $explicitMethods === null)) {
77748            $mockMethods->addMethods(...$this->mockInterfaceMethods($_mockClassName['fullClassName'], $cloneArguments));
77749        }
77750        if (is_array($explicitMethods)) {
77751            foreach ($explicitMethods as $methodName) {
77752                if ($class !== null && $class->hasMethod($methodName)) {
77753                    try {
77754                        $method = $class->getMethod($methodName);
77755                        // @codeCoverageIgnoreStart
77756                    } catch (\ReflectionException $e) {
77757                        throw new \PHPUnit\Framework\MockObject\ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
77758                    }
77759                    // @codeCoverageIgnoreEnd
77760                    if ($this->canMockMethod($method)) {
77761                        $mockMethods->addMethods(\PHPUnit\Framework\MockObject\MockMethod::fromReflection($method, $callOriginalMethods, $cloneArguments));
77762                    }
77763                } else {
77764                    $mockMethods->addMethods(\PHPUnit\Framework\MockObject\MockMethod::fromName($_mockClassName['fullClassName'], $methodName, $cloneArguments));
77765                }
77766            }
77767        }
77768        $mockedMethods = '';
77769        $configurable = [];
77770        foreach ($mockMethods->asArray() as $mockMethod) {
77771            $mockedMethods .= $mockMethod->generateCode();
77772            $configurable[] = new \PHPUnit\Framework\MockObject\ConfigurableMethod($mockMethod->getName(), $mockMethod->getReturnType());
77773        }
77774        $method = '';
77775        if (!$mockMethods->hasMethod('method') && (!isset($class) || !$class->hasMethod('method'))) {
77776            $method = \PHP_EOL . '    use \\PHPUnit\\Framework\\MockObject\\Method;';
77777        }
77778        $cloneTrait = '';
77779        if ($mockedCloneMethod) {
77780            $cloneTrait = \PHP_EOL . '    use \\PHPUnit\\Framework\\MockObject\\MockedCloneMethod;';
77781        }
77782        if ($unmockedCloneMethod) {
77783            $cloneTrait = \PHP_EOL . '    use \\PHPUnit\\Framework\\MockObject\\UnmockedCloneMethod;';
77784        }
77785        $classTemplate->setVar(['prologue' => $prologue ?? '', 'epilogue' => $epilogue ?? '', 'class_declaration' => $this->generateMockClassDeclaration($_mockClassName, $isInterface, $additionalInterfaces), 'clone' => $cloneTrait, 'mock_class_name' => $_mockClassName['className'], 'mocked_methods' => $mockedMethods, 'method' => $method]);
77786        return new \PHPUnit\Framework\MockObject\MockClass($classTemplate->render(), $_mockClassName['className'], $configurable);
77787    }
77788    private function generateClassName(string $type, string $className, string $prefix) : array
77789    {
77790        if ($type[0] === '\\') {
77791            $type = substr($type, 1);
77792        }
77793        $classNameParts = explode('\\', $type);
77794        if (count($classNameParts) > 1) {
77795            $type = array_pop($classNameParts);
77796            $namespaceName = implode('\\', $classNameParts);
77797            $fullClassName = $namespaceName . '\\' . $type;
77798        } else {
77799            $namespaceName = '';
77800            $fullClassName = $type;
77801        }
77802        if ($className === '') {
77803            do {
77804                $className = $prefix . $type . '_' . substr(md5((string) mt_rand()), 0, 8);
77805            } while (class_exists($className, \false));
77806        }
77807        return ['className' => $className, 'originalClassName' => $type, 'fullClassName' => $fullClassName, 'namespaceName' => $namespaceName];
77808    }
77809    private function generateMockClassDeclaration(array $mockClassName, bool $isInterface, array $additionalInterfaces = []) : string
77810    {
77811        $buffer = 'class ';
77812        $additionalInterfaces[] = \PHPUnit\Framework\MockObject\MockObject::class;
77813        $interfaces = implode(', ', $additionalInterfaces);
77814        if ($isInterface) {
77815            $buffer .= sprintf('%s implements %s', $mockClassName['className'], $interfaces);
77816            if (!in_array($mockClassName['originalClassName'], $additionalInterfaces, \true)) {
77817                $buffer .= ', ';
77818                if (!empty($mockClassName['namespaceName'])) {
77819                    $buffer .= $mockClassName['namespaceName'] . '\\';
77820                }
77821                $buffer .= $mockClassName['originalClassName'];
77822            }
77823        } else {
77824            $buffer .= sprintf('%s extends %s%s implements %s', $mockClassName['className'], !empty($mockClassName['namespaceName']) ? $mockClassName['namespaceName'] . '\\' : '', $mockClassName['originalClassName'], $interfaces);
77825        }
77826        return $buffer;
77827    }
77828    private function canMockMethod(ReflectionMethod $method) : bool
77829    {
77830        return !($this->isConstructor($method) || $method->isFinal() || $method->isPrivate() || $this->isMethodNameExcluded($method->getName()));
77831    }
77832    private function isMethodNameExcluded(string $name) : bool
77833    {
77834        return isset(self::EXCLUDED_METHOD_NAMES[$name]);
77835    }
77836    /**
77837     * @throws RuntimeException
77838     */
77839    private function getTemplate(string $template) : Template
77840    {
77841        $filename = __DIR__ . \DIRECTORY_SEPARATOR . 'Generator' . \DIRECTORY_SEPARATOR . $template;
77842        if (!isset(self::$templates[$filename])) {
77843            try {
77844                self::$templates[$filename] = new Template($filename);
77845            } catch (TemplateException $e) {
77846                throw new \PHPUnit\Framework\MockObject\RuntimeException($e->getMessage(), (int) $e->getCode(), $e);
77847            }
77848        }
77849        return self::$templates[$filename];
77850    }
77851    /**
77852     * @see https://github.com/sebastianbergmann/phpunit/issues/4139#issuecomment-605409765
77853     */
77854    private function isConstructor(ReflectionMethod $method) : bool
77855    {
77856        $methodName = strtolower($method->getName());
77857        if ($methodName === '__construct') {
77858            return \true;
77859        }
77860        if (\PHP_MAJOR_VERSION >= 8) {
77861            return \false;
77862        }
77863        $className = strtolower($method->getDeclaringClass()->getName());
77864        return $methodName === $className;
77865    }
77866}
77867
77868    {modifier} function {reference}{method_name}({arguments_decl}){return_declaration}
77869    {{deprecation}
77870        $__phpunit_arguments = [{arguments_call}];
77871        $__phpunit_count     = func_num_args();
77872
77873        if ($__phpunit_count > {arguments_count}) {
77874            $__phpunit_arguments_tmp = func_get_args();
77875
77876            for ($__phpunit_i = {arguments_count}; $__phpunit_i < $__phpunit_count; $__phpunit_i++) {
77877                $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i];
77878            }
77879        }
77880
77881        $this->__phpunit_getInvocationHandler()->invoke(
77882            new \PHPUnit\Framework\MockObject\Invocation(
77883                '{class_name}', '{method_name}', $__phpunit_arguments, '{return_type}', $this, {clone_arguments}
77884            )
77885        );
77886    }
77887declare(strict_types=1);
77888
77889{prologue}{class_declaration}
77890{
77891    use \PHPUnit\Framework\MockObject\Api;{method}{clone}
77892{mocked_methods}}{epilogue}
77893
77894    {modifier} function {reference}{method_name}({arguments_decl}){return_declaration}
77895    {{deprecation}
77896        $__phpunit_arguments = [{arguments_call}];
77897        $__phpunit_count     = func_num_args();
77898
77899        if ($__phpunit_count > {arguments_count}) {
77900            $__phpunit_arguments_tmp = func_get_args();
77901
77902            for ($__phpunit_i = {arguments_count}; $__phpunit_i < $__phpunit_count; $__phpunit_i++) {
77903                $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i];
77904            }
77905        }
77906
77907        $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke(
77908            new \PHPUnit\Framework\MockObject\Invocation(
77909                '{class_name}', '{method_name}', $__phpunit_arguments, '{return_type}', $this, {clone_arguments}
77910            )
77911        );
77912
77913        return $__phpunit_result;
77914    }
77915
77916    public function {method_name}({arguments})
77917    {
77918    }
77919declare(strict_types=1);
77920
77921{namespace}class {class_name} extends \SoapClient
77922{
77923    public function __construct($wsdl, array $options)
77924    {
77925        parent::__construct('{wsdl}', $options);
77926    }
77927{methods}}
77928
77929    {modifier} function {reference}{method_name}({arguments_decl}){return_declaration}
77930    {
77931        $__phpunit_arguments = [{arguments_call}];
77932        $__phpunit_count     = func_num_args();
77933
77934        if ($__phpunit_count > {arguments_count}) {
77935            $__phpunit_arguments_tmp = func_get_args();
77936
77937            for ($__phpunit_i = {arguments_count}; $__phpunit_i < $__phpunit_count; $__phpunit_i++) {
77938                $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i];
77939            }
77940        }
77941
77942        $this->__phpunit_getInvocationHandler()->invoke(
77943            new \PHPUnit\Framework\MockObject\Invocation(
77944                '{class_name}', '{method_name}', $__phpunit_arguments, '{return_type}', $this, {clone_arguments}, true
77945            )
77946        );
77947
77948        return call_user_func_array(array($this->__phpunit_originalObject, "{method_name}"), $__phpunit_arguments);
77949    }
77950
77951    {modifier} function {reference}{method_name}({arguments_decl}){return_declaration}
77952    {
77953        $__phpunit_arguments = [{arguments_call}];
77954        $__phpunit_count     = func_num_args();
77955
77956        if ($__phpunit_count > {arguments_count}) {
77957            $__phpunit_arguments_tmp = func_get_args();
77958
77959            for ($__phpunit_i = {arguments_count}; $__phpunit_i < $__phpunit_count; $__phpunit_i++) {
77960                $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i];
77961            }
77962        }
77963
77964        $this->__phpunit_getInvocationHandler()->invoke(
77965            new \PHPUnit\Framework\MockObject\Invocation(
77966                '{class_name}', '{method_name}', $__phpunit_arguments, '{return_type}', $this, {clone_arguments}, true
77967            )
77968        );
77969
77970        call_user_func_array(array($this->__phpunit_originalObject, "{method_name}"), $__phpunit_arguments);
77971    }
77972
77973    {modifier} function {reference}{method_name}({arguments_decl}){return_declaration}
77974    {
77975        throw new \PHPUnit\Framework\MockObject\BadMethodCallException('Static method "{method_name}" cannot be invoked on mock object');
77976    }
77977declare(strict_types=1);
77978
77979{prologue}class {class_name}
77980{
77981    use {trait_name};
77982}
77983
77984        @trigger_error({deprecation}, E_USER_DEPRECATED);
77985<?php
77986
77987declare (strict_types=1);
77988/*
77989 * This file is part of PHPUnit.
77990 *
77991 * (c) Sebastian Bergmann <sebastian@phpunit.de>
77992 *
77993 * For the full copyright and license information, please view the LICENSE
77994 * file that was distributed with this source code.
77995 */
77996namespace PHPUnit\Framework\MockObject;
77997
77998use function array_diff;
77999use function array_merge;
78000use PHPUnit\Framework\TestCase;
78001use ReflectionClass;
78002/**
78003 * @psalm-template MockedType
78004 *
78005 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
78006 */
78007final class MockBuilder
78008{
78009    /**
78010     * @var TestCase
78011     */
78012    private $testCase;
78013    /**
78014     * @var string
78015     */
78016    private $type;
78017    /**
78018     * @var null|string[]
78019     */
78020    private $methods = [];
78021    /**
78022     * @var bool
78023     */
78024    private $emptyMethodsArray = \false;
78025    /**
78026     * @var string
78027     */
78028    private $mockClassName = '';
78029    /**
78030     * @var array
78031     */
78032    private $constructorArgs = [];
78033    /**
78034     * @var bool
78035     */
78036    private $originalConstructor = \true;
78037    /**
78038     * @var bool
78039     */
78040    private $originalClone = \true;
78041    /**
78042     * @var bool
78043     */
78044    private $autoload = \true;
78045    /**
78046     * @var bool
78047     */
78048    private $cloneArguments = \false;
78049    /**
78050     * @var bool
78051     */
78052    private $callOriginalMethods = \false;
78053    /**
78054     * @var ?object
78055     */
78056    private $proxyTarget;
78057    /**
78058     * @var bool
78059     */
78060    private $allowMockingUnknownTypes = \true;
78061    /**
78062     * @var bool
78063     */
78064    private $returnValueGeneration = \true;
78065    /**
78066     * @var Generator
78067     */
78068    private $generator;
78069    /**
78070     * @param string|string[] $type
78071     *
78072     * @psalm-param class-string<MockedType>|string|string[] $type
78073     */
78074    public function __construct(TestCase $testCase, $type)
78075    {
78076        $this->testCase = $testCase;
78077        $this->type = $type;
78078        $this->generator = new \PHPUnit\Framework\MockObject\Generator();
78079    }
78080    /**
78081     * Creates a mock object using a fluent interface.
78082     *
78083     * @throws \PHPUnit\Framework\InvalidArgumentException
78084     * @throws ClassAlreadyExistsException
78085     * @throws ClassIsFinalException
78086     * @throws DuplicateMethodException
78087     * @throws InvalidMethodNameException
78088     * @throws OriginalConstructorInvocationRequiredException
78089     * @throws ReflectionException
78090     * @throws RuntimeException
78091     * @throws UnknownTypeException
78092     *
78093     * @psalm-return MockObject&MockedType
78094     */
78095    public function getMock() : \PHPUnit\Framework\MockObject\MockObject
78096    {
78097        $object = $this->generator->getMock($this->type, !$this->emptyMethodsArray ? $this->methods : null, $this->constructorArgs, $this->mockClassName, $this->originalConstructor, $this->originalClone, $this->autoload, $this->cloneArguments, $this->callOriginalMethods, $this->proxyTarget, $this->allowMockingUnknownTypes, $this->returnValueGeneration);
78098        $this->testCase->registerMockObject($object);
78099        return $object;
78100    }
78101    /**
78102     * Creates a mock object for an abstract class using a fluent interface.
78103     *
78104     * @psalm-return MockObject&MockedType
78105     *
78106     * @throws \PHPUnit\Framework\Exception
78107     * @throws ReflectionException
78108     * @throws RuntimeException
78109     */
78110    public function getMockForAbstractClass() : \PHPUnit\Framework\MockObject\MockObject
78111    {
78112        $object = $this->generator->getMockForAbstractClass($this->type, $this->constructorArgs, $this->mockClassName, $this->originalConstructor, $this->originalClone, $this->autoload, $this->methods, $this->cloneArguments);
78113        $this->testCase->registerMockObject($object);
78114        return $object;
78115    }
78116    /**
78117     * Creates a mock object for a trait using a fluent interface.
78118     *
78119     * @psalm-return MockObject&MockedType
78120     *
78121     * @throws \PHPUnit\Framework\Exception
78122     * @throws ReflectionException
78123     * @throws RuntimeException
78124     */
78125    public function getMockForTrait() : \PHPUnit\Framework\MockObject\MockObject
78126    {
78127        $object = $this->generator->getMockForTrait($this->type, $this->constructorArgs, $this->mockClassName, $this->originalConstructor, $this->originalClone, $this->autoload, $this->methods, $this->cloneArguments);
78128        $this->testCase->registerMockObject($object);
78129        return $object;
78130    }
78131    /**
78132     * Specifies the subset of methods to mock. Default is to mock none of them.
78133     *
78134     * @deprecated https://github.com/sebastianbergmann/phpunit/pull/3687
78135     *
78136     * @return $this
78137     */
78138    public function setMethods(?array $methods = null) : self
78139    {
78140        if ($methods === null) {
78141            $this->methods = $methods;
78142        } else {
78143            $this->methods = array_merge($this->methods ?? [], $methods);
78144        }
78145        return $this;
78146    }
78147    /**
78148     * Specifies the subset of methods to mock, requiring each to exist in the class.
78149     *
78150     * @param string[] $methods
78151     *
78152     * @throws CannotUseOnlyMethodsException
78153     * @throws ReflectionException
78154     *
78155     * @return $this
78156     */
78157    public function onlyMethods(array $methods) : self
78158    {
78159        if (empty($methods)) {
78160            $this->emptyMethodsArray = \true;
78161            return $this;
78162        }
78163        try {
78164            $reflector = new ReflectionClass($this->type);
78165            // @codeCoverageIgnoreStart
78166        } catch (\ReflectionException $e) {
78167            throw new \PHPUnit\Framework\MockObject\ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
78168        }
78169        // @codeCoverageIgnoreEnd
78170        foreach ($methods as $method) {
78171            if (!$reflector->hasMethod($method)) {
78172                throw new \PHPUnit\Framework\MockObject\CannotUseOnlyMethodsException($this->type, $method);
78173            }
78174        }
78175        $this->methods = array_merge($this->methods ?? [], $methods);
78176        return $this;
78177    }
78178    /**
78179     * Specifies methods that don't exist in the class which you want to mock.
78180     *
78181     * @param string[] $methods
78182     *
78183     * @throws CannotUseAddMethodsException
78184     * @throws ReflectionException
78185     * @throws RuntimeException
78186     *
78187     * @return $this
78188     */
78189    public function addMethods(array $methods) : self
78190    {
78191        if (empty($methods)) {
78192            $this->emptyMethodsArray = \true;
78193            return $this;
78194        }
78195        try {
78196            $reflector = new ReflectionClass($this->type);
78197            // @codeCoverageIgnoreStart
78198        } catch (\ReflectionException $e) {
78199            throw new \PHPUnit\Framework\MockObject\ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
78200        }
78201        // @codeCoverageIgnoreEnd
78202        foreach ($methods as $method) {
78203            if ($reflector->hasMethod($method)) {
78204                throw new \PHPUnit\Framework\MockObject\CannotUseAddMethodsException($this->type, $method);
78205            }
78206        }
78207        $this->methods = array_merge($this->methods ?? [], $methods);
78208        return $this;
78209    }
78210    /**
78211     * Specifies the subset of methods to not mock. Default is to mock all of them.
78212     *
78213     * @deprecated https://github.com/sebastianbergmann/phpunit/pull/3687
78214     *
78215     * @throws ReflectionException
78216     */
78217    public function setMethodsExcept(array $methods = []) : self
78218    {
78219        return $this->setMethods(array_diff($this->generator->getClassMethods($this->type), $methods));
78220    }
78221    /**
78222     * Specifies the arguments for the constructor.
78223     *
78224     * @return $this
78225     */
78226    public function setConstructorArgs(array $args) : self
78227    {
78228        $this->constructorArgs = $args;
78229        return $this;
78230    }
78231    /**
78232     * Specifies the name for the mock class.
78233     *
78234     * @return $this
78235     */
78236    public function setMockClassName(string $name) : self
78237    {
78238        $this->mockClassName = $name;
78239        return $this;
78240    }
78241    /**
78242     * Disables the invocation of the original constructor.
78243     *
78244     * @return $this
78245     */
78246    public function disableOriginalConstructor() : self
78247    {
78248        $this->originalConstructor = \false;
78249        return $this;
78250    }
78251    /**
78252     * Enables the invocation of the original constructor.
78253     *
78254     * @return $this
78255     */
78256    public function enableOriginalConstructor() : self
78257    {
78258        $this->originalConstructor = \true;
78259        return $this;
78260    }
78261    /**
78262     * Disables the invocation of the original clone constructor.
78263     *
78264     * @return $this
78265     */
78266    public function disableOriginalClone() : self
78267    {
78268        $this->originalClone = \false;
78269        return $this;
78270    }
78271    /**
78272     * Enables the invocation of the original clone constructor.
78273     *
78274     * @return $this
78275     */
78276    public function enableOriginalClone() : self
78277    {
78278        $this->originalClone = \true;
78279        return $this;
78280    }
78281    /**
78282     * Disables the use of class autoloading while creating the mock object.
78283     *
78284     * @return $this
78285     */
78286    public function disableAutoload() : self
78287    {
78288        $this->autoload = \false;
78289        return $this;
78290    }
78291    /**
78292     * Enables the use of class autoloading while creating the mock object.
78293     *
78294     * @return $this
78295     */
78296    public function enableAutoload() : self
78297    {
78298        $this->autoload = \true;
78299        return $this;
78300    }
78301    /**
78302     * Disables the cloning of arguments passed to mocked methods.
78303     *
78304     * @return $this
78305     */
78306    public function disableArgumentCloning() : self
78307    {
78308        $this->cloneArguments = \false;
78309        return $this;
78310    }
78311    /**
78312     * Enables the cloning of arguments passed to mocked methods.
78313     *
78314     * @return $this
78315     */
78316    public function enableArgumentCloning() : self
78317    {
78318        $this->cloneArguments = \true;
78319        return $this;
78320    }
78321    /**
78322     * Enables the invocation of the original methods.
78323     *
78324     * @return $this
78325     */
78326    public function enableProxyingToOriginalMethods() : self
78327    {
78328        $this->callOriginalMethods = \true;
78329        return $this;
78330    }
78331    /**
78332     * Disables the invocation of the original methods.
78333     *
78334     * @return $this
78335     */
78336    public function disableProxyingToOriginalMethods() : self
78337    {
78338        $this->callOriginalMethods = \false;
78339        $this->proxyTarget = null;
78340        return $this;
78341    }
78342    /**
78343     * Sets the proxy target.
78344     *
78345     * @return $this
78346     */
78347    public function setProxyTarget(object $object) : self
78348    {
78349        $this->proxyTarget = $object;
78350        return $this;
78351    }
78352    /**
78353     * @return $this
78354     */
78355    public function allowMockingUnknownTypes() : self
78356    {
78357        $this->allowMockingUnknownTypes = \true;
78358        return $this;
78359    }
78360    /**
78361     * @return $this
78362     */
78363    public function disallowMockingUnknownTypes() : self
78364    {
78365        $this->allowMockingUnknownTypes = \false;
78366        return $this;
78367    }
78368    /**
78369     * @return $this
78370     */
78371    public function enableAutoReturnValueGeneration() : self
78372    {
78373        $this->returnValueGeneration = \true;
78374        return $this;
78375    }
78376    /**
78377     * @return $this
78378     */
78379    public function disableAutoReturnValueGeneration() : self
78380    {
78381        $this->returnValueGeneration = \false;
78382        return $this;
78383    }
78384}
78385<?php
78386
78387declare (strict_types=1);
78388/*
78389 * This file is part of PHPUnit.
78390 *
78391 * (c) Sebastian Bergmann <sebastian@phpunit.de>
78392 *
78393 * For the full copyright and license information, please view the LICENSE
78394 * file that was distributed with this source code.
78395 */
78396namespace PHPUnit\Framework\MockObject;
78397
78398use function array_key_exists;
78399use function array_values;
78400use function strtolower;
78401/**
78402 * @internal This class is not covered by the backward compatibility promise for PHPUnit
78403 */
78404final class MockMethodSet
78405{
78406    /**
78407     * @var MockMethod[]
78408     */
78409    private $methods = [];
78410    public function addMethods(\PHPUnit\Framework\MockObject\MockMethod ...$methods) : void
78411    {
78412        foreach ($methods as $method) {
78413            $this->methods[strtolower($method->getName())] = $method;
78414        }
78415    }
78416    /**
78417     * @return MockMethod[]
78418     */
78419    public function asArray() : array
78420    {
78421        return array_values($this->methods);
78422    }
78423    public function hasMethod(string $methodName) : bool
78424    {
78425        return array_key_exists(strtolower($methodName), $this->methods);
78426    }
78427}
78428<?php
78429
78430declare (strict_types=1);
78431/*
78432 * This file is part of PHPUnit.
78433 *
78434 * (c) Sebastian Bergmann <sebastian@phpunit.de>
78435 *
78436 * For the full copyright and license information, please view the LICENSE
78437 * file that was distributed with this source code.
78438 */
78439namespace PHPUnit\Framework\MockObject;
78440
78441use function array_map;
78442use function explode;
78443use function get_class;
78444use function implode;
78445use function is_object;
78446use function sprintf;
78447use function strpos;
78448use function strtolower;
78449use function substr;
78450use PHPUnit\Doctrine\Instantiator\Instantiator;
78451use PHPUnit\Framework\SelfDescribing;
78452use PHPUnit\Util\Type;
78453use PHPUnit\SebastianBergmann\Exporter\Exporter;
78454use stdClass;
78455use Throwable;
78456/**
78457 * @internal This class is not covered by the backward compatibility promise for PHPUnit
78458 */
78459final class Invocation implements SelfDescribing
78460{
78461    /**
78462     * @var string
78463     */
78464    private $className;
78465    /**
78466     * @var string
78467     */
78468    private $methodName;
78469    /**
78470     * @var array
78471     */
78472    private $parameters;
78473    /**
78474     * @var string
78475     */
78476    private $returnType;
78477    /**
78478     * @var bool
78479     */
78480    private $isReturnTypeNullable = \false;
78481    /**
78482     * @var bool
78483     */
78484    private $proxiedCall;
78485    /**
78486     * @var object
78487     */
78488    private $object;
78489    public function __construct(string $className, string $methodName, array $parameters, string $returnType, object $object, bool $cloneObjects = \false, bool $proxiedCall = \false)
78490    {
78491        $this->className = $className;
78492        $this->methodName = $methodName;
78493        $this->parameters = $parameters;
78494        $this->object = $object;
78495        $this->proxiedCall = $proxiedCall;
78496        if (strtolower($methodName) === '__tostring') {
78497            $returnType = 'string';
78498        }
78499        if (strpos($returnType, '?') === 0) {
78500            $returnType = substr($returnType, 1);
78501            $this->isReturnTypeNullable = \true;
78502        }
78503        $this->returnType = $returnType;
78504        if (!$cloneObjects) {
78505            return;
78506        }
78507        foreach ($this->parameters as $key => $value) {
78508            if (is_object($value)) {
78509                $this->parameters[$key] = $this->cloneObject($value);
78510            }
78511        }
78512    }
78513    public function getClassName() : string
78514    {
78515        return $this->className;
78516    }
78517    public function getMethodName() : string
78518    {
78519        return $this->methodName;
78520    }
78521    public function getParameters() : array
78522    {
78523        return $this->parameters;
78524    }
78525    /**
78526     * @throws RuntimeException
78527     *
78528     * @return mixed Mocked return value
78529     */
78530    public function generateReturnValue()
78531    {
78532        if ($this->isReturnTypeNullable || $this->proxiedCall) {
78533            return null;
78534        }
78535        $union = \false;
78536        if (strpos($this->returnType, '|') !== \false) {
78537            $types = explode('|', $this->returnType);
78538            $union = \true;
78539        } else {
78540            $types = [$this->returnType];
78541        }
78542        $types = array_map('strtolower', $types);
78543        if (\in_array('', $types, \true) || \in_array('null', $types, \true) || \in_array('mixed', $types, \true) || \in_array('void', $types, \true)) {
78544            return null;
78545        }
78546        if (\in_array('false', $types, \true) || \in_array('bool', $types, \true)) {
78547            return \false;
78548        }
78549        if (\in_array('float', $types, \true)) {
78550            return 0.0;
78551        }
78552        if (\in_array('int', $types, \true)) {
78553            return 0;
78554        }
78555        if (\in_array('string', $types, \true)) {
78556            return '';
78557        }
78558        if (\in_array('array', $types, \true)) {
78559            return [];
78560        }
78561        if (\in_array('static', $types, \true)) {
78562            try {
78563                return (new Instantiator())->instantiate(get_class($this->object));
78564            } catch (Throwable $t) {
78565                throw new \PHPUnit\Framework\MockObject\RuntimeException($t->getMessage(), (int) $t->getCode(), $t);
78566            }
78567        }
78568        if (\in_array('object', $types, \true)) {
78569            return new stdClass();
78570        }
78571        if (\in_array('callable', $types, \true) || \in_array('closure', $types, \true)) {
78572            return static function () : void {
78573            };
78574        }
78575        if (\in_array('traversable', $types, \true) || \in_array('generator', $types, \true) || \in_array('iterable', $types, \true)) {
78576            $generator = static function () : \Generator {
78577                yield from [];
78578            };
78579            return $generator();
78580        }
78581        if (!$union) {
78582            try {
78583                return (new \PHPUnit\Framework\MockObject\Generator())->getMock($this->returnType, [], [], '', \false);
78584            } catch (Throwable $t) {
78585                throw new \PHPUnit\Framework\MockObject\RuntimeException(sprintf('Return value for %s::%s() cannot be generated: %s', $this->className, $this->methodName, $t->getMessage()), (int) $t->getCode());
78586            }
78587        }
78588        throw new \PHPUnit\Framework\MockObject\RuntimeException(sprintf('Return value for %s::%s() cannot be generated because the declared return type is a union, please configure a return value for this method', $this->className, $this->methodName));
78589    }
78590    public function toString() : string
78591    {
78592        $exporter = new Exporter();
78593        return sprintf('%s::%s(%s)%s', $this->className, $this->methodName, implode(', ', array_map([$exporter, 'shortenedExport'], $this->parameters)), $this->returnType ? sprintf(': %s', $this->returnType) : '');
78594    }
78595    public function getObject() : object
78596    {
78597        return $this->object;
78598    }
78599    private function cloneObject(object $original) : object
78600    {
78601        if (Type::isCloneable($original)) {
78602            return clone $original;
78603        }
78604        return $original;
78605    }
78606}
78607<?php
78608
78609declare (strict_types=1);
78610/*
78611 * This file is part of PHPUnit.
78612 *
78613 * (c) Sebastian Bergmann <sebastian@phpunit.de>
78614 *
78615 * For the full copyright and license information, please view the LICENSE
78616 * file that was distributed with this source code.
78617 */
78618namespace PHPUnit\Framework\MockObject;
78619
78620use const DIRECTORY_SEPARATOR;
78621use function implode;
78622use function is_string;
78623use function preg_match;
78624use function preg_replace;
78625use function sprintf;
78626use function substr_count;
78627use function trim;
78628use function var_export;
78629use ReflectionMethod;
78630use ReflectionNamedType;
78631use ReflectionParameter;
78632use ReflectionUnionType;
78633use PHPUnit\SebastianBergmann\Template\Exception as TemplateException;
78634use PHPUnit\SebastianBergmann\Template\Template;
78635use PHPUnit\SebastianBergmann\Type\ReflectionMapper;
78636use PHPUnit\SebastianBergmann\Type\Type;
78637use PHPUnit\SebastianBergmann\Type\UnknownType;
78638use PHPUnit\SebastianBergmann\Type\VoidType;
78639/**
78640 * @internal This class is not covered by the backward compatibility promise for PHPUnit
78641 */
78642final class MockMethod
78643{
78644    /**
78645     * @var Template[]
78646     */
78647    private static $templates = [];
78648    /**
78649     * @var string
78650     */
78651    private $className;
78652    /**
78653     * @var string
78654     */
78655    private $methodName;
78656    /**
78657     * @var bool
78658     */
78659    private $cloneArguments;
78660    /**
78661     * @var string string
78662     */
78663    private $modifier;
78664    /**
78665     * @var string
78666     */
78667    private $argumentsForDeclaration;
78668    /**
78669     * @var string
78670     */
78671    private $argumentsForCall;
78672    /**
78673     * @var Type
78674     */
78675    private $returnType;
78676    /**
78677     * @var string
78678     */
78679    private $reference;
78680    /**
78681     * @var bool
78682     */
78683    private $callOriginalMethod;
78684    /**
78685     * @var bool
78686     */
78687    private $static;
78688    /**
78689     * @var ?string
78690     */
78691    private $deprecation;
78692    /**
78693     * @throws ReflectionException
78694     * @throws RuntimeException
78695     */
78696    public static function fromReflection(ReflectionMethod $method, bool $callOriginalMethod, bool $cloneArguments) : self
78697    {
78698        if ($method->isPrivate()) {
78699            $modifier = 'private';
78700        } elseif ($method->isProtected()) {
78701            $modifier = 'protected';
78702        } else {
78703            $modifier = 'public';
78704        }
78705        if ($method->isStatic()) {
78706            $modifier .= ' static';
78707        }
78708        if ($method->returnsReference()) {
78709            $reference = '&';
78710        } else {
78711            $reference = '';
78712        }
78713        $docComment = $method->getDocComment();
78714        if (is_string($docComment) && preg_match('#\\*[ \\t]*+@deprecated[ \\t]*+(.*?)\\r?+\\n[ \\t]*+\\*(?:[ \\t]*+@|/$)#s', $docComment, $deprecation)) {
78715            $deprecation = trim(preg_replace('#[ \\t]*\\r?\\n[ \\t]*+\\*[ \\t]*+#', ' ', $deprecation[1]));
78716        } else {
78717            $deprecation = null;
78718        }
78719        return new self($method->getDeclaringClass()->getName(), $method->getName(), $cloneArguments, $modifier, self::getMethodParametersForDeclaration($method), self::getMethodParametersForCall($method), (new ReflectionMapper())->fromMethodReturnType($method), $reference, $callOriginalMethod, $method->isStatic(), $deprecation);
78720    }
78721    public static function fromName(string $fullClassName, string $methodName, bool $cloneArguments) : self
78722    {
78723        return new self($fullClassName, $methodName, $cloneArguments, 'public', '', '', new UnknownType(), '', \false, \false, null);
78724    }
78725    public function __construct(string $className, string $methodName, bool $cloneArguments, string $modifier, string $argumentsForDeclaration, string $argumentsForCall, Type $returnType, string $reference, bool $callOriginalMethod, bool $static, ?string $deprecation)
78726    {
78727        $this->className = $className;
78728        $this->methodName = $methodName;
78729        $this->cloneArguments = $cloneArguments;
78730        $this->modifier = $modifier;
78731        $this->argumentsForDeclaration = $argumentsForDeclaration;
78732        $this->argumentsForCall = $argumentsForCall;
78733        $this->returnType = $returnType;
78734        $this->reference = $reference;
78735        $this->callOriginalMethod = $callOriginalMethod;
78736        $this->static = $static;
78737        $this->deprecation = $deprecation;
78738    }
78739    public function getName() : string
78740    {
78741        return $this->methodName;
78742    }
78743    /**
78744     * @throws RuntimeException
78745     */
78746    public function generateCode() : string
78747    {
78748        if ($this->static) {
78749            $templateFile = 'mocked_static_method.tpl';
78750        } elseif ($this->returnType instanceof VoidType) {
78751            $templateFile = sprintf('%s_method_void.tpl', $this->callOriginalMethod ? 'proxied' : 'mocked');
78752        } else {
78753            $templateFile = sprintf('%s_method.tpl', $this->callOriginalMethod ? 'proxied' : 'mocked');
78754        }
78755        $deprecation = $this->deprecation;
78756        if (null !== $this->deprecation) {
78757            $deprecation = "The {$this->className}::{$this->methodName} method is deprecated ({$this->deprecation}).";
78758            $deprecationTemplate = $this->getTemplate('deprecation.tpl');
78759            $deprecationTemplate->setVar(['deprecation' => var_export($deprecation, \true)]);
78760            $deprecation = $deprecationTemplate->render();
78761        }
78762        $template = $this->getTemplate($templateFile);
78763        $template->setVar(['arguments_decl' => $this->argumentsForDeclaration, 'arguments_call' => $this->argumentsForCall, 'return_declaration' => !empty($this->returnType->asString()) ? ': ' . $this->returnType->asString() : '', 'return_type' => $this->returnType->asString(), 'arguments_count' => !empty($this->argumentsForCall) ? substr_count($this->argumentsForCall, ',') + 1 : 0, 'class_name' => $this->className, 'method_name' => $this->methodName, 'modifier' => $this->modifier, 'reference' => $this->reference, 'clone_arguments' => $this->cloneArguments ? 'true' : 'false', 'deprecation' => $deprecation]);
78764        return $template->render();
78765    }
78766    public function getReturnType() : Type
78767    {
78768        return $this->returnType;
78769    }
78770    /**
78771     * @throws RuntimeException
78772     */
78773    private function getTemplate(string $template) : Template
78774    {
78775        $filename = __DIR__ . \DIRECTORY_SEPARATOR . 'Generator' . \DIRECTORY_SEPARATOR . $template;
78776        if (!isset(self::$templates[$filename])) {
78777            try {
78778                self::$templates[$filename] = new Template($filename);
78779            } catch (TemplateException $e) {
78780                throw new \PHPUnit\Framework\MockObject\RuntimeException($e->getMessage(), (int) $e->getCode(), $e);
78781            }
78782        }
78783        return self::$templates[$filename];
78784    }
78785    /**
78786     * Returns the parameters of a function or method.
78787     *
78788     * @throws RuntimeException
78789     */
78790    private static function getMethodParametersForDeclaration(ReflectionMethod $method) : string
78791    {
78792        $parameters = [];
78793        foreach ($method->getParameters() as $i => $parameter) {
78794            $name = '$' . $parameter->getName();
78795            /* Note: PHP extensions may use empty names for reference arguments
78796             * or "..." for methods taking a variable number of arguments.
78797             */
78798            if ($name === '$' || $name === '$...') {
78799                $name = '$arg' . $i;
78800            }
78801            $nullable = '';
78802            $default = '';
78803            $reference = '';
78804            $typeDeclaration = '';
78805            $type = null;
78806            $typeName = null;
78807            if ($parameter->hasType()) {
78808                $type = $parameter->getType();
78809                if ($type instanceof ReflectionNamedType) {
78810                    $typeName = $type->getName();
78811                }
78812            }
78813            if ($parameter->isVariadic()) {
78814                $name = '...' . $name;
78815            } elseif ($parameter->isDefaultValueAvailable()) {
78816                $default = ' = ' . self::exportDefaultValue($parameter);
78817            } elseif ($parameter->isOptional()) {
78818                $default = ' = null';
78819            }
78820            if ($type !== null) {
78821                if ($typeName !== 'mixed' && $parameter->allowsNull() && !$type instanceof ReflectionUnionType) {
78822                    $nullable = '?';
78823                }
78824                if ($typeName === 'self') {
78825                    $typeDeclaration = $method->getDeclaringClass()->getName() . ' ';
78826                } elseif ($typeName !== null) {
78827                    $typeDeclaration = $typeName . ' ';
78828                } elseif ($type instanceof ReflectionUnionType) {
78829                    $typeDeclaration = self::unionTypeAsString($type, $method->getDeclaringClass()->getName());
78830                }
78831            }
78832            if ($parameter->isPassedByReference()) {
78833                $reference = '&';
78834            }
78835            $parameters[] = $nullable . $typeDeclaration . $reference . $name . $default;
78836        }
78837        return implode(', ', $parameters);
78838    }
78839    /**
78840     * Returns the parameters of a function or method.
78841     *
78842     * @throws ReflectionException
78843     */
78844    private static function getMethodParametersForCall(ReflectionMethod $method) : string
78845    {
78846        $parameters = [];
78847        foreach ($method->getParameters() as $i => $parameter) {
78848            $name = '$' . $parameter->getName();
78849            /* Note: PHP extensions may use empty names for reference arguments
78850             * or "..." for methods taking a variable number of arguments.
78851             */
78852            if ($name === '$' || $name === '$...') {
78853                $name = '$arg' . $i;
78854            }
78855            if ($parameter->isVariadic()) {
78856                continue;
78857            }
78858            if ($parameter->isPassedByReference()) {
78859                $parameters[] = '&' . $name;
78860            } else {
78861                $parameters[] = $name;
78862            }
78863        }
78864        return implode(', ', $parameters);
78865    }
78866    /**
78867     * @throws ReflectionException
78868     */
78869    private static function exportDefaultValue(ReflectionParameter $parameter) : string
78870    {
78871        try {
78872            return (string) var_export($parameter->getDefaultValue(), \true);
78873            // @codeCoverageIgnoreStart
78874        } catch (\ReflectionException $e) {
78875            throw new \PHPUnit\Framework\MockObject\ReflectionException($e->getMessage(), (int) $e->getCode(), $e);
78876        }
78877        // @codeCoverageIgnoreEnd
78878    }
78879    private static function unionTypeAsString(ReflectionUnionType $union, string $self) : string
78880    {
78881        $types = [];
78882        foreach ($union->getTypes() as $type) {
78883            if ((string) $type === 'self') {
78884                $types[] = $self;
78885            } else {
78886                $types[] = $type;
78887            }
78888        }
78889        return implode('|', $types) . ' ';
78890    }
78891}
78892<?php
78893
78894declare (strict_types=1);
78895/*
78896 * This file is part of PHPUnit.
78897 *
78898 * (c) Sebastian Bergmann <sebastian@phpunit.de>
78899 *
78900 * For the full copyright and license information, please view the LICENSE
78901 * file that was distributed with this source code.
78902 */
78903namespace PHPUnit\Framework\MockObject;
78904
78905use function is_string;
78906use function sprintf;
78907use function strtolower;
78908use PHPUnit\Framework\Constraint\Constraint;
78909/**
78910 * @internal This class is not covered by the backward compatibility promise for PHPUnit
78911 */
78912final class MethodNameConstraint extends Constraint
78913{
78914    /**
78915     * @var string
78916     */
78917    private $methodName;
78918    public function __construct(string $methodName)
78919    {
78920        $this->methodName = $methodName;
78921    }
78922    public function toString() : string
78923    {
78924        return sprintf('is "%s"', $this->methodName);
78925    }
78926    protected function matches($other) : bool
78927    {
78928        if (!is_string($other)) {
78929            return \false;
78930        }
78931        return strtolower($this->methodName) === strtolower($other);
78932    }
78933}
78934<?php
78935
78936declare (strict_types=1);
78937/*
78938 * This file is part of PHPUnit.
78939 *
78940 * (c) Sebastian Bergmann <sebastian@phpunit.de>
78941 *
78942 * For the full copyright and license information, please view the LICENSE
78943 * file that was distributed with this source code.
78944 */
78945namespace PHPUnit\Framework\MockObject\Rule;
78946
78947use function count;
78948use function gettype;
78949use function is_iterable;
78950use function sprintf;
78951use PHPUnit\Framework\Constraint\Constraint;
78952use PHPUnit\Framework\Constraint\IsEqual;
78953use PHPUnit\Framework\ExpectationFailedException;
78954use PHPUnit\Framework\InvalidParameterGroupException;
78955use PHPUnit\Framework\MockObject\Invocation as BaseInvocation;
78956/**
78957 * @internal This class is not covered by the backward compatibility promise for PHPUnit
78958 */
78959final class ConsecutiveParameters implements \PHPUnit\Framework\MockObject\Rule\ParametersRule
78960{
78961    /**
78962     * @var array
78963     */
78964    private $parameterGroups = [];
78965    /**
78966     * @var array
78967     */
78968    private $invocations = [];
78969    /**
78970     * @throws \PHPUnit\Framework\Exception
78971     */
78972    public function __construct(array $parameterGroups)
78973    {
78974        foreach ($parameterGroups as $index => $parameters) {
78975            if (!is_iterable($parameters)) {
78976                throw new InvalidParameterGroupException(sprintf('Parameter group #%d must be an array or Traversable, got %s', $index, gettype($parameters)));
78977            }
78978            foreach ($parameters as $parameter) {
78979                if (!$parameter instanceof Constraint) {
78980                    $parameter = new IsEqual($parameter);
78981                }
78982                $this->parameterGroups[$index][] = $parameter;
78983            }
78984        }
78985    }
78986    public function toString() : string
78987    {
78988        return 'with consecutive parameters';
78989    }
78990    /**
78991     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
78992     * @throws ExpectationFailedException
78993     */
78994    public function apply(BaseInvocation $invocation) : void
78995    {
78996        $this->invocations[] = $invocation;
78997        $callIndex = count($this->invocations) - 1;
78998        $this->verifyInvocation($invocation, $callIndex);
78999    }
79000    /**
79001     * @throws \PHPUnit\Framework\ExpectationFailedException
79002     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
79003     */
79004    public function verify() : void
79005    {
79006        foreach ($this->invocations as $callIndex => $invocation) {
79007            $this->verifyInvocation($invocation, $callIndex);
79008        }
79009    }
79010    /**
79011     * Verify a single invocation.
79012     *
79013     * @param int $callIndex
79014     *
79015     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
79016     * @throws ExpectationFailedException
79017     */
79018    private function verifyInvocation(BaseInvocation $invocation, $callIndex) : void
79019    {
79020        if (!isset($this->parameterGroups[$callIndex])) {
79021            // no parameter assertion for this call index
79022            return;
79023        }
79024        $parameters = $this->parameterGroups[$callIndex];
79025        if (count($invocation->getParameters()) < count($parameters)) {
79026            throw new ExpectationFailedException(sprintf('Parameter count for invocation %s is too low.', $invocation->toString()));
79027        }
79028        foreach ($parameters as $i => $parameter) {
79029            $parameter->evaluate($invocation->getParameters()[$i], sprintf('Parameter %s for invocation #%d %s does not match expected ' . 'value.', $i, $callIndex, $invocation->toString()));
79030        }
79031    }
79032}
79033<?php
79034
79035declare (strict_types=1);
79036/*
79037 * This file is part of PHPUnit.
79038 *
79039 * (c) Sebastian Bergmann <sebastian@phpunit.de>
79040 *
79041 * For the full copyright and license information, please view the LICENSE
79042 * file that was distributed with this source code.
79043 */
79044namespace PHPUnit\Framework\MockObject\Rule;
79045
79046use function is_string;
79047use PHPUnit\Framework\Constraint\Constraint;
79048use PHPUnit\Framework\InvalidArgumentException;
79049use PHPUnit\Framework\MockObject\Invocation as BaseInvocation;
79050use PHPUnit\Framework\MockObject\MethodNameConstraint;
79051/**
79052 * @internal This class is not covered by the backward compatibility promise for PHPUnit
79053 */
79054final class MethodName
79055{
79056    /**
79057     * @var Constraint
79058     */
79059    private $constraint;
79060    /**
79061     * @param Constraint|string $constraint
79062     *
79063     * @throws InvalidArgumentException
79064     */
79065    public function __construct($constraint)
79066    {
79067        if (is_string($constraint)) {
79068            $constraint = new MethodNameConstraint($constraint);
79069        }
79070        if (!$constraint instanceof Constraint) {
79071            throw InvalidArgumentException::create(1, 'PHPUnit\\Framework\\Constraint\\Constraint object or string');
79072        }
79073        $this->constraint = $constraint;
79074    }
79075    public function toString() : string
79076    {
79077        return 'method name ' . $this->constraint->toString();
79078    }
79079    /**
79080     * @throws \PHPUnit\Framework\ExpectationFailedException
79081     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
79082     */
79083    public function matches(BaseInvocation $invocation) : bool
79084    {
79085        return $this->matchesName($invocation->getMethodName());
79086    }
79087    /**
79088     * @throws \PHPUnit\Framework\ExpectationFailedException
79089     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
79090     */
79091    public function matchesName(string $methodName) : bool
79092    {
79093        return (bool) $this->constraint->evaluate($methodName, '', \true);
79094    }
79095}
79096<?php
79097
79098declare (strict_types=1);
79099/*
79100 * This file is part of PHPUnit.
79101 *
79102 * (c) Sebastian Bergmann <sebastian@phpunit.de>
79103 *
79104 * For the full copyright and license information, please view the LICENSE
79105 * file that was distributed with this source code.
79106 */
79107namespace PHPUnit\Framework\MockObject\Rule;
79108
79109use function sprintf;
79110use PHPUnit\Framework\ExpectationFailedException;
79111use PHPUnit\Framework\MockObject\Invocation as BaseInvocation;
79112/**
79113 * @internal This class is not covered by the backward compatibility promise for PHPUnit
79114 *
79115 * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4297
79116 * @codeCoverageIgnore
79117 */
79118final class InvokedAtIndex extends \PHPUnit\Framework\MockObject\Rule\InvocationOrder
79119{
79120    /**
79121     * @var int
79122     */
79123    private $sequenceIndex;
79124    /**
79125     * @var int
79126     */
79127    private $currentIndex = -1;
79128    /**
79129     * @param int $sequenceIndex
79130     */
79131    public function __construct($sequenceIndex)
79132    {
79133        $this->sequenceIndex = $sequenceIndex;
79134    }
79135    public function toString() : string
79136    {
79137        return 'invoked at sequence index ' . $this->sequenceIndex;
79138    }
79139    public function matches(BaseInvocation $invocation) : bool
79140    {
79141        $this->currentIndex++;
79142        return $this->currentIndex == $this->sequenceIndex;
79143    }
79144    /**
79145     * Verifies that the current expectation is valid. If everything is OK the
79146     * code should just return, if not it must throw an exception.
79147     *
79148     * @throws ExpectationFailedException
79149     */
79150    public function verify() : void
79151    {
79152        if ($this->currentIndex < $this->sequenceIndex) {
79153            throw new ExpectationFailedException(sprintf('The expected invocation at index %s was never reached.', $this->sequenceIndex));
79154        }
79155    }
79156    protected function invokedDo(BaseInvocation $invocation) : void
79157    {
79158    }
79159}
79160<?php
79161
79162declare (strict_types=1);
79163/*
79164 * This file is part of PHPUnit.
79165 *
79166 * (c) Sebastian Bergmann <sebastian@phpunit.de>
79167 *
79168 * For the full copyright and license information, please view the LICENSE
79169 * file that was distributed with this source code.
79170 */
79171namespace PHPUnit\Framework\MockObject\Rule;
79172
79173use PHPUnit\Framework\MockObject\Invocation as BaseInvocation;
79174/**
79175 * @internal This class is not covered by the backward compatibility promise for PHPUnit
79176 */
79177final class AnyParameters implements \PHPUnit\Framework\MockObject\Rule\ParametersRule
79178{
79179    public function toString() : string
79180    {
79181        return 'with any parameters';
79182    }
79183    public function apply(BaseInvocation $invocation) : void
79184    {
79185    }
79186    public function verify() : void
79187    {
79188    }
79189}
79190<?php
79191
79192declare (strict_types=1);
79193/*
79194 * This file is part of PHPUnit.
79195 *
79196 * (c) Sebastian Bergmann <sebastian@phpunit.de>
79197 *
79198 * For the full copyright and license information, please view the LICENSE
79199 * file that was distributed with this source code.
79200 */
79201namespace PHPUnit\Framework\MockObject\Rule;
79202
79203use function count;
79204use PHPUnit\Framework\MockObject\Invocation as BaseInvocation;
79205use PHPUnit\Framework\MockObject\Verifiable;
79206use PHPUnit\Framework\SelfDescribing;
79207/**
79208 * @internal This class is not covered by the backward compatibility promise for PHPUnit
79209 */
79210abstract class InvocationOrder implements SelfDescribing, Verifiable
79211{
79212    /**
79213     * @var BaseInvocation[]
79214     */
79215    private $invocations = [];
79216    public function getInvocationCount() : int
79217    {
79218        return count($this->invocations);
79219    }
79220    public function hasBeenInvoked() : bool
79221    {
79222        return count($this->invocations) > 0;
79223    }
79224    public final function invoked(BaseInvocation $invocation)
79225    {
79226        $this->invocations[] = $invocation;
79227        return $this->invokedDo($invocation);
79228    }
79229    public abstract function matches(BaseInvocation $invocation) : bool;
79230    protected abstract function invokedDo(BaseInvocation $invocation);
79231}
79232<?php
79233
79234declare (strict_types=1);
79235/*
79236 * This file is part of PHPUnit.
79237 *
79238 * (c) Sebastian Bergmann <sebastian@phpunit.de>
79239 *
79240 * For the full copyright and license information, please view the LICENSE
79241 * file that was distributed with this source code.
79242 */
79243namespace PHPUnit\Framework\MockObject\Rule;
79244
79245use PHPUnit\Framework\ExpectationFailedException;
79246use PHPUnit\Framework\MockObject\Invocation as BaseInvocation;
79247/**
79248 * @internal This class is not covered by the backward compatibility promise for PHPUnit
79249 */
79250final class InvokedAtLeastOnce extends \PHPUnit\Framework\MockObject\Rule\InvocationOrder
79251{
79252    public function toString() : string
79253    {
79254        return 'invoked at least once';
79255    }
79256    /**
79257     * Verifies that the current expectation is valid. If everything is OK the
79258     * code should just return, if not it must throw an exception.
79259     *
79260     * @throws ExpectationFailedException
79261     */
79262    public function verify() : void
79263    {
79264        $count = $this->getInvocationCount();
79265        if ($count < 1) {
79266            throw new ExpectationFailedException('Expected invocation at least once but it never occurred.');
79267        }
79268    }
79269    public function matches(BaseInvocation $invocation) : bool
79270    {
79271        return \true;
79272    }
79273    protected function invokedDo(BaseInvocation $invocation) : void
79274    {
79275    }
79276}
79277<?php
79278
79279declare (strict_types=1);
79280/*
79281 * This file is part of PHPUnit.
79282 *
79283 * (c) Sebastian Bergmann <sebastian@phpunit.de>
79284 *
79285 * For the full copyright and license information, please view the LICENSE
79286 * file that was distributed with this source code.
79287 */
79288namespace PHPUnit\Framework\MockObject\Rule;
79289
79290use PHPUnit\Framework\ExpectationFailedException;
79291use PHPUnit\Framework\MockObject\Invocation as BaseInvocation;
79292/**
79293 * @internal This class is not covered by the backward compatibility promise for PHPUnit
79294 */
79295final class InvokedAtMostCount extends \PHPUnit\Framework\MockObject\Rule\InvocationOrder
79296{
79297    /**
79298     * @var int
79299     */
79300    private $allowedInvocations;
79301    /**
79302     * @param int $allowedInvocations
79303     */
79304    public function __construct($allowedInvocations)
79305    {
79306        $this->allowedInvocations = $allowedInvocations;
79307    }
79308    public function toString() : string
79309    {
79310        return 'invoked at most ' . $this->allowedInvocations . ' times';
79311    }
79312    /**
79313     * Verifies that the current expectation is valid. If everything is OK the
79314     * code should just return, if not it must throw an exception.
79315     *
79316     * @throws ExpectationFailedException
79317     */
79318    public function verify() : void
79319    {
79320        $count = $this->getInvocationCount();
79321        if ($count > $this->allowedInvocations) {
79322            throw new ExpectationFailedException('Expected invocation at most ' . $this->allowedInvocations . ' times but it occurred ' . $count . ' time(s).');
79323        }
79324    }
79325    public function matches(BaseInvocation $invocation) : bool
79326    {
79327        return \true;
79328    }
79329    protected function invokedDo(BaseInvocation $invocation) : void
79330    {
79331    }
79332}
79333<?php
79334
79335declare (strict_types=1);
79336/*
79337 * This file is part of PHPUnit.
79338 *
79339 * (c) Sebastian Bergmann <sebastian@phpunit.de>
79340 *
79341 * For the full copyright and license information, please view the LICENSE
79342 * file that was distributed with this source code.
79343 */
79344namespace PHPUnit\Framework\MockObject\Rule;
79345
79346use PHPUnit\Framework\ExpectationFailedException;
79347use PHPUnit\Framework\MockObject\Invocation as BaseInvocation;
79348/**
79349 * @internal This class is not covered by the backward compatibility promise for PHPUnit
79350 */
79351final class InvokedAtLeastCount extends \PHPUnit\Framework\MockObject\Rule\InvocationOrder
79352{
79353    /**
79354     * @var int
79355     */
79356    private $requiredInvocations;
79357    /**
79358     * @param int $requiredInvocations
79359     */
79360    public function __construct($requiredInvocations)
79361    {
79362        $this->requiredInvocations = $requiredInvocations;
79363    }
79364    public function toString() : string
79365    {
79366        return 'invoked at least ' . $this->requiredInvocations . ' times';
79367    }
79368    /**
79369     * Verifies that the current expectation is valid. If everything is OK the
79370     * code should just return, if not it must throw an exception.
79371     *
79372     * @throws ExpectationFailedException
79373     */
79374    public function verify() : void
79375    {
79376        $count = $this->getInvocationCount();
79377        if ($count < $this->requiredInvocations) {
79378            throw new ExpectationFailedException('Expected invocation at least ' . $this->requiredInvocations . ' times but it occurred ' . $count . ' time(s).');
79379        }
79380    }
79381    public function matches(BaseInvocation $invocation) : bool
79382    {
79383        return \true;
79384    }
79385    protected function invokedDo(BaseInvocation $invocation) : void
79386    {
79387    }
79388}
79389<?php
79390
79391declare (strict_types=1);
79392/*
79393 * This file is part of PHPUnit.
79394 *
79395 * (c) Sebastian Bergmann <sebastian@phpunit.de>
79396 *
79397 * For the full copyright and license information, please view the LICENSE
79398 * file that was distributed with this source code.
79399 */
79400namespace PHPUnit\Framework\MockObject\Rule;
79401
79402use PHPUnit\Framework\MockObject\Invocation as BaseInvocation;
79403/**
79404 * @internal This class is not covered by the backward compatibility promise for PHPUnit
79405 */
79406final class AnyInvokedCount extends \PHPUnit\Framework\MockObject\Rule\InvocationOrder
79407{
79408    public function toString() : string
79409    {
79410        return 'invoked zero or more times';
79411    }
79412    public function verify() : void
79413    {
79414    }
79415    public function matches(BaseInvocation $invocation) : bool
79416    {
79417        return \true;
79418    }
79419    protected function invokedDo(BaseInvocation $invocation) : void
79420    {
79421    }
79422}
79423<?php
79424
79425declare (strict_types=1);
79426/*
79427 * This file is part of PHPUnit.
79428 *
79429 * (c) Sebastian Bergmann <sebastian@phpunit.de>
79430 *
79431 * For the full copyright and license information, please view the LICENSE
79432 * file that was distributed with this source code.
79433 */
79434namespace PHPUnit\Framework\MockObject\Rule;
79435
79436use PHPUnit\Framework\ExpectationFailedException;
79437use PHPUnit\Framework\MockObject\Invocation as BaseInvocation;
79438use PHPUnit\Framework\MockObject\Verifiable;
79439use PHPUnit\Framework\SelfDescribing;
79440/**
79441 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
79442 */
79443interface ParametersRule extends SelfDescribing, Verifiable
79444{
79445    /**
79446     * @throws ExpectationFailedException if the invocation violates the rule
79447     */
79448    public function apply(BaseInvocation $invocation) : void;
79449    public function verify() : void;
79450}
79451<?php
79452
79453declare (strict_types=1);
79454/*
79455 * This file is part of PHPUnit.
79456 *
79457 * (c) Sebastian Bergmann <sebastian@phpunit.de>
79458 *
79459 * For the full copyright and license information, please view the LICENSE
79460 * file that was distributed with this source code.
79461 */
79462namespace PHPUnit\Framework\MockObject\Rule;
79463
79464use function sprintf;
79465use PHPUnit\Framework\ExpectationFailedException;
79466use PHPUnit\Framework\MockObject\Invocation as BaseInvocation;
79467/**
79468 * @internal This class is not covered by the backward compatibility promise for PHPUnit
79469 */
79470final class InvokedCount extends \PHPUnit\Framework\MockObject\Rule\InvocationOrder
79471{
79472    /**
79473     * @var int
79474     */
79475    private $expectedCount;
79476    /**
79477     * @param int $expectedCount
79478     */
79479    public function __construct($expectedCount)
79480    {
79481        $this->expectedCount = $expectedCount;
79482    }
79483    public function isNever() : bool
79484    {
79485        return $this->expectedCount === 0;
79486    }
79487    public function toString() : string
79488    {
79489        return 'invoked ' . $this->expectedCount . ' time(s)';
79490    }
79491    public function matches(BaseInvocation $invocation) : bool
79492    {
79493        return \true;
79494    }
79495    /**
79496     * Verifies that the current expectation is valid. If everything is OK the
79497     * code should just return, if not it must throw an exception.
79498     *
79499     * @throws ExpectationFailedException
79500     */
79501    public function verify() : void
79502    {
79503        $count = $this->getInvocationCount();
79504        if ($count !== $this->expectedCount) {
79505            throw new ExpectationFailedException(sprintf('Method was expected to be called %d times, ' . 'actually called %d times.', $this->expectedCount, $count));
79506        }
79507    }
79508    /**
79509     * @throws ExpectationFailedException
79510     */
79511    protected function invokedDo(BaseInvocation $invocation) : void
79512    {
79513        $count = $this->getInvocationCount();
79514        if ($count > $this->expectedCount) {
79515            $message = $invocation->toString() . ' ';
79516            switch ($this->expectedCount) {
79517                case 0:
79518                    $message .= 'was not expected to be called.';
79519                    break;
79520                case 1:
79521                    $message .= 'was not expected to be called more than once.';
79522                    break;
79523                default:
79524                    $message .= sprintf('was not expected to be called more than %d times.', $this->expectedCount);
79525            }
79526            throw new ExpectationFailedException($message);
79527        }
79528    }
79529}
79530<?php
79531
79532declare (strict_types=1);
79533/*
79534 * This file is part of PHPUnit.
79535 *
79536 * (c) Sebastian Bergmann <sebastian@phpunit.de>
79537 *
79538 * For the full copyright and license information, please view the LICENSE
79539 * file that was distributed with this source code.
79540 */
79541namespace PHPUnit\Framework\MockObject\Rule;
79542
79543use function count;
79544use function get_class;
79545use function sprintf;
79546use Exception;
79547use PHPUnit\Framework\Constraint\Constraint;
79548use PHPUnit\Framework\Constraint\IsAnything;
79549use PHPUnit\Framework\Constraint\IsEqual;
79550use PHPUnit\Framework\ExpectationFailedException;
79551use PHPUnit\Framework\MockObject\Invocation as BaseInvocation;
79552/**
79553 * @internal This class is not covered by the backward compatibility promise for PHPUnit
79554 */
79555final class Parameters implements \PHPUnit\Framework\MockObject\Rule\ParametersRule
79556{
79557    /**
79558     * @var Constraint[]
79559     */
79560    private $parameters = [];
79561    /**
79562     * @var BaseInvocation
79563     */
79564    private $invocation;
79565    /**
79566     * @var bool|ExpectationFailedException
79567     */
79568    private $parameterVerificationResult;
79569    /**
79570     * @throws \PHPUnit\Framework\Exception
79571     */
79572    public function __construct(array $parameters)
79573    {
79574        foreach ($parameters as $parameter) {
79575            if (!$parameter instanceof Constraint) {
79576                $parameter = new IsEqual($parameter);
79577            }
79578            $this->parameters[] = $parameter;
79579        }
79580    }
79581    public function toString() : string
79582    {
79583        $text = 'with parameter';
79584        foreach ($this->parameters as $index => $parameter) {
79585            if ($index > 0) {
79586                $text .= ' and';
79587            }
79588            $text .= ' ' . $index . ' ' . $parameter->toString();
79589        }
79590        return $text;
79591    }
79592    /**
79593     * @throws Exception
79594     */
79595    public function apply(BaseInvocation $invocation) : void
79596    {
79597        $this->invocation = $invocation;
79598        $this->parameterVerificationResult = null;
79599        try {
79600            $this->parameterVerificationResult = $this->doVerify();
79601        } catch (ExpectationFailedException $e) {
79602            $this->parameterVerificationResult = $e;
79603            throw $this->parameterVerificationResult;
79604        }
79605    }
79606    /**
79607     * Checks if the invocation $invocation matches the current rules. If it
79608     * does the rule will get the invoked() method called which should check
79609     * if an expectation is met.
79610     *
79611     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
79612     * @throws ExpectationFailedException
79613     */
79614    public function verify() : void
79615    {
79616        $this->doVerify();
79617    }
79618    /**
79619     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
79620     * @throws ExpectationFailedException
79621     */
79622    private function doVerify() : bool
79623    {
79624        if (isset($this->parameterVerificationResult)) {
79625            return $this->guardAgainstDuplicateEvaluationOfParameterConstraints();
79626        }
79627        if ($this->invocation === null) {
79628            throw new ExpectationFailedException('Mocked method does not exist.');
79629        }
79630        if (count($this->invocation->getParameters()) < count($this->parameters)) {
79631            $message = 'Parameter count for invocation %s is too low.';
79632            // The user called `->with($this->anything())`, but may have meant
79633            // `->withAnyParameters()`.
79634            //
79635            // @see https://github.com/sebastianbergmann/phpunit-mock-objects/issues/199
79636            if (count($this->parameters) === 1 && get_class($this->parameters[0]) === IsAnything::class) {
79637                $message .= "\nTo allow 0 or more parameters with any value, omit ->with() or use ->withAnyParameters() instead.";
79638            }
79639            throw new ExpectationFailedException(sprintf($message, $this->invocation->toString()));
79640        }
79641        foreach ($this->parameters as $i => $parameter) {
79642            $parameter->evaluate($this->invocation->getParameters()[$i], sprintf('Parameter %s for invocation %s does not match expected ' . 'value.', $i, $this->invocation->toString()));
79643        }
79644        return \true;
79645    }
79646    /**
79647     * @throws ExpectationFailedException
79648     */
79649    private function guardAgainstDuplicateEvaluationOfParameterConstraints() : bool
79650    {
79651        if ($this->parameterVerificationResult instanceof ExpectationFailedException) {
79652            throw $this->parameterVerificationResult;
79653        }
79654        return (bool) $this->parameterVerificationResult;
79655    }
79656}
79657<?php
79658
79659declare (strict_types=1);
79660/*
79661 * This file is part of PHPUnit.
79662 *
79663 * (c) Sebastian Bergmann <sebastian@phpunit.de>
79664 *
79665 * For the full copyright and license information, please view the LICENSE
79666 * file that was distributed with this source code.
79667 */
79668namespace PHPUnit\Framework\MockObject;
79669
79670use function class_exists;
79671/**
79672 * @internal This class is not covered by the backward compatibility promise for PHPUnit
79673 */
79674final class MockTrait implements \PHPUnit\Framework\MockObject\MockType
79675{
79676    /**
79677     * @var string
79678     */
79679    private $classCode;
79680    /**
79681     * @var class-string
79682     */
79683    private $mockName;
79684    /**
79685     * @psalm-param class-string $mockName
79686     */
79687    public function __construct(string $classCode, string $mockName)
79688    {
79689        $this->classCode = $classCode;
79690        $this->mockName = $mockName;
79691    }
79692    /**
79693     * @psalm-return class-string
79694     */
79695    public function generate() : string
79696    {
79697        if (!class_exists($this->mockName, \false)) {
79698            eval($this->classCode);
79699        }
79700        return $this->mockName;
79701    }
79702    public function getClassCode() : string
79703    {
79704        return $this->classCode;
79705    }
79706}
79707<?php
79708
79709declare (strict_types=1);
79710/*
79711 * This file is part of PHPUnit.
79712 *
79713 * (c) Sebastian Bergmann <sebastian@phpunit.de>
79714 *
79715 * For the full copyright and license information, please view the LICENSE
79716 * file that was distributed with this source code.
79717 */
79718namespace PHPUnit\Framework\MockObject;
79719
79720use PHPUnit\SebastianBergmann\Type\Type;
79721/**
79722 * @internal This class is not covered by the backward compatibility promise for PHPUnit
79723 */
79724final class ConfigurableMethod
79725{
79726    /**
79727     * @var string
79728     */
79729    private $name;
79730    /**
79731     * @var Type
79732     */
79733    private $returnType;
79734    public function __construct(string $name, Type $returnType)
79735    {
79736        $this->name = $name;
79737        $this->returnType = $returnType;
79738    }
79739    public function getName() : string
79740    {
79741        return $this->name;
79742    }
79743    public function mayReturn($value) : bool
79744    {
79745        if ($value === null && $this->returnType->allowsNull()) {
79746            return \true;
79747        }
79748        return $this->returnType->isAssignable(Type::fromValue($value, \false));
79749    }
79750    public function getReturnTypeDeclaration() : string
79751    {
79752        return $this->returnType->asString();
79753    }
79754}
79755<?php
79756
79757declare (strict_types=1);
79758/*
79759 * This file is part of PHPUnit.
79760 *
79761 * (c) Sebastian Bergmann <sebastian@phpunit.de>
79762 *
79763 * For the full copyright and license information, please view the LICENSE
79764 * file that was distributed with this source code.
79765 */
79766namespace PHPUnit\Framework\MockObject;
79767
79768use PHPUnit\Framework\ExpectationFailedException;
79769/**
79770 * @internal This class is not covered by the backward compatibility promise for PHPUnit
79771 */
79772interface Verifiable
79773{
79774    /**
79775     * Verifies that the current expectation is valid. If everything is OK the
79776     * code should just return, if not it must throw an exception.
79777     *
79778     * @throws ExpectationFailedException
79779     */
79780    public function verify() : void;
79781}
79782<?php
79783
79784declare (strict_types=1);
79785/*
79786 * This file is part of PHPUnit.
79787 *
79788 * (c) Sebastian Bergmann <sebastian@phpunit.de>
79789 *
79790 * For the full copyright and license information, please view the LICENSE
79791 * file that was distributed with this source code.
79792 */
79793namespace PHPUnit\Framework\MockObject;
79794
79795use function call_user_func_array;
79796use function func_get_args;
79797use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount;
79798/**
79799 * @internal This trait is not covered by the backward compatibility promise for PHPUnit
79800 */
79801trait Method
79802{
79803    public function method()
79804    {
79805        $expects = $this->expects(new AnyInvokedCount());
79806        return call_user_func_array([$expects, 'method'], func_get_args());
79807    }
79808}
79809<?php
79810
79811declare (strict_types=1);
79812/*
79813 * This file is part of PHPUnit.
79814 *
79815 * (c) Sebastian Bergmann <sebastian@phpunit.de>
79816 *
79817 * For the full copyright and license information, please view the LICENSE
79818 * file that was distributed with this source code.
79819 */
79820namespace PHPUnit\Framework\MockObject;
79821
79822use PHPUnit\Framework\MockObject\Builder\InvocationMocker as InvocationMockerBuilder;
79823use PHPUnit\Framework\MockObject\Rule\InvocationOrder;
79824/**
79825 * @internal This trait is not covered by the backward compatibility promise for PHPUnit
79826 */
79827trait Api
79828{
79829    /**
79830     * @var ConfigurableMethod[]
79831     */
79832    private static $__phpunit_configurableMethods;
79833    /**
79834     * @var object
79835     */
79836    private $__phpunit_originalObject;
79837    /**
79838     * @var bool
79839     */
79840    private $__phpunit_returnValueGeneration = \true;
79841    /**
79842     * @var InvocationHandler
79843     */
79844    private $__phpunit_invocationMocker;
79845    /** @noinspection MagicMethodsValidityInspection */
79846    public static function __phpunit_initConfigurableMethods(\PHPUnit\Framework\MockObject\ConfigurableMethod ...$configurableMethods) : void
79847    {
79848        if (isset(static::$__phpunit_configurableMethods)) {
79849            throw new \PHPUnit\Framework\MockObject\ConfigurableMethodsAlreadyInitializedException('Configurable methods is already initialized and can not be reinitialized');
79850        }
79851        static::$__phpunit_configurableMethods = $configurableMethods;
79852    }
79853    /** @noinspection MagicMethodsValidityInspection */
79854    public function __phpunit_setOriginalObject($originalObject) : void
79855    {
79856        $this->__phpunit_originalObject = $originalObject;
79857    }
79858    /** @noinspection MagicMethodsValidityInspection */
79859    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration) : void
79860    {
79861        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
79862    }
79863    /** @noinspection MagicMethodsValidityInspection */
79864    public function __phpunit_getInvocationHandler() : \PHPUnit\Framework\MockObject\InvocationHandler
79865    {
79866        if ($this->__phpunit_invocationMocker === null) {
79867            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationHandler(static::$__phpunit_configurableMethods, $this->__phpunit_returnValueGeneration);
79868        }
79869        return $this->__phpunit_invocationMocker;
79870    }
79871    /** @noinspection MagicMethodsValidityInspection */
79872    public function __phpunit_hasMatchers() : bool
79873    {
79874        return $this->__phpunit_getInvocationHandler()->hasMatchers();
79875    }
79876    /** @noinspection MagicMethodsValidityInspection */
79877    public function __phpunit_verify(bool $unsetInvocationMocker = \true) : void
79878    {
79879        $this->__phpunit_getInvocationHandler()->verify();
79880        if ($unsetInvocationMocker) {
79881            $this->__phpunit_invocationMocker = null;
79882        }
79883    }
79884    public function expects(InvocationOrder $matcher) : InvocationMockerBuilder
79885    {
79886        return $this->__phpunit_getInvocationHandler()->expects($matcher);
79887    }
79888}
79889<?php
79890
79891declare (strict_types=1);
79892/*
79893 * This file is part of PHPUnit.
79894 *
79895 * (c) Sebastian Bergmann <sebastian@phpunit.de>
79896 *
79897 * For the full copyright and license information, please view the LICENSE
79898 * file that was distributed with this source code.
79899 */
79900namespace PHPUnit\Framework\MockObject;
79901
79902/**
79903 * @internal This trait is not covered by the backward compatibility promise for PHPUnit
79904 */
79905trait MockedCloneMethod
79906{
79907    public function __clone()
79908    {
79909        $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationHandler();
79910    }
79911}
79912<?php
79913
79914declare (strict_types=1);
79915/*
79916 * This file is part of PHPUnit.
79917 *
79918 * (c) Sebastian Bergmann <sebastian@phpunit.de>
79919 *
79920 * For the full copyright and license information, please view the LICENSE
79921 * file that was distributed with this source code.
79922 */
79923namespace PHPUnit\Framework\MockObject;
79924
79925/**
79926 * @internal This trait is not covered by the backward compatibility promise for PHPUnit
79927 */
79928trait UnmockedCloneMethod
79929{
79930    public function __clone()
79931    {
79932        $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationHandler();
79933        parent::__clone();
79934    }
79935}
79936<?php
79937
79938declare (strict_types=1);
79939/*
79940 * This file is part of PHPUnit.
79941 *
79942 * (c) Sebastian Bergmann <sebastian@phpunit.de>
79943 *
79944 * For the full copyright and license information, please view the LICENSE
79945 * file that was distributed with this source code.
79946 */
79947namespace PHPUnit\Framework\MockObject;
79948
79949use function assert;
79950use function implode;
79951use function sprintf;
79952use PHPUnit\Framework\ExpectationFailedException;
79953use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount;
79954use PHPUnit\Framework\MockObject\Rule\AnyParameters;
79955use PHPUnit\Framework\MockObject\Rule\InvocationOrder;
79956use PHPUnit\Framework\MockObject\Rule\InvokedCount;
79957use PHPUnit\Framework\MockObject\Rule\MethodName;
79958use PHPUnit\Framework\MockObject\Rule\ParametersRule;
79959use PHPUnit\Framework\MockObject\Stub\Stub;
79960use PHPUnit\Framework\TestFailure;
79961/**
79962 * @internal This class is not covered by the backward compatibility promise for PHPUnit
79963 */
79964final class Matcher
79965{
79966    /**
79967     * @var InvocationOrder
79968     */
79969    private $invocationRule;
79970    /**
79971     * @var mixed
79972     */
79973    private $afterMatchBuilderId;
79974    /**
79975     * @var bool
79976     */
79977    private $afterMatchBuilderIsInvoked = \false;
79978    /**
79979     * @var MethodName
79980     */
79981    private $methodNameRule;
79982    /**
79983     * @var ParametersRule
79984     */
79985    private $parametersRule;
79986    /**
79987     * @var Stub
79988     */
79989    private $stub;
79990    public function __construct(InvocationOrder $rule)
79991    {
79992        $this->invocationRule = $rule;
79993    }
79994    public function hasMatchers() : bool
79995    {
79996        return !$this->invocationRule instanceof AnyInvokedCount;
79997    }
79998    public function hasMethodNameRule() : bool
79999    {
80000        return $this->methodNameRule !== null;
80001    }
80002    public function getMethodNameRule() : MethodName
80003    {
80004        return $this->methodNameRule;
80005    }
80006    public function setMethodNameRule(MethodName $rule) : void
80007    {
80008        $this->methodNameRule = $rule;
80009    }
80010    public function hasParametersRule() : bool
80011    {
80012        return $this->parametersRule !== null;
80013    }
80014    public function setParametersRule(ParametersRule $rule) : void
80015    {
80016        $this->parametersRule = $rule;
80017    }
80018    public function setStub(Stub $stub) : void
80019    {
80020        $this->stub = $stub;
80021    }
80022    public function setAfterMatchBuilderId(string $id) : void
80023    {
80024        $this->afterMatchBuilderId = $id;
80025    }
80026    /**
80027     * @throws ExpectationFailedException
80028     * @throws MatchBuilderNotFoundException
80029     * @throws MethodNameNotConfiguredException
80030     * @throws RuntimeException
80031     */
80032    public function invoked(\PHPUnit\Framework\MockObject\Invocation $invocation)
80033    {
80034        if ($this->methodNameRule === null) {
80035            throw new \PHPUnit\Framework\MockObject\MethodNameNotConfiguredException();
80036        }
80037        if ($this->afterMatchBuilderId !== null) {
80038            $matcher = $invocation->getObject()->__phpunit_getInvocationHandler()->lookupMatcher($this->afterMatchBuilderId);
80039            if (!$matcher) {
80040                throw new \PHPUnit\Framework\MockObject\MatchBuilderNotFoundException($this->afterMatchBuilderId);
80041            }
80042            assert($matcher instanceof self);
80043            if ($matcher->invocationRule->hasBeenInvoked()) {
80044                $this->afterMatchBuilderIsInvoked = \true;
80045            }
80046        }
80047        $this->invocationRule->invoked($invocation);
80048        try {
80049            if ($this->parametersRule !== null) {
80050                $this->parametersRule->apply($invocation);
80051            }
80052        } catch (ExpectationFailedException $e) {
80053            throw new ExpectationFailedException(sprintf("Expectation failed for %s when %s\n%s", $this->methodNameRule->toString(), $this->invocationRule->toString(), $e->getMessage()), $e->getComparisonFailure());
80054        }
80055        if ($this->stub) {
80056            return $this->stub->invoke($invocation);
80057        }
80058        return $invocation->generateReturnValue();
80059    }
80060    /**
80061     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
80062     * @throws ExpectationFailedException
80063     * @throws MatchBuilderNotFoundException
80064     * @throws MethodNameNotConfiguredException
80065     * @throws RuntimeException
80066     */
80067    public function matches(\PHPUnit\Framework\MockObject\Invocation $invocation) : bool
80068    {
80069        if ($this->afterMatchBuilderId !== null) {
80070            $matcher = $invocation->getObject()->__phpunit_getInvocationHandler()->lookupMatcher($this->afterMatchBuilderId);
80071            if (!$matcher) {
80072                throw new \PHPUnit\Framework\MockObject\MatchBuilderNotFoundException($this->afterMatchBuilderId);
80073            }
80074            assert($matcher instanceof self);
80075            if (!$matcher->invocationRule->hasBeenInvoked()) {
80076                return \false;
80077            }
80078        }
80079        if ($this->methodNameRule === null) {
80080            throw new \PHPUnit\Framework\MockObject\MethodNameNotConfiguredException();
80081        }
80082        if (!$this->invocationRule->matches($invocation)) {
80083            return \false;
80084        }
80085        try {
80086            if (!$this->methodNameRule->matches($invocation)) {
80087                return \false;
80088            }
80089        } catch (ExpectationFailedException $e) {
80090            throw new ExpectationFailedException(sprintf("Expectation failed for %s when %s\n%s", $this->methodNameRule->toString(), $this->invocationRule->toString(), $e->getMessage()), $e->getComparisonFailure());
80091        }
80092        return \true;
80093    }
80094    /**
80095     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
80096     * @throws ExpectationFailedException
80097     * @throws MethodNameNotConfiguredException
80098     */
80099    public function verify() : void
80100    {
80101        if ($this->methodNameRule === null) {
80102            throw new \PHPUnit\Framework\MockObject\MethodNameNotConfiguredException();
80103        }
80104        try {
80105            $this->invocationRule->verify();
80106            if ($this->parametersRule === null) {
80107                $this->parametersRule = new AnyParameters();
80108            }
80109            $invocationIsAny = $this->invocationRule instanceof AnyInvokedCount;
80110            $invocationIsNever = $this->invocationRule instanceof InvokedCount && $this->invocationRule->isNever();
80111            if (!$invocationIsAny && !$invocationIsNever) {
80112                $this->parametersRule->verify();
80113            }
80114        } catch (ExpectationFailedException $e) {
80115            throw new ExpectationFailedException(sprintf("Expectation failed for %s when %s.\n%s", $this->methodNameRule->toString(), $this->invocationRule->toString(), TestFailure::exceptionToString($e)));
80116        }
80117    }
80118    public function toString() : string
80119    {
80120        $list = [];
80121        if ($this->invocationRule !== null) {
80122            $list[] = $this->invocationRule->toString();
80123        }
80124        if ($this->methodNameRule !== null) {
80125            $list[] = 'where ' . $this->methodNameRule->toString();
80126        }
80127        if ($this->parametersRule !== null) {
80128            $list[] = 'and ' . $this->parametersRule->toString();
80129        }
80130        if ($this->afterMatchBuilderId !== null) {
80131            $list[] = 'after ' . $this->afterMatchBuilderId;
80132        }
80133        if ($this->stub !== null) {
80134            $list[] = 'will ' . $this->stub->toString();
80135        }
80136        return implode(' ', $list);
80137    }
80138}
80139<?php
80140
80141declare (strict_types=1);
80142/*
80143 * This file is part of PHPUnit.
80144 *
80145 * (c) Sebastian Bergmann <sebastian@phpunit.de>
80146 *
80147 * For the full copyright and license information, please view the LICENSE
80148 * file that was distributed with this source code.
80149 */
80150namespace PHPUnit\Framework\MockObject;
80151
80152use function strtolower;
80153use Exception;
80154use PHPUnit\Framework\MockObject\Builder\InvocationMocker;
80155use PHPUnit\Framework\MockObject\Rule\InvocationOrder;
80156use Throwable;
80157/**
80158 * @internal This class is not covered by the backward compatibility promise for PHPUnit
80159 */
80160final class InvocationHandler
80161{
80162    /**
80163     * @var Matcher[]
80164     */
80165    private $matchers = [];
80166    /**
80167     * @var Matcher[]
80168     */
80169    private $matcherMap = [];
80170    /**
80171     * @var ConfigurableMethod[]
80172     */
80173    private $configurableMethods;
80174    /**
80175     * @var bool
80176     */
80177    private $returnValueGeneration;
80178    /**
80179     * @var Throwable
80180     */
80181    private $deferredError;
80182    public function __construct(array $configurableMethods, bool $returnValueGeneration)
80183    {
80184        $this->configurableMethods = $configurableMethods;
80185        $this->returnValueGeneration = $returnValueGeneration;
80186    }
80187    public function hasMatchers() : bool
80188    {
80189        foreach ($this->matchers as $matcher) {
80190            if ($matcher->hasMatchers()) {
80191                return \true;
80192            }
80193        }
80194        return \false;
80195    }
80196    /**
80197     * Looks up the match builder with identification $id and returns it.
80198     *
80199     * @param string $id The identification of the match builder
80200     */
80201    public function lookupMatcher(string $id) : ?\PHPUnit\Framework\MockObject\Matcher
80202    {
80203        if (isset($this->matcherMap[$id])) {
80204            return $this->matcherMap[$id];
80205        }
80206        return null;
80207    }
80208    /**
80209     * Registers a matcher with the identification $id. The matcher can later be
80210     * looked up using lookupMatcher() to figure out if it has been invoked.
80211     *
80212     * @param string  $id      The identification of the matcher
80213     * @param Matcher $matcher The builder which is being registered
80214     *
80215     * @throws MatcherAlreadyRegisteredException
80216     */
80217    public function registerMatcher(string $id, \PHPUnit\Framework\MockObject\Matcher $matcher) : void
80218    {
80219        if (isset($this->matcherMap[$id])) {
80220            throw new \PHPUnit\Framework\MockObject\MatcherAlreadyRegisteredException($id);
80221        }
80222        $this->matcherMap[$id] = $matcher;
80223    }
80224    public function expects(InvocationOrder $rule) : InvocationMocker
80225    {
80226        $matcher = new \PHPUnit\Framework\MockObject\Matcher($rule);
80227        $this->addMatcher($matcher);
80228        return new InvocationMocker($this, $matcher, ...$this->configurableMethods);
80229    }
80230    /**
80231     * @throws Exception
80232     * @throws RuntimeException
80233     */
80234    public function invoke(\PHPUnit\Framework\MockObject\Invocation $invocation)
80235    {
80236        $exception = null;
80237        $hasReturnValue = \false;
80238        $returnValue = null;
80239        foreach ($this->matchers as $match) {
80240            try {
80241                if ($match->matches($invocation)) {
80242                    $value = $match->invoked($invocation);
80243                    if (!$hasReturnValue) {
80244                        $returnValue = $value;
80245                        $hasReturnValue = \true;
80246                    }
80247                }
80248            } catch (Exception $e) {
80249                $exception = $e;
80250            }
80251        }
80252        if ($exception !== null) {
80253            throw $exception;
80254        }
80255        if ($hasReturnValue) {
80256            return $returnValue;
80257        }
80258        if (!$this->returnValueGeneration) {
80259            $exception = new \PHPUnit\Framework\MockObject\ReturnValueNotConfiguredException($invocation);
80260            if (strtolower($invocation->getMethodName()) === '__tostring') {
80261                $this->deferredError = $exception;
80262                return '';
80263            }
80264            throw $exception;
80265        }
80266        return $invocation->generateReturnValue();
80267    }
80268    public function matches(\PHPUnit\Framework\MockObject\Invocation $invocation) : bool
80269    {
80270        foreach ($this->matchers as $matcher) {
80271            if (!$matcher->matches($invocation)) {
80272                return \false;
80273            }
80274        }
80275        return \true;
80276    }
80277    /**
80278     * @throws Throwable
80279     */
80280    public function verify() : void
80281    {
80282        foreach ($this->matchers as $matcher) {
80283            $matcher->verify();
80284        }
80285        if ($this->deferredError) {
80286            throw $this->deferredError;
80287        }
80288    }
80289    private function addMatcher(\PHPUnit\Framework\MockObject\Matcher $matcher) : void
80290    {
80291        $this->matchers[] = $matcher;
80292    }
80293}
80294<?php
80295
80296declare (strict_types=1);
80297/*
80298 * This file is part of PHPUnit.
80299 *
80300 * (c) Sebastian Bergmann <sebastian@phpunit.de>
80301 *
80302 * For the full copyright and license information, please view the LICENSE
80303 * file that was distributed with this source code.
80304 */
80305namespace PHPUnit\Framework\MockObject;
80306
80307use PHPUnit\Framework\MockObject\Builder\InvocationMocker as BuilderInvocationMocker;
80308use PHPUnit\Framework\MockObject\Rule\InvocationOrder;
80309/**
80310 * @method BuilderInvocationMocker method($constraint)
80311 *
80312 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
80313 */
80314interface MockObject extends \PHPUnit\Framework\MockObject\Stub
80315{
80316    public function __phpunit_setOriginalObject($originalObject) : void;
80317    public function __phpunit_verify(bool $unsetInvocationMocker = \true) : void;
80318    public function expects(InvocationOrder $invocationRule) : BuilderInvocationMocker;
80319}
80320<?php
80321
80322declare (strict_types=1);
80323/*
80324 * This file is part of PHPUnit.
80325 *
80326 * (c) Sebastian Bergmann <sebastian@phpunit.de>
80327 *
80328 * For the full copyright and license information, please view the LICENSE
80329 * file that was distributed with this source code.
80330 */
80331namespace PHPUnit\Framework;
80332
80333/**
80334 * @internal This class is not covered by the backward compatibility promise for PHPUnit
80335 */
80336interface SelfDescribing
80337{
80338    /**
80339     * Returns a string representation of the object.
80340     */
80341    public function toString() : string;
80342}
80343<?php
80344
80345declare (strict_types=1);
80346/*
80347 * This file is part of PHPUnit.
80348 *
80349 * (c) Sebastian Bergmann <sebastian@phpunit.de>
80350 *
80351 * For the full copyright and license information, please view the LICENSE
80352 * file that was distributed with this source code.
80353 */
80354namespace PHPUnit\Framework;
80355
80356use const LC_ALL;
80357use const LC_COLLATE;
80358use const LC_CTYPE;
80359use const LC_MONETARY;
80360use const LC_NUMERIC;
80361use const LC_TIME;
80362use const PATHINFO_FILENAME;
80363use const PHP_EOL;
80364use const PHP_URL_PATH;
80365use function array_filter;
80366use function array_flip;
80367use function array_keys;
80368use function array_merge;
80369use function array_pop;
80370use function array_search;
80371use function array_unique;
80372use function array_values;
80373use function basename;
80374use function call_user_func;
80375use function chdir;
80376use function class_exists;
80377use function clearstatcache;
80378use function count;
80379use function debug_backtrace;
80380use function defined;
80381use function explode;
80382use function get_class;
80383use function get_include_path;
80384use function getcwd;
80385use function implode;
80386use function in_array;
80387use function ini_set;
80388use function is_array;
80389use function is_callable;
80390use function is_int;
80391use function is_object;
80392use function is_string;
80393use function libxml_clear_errors;
80394use function method_exists;
80395use function ob_end_clean;
80396use function ob_get_contents;
80397use function ob_get_level;
80398use function ob_start;
80399use function parse_url;
80400use function pathinfo;
80401use function preg_replace;
80402use function serialize;
80403use function setlocale;
80404use function sprintf;
80405use function strpos;
80406use function substr;
80407use function trim;
80408use function var_export;
80409use PHPUnit\DeepCopy\DeepCopy;
80410use PHPUnit\Framework\Constraint\Exception as ExceptionConstraint;
80411use PHPUnit\Framework\Constraint\ExceptionCode;
80412use PHPUnit\Framework\Constraint\ExceptionMessage;
80413use PHPUnit\Framework\Constraint\ExceptionMessageRegularExpression;
80414use PHPUnit\Framework\Constraint\LogicalOr;
80415use PHPUnit\Framework\Error\Deprecated;
80416use PHPUnit\Framework\Error\Error;
80417use PHPUnit\Framework\Error\Notice;
80418use PHPUnit\Framework\Error\Warning as WarningError;
80419use PHPUnit\Framework\MockObject\Generator as MockGenerator;
80420use PHPUnit\Framework\MockObject\MockBuilder;
80421use PHPUnit\Framework\MockObject\MockObject;
80422use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount as AnyInvokedCountMatcher;
80423use PHPUnit\Framework\MockObject\Rule\InvokedAtIndex as InvokedAtIndexMatcher;
80424use PHPUnit\Framework\MockObject\Rule\InvokedAtLeastCount as InvokedAtLeastCountMatcher;
80425use PHPUnit\Framework\MockObject\Rule\InvokedAtLeastOnce as InvokedAtLeastOnceMatcher;
80426use PHPUnit\Framework\MockObject\Rule\InvokedAtMostCount as InvokedAtMostCountMatcher;
80427use PHPUnit\Framework\MockObject\Rule\InvokedCount as InvokedCountMatcher;
80428use PHPUnit\Framework\MockObject\Stub;
80429use PHPUnit\Framework\MockObject\Stub\ConsecutiveCalls as ConsecutiveCallsStub;
80430use PHPUnit\Framework\MockObject\Stub\Exception as ExceptionStub;
80431use PHPUnit\Framework\MockObject\Stub\ReturnArgument as ReturnArgumentStub;
80432use PHPUnit\Framework\MockObject\Stub\ReturnCallback as ReturnCallbackStub;
80433use PHPUnit\Framework\MockObject\Stub\ReturnSelf as ReturnSelfStub;
80434use PHPUnit\Framework\MockObject\Stub\ReturnStub;
80435use PHPUnit\Framework\MockObject\Stub\ReturnValueMap as ReturnValueMapStub;
80436use PHPUnit\Runner\BaseTestRunner;
80437use PHPUnit\Runner\PhptTestCase;
80438use PHPUnit\Util\Exception as UtilException;
80439use PHPUnit\Util\GlobalState;
80440use PHPUnit\Util\PHP\AbstractPhpProcess;
80441use PHPUnit\Util\Test as TestUtil;
80442use PHPUnit\Util\Type;
80443use Prophecy\Exception\Prediction\PredictionException;
80444use Prophecy\Prophecy\MethodProphecy;
80445use Prophecy\Prophecy\ObjectProphecy;
80446use Prophecy\Prophet;
80447use ReflectionClass;
80448use ReflectionException;
80449use PHPUnit\SebastianBergmann\Comparator\Comparator;
80450use PHPUnit\SebastianBergmann\Comparator\Factory as ComparatorFactory;
80451use PHPUnit\SebastianBergmann\Diff\Differ;
80452use PHPUnit\SebastianBergmann\Exporter\Exporter;
80453use PHPUnit\SebastianBergmann\GlobalState\ExcludeList;
80454use PHPUnit\SebastianBergmann\GlobalState\Restorer;
80455use PHPUnit\SebastianBergmann\GlobalState\Snapshot;
80456use PHPUnit\SebastianBergmann\ObjectEnumerator\Enumerator;
80457use PHPUnit\SebastianBergmann\Template\Template;
80458use SoapClient;
80459use Throwable;
80460/**
80461 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
80462 */
80463abstract class TestCase extends \PHPUnit\Framework\Assert implements \PHPUnit\Framework\Reorderable, \PHPUnit\Framework\SelfDescribing, \PHPUnit\Framework\Test
80464{
80465    private const LOCALE_CATEGORIES = [\LC_ALL, \LC_COLLATE, \LC_CTYPE, \LC_MONETARY, \LC_NUMERIC, \LC_TIME];
80466    /**
80467     * @var ?bool
80468     */
80469    protected $backupGlobals;
80470    /**
80471     * @var string[]
80472     */
80473    protected $backupGlobalsExcludeList = [];
80474    /**
80475     * @var string[]
80476     *
80477     * @deprecated Use $backupGlobalsExcludeList instead
80478     */
80479    protected $backupGlobalsBlacklist = [];
80480    /**
80481     * @var bool
80482     */
80483    protected $backupStaticAttributes;
80484    /**
80485     * @var array<string,array<int,string>>
80486     */
80487    protected $backupStaticAttributesExcludeList = [];
80488    /**
80489     * @var array<string,array<int,string>>
80490     *
80491     * @deprecated Use $backupStaticAttributesExcludeList instead
80492     */
80493    protected $backupStaticAttributesBlacklist = [];
80494    /**
80495     * @var bool
80496     */
80497    protected $runTestInSeparateProcess;
80498    /**
80499     * @var bool
80500     */
80501    protected $preserveGlobalState = \true;
80502    /**
80503     * @var list<ExecutionOrderDependency>
80504     */
80505    protected $providedTests = [];
80506    /**
80507     * @var bool
80508     */
80509    private $runClassInSeparateProcess;
80510    /**
80511     * @var bool
80512     */
80513    private $inIsolation = \false;
80514    /**
80515     * @var array
80516     */
80517    private $data;
80518    /**
80519     * @var int|string
80520     */
80521    private $dataName;
80522    /**
80523     * @var null|string
80524     */
80525    private $expectedException;
80526    /**
80527     * @var null|string
80528     */
80529    private $expectedExceptionMessage;
80530    /**
80531     * @var null|string
80532     */
80533    private $expectedExceptionMessageRegExp;
80534    /**
80535     * @var null|int|string
80536     */
80537    private $expectedExceptionCode;
80538    /**
80539     * @var string
80540     */
80541    private $name = '';
80542    /**
80543     * @var list<ExecutionOrderDependency>
80544     */
80545    private $dependencies = [];
80546    /**
80547     * @var array
80548     */
80549    private $dependencyInput = [];
80550    /**
80551     * @var array<string,string>
80552     */
80553    private $iniSettings = [];
80554    /**
80555     * @var array
80556     */
80557    private $locale = [];
80558    /**
80559     * @var MockObject[]
80560     */
80561    private $mockObjects = [];
80562    /**
80563     * @var MockGenerator
80564     */
80565    private $mockObjectGenerator;
80566    /**
80567     * @var int
80568     */
80569    private $status = BaseTestRunner::STATUS_UNKNOWN;
80570    /**
80571     * @var string
80572     */
80573    private $statusMessage = '';
80574    /**
80575     * @var int
80576     */
80577    private $numAssertions = 0;
80578    /**
80579     * @var TestResult
80580     */
80581    private $result;
80582    /**
80583     * @var mixed
80584     */
80585    private $testResult;
80586    /**
80587     * @var string
80588     */
80589    private $output = '';
80590    /**
80591     * @var ?string
80592     */
80593    private $outputExpectedRegex;
80594    /**
80595     * @var ?string
80596     */
80597    private $outputExpectedString;
80598    /**
80599     * @var mixed
80600     */
80601    private $outputCallback = \false;
80602    /**
80603     * @var bool
80604     */
80605    private $outputBufferingActive = \false;
80606    /**
80607     * @var int
80608     */
80609    private $outputBufferingLevel;
80610    /**
80611     * @var bool
80612     */
80613    private $outputRetrievedForAssertion = \false;
80614    /**
80615     * @var ?Snapshot
80616     */
80617    private $snapshot;
80618    /**
80619     * @var \Prophecy\Prophet
80620     */
80621    private $prophet;
80622    /**
80623     * @var bool
80624     */
80625    private $beStrictAboutChangesToGlobalState = \false;
80626    /**
80627     * @var bool
80628     */
80629    private $registerMockObjectsFromTestArgumentsRecursively = \false;
80630    /**
80631     * @var string[]
80632     */
80633    private $warnings = [];
80634    /**
80635     * @var string[]
80636     */
80637    private $groups = [];
80638    /**
80639     * @var bool
80640     */
80641    private $doesNotPerformAssertions = \false;
80642    /**
80643     * @var Comparator[]
80644     */
80645    private $customComparators = [];
80646    /**
80647     * @var string[]
80648     */
80649    private $doubledTypes = [];
80650    /**
80651     * Returns a matcher that matches when the method is executed
80652     * zero or more times.
80653     */
80654    public static function any() : AnyInvokedCountMatcher
80655    {
80656        return new AnyInvokedCountMatcher();
80657    }
80658    /**
80659     * Returns a matcher that matches when the method is never executed.
80660     */
80661    public static function never() : InvokedCountMatcher
80662    {
80663        return new InvokedCountMatcher(0);
80664    }
80665    /**
80666     * Returns a matcher that matches when the method is executed
80667     * at least N times.
80668     */
80669    public static function atLeast(int $requiredInvocations) : InvokedAtLeastCountMatcher
80670    {
80671        return new InvokedAtLeastCountMatcher($requiredInvocations);
80672    }
80673    /**
80674     * Returns a matcher that matches when the method is executed at least once.
80675     */
80676    public static function atLeastOnce() : InvokedAtLeastOnceMatcher
80677    {
80678        return new InvokedAtLeastOnceMatcher();
80679    }
80680    /**
80681     * Returns a matcher that matches when the method is executed exactly once.
80682     */
80683    public static function once() : InvokedCountMatcher
80684    {
80685        return new InvokedCountMatcher(1);
80686    }
80687    /**
80688     * Returns a matcher that matches when the method is executed
80689     * exactly $count times.
80690     */
80691    public static function exactly(int $count) : InvokedCountMatcher
80692    {
80693        return new InvokedCountMatcher($count);
80694    }
80695    /**
80696     * Returns a matcher that matches when the method is executed
80697     * at most N times.
80698     */
80699    public static function atMost(int $allowedInvocations) : InvokedAtMostCountMatcher
80700    {
80701        return new InvokedAtMostCountMatcher($allowedInvocations);
80702    }
80703    /**
80704     * Returns a matcher that matches when the method is executed
80705     * at the given index.
80706     *
80707     * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4297
80708     * @codeCoverageIgnore
80709     */
80710    public static function at(int $index) : InvokedAtIndexMatcher
80711    {
80712        $stack = debug_backtrace();
80713        while (!empty($stack)) {
80714            $frame = array_pop($stack);
80715            if (isset($frame['object']) && $frame['object'] instanceof self) {
80716                $frame['object']->addWarning('The at() matcher has been deprecated. It will be removed in PHPUnit 10. Please refactor your test to not rely on the order in which methods are invoked.');
80717                break;
80718            }
80719        }
80720        return new InvokedAtIndexMatcher($index);
80721    }
80722    public static function returnValue($value) : ReturnStub
80723    {
80724        return new ReturnStub($value);
80725    }
80726    public static function returnValueMap(array $valueMap) : ReturnValueMapStub
80727    {
80728        return new ReturnValueMapStub($valueMap);
80729    }
80730    public static function returnArgument(int $argumentIndex) : ReturnArgumentStub
80731    {
80732        return new ReturnArgumentStub($argumentIndex);
80733    }
80734    public static function returnCallback($callback) : ReturnCallbackStub
80735    {
80736        return new ReturnCallbackStub($callback);
80737    }
80738    /**
80739     * Returns the current object.
80740     *
80741     * This method is useful when mocking a fluent interface.
80742     */
80743    public static function returnSelf() : ReturnSelfStub
80744    {
80745        return new ReturnSelfStub();
80746    }
80747    public static function throwException(Throwable $exception) : ExceptionStub
80748    {
80749        return new ExceptionStub($exception);
80750    }
80751    public static function onConsecutiveCalls(...$args) : ConsecutiveCallsStub
80752    {
80753        return new ConsecutiveCallsStub($args);
80754    }
80755    /**
80756     * @param int|string $dataName
80757     *
80758     * @internal This method is not covered by the backward compatibility promise for PHPUnit
80759     */
80760    public function __construct(?string $name = null, array $data = [], $dataName = '')
80761    {
80762        if ($name !== null) {
80763            $this->setName($name);
80764        }
80765        $this->data = $data;
80766        $this->dataName = $dataName;
80767    }
80768    /**
80769     * This method is called before the first test of this test class is run.
80770     */
80771    public static function setUpBeforeClass() : void
80772    {
80773    }
80774    /**
80775     * This method is called after the last test of this test class is run.
80776     */
80777    public static function tearDownAfterClass() : void
80778    {
80779    }
80780    /**
80781     * This method is called before each test.
80782     */
80783    protected function setUp() : void
80784    {
80785    }
80786    /**
80787     * This method is called after each test.
80788     */
80789    protected function tearDown() : void
80790    {
80791    }
80792    /**
80793     * Returns a string representation of the test case.
80794     *
80795     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
80796     * @throws Exception
80797     */
80798    public function toString() : string
80799    {
80800        try {
80801            $class = new ReflectionClass($this);
80802            // @codeCoverageIgnoreStart
80803        } catch (ReflectionException $e) {
80804            throw new \PHPUnit\Framework\Exception($e->getMessage(), (int) $e->getCode(), $e);
80805        }
80806        // @codeCoverageIgnoreEnd
80807        $buffer = sprintf('%s::%s', $class->name, $this->getName(\false));
80808        return $buffer . $this->getDataSetAsString();
80809    }
80810    public function count() : int
80811    {
80812        return 1;
80813    }
80814    public function getActualOutputForAssertion() : string
80815    {
80816        $this->outputRetrievedForAssertion = \true;
80817        return $this->getActualOutput();
80818    }
80819    public function expectOutputRegex(string $expectedRegex) : void
80820    {
80821        $this->outputExpectedRegex = $expectedRegex;
80822    }
80823    public function expectOutputString(string $expectedString) : void
80824    {
80825        $this->outputExpectedString = $expectedString;
80826    }
80827    /**
80828     * @psalm-param class-string<\Throwable> $exception
80829     */
80830    public function expectException(string $exception) : void
80831    {
80832        // @codeCoverageIgnoreStart
80833        switch ($exception) {
80834            case Deprecated::class:
80835                $this->addWarning('Support for using expectException() with PHPUnit\\Framework\\Error\\Deprecated is deprecated and will be removed in PHPUnit 10. Use expectDeprecation() instead.');
80836                break;
80837            case Error::class:
80838                $this->addWarning('Support for using expectException() with PHPUnit\\Framework\\Error\\Error is deprecated and will be removed in PHPUnit 10. Use expectError() instead.');
80839                break;
80840            case Notice::class:
80841                $this->addWarning('Support for using expectException() with PHPUnit\\Framework\\Error\\Notice is deprecated and will be removed in PHPUnit 10. Use expectNotice() instead.');
80842                break;
80843            case WarningError::class:
80844                $this->addWarning('Support for using expectException() with PHPUnit\\Framework\\Error\\Warning is deprecated and will be removed in PHPUnit 10. Use expectWarning() instead.');
80845                break;
80846        }
80847        // @codeCoverageIgnoreEnd
80848        $this->expectedException = $exception;
80849    }
80850    /**
80851     * @param int|string $code
80852     */
80853    public function expectExceptionCode($code) : void
80854    {
80855        $this->expectedExceptionCode = $code;
80856    }
80857    public function expectExceptionMessage(string $message) : void
80858    {
80859        $this->expectedExceptionMessage = $message;
80860    }
80861    public function expectExceptionMessageMatches(string $regularExpression) : void
80862    {
80863        $this->expectedExceptionMessageRegExp = $regularExpression;
80864    }
80865    /**
80866     * Sets up an expectation for an exception to be raised by the code under test.
80867     * Information for expected exception class, expected exception message, and
80868     * expected exception code are retrieved from a given Exception object.
80869     */
80870    public function expectExceptionObject(\Exception $exception) : void
80871    {
80872        $this->expectException(get_class($exception));
80873        $this->expectExceptionMessage($exception->getMessage());
80874        $this->expectExceptionCode($exception->getCode());
80875    }
80876    public function expectNotToPerformAssertions() : void
80877    {
80878        $this->doesNotPerformAssertions = \true;
80879    }
80880    public function expectDeprecation() : void
80881    {
80882        $this->expectedException = Deprecated::class;
80883    }
80884    public function expectDeprecationMessage(string $message) : void
80885    {
80886        $this->expectExceptionMessage($message);
80887    }
80888    public function expectDeprecationMessageMatches(string $regularExpression) : void
80889    {
80890        $this->expectExceptionMessageMatches($regularExpression);
80891    }
80892    public function expectNotice() : void
80893    {
80894        $this->expectedException = Notice::class;
80895    }
80896    public function expectNoticeMessage(string $message) : void
80897    {
80898        $this->expectExceptionMessage($message);
80899    }
80900    public function expectNoticeMessageMatches(string $regularExpression) : void
80901    {
80902        $this->expectExceptionMessageMatches($regularExpression);
80903    }
80904    public function expectWarning() : void
80905    {
80906        $this->expectedException = WarningError::class;
80907    }
80908    public function expectWarningMessage(string $message) : void
80909    {
80910        $this->expectExceptionMessage($message);
80911    }
80912    public function expectWarningMessageMatches(string $regularExpression) : void
80913    {
80914        $this->expectExceptionMessageMatches($regularExpression);
80915    }
80916    public function expectError() : void
80917    {
80918        $this->expectedException = Error::class;
80919    }
80920    public function expectErrorMessage(string $message) : void
80921    {
80922        $this->expectExceptionMessage($message);
80923    }
80924    public function expectErrorMessageMatches(string $regularExpression) : void
80925    {
80926        $this->expectExceptionMessageMatches($regularExpression);
80927    }
80928    public function getStatus() : int
80929    {
80930        return $this->status;
80931    }
80932    public function markAsRisky() : void
80933    {
80934        $this->status = BaseTestRunner::STATUS_RISKY;
80935    }
80936    public function getStatusMessage() : string
80937    {
80938        return $this->statusMessage;
80939    }
80940    public function hasFailed() : bool
80941    {
80942        $status = $this->getStatus();
80943        return $status === BaseTestRunner::STATUS_FAILURE || $status === BaseTestRunner::STATUS_ERROR;
80944    }
80945    /**
80946     * Runs the test case and collects the results in a TestResult object.
80947     * If no TestResult object is passed a new one will be created.
80948     *
80949     * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException
80950     * @throws \SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException
80951     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
80952     * @throws CodeCoverageException
80953     * @throws UtilException
80954     */
80955    public function run(\PHPUnit\Framework\TestResult $result = null) : \PHPUnit\Framework\TestResult
80956    {
80957        if ($result === null) {
80958            $result = $this->createResult();
80959        }
80960        if (!$this instanceof \PHPUnit\Framework\ErrorTestCase && !$this instanceof \PHPUnit\Framework\WarningTestCase) {
80961            $this->setTestResultObject($result);
80962        }
80963        if (!$this instanceof \PHPUnit\Framework\ErrorTestCase && !$this instanceof \PHPUnit\Framework\WarningTestCase && !$this instanceof \PHPUnit\Framework\SkippedTestCase && !$this->handleDependencies()) {
80964            return $result;
80965        }
80966        if ($this->runInSeparateProcess()) {
80967            $runEntireClass = $this->runClassInSeparateProcess && !$this->runTestInSeparateProcess;
80968            try {
80969                $class = new ReflectionClass($this);
80970                // @codeCoverageIgnoreStart
80971            } catch (ReflectionException $e) {
80972                throw new \PHPUnit\Framework\Exception($e->getMessage(), (int) $e->getCode(), $e);
80973            }
80974            // @codeCoverageIgnoreEnd
80975            if ($runEntireClass) {
80976                $template = new Template(__DIR__ . '/../Util/PHP/Template/TestCaseClass.tpl');
80977            } else {
80978                $template = new Template(__DIR__ . '/../Util/PHP/Template/TestCaseMethod.tpl');
80979            }
80980            if ($this->preserveGlobalState) {
80981                $constants = GlobalState::getConstantsAsString();
80982                $globals = GlobalState::getGlobalsAsString();
80983                $includedFiles = GlobalState::getIncludedFilesAsString();
80984                $iniSettings = GlobalState::getIniSettingsAsString();
80985            } else {
80986                $constants = '';
80987                if (!empty($GLOBALS['__PHPUNIT_BOOTSTRAP'])) {
80988                    $globals = '$GLOBALS[\'__PHPUNIT_BOOTSTRAP\'] = ' . var_export($GLOBALS['__PHPUNIT_BOOTSTRAP'], \true) . ";\n";
80989                } else {
80990                    $globals = '';
80991                }
80992                $includedFiles = '';
80993                $iniSettings = '';
80994            }
80995            $coverage = $result->getCollectCodeCoverageInformation() ? 'true' : 'false';
80996            $isStrictAboutTestsThatDoNotTestAnything = $result->isStrictAboutTestsThatDoNotTestAnything() ? 'true' : 'false';
80997            $isStrictAboutOutputDuringTests = $result->isStrictAboutOutputDuringTests() ? 'true' : 'false';
80998            $enforcesTimeLimit = $result->enforcesTimeLimit() ? 'true' : 'false';
80999            $isStrictAboutTodoAnnotatedTests = $result->isStrictAboutTodoAnnotatedTests() ? 'true' : 'false';
81000            $isStrictAboutResourceUsageDuringSmallTests = $result->isStrictAboutResourceUsageDuringSmallTests() ? 'true' : 'false';
81001            if (defined('PHPUNIT_COMPOSER_INSTALL')) {
81002                $composerAutoload = var_export(PHPUNIT_COMPOSER_INSTALL, \true);
81003            } else {
81004                $composerAutoload = '\'\'';
81005            }
81006            if (defined('__PHPUNIT_PHAR__')) {
81007                $phar = var_export(__PHPUNIT_PHAR__, \true);
81008            } else {
81009                $phar = '\'\'';
81010            }
81011            $codeCoverage = $result->getCodeCoverage();
81012            $codeCoverageFilter = null;
81013            $cachesStaticAnalysis = 'false';
81014            $codeCoverageCacheDirectory = null;
81015            $driverMethod = 'forLineCoverage';
81016            if ($codeCoverage) {
81017                $codeCoverageFilter = $codeCoverage->filter();
81018                if ($codeCoverage->collectsBranchAndPathCoverage()) {
81019                    $driverMethod = 'forLineAndPathCoverage';
81020                }
81021                if ($codeCoverage->cachesStaticAnalysis()) {
81022                    $cachesStaticAnalysis = 'true';
81023                    $codeCoverageCacheDirectory = $codeCoverage->cacheDirectory();
81024                }
81025            }
81026            $data = var_export(serialize($this->data), \true);
81027            $dataName = var_export($this->dataName, \true);
81028            $dependencyInput = var_export(serialize($this->dependencyInput), \true);
81029            $includePath = var_export(get_include_path(), \true);
81030            $codeCoverageFilter = var_export(serialize($codeCoverageFilter), \true);
81031            $codeCoverageCacheDirectory = var_export(serialize($codeCoverageCacheDirectory), \true);
81032            // must do these fixes because TestCaseMethod.tpl has unserialize('{data}') in it, and we can't break BC
81033            // the lines above used to use addcslashes() rather than var_export(), which breaks null byte escape sequences
81034            $data = "'." . $data . ".'";
81035            $dataName = "'.(" . $dataName . ").'";
81036            $dependencyInput = "'." . $dependencyInput . ".'";
81037            $includePath = "'." . $includePath . ".'";
81038            $codeCoverageFilter = "'." . $codeCoverageFilter . ".'";
81039            $codeCoverageCacheDirectory = "'." . $codeCoverageCacheDirectory . ".'";
81040            $configurationFilePath = $GLOBALS['__PHPUNIT_CONFIGURATION_FILE'] ?? '';
81041            $var = ['composerAutoload' => $composerAutoload, 'phar' => $phar, 'filename' => $class->getFileName(), 'className' => $class->getName(), 'collectCodeCoverageInformation' => $coverage, 'cachesStaticAnalysis' => $cachesStaticAnalysis, 'codeCoverageCacheDirectory' => $codeCoverageCacheDirectory, 'driverMethod' => $driverMethod, 'data' => $data, 'dataName' => $dataName, 'dependencyInput' => $dependencyInput, 'constants' => $constants, 'globals' => $globals, 'include_path' => $includePath, 'included_files' => $includedFiles, 'iniSettings' => $iniSettings, 'isStrictAboutTestsThatDoNotTestAnything' => $isStrictAboutTestsThatDoNotTestAnything, 'isStrictAboutOutputDuringTests' => $isStrictAboutOutputDuringTests, 'enforcesTimeLimit' => $enforcesTimeLimit, 'isStrictAboutTodoAnnotatedTests' => $isStrictAboutTodoAnnotatedTests, 'isStrictAboutResourceUsageDuringSmallTests' => $isStrictAboutResourceUsageDuringSmallTests, 'codeCoverageFilter' => $codeCoverageFilter, 'configurationFilePath' => $configurationFilePath, 'name' => $this->getName(\false)];
81042            if (!$runEntireClass) {
81043                $var['methodName'] = $this->name;
81044            }
81045            $template->setVar($var);
81046            $php = AbstractPhpProcess::factory();
81047            $php->runTestJob($template->render(), $this, $result);
81048        } else {
81049            $result->run($this);
81050        }
81051        $this->result = null;
81052        return $result;
81053    }
81054    /**
81055     * Returns a builder object to create mock objects using a fluent interface.
81056     *
81057     * @psalm-template RealInstanceType of object
81058     * @psalm-param class-string<RealInstanceType> $className
81059     * @psalm-return MockBuilder<RealInstanceType>
81060     */
81061    public function getMockBuilder(string $className) : MockBuilder
81062    {
81063        $this->recordDoubledType($className);
81064        return new MockBuilder($this, $className);
81065    }
81066    public function registerComparator(Comparator $comparator) : void
81067    {
81068        ComparatorFactory::getInstance()->register($comparator);
81069        $this->customComparators[] = $comparator;
81070    }
81071    /**
81072     * @return string[]
81073     *
81074     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81075     */
81076    public function doubledTypes() : array
81077    {
81078        return array_unique($this->doubledTypes);
81079    }
81080    /**
81081     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81082     */
81083    public function getGroups() : array
81084    {
81085        return $this->groups;
81086    }
81087    /**
81088     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81089     */
81090    public function setGroups(array $groups) : void
81091    {
81092        $this->groups = $groups;
81093    }
81094    /**
81095     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
81096     *
81097     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81098     */
81099    public function getName(bool $withDataSet = \true) : string
81100    {
81101        if ($withDataSet) {
81102            return $this->name . $this->getDataSetAsString(\false);
81103        }
81104        return $this->name;
81105    }
81106    /**
81107     * Returns the size of the test.
81108     *
81109     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
81110     *
81111     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81112     */
81113    public function getSize() : int
81114    {
81115        return TestUtil::getSize(static::class, $this->getName(\false));
81116    }
81117    /**
81118     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
81119     *
81120     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81121     */
81122    public function hasSize() : bool
81123    {
81124        return $this->getSize() !== TestUtil::UNKNOWN;
81125    }
81126    /**
81127     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
81128     *
81129     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81130     */
81131    public function isSmall() : bool
81132    {
81133        return $this->getSize() === TestUtil::SMALL;
81134    }
81135    /**
81136     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
81137     *
81138     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81139     */
81140    public function isMedium() : bool
81141    {
81142        return $this->getSize() === TestUtil::MEDIUM;
81143    }
81144    /**
81145     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
81146     *
81147     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81148     */
81149    public function isLarge() : bool
81150    {
81151        return $this->getSize() === TestUtil::LARGE;
81152    }
81153    /**
81154     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81155     */
81156    public function getActualOutput() : string
81157    {
81158        if (!$this->outputBufferingActive) {
81159            return $this->output;
81160        }
81161        return (string) ob_get_contents();
81162    }
81163    /**
81164     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81165     */
81166    public function hasOutput() : bool
81167    {
81168        if ($this->output === '') {
81169            return \false;
81170        }
81171        if ($this->hasExpectationOnOutput()) {
81172            return \false;
81173        }
81174        return \true;
81175    }
81176    /**
81177     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81178     */
81179    public function doesNotPerformAssertions() : bool
81180    {
81181        return $this->doesNotPerformAssertions;
81182    }
81183    /**
81184     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81185     */
81186    public function hasExpectationOnOutput() : bool
81187    {
81188        return is_string($this->outputExpectedString) || is_string($this->outputExpectedRegex) || $this->outputRetrievedForAssertion;
81189    }
81190    /**
81191     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81192     */
81193    public function getExpectedException() : ?string
81194    {
81195        return $this->expectedException;
81196    }
81197    /**
81198     * @return null|int|string
81199     *
81200     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81201     */
81202    public function getExpectedExceptionCode()
81203    {
81204        return $this->expectedExceptionCode;
81205    }
81206    /**
81207     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81208     */
81209    public function getExpectedExceptionMessage() : ?string
81210    {
81211        return $this->expectedExceptionMessage;
81212    }
81213    /**
81214     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81215     */
81216    public function getExpectedExceptionMessageRegExp() : ?string
81217    {
81218        return $this->expectedExceptionMessageRegExp;
81219    }
81220    /**
81221     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81222     */
81223    public function setRegisterMockObjectsFromTestArgumentsRecursively(bool $flag) : void
81224    {
81225        $this->registerMockObjectsFromTestArgumentsRecursively = $flag;
81226    }
81227    /**
81228     * @throws Throwable
81229     *
81230     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81231     */
81232    public function runBare() : void
81233    {
81234        $this->numAssertions = 0;
81235        $this->snapshotGlobalState();
81236        $this->startOutputBuffering();
81237        clearstatcache();
81238        $currentWorkingDirectory = getcwd();
81239        $hookMethods = TestUtil::getHookMethods(static::class);
81240        $hasMetRequirements = \false;
81241        try {
81242            $this->checkRequirements();
81243            $hasMetRequirements = \true;
81244            if ($this->inIsolation) {
81245                foreach ($hookMethods['beforeClass'] as $method) {
81246                    $this->{$method}();
81247                }
81248            }
81249            $this->setDoesNotPerformAssertionsFromAnnotation();
81250            foreach ($hookMethods['before'] as $method) {
81251                $this->{$method}();
81252            }
81253            foreach ($hookMethods['preCondition'] as $method) {
81254                $this->{$method}();
81255            }
81256            $this->testResult = $this->runTest();
81257            $this->verifyMockObjects();
81258            foreach ($hookMethods['postCondition'] as $method) {
81259                $this->{$method}();
81260            }
81261            if (!empty($this->warnings)) {
81262                throw new \PHPUnit\Framework\Warning(implode("\n", array_unique($this->warnings)));
81263            }
81264            $this->status = BaseTestRunner::STATUS_PASSED;
81265        } catch (\PHPUnit\Framework\IncompleteTest $e) {
81266            $this->status = BaseTestRunner::STATUS_INCOMPLETE;
81267            $this->statusMessage = $e->getMessage();
81268        } catch (\PHPUnit\Framework\SkippedTest $e) {
81269            $this->status = BaseTestRunner::STATUS_SKIPPED;
81270            $this->statusMessage = $e->getMessage();
81271        } catch (\PHPUnit\Framework\Warning $e) {
81272            $this->status = BaseTestRunner::STATUS_WARNING;
81273            $this->statusMessage = $e->getMessage();
81274        } catch (\PHPUnit\Framework\AssertionFailedError $e) {
81275            $this->status = BaseTestRunner::STATUS_FAILURE;
81276            $this->statusMessage = $e->getMessage();
81277        } catch (PredictionException $e) {
81278            $this->status = BaseTestRunner::STATUS_FAILURE;
81279            $this->statusMessage = $e->getMessage();
81280        } catch (Throwable $_e) {
81281            $e = $_e;
81282            $this->status = BaseTestRunner::STATUS_ERROR;
81283            $this->statusMessage = $_e->getMessage();
81284        }
81285        $this->mockObjects = [];
81286        $this->prophet = null;
81287        // Tear down the fixture. An exception raised in tearDown() will be
81288        // caught and passed on when no exception was raised before.
81289        try {
81290            if ($hasMetRequirements) {
81291                foreach ($hookMethods['after'] as $method) {
81292                    $this->{$method}();
81293                }
81294                if ($this->inIsolation) {
81295                    foreach ($hookMethods['afterClass'] as $method) {
81296                        $this->{$method}();
81297                    }
81298                }
81299            }
81300        } catch (Throwable $_e) {
81301            $e = $e ?? $_e;
81302        }
81303        try {
81304            $this->stopOutputBuffering();
81305        } catch (\PHPUnit\Framework\RiskyTestError $_e) {
81306            $e = $e ?? $_e;
81307        }
81308        if (isset($_e)) {
81309            $this->status = BaseTestRunner::STATUS_ERROR;
81310            $this->statusMessage = $_e->getMessage();
81311        }
81312        clearstatcache();
81313        if ($currentWorkingDirectory !== getcwd()) {
81314            chdir($currentWorkingDirectory);
81315        }
81316        $this->restoreGlobalState();
81317        $this->unregisterCustomComparators();
81318        $this->cleanupIniSettings();
81319        $this->cleanupLocaleSettings();
81320        libxml_clear_errors();
81321        // Perform assertion on output.
81322        if (!isset($e)) {
81323            try {
81324                if ($this->outputExpectedRegex !== null) {
81325                    $this->assertMatchesRegularExpression($this->outputExpectedRegex, $this->output);
81326                } elseif ($this->outputExpectedString !== null) {
81327                    $this->assertEquals($this->outputExpectedString, $this->output);
81328                }
81329            } catch (Throwable $_e) {
81330                $e = $_e;
81331            }
81332        }
81333        // Workaround for missing "finally".
81334        if (isset($e)) {
81335            if ($e instanceof PredictionException) {
81336                $e = new \PHPUnit\Framework\AssertionFailedError($e->getMessage());
81337            }
81338            $this->onNotSuccessfulTest($e);
81339        }
81340    }
81341    /**
81342     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81343     */
81344    public function setName(string $name) : void
81345    {
81346        $this->name = $name;
81347        if (is_callable($this->sortId(), \true)) {
81348            $this->providedTests = [new \PHPUnit\Framework\ExecutionOrderDependency($this->sortId())];
81349        }
81350    }
81351    /**
81352     * @param list<ExecutionOrderDependency> $dependencies
81353     *
81354     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81355     */
81356    public function setDependencies(array $dependencies) : void
81357    {
81358        $this->dependencies = $dependencies;
81359    }
81360    /**
81361     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81362     */
81363    public function setDependencyInput(array $dependencyInput) : void
81364    {
81365        $this->dependencyInput = $dependencyInput;
81366    }
81367    /**
81368     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81369     */
81370    public function setBeStrictAboutChangesToGlobalState(?bool $beStrictAboutChangesToGlobalState) : void
81371    {
81372        $this->beStrictAboutChangesToGlobalState = $beStrictAboutChangesToGlobalState;
81373    }
81374    /**
81375     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81376     */
81377    public function setBackupGlobals(?bool $backupGlobals) : void
81378    {
81379        if ($this->backupGlobals === null && $backupGlobals !== null) {
81380            $this->backupGlobals = $backupGlobals;
81381        }
81382    }
81383    /**
81384     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81385     */
81386    public function setBackupStaticAttributes(?bool $backupStaticAttributes) : void
81387    {
81388        if ($this->backupStaticAttributes === null && $backupStaticAttributes !== null) {
81389            $this->backupStaticAttributes = $backupStaticAttributes;
81390        }
81391    }
81392    /**
81393     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81394     */
81395    public function setRunTestInSeparateProcess(bool $runTestInSeparateProcess) : void
81396    {
81397        if ($this->runTestInSeparateProcess === null) {
81398            $this->runTestInSeparateProcess = $runTestInSeparateProcess;
81399        }
81400    }
81401    /**
81402     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81403     */
81404    public function setRunClassInSeparateProcess(bool $runClassInSeparateProcess) : void
81405    {
81406        if ($this->runClassInSeparateProcess === null) {
81407            $this->runClassInSeparateProcess = $runClassInSeparateProcess;
81408        }
81409    }
81410    /**
81411     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81412     */
81413    public function setPreserveGlobalState(bool $preserveGlobalState) : void
81414    {
81415        $this->preserveGlobalState = $preserveGlobalState;
81416    }
81417    /**
81418     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81419     */
81420    public function setInIsolation(bool $inIsolation) : void
81421    {
81422        $this->inIsolation = $inIsolation;
81423    }
81424    /**
81425     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81426     */
81427    public function isInIsolation() : bool
81428    {
81429        return $this->inIsolation;
81430    }
81431    /**
81432     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81433     */
81434    public function getResult()
81435    {
81436        return $this->testResult;
81437    }
81438    /**
81439     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81440     */
81441    public function setResult($result) : void
81442    {
81443        $this->testResult = $result;
81444    }
81445    /**
81446     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81447     */
81448    public function setOutputCallback(callable $callback) : void
81449    {
81450        $this->outputCallback = $callback;
81451    }
81452    /**
81453     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81454     */
81455    public function getTestResultObject() : ?\PHPUnit\Framework\TestResult
81456    {
81457        return $this->result;
81458    }
81459    /**
81460     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81461     */
81462    public function setTestResultObject(\PHPUnit\Framework\TestResult $result) : void
81463    {
81464        $this->result = $result;
81465    }
81466    /**
81467     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81468     */
81469    public function registerMockObject(MockObject $mockObject) : void
81470    {
81471        $this->mockObjects[] = $mockObject;
81472    }
81473    /**
81474     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81475     */
81476    public function addToAssertionCount(int $count) : void
81477    {
81478        $this->numAssertions += $count;
81479    }
81480    /**
81481     * Returns the number of assertions performed by this test.
81482     *
81483     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81484     */
81485    public function getNumAssertions() : int
81486    {
81487        return $this->numAssertions;
81488    }
81489    /**
81490     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81491     */
81492    public function usesDataProvider() : bool
81493    {
81494        return !empty($this->data);
81495    }
81496    /**
81497     * @return int|string
81498     *
81499     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81500     */
81501    public function dataName()
81502    {
81503        return $this->dataName;
81504    }
81505    /**
81506     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81507     */
81508    public function getDataSetAsString(bool $includeData = \true) : string
81509    {
81510        $buffer = '';
81511        if (!empty($this->data)) {
81512            if (is_int($this->dataName)) {
81513                $buffer .= sprintf(' with data set #%d', $this->dataName);
81514            } else {
81515                $buffer .= sprintf(' with data set "%s"', $this->dataName);
81516            }
81517            if ($includeData) {
81518                $exporter = new Exporter();
81519                $buffer .= sprintf(' (%s)', $exporter->shortenedRecursiveExport($this->data));
81520            }
81521        }
81522        return $buffer;
81523    }
81524    /**
81525     * Gets the data set of a TestCase.
81526     *
81527     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81528     */
81529    public function getProvidedData() : array
81530    {
81531        return $this->data;
81532    }
81533    /**
81534     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81535     */
81536    public function addWarning(string $warning) : void
81537    {
81538        $this->warnings[] = $warning;
81539    }
81540    public function sortId() : string
81541    {
81542        $id = $this->name;
81543        if (strpos($id, '::') === \false) {
81544            $id = static::class . '::' . $id;
81545        }
81546        if ($this->usesDataProvider()) {
81547            $id .= $this->getDataSetAsString(\false);
81548        }
81549        return $id;
81550    }
81551    /**
81552     * Returns the normalized test name as class::method.
81553     *
81554     * @return list<ExecutionOrderDependency>
81555     */
81556    public function provides() : array
81557    {
81558        return $this->providedTests;
81559    }
81560    /**
81561     * Returns a list of normalized dependency names, class::method.
81562     *
81563     * This list can differ from the raw dependencies as the resolver has
81564     * no need for the [!][shallow]clone prefix that is filtered out
81565     * during normalization.
81566     *
81567     * @return list<ExecutionOrderDependency>
81568     */
81569    public function requires() : array
81570    {
81571        return $this->dependencies;
81572    }
81573    /**
81574     * Override to run the test and assert its state.
81575     *
81576     * @throws \SebastianBergmann\ObjectEnumerator\InvalidArgumentException
81577     * @throws AssertionFailedError
81578     * @throws Exception
81579     * @throws ExpectationFailedException
81580     * @throws Throwable
81581     */
81582    protected function runTest()
81583    {
81584        if (trim($this->name) === '') {
81585            throw new \PHPUnit\Framework\Exception('PHPUnit\\Framework\\TestCase::$name must be a non-blank string.');
81586        }
81587        $testArguments = array_merge($this->data, $this->dependencyInput);
81588        $this->registerMockObjectsFromTestArguments($testArguments);
81589        try {
81590            $testResult = $this->{$this->name}(...array_values($testArguments));
81591        } catch (Throwable $exception) {
81592            if (!$this->checkExceptionExpectations($exception)) {
81593                throw $exception;
81594            }
81595            if ($this->expectedException !== null) {
81596                if ($this->expectedException === Error::class) {
81597                    $this->assertThat($exception, LogicalOr::fromConstraints(new ExceptionConstraint(Error::class), new ExceptionConstraint(\Error::class)));
81598                } else {
81599                    $this->assertThat($exception, new ExceptionConstraint($this->expectedException));
81600                }
81601            }
81602            if ($this->expectedExceptionMessage !== null) {
81603                $this->assertThat($exception, new ExceptionMessage($this->expectedExceptionMessage));
81604            }
81605            if ($this->expectedExceptionMessageRegExp !== null) {
81606                $this->assertThat($exception, new ExceptionMessageRegularExpression($this->expectedExceptionMessageRegExp));
81607            }
81608            if ($this->expectedExceptionCode !== null) {
81609                $this->assertThat($exception, new ExceptionCode($this->expectedExceptionCode));
81610            }
81611            return;
81612        }
81613        if ($this->expectedException !== null) {
81614            $this->assertThat(null, new ExceptionConstraint($this->expectedException));
81615        } elseif ($this->expectedExceptionMessage !== null) {
81616            $this->numAssertions++;
81617            throw new \PHPUnit\Framework\AssertionFailedError(sprintf('Failed asserting that exception with message "%s" is thrown', $this->expectedExceptionMessage));
81618        } elseif ($this->expectedExceptionMessageRegExp !== null) {
81619            $this->numAssertions++;
81620            throw new \PHPUnit\Framework\AssertionFailedError(sprintf('Failed asserting that exception with message matching "%s" is thrown', $this->expectedExceptionMessageRegExp));
81621        } elseif ($this->expectedExceptionCode !== null) {
81622            $this->numAssertions++;
81623            throw new \PHPUnit\Framework\AssertionFailedError(sprintf('Failed asserting that exception with code "%s" is thrown', $this->expectedExceptionCode));
81624        }
81625        return $testResult;
81626    }
81627    /**
81628     * This method is a wrapper for the ini_set() function that automatically
81629     * resets the modified php.ini setting to its original value after the
81630     * test is run.
81631     *
81632     * @throws Exception
81633     */
81634    protected function iniSet(string $varName, string $newValue) : void
81635    {
81636        $currentValue = ini_set($varName, $newValue);
81637        if ($currentValue !== \false) {
81638            $this->iniSettings[$varName] = $currentValue;
81639        } else {
81640            throw new \PHPUnit\Framework\Exception(sprintf('INI setting "%s" could not be set to "%s".', $varName, $newValue));
81641        }
81642    }
81643    /**
81644     * This method is a wrapper for the setlocale() function that automatically
81645     * resets the locale to its original value after the test is run.
81646     *
81647     * @throws Exception
81648     */
81649    protected function setLocale(...$args) : void
81650    {
81651        if (count($args) < 2) {
81652            throw new \PHPUnit\Framework\Exception();
81653        }
81654        [$category, $locale] = $args;
81655        if (!in_array($category, self::LOCALE_CATEGORIES, \true)) {
81656            throw new \PHPUnit\Framework\Exception();
81657        }
81658        if (!is_array($locale) && !is_string($locale)) {
81659            throw new \PHPUnit\Framework\Exception();
81660        }
81661        $this->locale[$category] = setlocale($category, 0);
81662        $result = setlocale(...$args);
81663        if ($result === \false) {
81664            throw new \PHPUnit\Framework\Exception('The locale functionality is not implemented on your platform, ' . 'the specified locale does not exist or the category name is ' . 'invalid.');
81665        }
81666    }
81667    /**
81668     * Makes configurable stub for the specified class.
81669     *
81670     * @psalm-template RealInstanceType of object
81671     * @psalm-param    class-string<RealInstanceType> $originalClassName
81672     * @psalm-return   Stub&RealInstanceType
81673     */
81674    protected function createStub(string $originalClassName) : Stub
81675    {
81676        return $this->createMockObject($originalClassName);
81677    }
81678    /**
81679     * Returns a mock object for the specified class.
81680     *
81681     * @psalm-template RealInstanceType of object
81682     * @psalm-param class-string<RealInstanceType> $originalClassName
81683     * @psalm-return MockObject&RealInstanceType
81684     */
81685    protected function createMock(string $originalClassName) : MockObject
81686    {
81687        return $this->createMockObject($originalClassName);
81688    }
81689    /**
81690     * Returns a configured mock object for the specified class.
81691     *
81692     * @psalm-template RealInstanceType of object
81693     * @psalm-param class-string<RealInstanceType> $originalClassName
81694     * @psalm-return MockObject&RealInstanceType
81695     */
81696    protected function createConfiguredMock(string $originalClassName, array $configuration) : MockObject
81697    {
81698        $o = $this->createMockObject($originalClassName);
81699        foreach ($configuration as $method => $return) {
81700            $o->method($method)->willReturn($return);
81701        }
81702        return $o;
81703    }
81704    /**
81705     * Returns a partial mock object for the specified class.
81706     *
81707     * @param string[] $methods
81708     *
81709     * @psalm-template RealInstanceType of object
81710     * @psalm-param class-string<RealInstanceType> $originalClassName
81711     * @psalm-return MockObject&RealInstanceType
81712     */
81713    protected function createPartialMock(string $originalClassName, array $methods) : MockObject
81714    {
81715        try {
81716            $reflector = new ReflectionClass($originalClassName);
81717            // @codeCoverageIgnoreStart
81718        } catch (ReflectionException $e) {
81719            throw new \PHPUnit\Framework\Exception($e->getMessage(), (int) $e->getCode(), $e);
81720        }
81721        // @codeCoverageIgnoreEnd
81722        $mockedMethodsThatDontExist = array_filter($methods, static function (string $method) use($reflector) {
81723            return !$reflector->hasMethod($method);
81724        });
81725        if ($mockedMethodsThatDontExist) {
81726            $this->addWarning(sprintf('createPartialMock() called with method(s) %s that do not exist in %s. This will not be allowed in future versions of PHPUnit.', implode(', ', $mockedMethodsThatDontExist), $originalClassName));
81727        }
81728        return $this->getMockBuilder($originalClassName)->disableOriginalConstructor()->disableOriginalClone()->disableArgumentCloning()->disallowMockingUnknownTypes()->setMethods(empty($methods) ? null : $methods)->getMock();
81729    }
81730    /**
81731     * Returns a test proxy for the specified class.
81732     *
81733     * @psalm-template RealInstanceType of object
81734     * @psalm-param class-string<RealInstanceType> $originalClassName
81735     * @psalm-return MockObject&RealInstanceType
81736     */
81737    protected function createTestProxy(string $originalClassName, array $constructorArguments = []) : MockObject
81738    {
81739        return $this->getMockBuilder($originalClassName)->setConstructorArgs($constructorArguments)->enableProxyingToOriginalMethods()->getMock();
81740    }
81741    /**
81742     * Mocks the specified class and returns the name of the mocked class.
81743     *
81744     * @param null|array $methods $methods
81745     *
81746     * @psalm-template RealInstanceType of object
81747     * @psalm-param class-string<RealInstanceType>|string $originalClassName
81748     * @psalm-return class-string<MockObject&RealInstanceType>
81749     */
81750    protected function getMockClass(string $originalClassName, $methods = [], array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = \false, bool $callOriginalClone = \true, bool $callAutoload = \true, bool $cloneArguments = \false) : string
81751    {
81752        $this->recordDoubledType($originalClassName);
81753        $mock = $this->getMockObjectGenerator()->getMock($originalClassName, $methods, $arguments, $mockClassName, $callOriginalConstructor, $callOriginalClone, $callAutoload, $cloneArguments);
81754        return get_class($mock);
81755    }
81756    /**
81757     * Returns a mock object for the specified abstract class with all abstract
81758     * methods of the class mocked. Concrete methods are not mocked by default.
81759     * To mock concrete methods, use the 7th parameter ($mockedMethods).
81760     *
81761     * @psalm-template RealInstanceType of object
81762     * @psalm-param class-string<RealInstanceType> $originalClassName
81763     * @psalm-return MockObject&RealInstanceType
81764     */
81765    protected function getMockForAbstractClass(string $originalClassName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = \true, bool $callOriginalClone = \true, bool $callAutoload = \true, array $mockedMethods = [], bool $cloneArguments = \false) : MockObject
81766    {
81767        $this->recordDoubledType($originalClassName);
81768        $mockObject = $this->getMockObjectGenerator()->getMockForAbstractClass($originalClassName, $arguments, $mockClassName, $callOriginalConstructor, $callOriginalClone, $callAutoload, $mockedMethods, $cloneArguments);
81769        $this->registerMockObject($mockObject);
81770        return $mockObject;
81771    }
81772    /**
81773     * Returns a mock object based on the given WSDL file.
81774     *
81775     * @psalm-template RealInstanceType of object
81776     * @psalm-param class-string<RealInstanceType>|string $originalClassName
81777     * @psalm-return MockObject&RealInstanceType
81778     */
81779    protected function getMockFromWsdl(string $wsdlFile, string $originalClassName = '', string $mockClassName = '', array $methods = [], bool $callOriginalConstructor = \true, array $options = []) : MockObject
81780    {
81781        $this->recordDoubledType(SoapClient::class);
81782        if ($originalClassName === '') {
81783            $fileName = pathinfo(basename(parse_url($wsdlFile, \PHP_URL_PATH)), \PATHINFO_FILENAME);
81784            $originalClassName = preg_replace('/\\W/', '', $fileName);
81785        }
81786        if (!class_exists($originalClassName)) {
81787            eval($this->getMockObjectGenerator()->generateClassFromWsdl($wsdlFile, $originalClassName, $methods, $options));
81788        }
81789        $mockObject = $this->getMockObjectGenerator()->getMock($originalClassName, $methods, ['', $options], $mockClassName, $callOriginalConstructor, \false, \false);
81790        $this->registerMockObject($mockObject);
81791        return $mockObject;
81792    }
81793    /**
81794     * Returns a mock object for the specified trait with all abstract methods
81795     * of the trait mocked. Concrete methods to mock can be specified with the
81796     * `$mockedMethods` parameter.
81797     *
81798     * @psalm-param trait-string $traitName
81799     */
81800    protected function getMockForTrait(string $traitName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = \true, bool $callOriginalClone = \true, bool $callAutoload = \true, array $mockedMethods = [], bool $cloneArguments = \false) : MockObject
81801    {
81802        $this->recordDoubledType($traitName);
81803        $mockObject = $this->getMockObjectGenerator()->getMockForTrait($traitName, $arguments, $mockClassName, $callOriginalConstructor, $callOriginalClone, $callAutoload, $mockedMethods, $cloneArguments);
81804        $this->registerMockObject($mockObject);
81805        return $mockObject;
81806    }
81807    /**
81808     * Returns an object for the specified trait.
81809     *
81810     * @psalm-param trait-string $traitName
81811     */
81812    protected function getObjectForTrait(string $traitName, array $arguments = [], string $traitClassName = '', bool $callOriginalConstructor = \true, bool $callOriginalClone = \true, bool $callAutoload = \true) : object
81813    {
81814        $this->recordDoubledType($traitName);
81815        return $this->getMockObjectGenerator()->getObjectForTrait($traitName, $traitClassName, $callAutoload, $callOriginalConstructor, $arguments);
81816    }
81817    /**
81818     * @throws \Prophecy\Exception\Doubler\ClassNotFoundException
81819     * @throws \Prophecy\Exception\Doubler\DoubleException
81820     * @throws \Prophecy\Exception\Doubler\InterfaceNotFoundException
81821     *
81822     * @psalm-param class-string|null $classOrInterface
81823     */
81824    protected function prophesize(?string $classOrInterface = null) : ObjectProphecy
81825    {
81826        $this->addWarning('PHPUnit\\Framework\\TestCase::prophesize() is deprecated and will be removed in PHPUnit 10. Please use the trait provided by phpspec/prophecy-phpunit.');
81827        if (is_string($classOrInterface)) {
81828            $this->recordDoubledType($classOrInterface);
81829        }
81830        return $this->getProphet()->prophesize($classOrInterface);
81831    }
81832    /**
81833     * Creates a default TestResult object.
81834     *
81835     * @internal This method is not covered by the backward compatibility promise for PHPUnit
81836     */
81837    protected function createResult() : \PHPUnit\Framework\TestResult
81838    {
81839        return new \PHPUnit\Framework\TestResult();
81840    }
81841    /**
81842     * Performs assertions shared by all tests of a test case.
81843     *
81844     * This method is called between setUp() and test.
81845     */
81846    protected function assertPreConditions() : void
81847    {
81848    }
81849    /**
81850     * Performs assertions shared by all tests of a test case.
81851     *
81852     * This method is called between test and tearDown().
81853     */
81854    protected function assertPostConditions() : void
81855    {
81856    }
81857    /**
81858     * This method is called when a test method did not execute successfully.
81859     *
81860     * @throws Throwable
81861     */
81862    protected function onNotSuccessfulTest(Throwable $t) : void
81863    {
81864        throw $t;
81865    }
81866    protected function recordDoubledType(string $originalClassName) : void
81867    {
81868        $this->doubledTypes[] = $originalClassName;
81869    }
81870    /**
81871     * @throws Throwable
81872     */
81873    private function verifyMockObjects() : void
81874    {
81875        foreach ($this->mockObjects as $mockObject) {
81876            if ($mockObject->__phpunit_hasMatchers()) {
81877                $this->numAssertions++;
81878            }
81879            $mockObject->__phpunit_verify($this->shouldInvocationMockerBeReset($mockObject));
81880        }
81881        if ($this->prophet !== null) {
81882            try {
81883                $this->prophet->checkPredictions();
81884            } finally {
81885                foreach ($this->prophet->getProphecies() as $objectProphecy) {
81886                    foreach ($objectProphecy->getMethodProphecies() as $methodProphecies) {
81887                        foreach ($methodProphecies as $methodProphecy) {
81888                            /* @var MethodProphecy $methodProphecy */
81889                            $this->numAssertions += count($methodProphecy->getCheckedPredictions());
81890                        }
81891                    }
81892                }
81893            }
81894        }
81895    }
81896    /**
81897     * @throws SkippedTestError
81898     * @throws SyntheticSkippedError
81899     * @throws Warning
81900     */
81901    private function checkRequirements() : void
81902    {
81903        if (!$this->name || !method_exists($this, $this->name)) {
81904            return;
81905        }
81906        $missingRequirements = TestUtil::getMissingRequirements(static::class, $this->name);
81907        if (!empty($missingRequirements)) {
81908            $this->markTestSkipped(implode(\PHP_EOL, $missingRequirements));
81909        }
81910    }
81911    private function handleDependencies() : bool
81912    {
81913        if ([] === $this->dependencies || $this->inIsolation) {
81914            return \true;
81915        }
81916        $passed = $this->result->passed();
81917        $passedKeys = array_keys($passed);
81918        $numKeys = count($passedKeys);
81919        for ($i = 0; $i < $numKeys; $i++) {
81920            $pos = strpos($passedKeys[$i], ' with data set');
81921            if ($pos !== \false) {
81922                $passedKeys[$i] = substr($passedKeys[$i], 0, $pos);
81923            }
81924        }
81925        $passedKeys = array_flip(array_unique($passedKeys));
81926        foreach ($this->dependencies as $dependency) {
81927            if (!$dependency->isValid()) {
81928                $this->markSkippedForNotSpecifyingDependency();
81929                return \false;
81930            }
81931            if ($dependency->targetIsClass()) {
81932                $dependencyClassName = $dependency->getTargetClassName();
81933                if (array_search($dependencyClassName, $this->result->passedClasses(), \true) === \false) {
81934                    $this->markSkippedForMissingDependency($dependency);
81935                    return \false;
81936                }
81937                continue;
81938            }
81939            $dependencyTarget = $dependency->getTarget();
81940            if (!isset($passedKeys[$dependencyTarget])) {
81941                if (!$this->isCallableTestMethod($dependencyTarget)) {
81942                    $this->markWarningForUncallableDependency($dependency);
81943                } else {
81944                    $this->markSkippedForMissingDependency($dependency);
81945                }
81946                return \false;
81947            }
81948            if (isset($passed[$dependencyTarget])) {
81949                if ($passed[$dependencyTarget]['size'] != \PHPUnit\Util\Test::UNKNOWN && $this->getSize() != \PHPUnit\Util\Test::UNKNOWN && $passed[$dependencyTarget]['size'] > $this->getSize()) {
81950                    $this->result->addError($this, new \PHPUnit\Framework\SkippedTestError('This test depends on a test that is larger than itself.'), 0);
81951                    return \false;
81952                }
81953                if ($dependency->useDeepClone()) {
81954                    $deepCopy = new DeepCopy();
81955                    $deepCopy->skipUncloneable(\false);
81956                    $this->dependencyInput[$dependencyTarget] = $deepCopy->copy($passed[$dependencyTarget]['result']);
81957                } elseif ($dependency->useShallowClone()) {
81958                    $this->dependencyInput[$dependencyTarget] = clone $passed[$dependencyTarget]['result'];
81959                } else {
81960                    $this->dependencyInput[$dependencyTarget] = $passed[$dependencyTarget]['result'];
81961                }
81962            } else {
81963                $this->dependencyInput[$dependencyTarget] = null;
81964            }
81965        }
81966        return \true;
81967    }
81968    private function markSkippedForNotSpecifyingDependency() : void
81969    {
81970        $this->status = BaseTestRunner::STATUS_SKIPPED;
81971        $this->result->startTest($this);
81972        $this->result->addError($this, new \PHPUnit\Framework\SkippedTestError('This method has an invalid @depends annotation.'), 0);
81973        $this->result->endTest($this, 0);
81974    }
81975    private function markSkippedForMissingDependency(\PHPUnit\Framework\ExecutionOrderDependency $dependency) : void
81976    {
81977        $this->status = BaseTestRunner::STATUS_SKIPPED;
81978        $this->result->startTest($this);
81979        $this->result->addError($this, new \PHPUnit\Framework\SkippedTestError(sprintf('This test depends on "%s" to pass.', $dependency->getTarget())), 0);
81980        $this->result->endTest($this, 0);
81981    }
81982    private function markWarningForUncallableDependency(\PHPUnit\Framework\ExecutionOrderDependency $dependency) : void
81983    {
81984        $this->status = BaseTestRunner::STATUS_WARNING;
81985        $this->result->startTest($this);
81986        $this->result->addWarning($this, new \PHPUnit\Framework\Warning(sprintf('This test depends on "%s" which does not exist.', $dependency->getTarget())), 0);
81987        $this->result->endTest($this, 0);
81988    }
81989    /**
81990     * Get the mock object generator, creating it if it doesn't exist.
81991     */
81992    private function getMockObjectGenerator() : MockGenerator
81993    {
81994        if ($this->mockObjectGenerator === null) {
81995            $this->mockObjectGenerator = new MockGenerator();
81996        }
81997        return $this->mockObjectGenerator;
81998    }
81999    private function startOutputBuffering() : void
82000    {
82001        ob_start();
82002        $this->outputBufferingActive = \true;
82003        $this->outputBufferingLevel = ob_get_level();
82004    }
82005    /**
82006     * @throws RiskyTestError
82007     */
82008    private function stopOutputBuffering() : void
82009    {
82010        if (ob_get_level() !== $this->outputBufferingLevel) {
82011            while (ob_get_level() >= $this->outputBufferingLevel) {
82012                ob_end_clean();
82013            }
82014            throw new \PHPUnit\Framework\RiskyTestError('Test code or tested code did not (only) close its own output buffers');
82015        }
82016        $this->output = ob_get_contents();
82017        if ($this->outputCallback !== \false) {
82018            $this->output = (string) call_user_func($this->outputCallback, $this->output);
82019        }
82020        ob_end_clean();
82021        $this->outputBufferingActive = \false;
82022        $this->outputBufferingLevel = ob_get_level();
82023    }
82024    private function snapshotGlobalState() : void
82025    {
82026        if ($this->runTestInSeparateProcess || $this->inIsolation || !$this->backupGlobals && !$this->backupStaticAttributes) {
82027            return;
82028        }
82029        $this->snapshot = $this->createGlobalStateSnapshot($this->backupGlobals === \true);
82030    }
82031    /**
82032     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
82033     * @throws RiskyTestError
82034     */
82035    private function restoreGlobalState() : void
82036    {
82037        if (!$this->snapshot instanceof Snapshot) {
82038            return;
82039        }
82040        if ($this->beStrictAboutChangesToGlobalState) {
82041            try {
82042                $this->compareGlobalStateSnapshots($this->snapshot, $this->createGlobalStateSnapshot($this->backupGlobals === \true));
82043            } catch (\PHPUnit\Framework\RiskyTestError $rte) {
82044                // Intentionally left empty
82045            }
82046        }
82047        $restorer = new Restorer();
82048        if ($this->backupGlobals) {
82049            $restorer->restoreGlobalVariables($this->snapshot);
82050        }
82051        if ($this->backupStaticAttributes) {
82052            $restorer->restoreStaticAttributes($this->snapshot);
82053        }
82054        $this->snapshot = null;
82055        if (isset($rte)) {
82056            throw $rte;
82057        }
82058    }
82059    private function createGlobalStateSnapshot(bool $backupGlobals) : Snapshot
82060    {
82061        $excludeList = new ExcludeList();
82062        foreach ($this->backupGlobalsExcludeList as $globalVariable) {
82063            $excludeList->addGlobalVariable($globalVariable);
82064        }
82065        if (!empty($this->backupGlobalsBlacklist)) {
82066            $this->addWarning('PHPUnit\\Framework\\TestCase::$backupGlobalsBlacklist is deprecated and will be removed in PHPUnit 10. Please use PHPUnit\\Framework\\TestCase::$backupGlobalsExcludeList instead.');
82067            foreach ($this->backupGlobalsBlacklist as $globalVariable) {
82068                $excludeList->addGlobalVariable($globalVariable);
82069            }
82070        }
82071        if (!defined('PHPUNIT_TESTSUITE')) {
82072            $excludeList->addClassNamePrefix('PHPUnit');
82073            $excludeList->addClassNamePrefix('PHPUnit\\SebastianBergmann\\CodeCoverage');
82074            $excludeList->addClassNamePrefix('PHPUnit\\SebastianBergmann\\FileIterator');
82075            $excludeList->addClassNamePrefix('PHPUnit\\SebastianBergmann\\Invoker');
82076            $excludeList->addClassNamePrefix('PHPUnit\\SebastianBergmann\\Template');
82077            $excludeList->addClassNamePrefix('PHPUnit\\SebastianBergmann\\Timer');
82078            $excludeList->addClassNamePrefix('Symfony');
82079            $excludeList->addClassNamePrefix('PHPUnit\\Doctrine\\Instantiator');
82080            $excludeList->addClassNamePrefix('Prophecy');
82081            $excludeList->addStaticAttribute(ComparatorFactory::class, 'instance');
82082            foreach ($this->backupStaticAttributesExcludeList as $class => $attributes) {
82083                foreach ($attributes as $attribute) {
82084                    $excludeList->addStaticAttribute($class, $attribute);
82085                }
82086            }
82087            if (!empty($this->backupStaticAttributesBlacklist)) {
82088                $this->addWarning('PHPUnit\\Framework\\TestCase::$backupStaticAttributesBlacklist is deprecated and will be removed in PHPUnit 10. Please use PHPUnit\\Framework\\TestCase::$backupStaticAttributesExcludeList instead.');
82089                foreach ($this->backupStaticAttributesBlacklist as $class => $attributes) {
82090                    foreach ($attributes as $attribute) {
82091                        $excludeList->addStaticAttribute($class, $attribute);
82092                    }
82093                }
82094            }
82095        }
82096        return new Snapshot($excludeList, $backupGlobals, (bool) $this->backupStaticAttributes, \false, \false, \false, \false, \false, \false, \false);
82097    }
82098    /**
82099     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
82100     * @throws RiskyTestError
82101     */
82102    private function compareGlobalStateSnapshots(Snapshot $before, Snapshot $after) : void
82103    {
82104        $backupGlobals = $this->backupGlobals === null || $this->backupGlobals;
82105        if ($backupGlobals) {
82106            $this->compareGlobalStateSnapshotPart($before->globalVariables(), $after->globalVariables(), "--- Global variables before the test\n+++ Global variables after the test\n");
82107            $this->compareGlobalStateSnapshotPart($before->superGlobalVariables(), $after->superGlobalVariables(), "--- Super-global variables before the test\n+++ Super-global variables after the test\n");
82108        }
82109        if ($this->backupStaticAttributes) {
82110            $this->compareGlobalStateSnapshotPart($before->staticAttributes(), $after->staticAttributes(), "--- Static attributes before the test\n+++ Static attributes after the test\n");
82111        }
82112    }
82113    /**
82114     * @throws RiskyTestError
82115     */
82116    private function compareGlobalStateSnapshotPart(array $before, array $after, string $header) : void
82117    {
82118        if ($before != $after) {
82119            $differ = new Differ($header);
82120            $exporter = new Exporter();
82121            $diff = $differ->diff($exporter->export($before), $exporter->export($after));
82122            throw new \PHPUnit\Framework\RiskyTestError($diff);
82123        }
82124    }
82125    private function getProphet() : Prophet
82126    {
82127        if ($this->prophet === null) {
82128            $this->prophet = new Prophet();
82129        }
82130        return $this->prophet;
82131    }
82132    /**
82133     * @throws \SebastianBergmann\ObjectEnumerator\InvalidArgumentException
82134     */
82135    private function shouldInvocationMockerBeReset(MockObject $mock) : bool
82136    {
82137        $enumerator = new Enumerator();
82138        foreach ($enumerator->enumerate($this->dependencyInput) as $object) {
82139            if ($mock === $object) {
82140                return \false;
82141            }
82142        }
82143        if (!is_array($this->testResult) && !is_object($this->testResult)) {
82144            return \true;
82145        }
82146        return !in_array($mock, $enumerator->enumerate($this->testResult), \true);
82147    }
82148    /**
82149     * @throws \SebastianBergmann\ObjectEnumerator\InvalidArgumentException
82150     * @throws \SebastianBergmann\ObjectReflector\InvalidArgumentException
82151     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
82152     */
82153    private function registerMockObjectsFromTestArguments(array $testArguments, array &$visited = []) : void
82154    {
82155        if ($this->registerMockObjectsFromTestArgumentsRecursively) {
82156            foreach ((new Enumerator())->enumerate($testArguments) as $object) {
82157                if ($object instanceof MockObject) {
82158                    $this->registerMockObject($object);
82159                }
82160            }
82161        } else {
82162            foreach ($testArguments as $testArgument) {
82163                if ($testArgument instanceof MockObject) {
82164                    if (Type::isCloneable($testArgument)) {
82165                        $testArgument = clone $testArgument;
82166                    }
82167                    $this->registerMockObject($testArgument);
82168                } elseif (is_array($testArgument) && !in_array($testArgument, $visited, \true)) {
82169                    $visited[] = $testArgument;
82170                    $this->registerMockObjectsFromTestArguments($testArgument, $visited);
82171                }
82172            }
82173        }
82174    }
82175    private function setDoesNotPerformAssertionsFromAnnotation() : void
82176    {
82177        $annotations = TestUtil::parseTestMethodAnnotations(static::class, $this->name);
82178        if (isset($annotations['method']['doesNotPerformAssertions'])) {
82179            $this->doesNotPerformAssertions = \true;
82180        }
82181    }
82182    private function unregisterCustomComparators() : void
82183    {
82184        $factory = ComparatorFactory::getInstance();
82185        foreach ($this->customComparators as $comparator) {
82186            $factory->unregister($comparator);
82187        }
82188        $this->customComparators = [];
82189    }
82190    private function cleanupIniSettings() : void
82191    {
82192        foreach ($this->iniSettings as $varName => $oldValue) {
82193            ini_set($varName, $oldValue);
82194        }
82195        $this->iniSettings = [];
82196    }
82197    private function cleanupLocaleSettings() : void
82198    {
82199        foreach ($this->locale as $category => $locale) {
82200            setlocale($category, $locale);
82201        }
82202        $this->locale = [];
82203    }
82204    /**
82205     * @throws Exception
82206     */
82207    private function checkExceptionExpectations(Throwable $throwable) : bool
82208    {
82209        $result = \false;
82210        if ($this->expectedException !== null || $this->expectedExceptionCode !== null || $this->expectedExceptionMessage !== null || $this->expectedExceptionMessageRegExp !== null) {
82211            $result = \true;
82212        }
82213        if ($throwable instanceof \PHPUnit\Framework\Exception) {
82214            $result = \false;
82215        }
82216        if (is_string($this->expectedException)) {
82217            try {
82218                $reflector = new ReflectionClass($this->expectedException);
82219                // @codeCoverageIgnoreStart
82220            } catch (ReflectionException $e) {
82221                throw new \PHPUnit\Framework\Exception($e->getMessage(), (int) $e->getCode(), $e);
82222            }
82223            // @codeCoverageIgnoreEnd
82224            if ($this->expectedException === 'PHPUnit\\Framework\\Exception' || $this->expectedException === '\\PHPUnit\\Framework\\Exception' || $reflector->isSubclassOf(\PHPUnit\Framework\Exception::class)) {
82225                $result = \true;
82226            }
82227        }
82228        return $result;
82229    }
82230    private function runInSeparateProcess() : bool
82231    {
82232        return ($this->runTestInSeparateProcess || $this->runClassInSeparateProcess) && !$this->inIsolation && !$this instanceof PhptTestCase;
82233    }
82234    private function isCallableTestMethod(string $dependency) : bool
82235    {
82236        [$className, $methodName] = explode('::', $dependency);
82237        if (!class_exists($className)) {
82238            return \false;
82239        }
82240        try {
82241            $class = new ReflectionClass($className);
82242        } catch (ReflectionException $e) {
82243            return \false;
82244        }
82245        if (!$class->isSubclassOf(__CLASS__)) {
82246            return \false;
82247        }
82248        if (!$class->hasMethod($methodName)) {
82249            return \false;
82250        }
82251        try {
82252            $method = $class->getMethod($methodName);
82253        } catch (ReflectionException $e) {
82254            return \false;
82255        }
82256        return TestUtil::isTestMethod($method);
82257    }
82258    /**
82259     * @psalm-template RealInstanceType of object
82260     * @psalm-param class-string<RealInstanceType> $originalClassName
82261     * @psalm-return MockObject&RealInstanceType
82262     */
82263    private function createMockObject(string $originalClassName) : MockObject
82264    {
82265        return $this->getMockBuilder($originalClassName)->disableOriginalConstructor()->disableOriginalClone()->disableArgumentCloning()->disallowMockingUnknownTypes()->getMock();
82266    }
82267}
82268<?php
82269
82270declare (strict_types=1);
82271/*
82272 * This file is part of PHPUnit.
82273 *
82274 * (c) Sebastian Bergmann <sebastian@phpunit.de>
82275 *
82276 * For the full copyright and license information, please view the LICENSE
82277 * file that was distributed with this source code.
82278 */
82279namespace PHPUnit\Framework;
82280
82281/**
82282 * @internal This class is not covered by the backward compatibility promise for PHPUnit
82283 */
82284final class WarningTestCase extends \PHPUnit\Framework\TestCase
82285{
82286    /**
82287     * @var bool
82288     */
82289    protected $backupGlobals = \false;
82290    /**
82291     * @var bool
82292     */
82293    protected $backupStaticAttributes = \false;
82294    /**
82295     * @var bool
82296     */
82297    protected $runTestInSeparateProcess = \false;
82298    /**
82299     * @var string
82300     */
82301    private $message;
82302    public function __construct(string $message = '')
82303    {
82304        $this->message = $message;
82305        parent::__construct('Warning');
82306    }
82307    public function getMessage() : string
82308    {
82309        return $this->message;
82310    }
82311    /**
82312     * Returns a string representation of the test case.
82313     */
82314    public function toString() : string
82315    {
82316        return 'Warning';
82317    }
82318    /**
82319     * @throws Exception
82320     *
82321     * @psalm-return never-return
82322     */
82323    protected function runTest() : void
82324    {
82325        throw new \PHPUnit\Framework\Warning($this->message);
82326    }
82327}
82328<?php
82329
82330declare (strict_types=1);
82331/*
82332 * This file is part of PHPUnit.
82333 *
82334 * (c) Sebastian Bergmann <sebastian@phpunit.de>
82335 *
82336 * For the full copyright and license information, please view the LICENSE
82337 * file that was distributed with this source code.
82338 */
82339namespace PHPUnit\Framework;
82340
82341/**
82342 * @internal This class is not covered by the backward compatibility promise for PHPUnit
82343 */
82344final class InvalidParameterGroupException extends \PHPUnit\Framework\Exception
82345{
82346}
82347<?php
82348
82349declare (strict_types=1);
82350/*
82351 * This file is part of PHPUnit.
82352 *
82353 * (c) Sebastian Bergmann <sebastian@phpunit.de>
82354 *
82355 * For the full copyright and license information, please view the LICENSE
82356 * file that was distributed with this source code.
82357 */
82358namespace PHPUnit\Framework\Constraint;
82359
82360use function sprintf;
82361use function strpos;
82362use Throwable;
82363/**
82364 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
82365 */
82366final class ExceptionMessage extends \PHPUnit\Framework\Constraint\Constraint
82367{
82368    /**
82369     * @var string
82370     */
82371    private $expectedMessage;
82372    public function __construct(string $expected)
82373    {
82374        $this->expectedMessage = $expected;
82375    }
82376    public function toString() : string
82377    {
82378        if ($this->expectedMessage === '') {
82379            return 'exception message is empty';
82380        }
82381        return 'exception message contains ';
82382    }
82383    /**
82384     * Evaluates the constraint for parameter $other. Returns true if the
82385     * constraint is met, false otherwise.
82386     *
82387     * @param Throwable $other
82388     */
82389    protected function matches($other) : bool
82390    {
82391        if ($this->expectedMessage === '') {
82392            return $other->getMessage() === '';
82393        }
82394        return strpos((string) $other->getMessage(), $this->expectedMessage) !== \false;
82395    }
82396    /**
82397     * Returns the description of the failure.
82398     *
82399     * The beginning of failure messages is "Failed asserting that" in most
82400     * cases. This method should return the second part of that sentence.
82401     *
82402     * @param mixed $other evaluated value or object
82403     */
82404    protected function failureDescription($other) : string
82405    {
82406        if ($this->expectedMessage === '') {
82407            return sprintf("exception message is empty but is '%s'", $other->getMessage());
82408        }
82409        return sprintf("exception message '%s' contains '%s'", $other->getMessage(), $this->expectedMessage);
82410    }
82411}
82412<?php
82413
82414declare (strict_types=1);
82415/*
82416 * This file is part of PHPUnit.
82417 *
82418 * (c) Sebastian Bergmann <sebastian@phpunit.de>
82419 *
82420 * For the full copyright and license information, please view the LICENSE
82421 * file that was distributed with this source code.
82422 */
82423namespace PHPUnit\Framework\Constraint;
82424
82425use function sprintf;
82426use Throwable;
82427/**
82428 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
82429 */
82430final class ExceptionCode extends \PHPUnit\Framework\Constraint\Constraint
82431{
82432    /**
82433     * @var int|string
82434     */
82435    private $expectedCode;
82436    /**
82437     * @param int|string $expected
82438     */
82439    public function __construct($expected)
82440    {
82441        $this->expectedCode = $expected;
82442    }
82443    public function toString() : string
82444    {
82445        return 'exception code is ';
82446    }
82447    /**
82448     * Evaluates the constraint for parameter $other. Returns true if the
82449     * constraint is met, false otherwise.
82450     *
82451     * @param Throwable $other
82452     */
82453    protected function matches($other) : bool
82454    {
82455        return (string) $other->getCode() === (string) $this->expectedCode;
82456    }
82457    /**
82458     * Returns the description of the failure.
82459     *
82460     * The beginning of failure messages is "Failed asserting that" in most
82461     * cases. This method should return the second part of that sentence.
82462     *
82463     * @param mixed $other evaluated value or object
82464     *
82465     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
82466     */
82467    protected function failureDescription($other) : string
82468    {
82469        return sprintf('%s is equal to expected exception code %s', $this->exporter()->export($other->getCode()), $this->exporter()->export($this->expectedCode));
82470    }
82471}
82472<?php
82473
82474declare (strict_types=1);
82475/*
82476 * This file is part of PHPUnit.
82477 *
82478 * (c) Sebastian Bergmann <sebastian@phpunit.de>
82479 *
82480 * For the full copyright and license information, please view the LICENSE
82481 * file that was distributed with this source code.
82482 */
82483namespace PHPUnit\Framework\Constraint;
82484
82485use function sprintf;
82486use Exception;
82487use PHPUnit\Util\RegularExpression as RegularExpressionUtil;
82488/**
82489 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
82490 */
82491final class ExceptionMessageRegularExpression extends \PHPUnit\Framework\Constraint\Constraint
82492{
82493    /**
82494     * @var string
82495     */
82496    private $expectedMessageRegExp;
82497    public function __construct(string $expected)
82498    {
82499        $this->expectedMessageRegExp = $expected;
82500    }
82501    public function toString() : string
82502    {
82503        return 'exception message matches ';
82504    }
82505    /**
82506     * Evaluates the constraint for parameter $other. Returns true if the
82507     * constraint is met, false otherwise.
82508     *
82509     * @param \PHPUnit\Framework\Exception $other
82510     *
82511     * @throws \PHPUnit\Framework\Exception
82512     * @throws Exception
82513     */
82514    protected function matches($other) : bool
82515    {
82516        $match = RegularExpressionUtil::safeMatch($this->expectedMessageRegExp, $other->getMessage());
82517        if ($match === \false) {
82518            throw new \PHPUnit\Framework\Exception("Invalid expected exception message regex given: '{$this->expectedMessageRegExp}'");
82519        }
82520        return $match === 1;
82521    }
82522    /**
82523     * Returns the description of the failure.
82524     *
82525     * The beginning of failure messages is "Failed asserting that" in most
82526     * cases. This method should return the second part of that sentence.
82527     *
82528     * @param mixed $other evaluated value or object
82529     */
82530    protected function failureDescription($other) : string
82531    {
82532        return sprintf("exception message '%s' matches '%s'", $other->getMessage(), $this->expectedMessageRegExp);
82533    }
82534}
82535<?php
82536
82537declare (strict_types=1);
82538/*
82539 * This file is part of PHPUnit.
82540 *
82541 * (c) Sebastian Bergmann <sebastian@phpunit.de>
82542 *
82543 * For the full copyright and license information, please view the LICENSE
82544 * file that was distributed with this source code.
82545 */
82546namespace PHPUnit\Framework\Constraint;
82547
82548use function get_class;
82549use function sprintf;
82550use PHPUnit\Util\Filter;
82551use Throwable;
82552/**
82553 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
82554 */
82555final class Exception extends \PHPUnit\Framework\Constraint\Constraint
82556{
82557    /**
82558     * @var string
82559     */
82560    private $className;
82561    public function __construct(string $className)
82562    {
82563        $this->className = $className;
82564    }
82565    /**
82566     * Returns a string representation of the constraint.
82567     */
82568    public function toString() : string
82569    {
82570        return sprintf('exception of type "%s"', $this->className);
82571    }
82572    /**
82573     * Evaluates the constraint for parameter $other. Returns true if the
82574     * constraint is met, false otherwise.
82575     *
82576     * @param mixed $other value or object to evaluate
82577     */
82578    protected function matches($other) : bool
82579    {
82580        return $other instanceof $this->className;
82581    }
82582    /**
82583     * Returns the description of the failure.
82584     *
82585     * The beginning of failure messages is "Failed asserting that" in most
82586     * cases. This method should return the second part of that sentence.
82587     *
82588     * @param mixed $other evaluated value or object
82589     */
82590    protected function failureDescription($other) : string
82591    {
82592        if ($other !== null) {
82593            $message = '';
82594            if ($other instanceof Throwable) {
82595                $message = '. Message was: "' . $other->getMessage() . '" at' . "\n" . Filter::getFilteredStacktrace($other);
82596            }
82597            return sprintf('exception of type "%s" matches expected exception "%s"%s', get_class($other), $this->className, $message);
82598        }
82599        return sprintf('exception of type "%s" is thrown', $this->className);
82600    }
82601}
82602<?php
82603
82604declare (strict_types=1);
82605/*
82606 * This file is part of PHPUnit.
82607 *
82608 * (c) Sebastian Bergmann <sebastian@phpunit.de>
82609 *
82610 * For the full copyright and license information, please view the LICENSE
82611 * file that was distributed with this source code.
82612 */
82613namespace PHPUnit\Framework\Constraint;
82614
82615use function array_map;
82616use function array_values;
82617use function count;
82618/**
82619 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
82620 */
82621abstract class BinaryOperator extends \PHPUnit\Framework\Constraint\Operator
82622{
82623    /**
82624     * @var Constraint[]
82625     */
82626    private $constraints = [];
82627    public static function fromConstraints(\PHPUnit\Framework\Constraint\Constraint ...$constraints) : self
82628    {
82629        $constraint = new static();
82630        $constraint->constraints = $constraints;
82631        return $constraint;
82632    }
82633    /**
82634     * @param mixed[] $constraints
82635     */
82636    public function setConstraints(array $constraints) : void
82637    {
82638        $this->constraints = array_map(function ($constraint) : Constraint {
82639            return $this->checkConstraint($constraint);
82640        }, array_values($constraints));
82641    }
82642    /**
82643     * Returns the number of operands (constraints).
82644     */
82645    public final function arity() : int
82646    {
82647        return count($this->constraints);
82648    }
82649    /**
82650     * Returns a string representation of the constraint.
82651     */
82652    public function toString() : string
82653    {
82654        $reduced = $this->reduce();
82655        if ($reduced !== $this) {
82656            return $reduced->toString();
82657        }
82658        $text = '';
82659        foreach ($this->constraints as $key => $constraint) {
82660            $constraint = $constraint->reduce();
82661            $text .= $this->constraintToString($constraint, $key);
82662        }
82663        return $text;
82664    }
82665    /**
82666     * Counts the number of constraint elements.
82667     */
82668    public function count() : int
82669    {
82670        $count = 0;
82671        foreach ($this->constraints as $constraint) {
82672            $count += count($constraint);
82673        }
82674        return $count;
82675    }
82676    /**
82677     * Returns the nested constraints.
82678     */
82679    protected final function constraints() : array
82680    {
82681        return $this->constraints;
82682    }
82683    /**
82684     * Returns true if the $constraint needs to be wrapped with braces.
82685     */
82686    protected final function constraintNeedsParentheses(\PHPUnit\Framework\Constraint\Constraint $constraint) : bool
82687    {
82688        return $this->arity() > 1 && parent::constraintNeedsParentheses($constraint);
82689    }
82690    /**
82691     * Reduces the sub-expression starting at $this by skipping degenerate
82692     * sub-expression and returns first descendant constraint that starts
82693     * a non-reducible sub-expression.
82694     *
82695     * See Constraint::reduce() for more.
82696     */
82697    protected function reduce() : \PHPUnit\Framework\Constraint\Constraint
82698    {
82699        if ($this->arity() === 1 && $this->constraints[0] instanceof \PHPUnit\Framework\Constraint\Operator) {
82700            return $this->constraints[0]->reduce();
82701        }
82702        return parent::reduce();
82703    }
82704    /**
82705     * Returns string representation of given operand in context of this operator.
82706     *
82707     * @param Constraint $constraint operand constraint
82708     * @param int        $position   position of $constraint in this expression
82709     */
82710    private function constraintToString(\PHPUnit\Framework\Constraint\Constraint $constraint, int $position) : string
82711    {
82712        $prefix = '';
82713        if ($position > 0) {
82714            $prefix = ' ' . $this->operator() . ' ';
82715        }
82716        if ($this->constraintNeedsParentheses($constraint)) {
82717            return $prefix . '( ' . $constraint->toString() . ' )';
82718        }
82719        $string = $constraint->toStringInContext($this, $position);
82720        if ($string === '') {
82721            $string = $constraint->toString();
82722        }
82723        return $prefix . $string;
82724    }
82725}
82726<?php
82727
82728declare (strict_types=1);
82729/*
82730 * This file is part of PHPUnit.
82731 *
82732 * (c) Sebastian Bergmann <sebastian@phpunit.de>
82733 *
82734 * For the full copyright and license information, please view the LICENSE
82735 * file that was distributed with this source code.
82736 */
82737namespace PHPUnit\Framework\Constraint;
82738
82739use function array_reduce;
82740use function array_shift;
82741/**
82742 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
82743 */
82744final class LogicalXor extends \PHPUnit\Framework\Constraint\BinaryOperator
82745{
82746    /**
82747     * Returns the name of this operator.
82748     */
82749    public function operator() : string
82750    {
82751        return 'xor';
82752    }
82753    /**
82754     * Returns this operator's precedence.
82755     *
82756     * @see https://www.php.net/manual/en/language.operators.precedence.php.
82757     */
82758    public function precedence() : int
82759    {
82760        return 23;
82761    }
82762    /**
82763     * Evaluates the constraint for parameter $other. Returns true if the
82764     * constraint is met, false otherwise.
82765     *
82766     * @param mixed $other value or object to evaluate
82767     */
82768    public function matches($other) : bool
82769    {
82770        $constraints = $this->constraints();
82771        $initial = array_shift($constraints);
82772        if ($initial === null) {
82773            return \false;
82774        }
82775        return array_reduce($constraints, static function (bool $matches, \PHPUnit\Framework\Constraint\Constraint $constraint) use($other) : bool {
82776            return $matches xor $constraint->evaluate($other, '', \true);
82777        }, $initial->evaluate($other, '', \true));
82778    }
82779}
82780<?php
82781
82782declare (strict_types=1);
82783/*
82784 * This file is part of PHPUnit.
82785 *
82786 * (c) Sebastian Bergmann <sebastian@phpunit.de>
82787 *
82788 * For the full copyright and license information, please view the LICENSE
82789 * file that was distributed with this source code.
82790 */
82791namespace PHPUnit\Framework\Constraint;
82792
82793use function array_map;
82794use function count;
82795use function preg_match;
82796use function preg_quote;
82797use function preg_replace;
82798/**
82799 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
82800 */
82801final class LogicalNot extends \PHPUnit\Framework\Constraint\UnaryOperator
82802{
82803    public static function negate(string $string) : string
82804    {
82805        $positives = ['contains ', 'exists', 'has ', 'is ', 'are ', 'matches ', 'starts with ', 'ends with ', 'reference ', 'not not '];
82806        $negatives = ['does not contain ', 'does not exist', 'does not have ', 'is not ', 'are not ', 'does not match ', 'starts not with ', 'ends not with ', 'don\'t reference ', 'not '];
82807        preg_match('/(\'[\\w\\W]*\')([\\w\\W]*)("[\\w\\W]*")/i', $string, $matches);
82808        $positives = array_map(static function (string $s) {
82809            return '/\\b' . preg_quote($s, '/') . '/';
82810        }, $positives);
82811        if (count($matches) > 0) {
82812            $nonInput = $matches[2];
82813            $negatedString = preg_replace('/' . preg_quote($nonInput, '/') . '/', preg_replace($positives, $negatives, $nonInput), $string);
82814        } else {
82815            $negatedString = preg_replace($positives, $negatives, $string);
82816        }
82817        return $negatedString;
82818    }
82819    /**
82820     * Returns the name of this operator.
82821     */
82822    public function operator() : string
82823    {
82824        return 'not';
82825    }
82826    /**
82827     * Returns this operator's precedence.
82828     *
82829     * @see https://www.php.net/manual/en/language.operators.precedence.php
82830     */
82831    public function precedence() : int
82832    {
82833        return 5;
82834    }
82835    /**
82836     * Evaluates the constraint for parameter $other. Returns true if the
82837     * constraint is met, false otherwise.
82838     *
82839     * @param mixed $other value or object to evaluate
82840     */
82841    protected function matches($other) : bool
82842    {
82843        return !$this->constraint()->evaluate($other, '', \true);
82844    }
82845    /**
82846     * Applies additional transformation to strings returned by toString() or
82847     * failureDescription().
82848     */
82849    protected function transformString(string $string) : string
82850    {
82851        return self::negate($string);
82852    }
82853    /**
82854     * Reduces the sub-expression starting at $this by skipping degenerate
82855     * sub-expression and returns first descendant constraint that starts
82856     * a non-reducible sub-expression.
82857     *
82858     * See Constraint::reduce() for more.
82859     */
82860    protected function reduce() : \PHPUnit\Framework\Constraint\Constraint
82861    {
82862        $constraint = $this->constraint();
82863        if ($constraint instanceof self) {
82864            return $constraint->constraint()->reduce();
82865        }
82866        return parent::reduce();
82867    }
82868}
82869<?php
82870
82871declare (strict_types=1);
82872/*
82873 * This file is part of PHPUnit.
82874 *
82875 * (c) Sebastian Bergmann <sebastian@phpunit.de>
82876 *
82877 * For the full copyright and license information, please view the LICENSE
82878 * file that was distributed with this source code.
82879 */
82880namespace PHPUnit\Framework\Constraint;
82881
82882use function count;
82883/**
82884 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
82885 */
82886abstract class UnaryOperator extends \PHPUnit\Framework\Constraint\Operator
82887{
82888    /**
82889     * @var Constraint
82890     */
82891    private $constraint;
82892    /**
82893     * @param Constraint|mixed $constraint
82894     */
82895    public function __construct($constraint)
82896    {
82897        $this->constraint = $this->checkConstraint($constraint);
82898    }
82899    /**
82900     * Returns the number of operands (constraints).
82901     */
82902    public function arity() : int
82903    {
82904        return 1;
82905    }
82906    /**
82907     * Returns a string representation of the constraint.
82908     */
82909    public function toString() : string
82910    {
82911        $reduced = $this->reduce();
82912        if ($reduced !== $this) {
82913            return $reduced->toString();
82914        }
82915        $constraint = $this->constraint->reduce();
82916        if ($this->constraintNeedsParentheses($constraint)) {
82917            return $this->operator() . '( ' . $constraint->toString() . ' )';
82918        }
82919        $string = $constraint->toStringInContext($this, 0);
82920        if ($string === '') {
82921            return $this->transformString($constraint->toString());
82922        }
82923        return $string;
82924    }
82925    /**
82926     * Counts the number of constraint elements.
82927     */
82928    public function count() : int
82929    {
82930        return count($this->constraint);
82931    }
82932    /**
82933     * Returns the description of the failure.
82934     *
82935     * The beginning of failure messages is "Failed asserting that" in most
82936     * cases. This method should return the second part of that sentence.
82937     *
82938     * @param mixed $other evaluated value or object
82939     *
82940     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
82941     */
82942    protected function failureDescription($other) : string
82943    {
82944        $reduced = $this->reduce();
82945        if ($reduced !== $this) {
82946            return $reduced->failureDescription($other);
82947        }
82948        $constraint = $this->constraint->reduce();
82949        if ($this->constraintNeedsParentheses($constraint)) {
82950            return $this->operator() . '( ' . $constraint->failureDescription($other) . ' )';
82951        }
82952        $string = $constraint->failureDescriptionInContext($this, 0, $other);
82953        if ($string === '') {
82954            return $this->transformString($constraint->failureDescription($other));
82955        }
82956        return $string;
82957    }
82958    /**
82959     * Transforms string returned by the memeber constraint's toString() or
82960     * failureDescription() such that it reflects constraint's participation in
82961     * this expression.
82962     *
82963     * The method may be overwritten in a subclass to apply default
82964     * transformation in case the operand constraint does not provide its own
82965     * custom strings via toStringInContext() or failureDescriptionInContext().
82966     *
82967     * @param string $string the string to be transformed
82968     */
82969    protected function transformString(string $string) : string
82970    {
82971        return $string;
82972    }
82973    /**
82974     * Provides access to $this->constraint for subclasses.
82975     */
82976    protected final function constraint() : \PHPUnit\Framework\Constraint\Constraint
82977    {
82978        return $this->constraint;
82979    }
82980    /**
82981     * Returns true if the $constraint needs to be wrapped with parentheses.
82982     */
82983    protected function constraintNeedsParentheses(\PHPUnit\Framework\Constraint\Constraint $constraint) : bool
82984    {
82985        $constraint = $constraint->reduce();
82986        return $constraint instanceof self || parent::constraintNeedsParentheses($constraint);
82987    }
82988}
82989<?php
82990
82991declare (strict_types=1);
82992/*
82993 * This file is part of PHPUnit.
82994 *
82995 * (c) Sebastian Bergmann <sebastian@phpunit.de>
82996 *
82997 * For the full copyright and license information, please view the LICENSE
82998 * file that was distributed with this source code.
82999 */
83000namespace PHPUnit\Framework\Constraint;
83001
83002/**
83003 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
83004 */
83005abstract class Operator extends \PHPUnit\Framework\Constraint\Constraint
83006{
83007    /**
83008     * Returns the name of this operator.
83009     */
83010    public abstract function operator() : string;
83011    /**
83012     * Returns this operator's precedence.
83013     *
83014     * @see https://www.php.net/manual/en/language.operators.precedence.php
83015     */
83016    public abstract function precedence() : int;
83017    /**
83018     * Returns the number of operands.
83019     */
83020    public abstract function arity() : int;
83021    /**
83022     * Validates $constraint argument.
83023     */
83024    protected function checkConstraint($constraint) : \PHPUnit\Framework\Constraint\Constraint
83025    {
83026        if (!$constraint instanceof \PHPUnit\Framework\Constraint\Constraint) {
83027            return new \PHPUnit\Framework\Constraint\IsEqual($constraint);
83028        }
83029        return $constraint;
83030    }
83031    /**
83032     * Returns true if the $constraint needs to be wrapped with braces.
83033     */
83034    protected function constraintNeedsParentheses(\PHPUnit\Framework\Constraint\Constraint $constraint) : bool
83035    {
83036        return $constraint instanceof self && $constraint->arity() > 1 && $this->precedence() <= $constraint->precedence();
83037    }
83038}
83039<?php
83040
83041declare (strict_types=1);
83042/*
83043 * This file is part of PHPUnit.
83044 *
83045 * (c) Sebastian Bergmann <sebastian@phpunit.de>
83046 *
83047 * For the full copyright and license information, please view the LICENSE
83048 * file that was distributed with this source code.
83049 */
83050namespace PHPUnit\Framework\Constraint;
83051
83052/**
83053 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
83054 */
83055final class LogicalOr extends \PHPUnit\Framework\Constraint\BinaryOperator
83056{
83057    /**
83058     * Returns the name of this operator.
83059     */
83060    public function operator() : string
83061    {
83062        return 'or';
83063    }
83064    /**
83065     * Returns this operator's precedence.
83066     *
83067     * @see https://www.php.net/manual/en/language.operators.precedence.php
83068     */
83069    public function precedence() : int
83070    {
83071        return 24;
83072    }
83073    /**
83074     * Evaluates the constraint for parameter $other. Returns true if the
83075     * constraint is met, false otherwise.
83076     *
83077     * @param mixed $other value or object to evaluate
83078     */
83079    public function matches($other) : bool
83080    {
83081        foreach ($this->constraints() as $constraint) {
83082            if ($constraint->evaluate($other, '', \true)) {
83083                return \true;
83084            }
83085        }
83086        return \false;
83087    }
83088}
83089<?php
83090
83091declare (strict_types=1);
83092/*
83093 * This file is part of PHPUnit.
83094 *
83095 * (c) Sebastian Bergmann <sebastian@phpunit.de>
83096 *
83097 * For the full copyright and license information, please view the LICENSE
83098 * file that was distributed with this source code.
83099 */
83100namespace PHPUnit\Framework\Constraint;
83101
83102/**
83103 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
83104 */
83105final class LogicalAnd extends \PHPUnit\Framework\Constraint\BinaryOperator
83106{
83107    /**
83108     * Returns the name of this operator.
83109     */
83110    public function operator() : string
83111    {
83112        return 'and';
83113    }
83114    /**
83115     * Returns this operator's precedence.
83116     *
83117     * @see https://www.php.net/manual/en/language.operators.precedence.php
83118     */
83119    public function precedence() : int
83120    {
83121        return 22;
83122    }
83123    /**
83124     * Evaluates the constraint for parameter $other. Returns true if the
83125     * constraint is met, false otherwise.
83126     *
83127     * @param mixed $other value or object to evaluate
83128     */
83129    protected function matches($other) : bool
83130    {
83131        foreach ($this->constraints() as $constraint) {
83132            if (!$constraint->evaluate($other, '', \true)) {
83133                return \false;
83134            }
83135        }
83136        return [] !== $this->constraints();
83137    }
83138}
83139<?php
83140
83141declare (strict_types=1);
83142/*
83143 * This file is part of PHPUnit.
83144 *
83145 * (c) Sebastian Bergmann <sebastian@phpunit.de>
83146 *
83147 * For the full copyright and license information, please view the LICENSE
83148 * file that was distributed with this source code.
83149 */
83150namespace PHPUnit\Framework\Constraint;
83151
83152use function file_exists;
83153use function sprintf;
83154/**
83155 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
83156 */
83157final class FileExists extends \PHPUnit\Framework\Constraint\Constraint
83158{
83159    /**
83160     * Returns a string representation of the constraint.
83161     */
83162    public function toString() : string
83163    {
83164        return 'file exists';
83165    }
83166    /**
83167     * Evaluates the constraint for parameter $other. Returns true if the
83168     * constraint is met, false otherwise.
83169     *
83170     * @param mixed $other value or object to evaluate
83171     */
83172    protected function matches($other) : bool
83173    {
83174        return file_exists($other);
83175    }
83176    /**
83177     * Returns the description of the failure.
83178     *
83179     * The beginning of failure messages is "Failed asserting that" in most
83180     * cases. This method should return the second part of that sentence.
83181     *
83182     * @param mixed $other evaluated value or object
83183     */
83184    protected function failureDescription($other) : string
83185    {
83186        return sprintf('file "%s" exists', $other);
83187    }
83188}
83189<?php
83190
83191declare (strict_types=1);
83192/*
83193 * This file is part of PHPUnit.
83194 *
83195 * (c) Sebastian Bergmann <sebastian@phpunit.de>
83196 *
83197 * For the full copyright and license information, please view the LICENSE
83198 * file that was distributed with this source code.
83199 */
83200namespace PHPUnit\Framework\Constraint;
83201
83202use function is_writable;
83203use function sprintf;
83204/**
83205 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
83206 */
83207final class IsWritable extends \PHPUnit\Framework\Constraint\Constraint
83208{
83209    /**
83210     * Returns a string representation of the constraint.
83211     */
83212    public function toString() : string
83213    {
83214        return 'is writable';
83215    }
83216    /**
83217     * Evaluates the constraint for parameter $other. Returns true if the
83218     * constraint is met, false otherwise.
83219     *
83220     * @param mixed $other value or object to evaluate
83221     */
83222    protected function matches($other) : bool
83223    {
83224        return is_writable($other);
83225    }
83226    /**
83227     * Returns the description of the failure.
83228     *
83229     * The beginning of failure messages is "Failed asserting that" in most
83230     * cases. This method should return the second part of that sentence.
83231     *
83232     * @param mixed $other evaluated value or object
83233     */
83234    protected function failureDescription($other) : string
83235    {
83236        return sprintf('"%s" is writable', $other);
83237    }
83238}
83239<?php
83240
83241declare (strict_types=1);
83242/*
83243 * This file is part of PHPUnit.
83244 *
83245 * (c) Sebastian Bergmann <sebastian@phpunit.de>
83246 *
83247 * For the full copyright and license information, please view the LICENSE
83248 * file that was distributed with this source code.
83249 */
83250namespace PHPUnit\Framework\Constraint;
83251
83252use function is_dir;
83253use function sprintf;
83254/**
83255 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
83256 */
83257final class DirectoryExists extends \PHPUnit\Framework\Constraint\Constraint
83258{
83259    /**
83260     * Returns a string representation of the constraint.
83261     */
83262    public function toString() : string
83263    {
83264        return 'directory exists';
83265    }
83266    /**
83267     * Evaluates the constraint for parameter $other. Returns true if the
83268     * constraint is met, false otherwise.
83269     *
83270     * @param mixed $other value or object to evaluate
83271     */
83272    protected function matches($other) : bool
83273    {
83274        return is_dir($other);
83275    }
83276    /**
83277     * Returns the description of the failure.
83278     *
83279     * The beginning of failure messages is "Failed asserting that" in most
83280     * cases. This method should return the second part of that sentence.
83281     *
83282     * @param mixed $other evaluated value or object
83283     */
83284    protected function failureDescription($other) : string
83285    {
83286        return sprintf('directory "%s" exists', $other);
83287    }
83288}
83289<?php
83290
83291declare (strict_types=1);
83292/*
83293 * This file is part of PHPUnit.
83294 *
83295 * (c) Sebastian Bergmann <sebastian@phpunit.de>
83296 *
83297 * For the full copyright and license information, please view the LICENSE
83298 * file that was distributed with this source code.
83299 */
83300namespace PHPUnit\Framework\Constraint;
83301
83302use function is_readable;
83303use function sprintf;
83304/**
83305 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
83306 */
83307final class IsReadable extends \PHPUnit\Framework\Constraint\Constraint
83308{
83309    /**
83310     * Returns a string representation of the constraint.
83311     */
83312    public function toString() : string
83313    {
83314        return 'is readable';
83315    }
83316    /**
83317     * Evaluates the constraint for parameter $other. Returns true if the
83318     * constraint is met, false otherwise.
83319     *
83320     * @param mixed $other value or object to evaluate
83321     */
83322    protected function matches($other) : bool
83323    {
83324        return is_readable($other);
83325    }
83326    /**
83327     * Returns the description of the failure.
83328     *
83329     * The beginning of failure messages is "Failed asserting that" in most
83330     * cases. This method should return the second part of that sentence.
83331     *
83332     * @param mixed $other evaluated value or object
83333     */
83334    protected function failureDescription($other) : string
83335    {
83336        return sprintf('"%s" is readable', $other);
83337    }
83338}
83339<?php
83340
83341declare (strict_types=1);
83342/*
83343 * This file is part of PHPUnit.
83344 *
83345 * (c) Sebastian Bergmann <sebastian@phpunit.de>
83346 *
83347 * For the full copyright and license information, please view the LICENSE
83348 * file that was distributed with this source code.
83349 */
83350namespace PHPUnit\Framework\Constraint;
83351
83352/**
83353 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
83354 */
83355final class IsTrue extends \PHPUnit\Framework\Constraint\Constraint
83356{
83357    /**
83358     * Returns a string representation of the constraint.
83359     */
83360    public function toString() : string
83361    {
83362        return 'is true';
83363    }
83364    /**
83365     * Evaluates the constraint for parameter $other. Returns true if the
83366     * constraint is met, false otherwise.
83367     *
83368     * @param mixed $other value or object to evaluate
83369     */
83370    protected function matches($other) : bool
83371    {
83372        return $other === \true;
83373    }
83374}
83375<?php
83376
83377declare (strict_types=1);
83378/*
83379 * This file is part of PHPUnit.
83380 *
83381 * (c) Sebastian Bergmann <sebastian@phpunit.de>
83382 *
83383 * For the full copyright and license information, please view the LICENSE
83384 * file that was distributed with this source code.
83385 */
83386namespace PHPUnit\Framework\Constraint;
83387
83388/**
83389 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
83390 */
83391final class IsFalse extends \PHPUnit\Framework\Constraint\Constraint
83392{
83393    /**
83394     * Returns a string representation of the constraint.
83395     */
83396    public function toString() : string
83397    {
83398        return 'is false';
83399    }
83400    /**
83401     * Evaluates the constraint for parameter $other. Returns true if the
83402     * constraint is met, false otherwise.
83403     *
83404     * @param mixed $other value or object to evaluate
83405     */
83406    protected function matches($other) : bool
83407    {
83408        return $other === \false;
83409    }
83410}
83411<?php
83412
83413declare (strict_types=1);
83414/*
83415 * This file is part of PHPUnit.
83416 *
83417 * (c) Sebastian Bergmann <sebastian@phpunit.de>
83418 *
83419 * For the full copyright and license information, please view the LICENSE
83420 * file that was distributed with this source code.
83421 */
83422namespace PHPUnit\Framework\Constraint;
83423
83424use function is_string;
83425use function sprintf;
83426use function strpos;
83427use function trim;
83428use PHPUnit\Framework\ExpectationFailedException;
83429use PHPUnit\SebastianBergmann\Comparator\ComparisonFailure;
83430use PHPUnit\SebastianBergmann\Comparator\Factory as ComparatorFactory;
83431/**
83432 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
83433 */
83434final class IsEqualCanonicalizing extends \PHPUnit\Framework\Constraint\Constraint
83435{
83436    /**
83437     * @var mixed
83438     */
83439    private $value;
83440    public function __construct($value)
83441    {
83442        $this->value = $value;
83443    }
83444    /**
83445     * Evaluates the constraint for parameter $other.
83446     *
83447     * If $returnResult is set to false (the default), an exception is thrown
83448     * in case of a failure. null is returned otherwise.
83449     *
83450     * If $returnResult is true, the result of the evaluation is returned as
83451     * a boolean value instead: true in case of success, false in case of a
83452     * failure.
83453     *
83454     * @throws ExpectationFailedException
83455     */
83456    public function evaluate($other, string $description = '', bool $returnResult = \false) : ?bool
83457    {
83458        // If $this->value and $other are identical, they are also equal.
83459        // This is the most common path and will allow us to skip
83460        // initialization of all the comparators.
83461        if ($this->value === $other) {
83462            return \true;
83463        }
83464        $comparatorFactory = ComparatorFactory::getInstance();
83465        try {
83466            $comparator = $comparatorFactory->getComparatorFor($this->value, $other);
83467            $comparator->assertEquals($this->value, $other, 0.0, \true, \false);
83468        } catch (ComparisonFailure $f) {
83469            if ($returnResult) {
83470                return \false;
83471            }
83472            throw new ExpectationFailedException(trim($description . "\n" . $f->getMessage()), $f);
83473        }
83474        return \true;
83475    }
83476    /**
83477     * Returns a string representation of the constraint.
83478     *
83479     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
83480     */
83481    public function toString() : string
83482    {
83483        if (is_string($this->value)) {
83484            if (strpos($this->value, "\n") !== \false) {
83485                return 'is equal to <text>';
83486            }
83487            return sprintf("is equal to '%s'", $this->value);
83488        }
83489        return sprintf('is equal to %s', $this->exporter()->export($this->value));
83490    }
83491}
83492<?php
83493
83494declare (strict_types=1);
83495/*
83496 * This file is part of PHPUnit.
83497 *
83498 * (c) Sebastian Bergmann <sebastian@phpunit.de>
83499 *
83500 * For the full copyright and license information, please view the LICENSE
83501 * file that was distributed with this source code.
83502 */
83503namespace PHPUnit\Framework\Constraint;
83504
83505use function is_string;
83506use function sprintf;
83507use function strpos;
83508use function trim;
83509use PHPUnit\Framework\ExpectationFailedException;
83510use PHPUnit\SebastianBergmann\Comparator\ComparisonFailure;
83511use PHPUnit\SebastianBergmann\Comparator\Factory as ComparatorFactory;
83512/**
83513 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
83514 */
83515final class IsEqualIgnoringCase extends \PHPUnit\Framework\Constraint\Constraint
83516{
83517    /**
83518     * @var mixed
83519     */
83520    private $value;
83521    public function __construct($value)
83522    {
83523        $this->value = $value;
83524    }
83525    /**
83526     * Evaluates the constraint for parameter $other.
83527     *
83528     * If $returnResult is set to false (the default), an exception is thrown
83529     * in case of a failure. null is returned otherwise.
83530     *
83531     * If $returnResult is true, the result of the evaluation is returned as
83532     * a boolean value instead: true in case of success, false in case of a
83533     * failure.
83534     *
83535     * @throws ExpectationFailedException
83536     */
83537    public function evaluate($other, string $description = '', bool $returnResult = \false) : ?bool
83538    {
83539        // If $this->value and $other are identical, they are also equal.
83540        // This is the most common path and will allow us to skip
83541        // initialization of all the comparators.
83542        if ($this->value === $other) {
83543            return \true;
83544        }
83545        $comparatorFactory = ComparatorFactory::getInstance();
83546        try {
83547            $comparator = $comparatorFactory->getComparatorFor($this->value, $other);
83548            $comparator->assertEquals($this->value, $other, 0.0, \false, \true);
83549        } catch (ComparisonFailure $f) {
83550            if ($returnResult) {
83551                return \false;
83552            }
83553            throw new ExpectationFailedException(trim($description . "\n" . $f->getMessage()), $f);
83554        }
83555        return \true;
83556    }
83557    /**
83558     * Returns a string representation of the constraint.
83559     *
83560     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
83561     */
83562    public function toString() : string
83563    {
83564        if (is_string($this->value)) {
83565            if (strpos($this->value, "\n") !== \false) {
83566                return 'is equal to <text>';
83567            }
83568            return sprintf("is equal to '%s'", $this->value);
83569        }
83570        return sprintf('is equal to %s', $this->exporter()->export($this->value));
83571    }
83572}
83573<?php
83574
83575declare (strict_types=1);
83576/*
83577 * This file is part of PHPUnit.
83578 *
83579 * (c) Sebastian Bergmann <sebastian@phpunit.de>
83580 *
83581 * For the full copyright and license information, please view the LICENSE
83582 * file that was distributed with this source code.
83583 */
83584namespace PHPUnit\Framework\Constraint;
83585
83586use function sprintf;
83587use function trim;
83588use PHPUnit\Framework\ExpectationFailedException;
83589use PHPUnit\SebastianBergmann\Comparator\ComparisonFailure;
83590use PHPUnit\SebastianBergmann\Comparator\Factory as ComparatorFactory;
83591/**
83592 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
83593 */
83594final class IsEqualWithDelta extends \PHPUnit\Framework\Constraint\Constraint
83595{
83596    /**
83597     * @var mixed
83598     */
83599    private $value;
83600    /**
83601     * @var float
83602     */
83603    private $delta;
83604    public function __construct($value, float $delta)
83605    {
83606        $this->value = $value;
83607        $this->delta = $delta;
83608    }
83609    /**
83610     * Evaluates the constraint for parameter $other.
83611     *
83612     * If $returnResult is set to false (the default), an exception is thrown
83613     * in case of a failure. null is returned otherwise.
83614     *
83615     * If $returnResult is true, the result of the evaluation is returned as
83616     * a boolean value instead: true in case of success, false in case of a
83617     * failure.
83618     *
83619     * @throws ExpectationFailedException
83620     */
83621    public function evaluate($other, string $description = '', bool $returnResult = \false) : ?bool
83622    {
83623        // If $this->value and $other are identical, they are also equal.
83624        // This is the most common path and will allow us to skip
83625        // initialization of all the comparators.
83626        if ($this->value === $other) {
83627            return \true;
83628        }
83629        $comparatorFactory = ComparatorFactory::getInstance();
83630        try {
83631            $comparator = $comparatorFactory->getComparatorFor($this->value, $other);
83632            $comparator->assertEquals($this->value, $other, $this->delta);
83633        } catch (ComparisonFailure $f) {
83634            if ($returnResult) {
83635                return \false;
83636            }
83637            throw new ExpectationFailedException(trim($description . "\n" . $f->getMessage()), $f);
83638        }
83639        return \true;
83640    }
83641    /**
83642     * Returns a string representation of the constraint.
83643     *
83644     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
83645     */
83646    public function toString() : string
83647    {
83648        return sprintf('is equal to %s with delta <%F>>', $this->exporter()->export($this->value), $this->delta);
83649    }
83650}
83651<?php
83652
83653declare (strict_types=1);
83654/*
83655 * This file is part of PHPUnit.
83656 *
83657 * (c) Sebastian Bergmann <sebastian@phpunit.de>
83658 *
83659 * For the full copyright and license information, please view the LICENSE
83660 * file that was distributed with this source code.
83661 */
83662namespace PHPUnit\Framework\Constraint;
83663
83664use function is_string;
83665use function sprintf;
83666use function strpos;
83667use function trim;
83668use PHPUnit\Framework\ExpectationFailedException;
83669use PHPUnit\SebastianBergmann\Comparator\ComparisonFailure;
83670use PHPUnit\SebastianBergmann\Comparator\Factory as ComparatorFactory;
83671/**
83672 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
83673 */
83674final class IsEqual extends \PHPUnit\Framework\Constraint\Constraint
83675{
83676    /**
83677     * @var mixed
83678     */
83679    private $value;
83680    /**
83681     * @var float
83682     */
83683    private $delta;
83684    /**
83685     * @var bool
83686     */
83687    private $canonicalize;
83688    /**
83689     * @var bool
83690     */
83691    private $ignoreCase;
83692    public function __construct($value, float $delta = 0.0, bool $canonicalize = \false, bool $ignoreCase = \false)
83693    {
83694        $this->value = $value;
83695        $this->delta = $delta;
83696        $this->canonicalize = $canonicalize;
83697        $this->ignoreCase = $ignoreCase;
83698    }
83699    /**
83700     * Evaluates the constraint for parameter $other.
83701     *
83702     * If $returnResult is set to false (the default), an exception is thrown
83703     * in case of a failure. null is returned otherwise.
83704     *
83705     * If $returnResult is true, the result of the evaluation is returned as
83706     * a boolean value instead: true in case of success, false in case of a
83707     * failure.
83708     *
83709     * @throws ExpectationFailedException
83710     *
83711     * @return bool
83712     */
83713    public function evaluate($other, string $description = '', bool $returnResult = \false) : ?bool
83714    {
83715        // If $this->value and $other are identical, they are also equal.
83716        // This is the most common path and will allow us to skip
83717        // initialization of all the comparators.
83718        if ($this->value === $other) {
83719            return \true;
83720        }
83721        $comparatorFactory = ComparatorFactory::getInstance();
83722        try {
83723            $comparator = $comparatorFactory->getComparatorFor($this->value, $other);
83724            $comparator->assertEquals($this->value, $other, $this->delta, $this->canonicalize, $this->ignoreCase);
83725        } catch (ComparisonFailure $f) {
83726            if ($returnResult) {
83727                return \false;
83728            }
83729            throw new ExpectationFailedException(trim($description . "\n" . $f->getMessage()), $f);
83730        }
83731        return \true;
83732    }
83733    /**
83734     * Returns a string representation of the constraint.
83735     *
83736     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
83737     */
83738    public function toString() : string
83739    {
83740        $delta = '';
83741        if (is_string($this->value)) {
83742            if (strpos($this->value, "\n") !== \false) {
83743                return 'is equal to <text>';
83744            }
83745            return sprintf("is equal to '%s'", $this->value);
83746        }
83747        if ($this->delta != 0) {
83748            $delta = sprintf(' with delta <%F>', $this->delta);
83749        }
83750        return sprintf('is equal to %s%s', $this->exporter()->export($this->value), $delta);
83751    }
83752}
83753<?php
83754
83755declare (strict_types=1);
83756/*
83757 * This file is part of PHPUnit.
83758 *
83759 * (c) Sebastian Bergmann <sebastian@phpunit.de>
83760 *
83761 * For the full copyright and license information, please view the LICENSE
83762 * file that was distributed with this source code.
83763 */
83764namespace PHPUnit\Framework\Constraint;
83765
83766/**
83767 * @psalm-template CallbackInput of mixed
83768 *
83769 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
83770 */
83771final class Callback extends \PHPUnit\Framework\Constraint\Constraint
83772{
83773    /**
83774     * @var callable
83775     *
83776     * @psalm-var callable(CallbackInput $input): bool
83777     */
83778    private $callback;
83779    /** @psalm-param callable(CallbackInput $input): bool $callback */
83780    public function __construct(callable $callback)
83781    {
83782        $this->callback = $callback;
83783    }
83784    /**
83785     * Returns a string representation of the constraint.
83786     */
83787    public function toString() : string
83788    {
83789        return 'is accepted by specified callback';
83790    }
83791    /**
83792     * Evaluates the constraint for parameter $value. Returns true if the
83793     * constraint is met, false otherwise.
83794     *
83795     * @param mixed $other value or object to evaluate
83796     *
83797     * @psalm-param CallbackInput $other
83798     */
83799    protected function matches($other) : bool
83800    {
83801        return ($this->callback)($other);
83802    }
83803}
83804<?php
83805
83806declare (strict_types=1);
83807/*
83808 * This file is part of PHPUnit.
83809 *
83810 * (c) Sebastian Bergmann <sebastian@phpunit.de>
83811 *
83812 * For the full copyright and license information, please view the LICENSE
83813 * file that was distributed with this source code.
83814 */
83815namespace PHPUnit\Framework\Constraint;
83816
83817use PHPUnit\Framework\ExpectationFailedException;
83818/**
83819 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
83820 */
83821final class IsAnything extends \PHPUnit\Framework\Constraint\Constraint
83822{
83823    /**
83824     * Evaluates the constraint for parameter $other.
83825     *
83826     * If $returnResult is set to false (the default), an exception is thrown
83827     * in case of a failure. null is returned otherwise.
83828     *
83829     * If $returnResult is true, the result of the evaluation is returned as
83830     * a boolean value instead: true in case of success, false in case of a
83831     * failure.
83832     *
83833     * @throws ExpectationFailedException
83834     */
83835    public function evaluate($other, string $description = '', bool $returnResult = \false) : ?bool
83836    {
83837        return $returnResult ? \true : null;
83838    }
83839    /**
83840     * Returns a string representation of the constraint.
83841     */
83842    public function toString() : string
83843    {
83844        return 'is anything';
83845    }
83846    /**
83847     * Counts the number of constraint elements.
83848     */
83849    public function count() : int
83850    {
83851        return 0;
83852    }
83853}
83854<?php
83855
83856declare (strict_types=1);
83857/*
83858 * This file is part of PHPUnit.
83859 *
83860 * (c) Sebastian Bergmann <sebastian@phpunit.de>
83861 *
83862 * For the full copyright and license information, please view the LICENSE
83863 * file that was distributed with this source code.
83864 */
83865namespace PHPUnit\Framework\Constraint;
83866
83867use function is_nan;
83868/**
83869 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
83870 */
83871final class IsNan extends \PHPUnit\Framework\Constraint\Constraint
83872{
83873    /**
83874     * Returns a string representation of the constraint.
83875     */
83876    public function toString() : string
83877    {
83878        return 'is nan';
83879    }
83880    /**
83881     * Evaluates the constraint for parameter $other. Returns true if the
83882     * constraint is met, false otherwise.
83883     *
83884     * @param mixed $other value or object to evaluate
83885     */
83886    protected function matches($other) : bool
83887    {
83888        return is_nan($other);
83889    }
83890}
83891<?php
83892
83893declare (strict_types=1);
83894/*
83895 * This file is part of PHPUnit.
83896 *
83897 * (c) Sebastian Bergmann <sebastian@phpunit.de>
83898 *
83899 * For the full copyright and license information, please view the LICENSE
83900 * file that was distributed with this source code.
83901 */
83902namespace PHPUnit\Framework\Constraint;
83903
83904use function is_finite;
83905/**
83906 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
83907 */
83908final class IsFinite extends \PHPUnit\Framework\Constraint\Constraint
83909{
83910    /**
83911     * Returns a string representation of the constraint.
83912     */
83913    public function toString() : string
83914    {
83915        return 'is finite';
83916    }
83917    /**
83918     * Evaluates the constraint for parameter $other. Returns true if the
83919     * constraint is met, false otherwise.
83920     *
83921     * @param mixed $other value or object to evaluate
83922     */
83923    protected function matches($other) : bool
83924    {
83925        return is_finite($other);
83926    }
83927}
83928<?php
83929
83930declare (strict_types=1);
83931/*
83932 * This file is part of PHPUnit.
83933 *
83934 * (c) Sebastian Bergmann <sebastian@phpunit.de>
83935 *
83936 * For the full copyright and license information, please view the LICENSE
83937 * file that was distributed with this source code.
83938 */
83939namespace PHPUnit\Framework\Constraint;
83940
83941use function is_infinite;
83942/**
83943 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
83944 */
83945final class IsInfinite extends \PHPUnit\Framework\Constraint\Constraint
83946{
83947    /**
83948     * Returns a string representation of the constraint.
83949     */
83950    public function toString() : string
83951    {
83952        return 'is infinite';
83953    }
83954    /**
83955     * Evaluates the constraint for parameter $other. Returns true if the
83956     * constraint is met, false otherwise.
83957     *
83958     * @param mixed $other value or object to evaluate
83959     */
83960    protected function matches($other) : bool
83961    {
83962        return is_infinite($other);
83963    }
83964}
83965<?php
83966
83967declare (strict_types=1);
83968/*
83969 * This file is part of PHPUnit.
83970 *
83971 * (c) Sebastian Bergmann <sebastian@phpunit.de>
83972 *
83973 * For the full copyright and license information, please view the LICENSE
83974 * file that was distributed with this source code.
83975 */
83976namespace PHPUnit\Framework\Constraint;
83977
83978use function count;
83979use function is_array;
83980use function iterator_count;
83981use function sprintf;
83982use Countable;
83983use EmptyIterator;
83984use Generator;
83985use Iterator;
83986use IteratorAggregate;
83987use PHPUnit\Framework\Exception;
83988use Traversable;
83989/**
83990 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
83991 */
83992class Count extends \PHPUnit\Framework\Constraint\Constraint
83993{
83994    /**
83995     * @var int
83996     */
83997    private $expectedCount;
83998    public function __construct(int $expected)
83999    {
84000        $this->expectedCount = $expected;
84001    }
84002    public function toString() : string
84003    {
84004        return sprintf('count matches %d', $this->expectedCount);
84005    }
84006    /**
84007     * Evaluates the constraint for parameter $other. Returns true if the
84008     * constraint is met, false otherwise.
84009     *
84010     * @throws Exception
84011     */
84012    protected function matches($other) : bool
84013    {
84014        return $this->expectedCount === $this->getCountOf($other);
84015    }
84016    /**
84017     * @throws Exception
84018     */
84019    protected function getCountOf($other) : ?int
84020    {
84021        if ($other instanceof Countable || is_array($other)) {
84022            return count($other);
84023        }
84024        if ($other instanceof EmptyIterator) {
84025            return 0;
84026        }
84027        if ($other instanceof Traversable) {
84028            while ($other instanceof IteratorAggregate) {
84029                try {
84030                    $other = $other->getIterator();
84031                } catch (\Exception $e) {
84032                    throw new Exception($e->getMessage(), $e->getCode(), $e);
84033                }
84034            }
84035            $iterator = $other;
84036            if ($iterator instanceof Generator) {
84037                return $this->getCountOfGenerator($iterator);
84038            }
84039            if (!$iterator instanceof Iterator) {
84040                return iterator_count($iterator);
84041            }
84042            $key = $iterator->key();
84043            $count = iterator_count($iterator);
84044            // Manually rewind $iterator to previous key, since iterator_count
84045            // moves pointer.
84046            if ($key !== null) {
84047                $iterator->rewind();
84048                while ($iterator->valid() && $key !== $iterator->key()) {
84049                    $iterator->next();
84050                }
84051            }
84052            return $count;
84053        }
84054        return null;
84055    }
84056    /**
84057     * Returns the total number of iterations from a generator.
84058     * This will fully exhaust the generator.
84059     */
84060    protected function getCountOfGenerator(Generator $generator) : int
84061    {
84062        for ($count = 0; $generator->valid(); $generator->next()) {
84063            $count++;
84064        }
84065        return $count;
84066    }
84067    /**
84068     * Returns the description of the failure.
84069     *
84070     * The beginning of failure messages is "Failed asserting that" in most
84071     * cases. This method should return the second part of that sentence.
84072     *
84073     * @param mixed $other evaluated value or object
84074     */
84075    protected function failureDescription($other) : string
84076    {
84077        return sprintf('actual size %d matches expected size %d', (int) $this->getCountOf($other), $this->expectedCount);
84078    }
84079}
84080<?php
84081
84082declare (strict_types=1);
84083/*
84084 * This file is part of PHPUnit.
84085 *
84086 * (c) Sebastian Bergmann <sebastian@phpunit.de>
84087 *
84088 * For the full copyright and license information, please view the LICENSE
84089 * file that was distributed with this source code.
84090 */
84091namespace PHPUnit\Framework\Constraint;
84092
84093/**
84094 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
84095 */
84096final class GreaterThan extends \PHPUnit\Framework\Constraint\Constraint
84097{
84098    /**
84099     * @var float|int
84100     */
84101    private $value;
84102    /**
84103     * @param float|int $value
84104     */
84105    public function __construct($value)
84106    {
84107        $this->value = $value;
84108    }
84109    /**
84110     * Returns a string representation of the constraint.
84111     *
84112     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
84113     */
84114    public function toString() : string
84115    {
84116        return 'is greater than ' . $this->exporter()->export($this->value);
84117    }
84118    /**
84119     * Evaluates the constraint for parameter $other. Returns true if the
84120     * constraint is met, false otherwise.
84121     *
84122     * @param mixed $other value or object to evaluate
84123     */
84124    protected function matches($other) : bool
84125    {
84126        return $this->value < $other;
84127    }
84128}
84129<?php
84130
84131declare (strict_types=1);
84132/*
84133 * This file is part of PHPUnit.
84134 *
84135 * (c) Sebastian Bergmann <sebastian@phpunit.de>
84136 *
84137 * For the full copyright and license information, please view the LICENSE
84138 * file that was distributed with this source code.
84139 */
84140namespace PHPUnit\Framework\Constraint;
84141
84142use function count;
84143use function gettype;
84144use function sprintf;
84145use function strpos;
84146use Countable;
84147use EmptyIterator;
84148/**
84149 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
84150 */
84151final class IsEmpty extends \PHPUnit\Framework\Constraint\Constraint
84152{
84153    /**
84154     * Returns a string representation of the constraint.
84155     */
84156    public function toString() : string
84157    {
84158        return 'is empty';
84159    }
84160    /**
84161     * Evaluates the constraint for parameter $other. Returns true if the
84162     * constraint is met, false otherwise.
84163     *
84164     * @param mixed $other value or object to evaluate
84165     */
84166    protected function matches($other) : bool
84167    {
84168        if ($other instanceof EmptyIterator) {
84169            return \true;
84170        }
84171        if ($other instanceof Countable) {
84172            return count($other) === 0;
84173        }
84174        return empty($other);
84175    }
84176    /**
84177     * Returns the description of the failure.
84178     *
84179     * The beginning of failure messages is "Failed asserting that" in most
84180     * cases. This method should return the second part of that sentence.
84181     *
84182     * @param mixed $other evaluated value or object
84183     */
84184    protected function failureDescription($other) : string
84185    {
84186        $type = gettype($other);
84187        return sprintf('%s %s %s', strpos($type, 'a') === 0 || strpos($type, 'o') === 0 ? 'an' : 'a', $type, $this->toString());
84188    }
84189}
84190<?php
84191
84192declare (strict_types=1);
84193/*
84194 * This file is part of PHPUnit.
84195 *
84196 * (c) Sebastian Bergmann <sebastian@phpunit.de>
84197 *
84198 * For the full copyright and license information, please view the LICENSE
84199 * file that was distributed with this source code.
84200 */
84201namespace PHPUnit\Framework\Constraint;
84202
84203/**
84204 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
84205 */
84206final class LessThan extends \PHPUnit\Framework\Constraint\Constraint
84207{
84208    /**
84209     * @var float|int
84210     */
84211    private $value;
84212    /**
84213     * @param float|int $value
84214     */
84215    public function __construct($value)
84216    {
84217        $this->value = $value;
84218    }
84219    /**
84220     * Returns a string representation of the constraint.
84221     *
84222     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
84223     */
84224    public function toString() : string
84225    {
84226        return 'is less than ' . $this->exporter()->export($this->value);
84227    }
84228    /**
84229     * Evaluates the constraint for parameter $other. Returns true if the
84230     * constraint is met, false otherwise.
84231     *
84232     * @param mixed $other value or object to evaluate
84233     */
84234    protected function matches($other) : bool
84235    {
84236        return $this->value > $other;
84237    }
84238}
84239<?php
84240
84241declare (strict_types=1);
84242/*
84243 * This file is part of PHPUnit.
84244 *
84245 * (c) Sebastian Bergmann <sebastian@phpunit.de>
84246 *
84247 * For the full copyright and license information, please view the LICENSE
84248 * file that was distributed with this source code.
84249 */
84250namespace PHPUnit\Framework\Constraint;
84251
84252/**
84253 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
84254 */
84255final class SameSize extends \PHPUnit\Framework\Constraint\Count
84256{
84257    public function __construct(iterable $expected)
84258    {
84259        parent::__construct((int) $this->getCountOf($expected));
84260    }
84261}
84262<?php
84263
84264declare (strict_types=1);
84265/*
84266 * This file is part of PHPUnit.
84267 *
84268 * (c) Sebastian Bergmann <sebastian@phpunit.de>
84269 *
84270 * For the full copyright and license information, please view the LICENSE
84271 * file that was distributed with this source code.
84272 */
84273namespace PHPUnit\Framework\Constraint;
84274
84275use function abs;
84276use function get_class;
84277use function is_array;
84278use function is_float;
84279use function is_infinite;
84280use function is_nan;
84281use function is_object;
84282use function is_string;
84283use function sprintf;
84284use PHPUnit\Framework\ExpectationFailedException;
84285use PHPUnit\SebastianBergmann\Comparator\ComparisonFailure;
84286/**
84287 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
84288 */
84289final class IsIdentical extends \PHPUnit\Framework\Constraint\Constraint
84290{
84291    /**
84292     * @var float
84293     */
84294    private const EPSILON = 1.0E-10;
84295    /**
84296     * @var mixed
84297     */
84298    private $value;
84299    public function __construct($value)
84300    {
84301        $this->value = $value;
84302    }
84303    /**
84304     * Evaluates the constraint for parameter $other.
84305     *
84306     * If $returnResult is set to false (the default), an exception is thrown
84307     * in case of a failure. null is returned otherwise.
84308     *
84309     * If $returnResult is true, the result of the evaluation is returned as
84310     * a boolean value instead: true in case of success, false in case of a
84311     * failure.
84312     *
84313     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
84314     * @throws ExpectationFailedException
84315     */
84316    public function evaluate($other, string $description = '', bool $returnResult = \false) : ?bool
84317    {
84318        if (is_float($this->value) && is_float($other) && !is_infinite($this->value) && !is_infinite($other) && !is_nan($this->value) && !is_nan($other)) {
84319            $success = abs($this->value - $other) < self::EPSILON;
84320        } else {
84321            $success = $this->value === $other;
84322        }
84323        if ($returnResult) {
84324            return $success;
84325        }
84326        if (!$success) {
84327            $f = null;
84328            // if both values are strings, make sure a diff is generated
84329            if (is_string($this->value) && is_string($other)) {
84330                $f = new ComparisonFailure($this->value, $other, sprintf("'%s'", $this->value), sprintf("'%s'", $other));
84331            }
84332            // if both values are array, make sure a diff is generated
84333            if (is_array($this->value) && is_array($other)) {
84334                $f = new ComparisonFailure($this->value, $other, $this->exporter()->export($this->value), $this->exporter()->export($other));
84335            }
84336            $this->fail($other, $description, $f);
84337        }
84338        return null;
84339    }
84340    /**
84341     * Returns a string representation of the constraint.
84342     *
84343     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
84344     */
84345    public function toString() : string
84346    {
84347        if (is_object($this->value)) {
84348            return 'is identical to an object of class "' . get_class($this->value) . '"';
84349        }
84350        return 'is identical to ' . $this->exporter()->export($this->value);
84351    }
84352    /**
84353     * Returns the description of the failure.
84354     *
84355     * The beginning of failure messages is "Failed asserting that" in most
84356     * cases. This method should return the second part of that sentence.
84357     *
84358     * @param mixed $other evaluated value or object
84359     *
84360     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
84361     */
84362    protected function failureDescription($other) : string
84363    {
84364        if (is_object($this->value) && is_object($other)) {
84365            return 'two variables reference the same object';
84366        }
84367        if (is_string($this->value) && is_string($other)) {
84368            return 'two strings are identical';
84369        }
84370        if (is_array($this->value) && is_array($other)) {
84371            return 'two arrays are identical';
84372        }
84373        return parent::failureDescription($other);
84374    }
84375}
84376<?php
84377
84378declare (strict_types=1);
84379/*
84380 * This file is part of PHPUnit.
84381 *
84382 * (c) Sebastian Bergmann <sebastian@phpunit.de>
84383 *
84384 * For the full copyright and license information, please view the LICENSE
84385 * file that was distributed with this source code.
84386 */
84387namespace PHPUnit\Framework\Constraint;
84388
84389use function get_class;
84390use function is_object;
84391use PHPUnit\Framework\ActualValueIsNotAnObjectException;
84392use PHPUnit\Framework\ComparisonMethodDoesNotAcceptParameterTypeException;
84393use PHPUnit\Framework\ComparisonMethodDoesNotDeclareBoolReturnTypeException;
84394use PHPUnit\Framework\ComparisonMethodDoesNotDeclareExactlyOneParameterException;
84395use PHPUnit\Framework\ComparisonMethodDoesNotDeclareParameterTypeException;
84396use PHPUnit\Framework\ComparisonMethodDoesNotExistException;
84397use ReflectionNamedType;
84398use ReflectionObject;
84399/**
84400 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
84401 */
84402final class ObjectEquals extends \PHPUnit\Framework\Constraint\Constraint
84403{
84404    /**
84405     * @var object
84406     */
84407    private $expected;
84408    /**
84409     * @var string
84410     */
84411    private $method;
84412    public function __construct(object $object, string $method = 'equals')
84413    {
84414        $this->expected = $object;
84415        $this->method = $method;
84416    }
84417    public function toString() : string
84418    {
84419        return 'two objects are equal';
84420    }
84421    /**
84422     * @throws ActualValueIsNotAnObjectException
84423     * @throws ComparisonMethodDoesNotAcceptParameterTypeException
84424     * @throws ComparisonMethodDoesNotDeclareBoolReturnTypeException
84425     * @throws ComparisonMethodDoesNotDeclareExactlyOneParameterException
84426     * @throws ComparisonMethodDoesNotDeclareParameterTypeException
84427     * @throws ComparisonMethodDoesNotExistException
84428     */
84429    protected function matches($other) : bool
84430    {
84431        if (!is_object($other)) {
84432            throw new ActualValueIsNotAnObjectException();
84433        }
84434        $object = new ReflectionObject($other);
84435        if (!$object->hasMethod($this->method)) {
84436            throw new ComparisonMethodDoesNotExistException(get_class($other), $this->method);
84437        }
84438        /** @noinspection PhpUnhandledExceptionInspection */
84439        $method = $object->getMethod($this->method);
84440        if (!$method->hasReturnType()) {
84441            throw new ComparisonMethodDoesNotDeclareBoolReturnTypeException(get_class($other), $this->method);
84442        }
84443        $returnType = $method->getReturnType();
84444        if (!$returnType instanceof ReflectionNamedType) {
84445            throw new ComparisonMethodDoesNotDeclareBoolReturnTypeException(get_class($other), $this->method);
84446        }
84447        if ($returnType->allowsNull()) {
84448            throw new ComparisonMethodDoesNotDeclareBoolReturnTypeException(get_class($other), $this->method);
84449        }
84450        if ($returnType->getName() !== 'bool') {
84451            throw new ComparisonMethodDoesNotDeclareBoolReturnTypeException(get_class($other), $this->method);
84452        }
84453        if ($method->getNumberOfParameters() !== 1 || $method->getNumberOfRequiredParameters() !== 1) {
84454            throw new ComparisonMethodDoesNotDeclareExactlyOneParameterException(get_class($other), $this->method);
84455        }
84456        $parameter = $method->getParameters()[0];
84457        if (!$parameter->hasType()) {
84458            throw new ComparisonMethodDoesNotDeclareParameterTypeException(get_class($other), $this->method);
84459        }
84460        $type = $parameter->getType();
84461        if (!$type instanceof ReflectionNamedType) {
84462            throw new ComparisonMethodDoesNotDeclareParameterTypeException(get_class($other), $this->method);
84463        }
84464        $typeName = $type->getName();
84465        if ($typeName === 'self') {
84466            $typeName = get_class($other);
84467        }
84468        if (!$this->expected instanceof $typeName) {
84469            throw new ComparisonMethodDoesNotAcceptParameterTypeException(get_class($other), $this->method, get_class($this->expected));
84470        }
84471        return $other->{$this->method}($this->expected);
84472    }
84473    protected function failureDescription($other) : string
84474    {
84475        return $this->toString();
84476    }
84477}
84478<?php
84479
84480declare (strict_types=1);
84481/*
84482 * This file is part of PHPUnit.
84483 *
84484 * (c) Sebastian Bergmann <sebastian@phpunit.de>
84485 *
84486 * For the full copyright and license information, please view the LICENSE
84487 * file that was distributed with this source code.
84488 */
84489namespace PHPUnit\Framework\Constraint;
84490
84491use ReflectionObject;
84492/**
84493 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
84494 */
84495final class ObjectHasAttribute extends \PHPUnit\Framework\Constraint\ClassHasAttribute
84496{
84497    /**
84498     * Evaluates the constraint for parameter $other. Returns true if the
84499     * constraint is met, false otherwise.
84500     *
84501     * @param mixed $other value or object to evaluate
84502     */
84503    protected function matches($other) : bool
84504    {
84505        return (new ReflectionObject($other))->hasProperty($this->attributeName());
84506    }
84507}
84508<?php
84509
84510declare (strict_types=1);
84511/*
84512 * This file is part of PHPUnit.
84513 *
84514 * (c) Sebastian Bergmann <sebastian@phpunit.de>
84515 *
84516 * For the full copyright and license information, please view the LICENSE
84517 * file that was distributed with this source code.
84518 */
84519namespace PHPUnit\Framework\Constraint;
84520
84521use function get_class;
84522use function is_object;
84523use function sprintf;
84524use PHPUnit\Framework\Exception;
84525use ReflectionClass;
84526use ReflectionException;
84527/**
84528 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
84529 */
84530class ClassHasAttribute extends \PHPUnit\Framework\Constraint\Constraint
84531{
84532    /**
84533     * @var string
84534     */
84535    private $attributeName;
84536    public function __construct(string $attributeName)
84537    {
84538        $this->attributeName = $attributeName;
84539    }
84540    /**
84541     * Returns a string representation of the constraint.
84542     */
84543    public function toString() : string
84544    {
84545        return sprintf('has attribute "%s"', $this->attributeName);
84546    }
84547    /**
84548     * Evaluates the constraint for parameter $other. Returns true if the
84549     * constraint is met, false otherwise.
84550     *
84551     * @param mixed $other value or object to evaluate
84552     */
84553    protected function matches($other) : bool
84554    {
84555        try {
84556            return (new ReflectionClass($other))->hasProperty($this->attributeName);
84557            // @codeCoverageIgnoreStart
84558        } catch (ReflectionException $e) {
84559            throw new Exception($e->getMessage(), (int) $e->getCode(), $e);
84560        }
84561        // @codeCoverageIgnoreEnd
84562    }
84563    /**
84564     * Returns the description of the failure.
84565     *
84566     * The beginning of failure messages is "Failed asserting that" in most
84567     * cases. This method should return the second part of that sentence.
84568     *
84569     * @param mixed $other evaluated value or object
84570     */
84571    protected function failureDescription($other) : string
84572    {
84573        return sprintf('%sclass "%s" %s', is_object($other) ? 'object of ' : '', is_object($other) ? get_class($other) : $other, $this->toString());
84574    }
84575    protected function attributeName() : string
84576    {
84577        return $this->attributeName;
84578    }
84579}
84580<?php
84581
84582declare (strict_types=1);
84583/*
84584 * This file is part of PHPUnit.
84585 *
84586 * (c) Sebastian Bergmann <sebastian@phpunit.de>
84587 *
84588 * For the full copyright and license information, please view the LICENSE
84589 * file that was distributed with this source code.
84590 */
84591namespace PHPUnit\Framework\Constraint;
84592
84593use function sprintf;
84594use PHPUnit\Framework\Exception;
84595use ReflectionClass;
84596use ReflectionException;
84597/**
84598 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
84599 */
84600final class ClassHasStaticAttribute extends \PHPUnit\Framework\Constraint\ClassHasAttribute
84601{
84602    /**
84603     * Returns a string representation of the constraint.
84604     */
84605    public function toString() : string
84606    {
84607        return sprintf('has static attribute "%s"', $this->attributeName());
84608    }
84609    /**
84610     * Evaluates the constraint for parameter $other. Returns true if the
84611     * constraint is met, false otherwise.
84612     *
84613     * @param mixed $other value or object to evaluate
84614     */
84615    protected function matches($other) : bool
84616    {
84617        try {
84618            $class = new ReflectionClass($other);
84619            if ($class->hasProperty($this->attributeName())) {
84620                return $class->getProperty($this->attributeName())->isStatic();
84621            }
84622            // @codeCoverageIgnoreStart
84623        } catch (ReflectionException $e) {
84624            throw new Exception($e->getMessage(), (int) $e->getCode(), $e);
84625        }
84626        // @codeCoverageIgnoreEnd
84627        return \false;
84628    }
84629}
84630<?php
84631
84632declare (strict_types=1);
84633/*
84634 * This file is part of PHPUnit.
84635 *
84636 * (c) Sebastian Bergmann <sebastian@phpunit.de>
84637 *
84638 * For the full copyright and license information, please view the LICENSE
84639 * file that was distributed with this source code.
84640 */
84641namespace PHPUnit\Framework\Constraint;
84642
84643use function array_key_exists;
84644use function is_array;
84645use ArrayAccess;
84646/**
84647 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
84648 */
84649final class ArrayHasKey extends \PHPUnit\Framework\Constraint\Constraint
84650{
84651    /**
84652     * @var int|string
84653     */
84654    private $key;
84655    /**
84656     * @param int|string $key
84657     */
84658    public function __construct($key)
84659    {
84660        $this->key = $key;
84661    }
84662    /**
84663     * Returns a string representation of the constraint.
84664     *
84665     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
84666     */
84667    public function toString() : string
84668    {
84669        return 'has the key ' . $this->exporter()->export($this->key);
84670    }
84671    /**
84672     * Evaluates the constraint for parameter $other. Returns true if the
84673     * constraint is met, false otherwise.
84674     *
84675     * @param mixed $other value or object to evaluate
84676     */
84677    protected function matches($other) : bool
84678    {
84679        if (is_array($other)) {
84680            return array_key_exists($this->key, $other);
84681        }
84682        if ($other instanceof ArrayAccess) {
84683            return $other->offsetExists($this->key);
84684        }
84685        return \false;
84686    }
84687    /**
84688     * Returns the description of the failure.
84689     *
84690     * The beginning of failure messages is "Failed asserting that" in most
84691     * cases. This method should return the second part of that sentence.
84692     *
84693     * @param mixed $other evaluated value or object
84694     *
84695     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
84696     */
84697    protected function failureDescription($other) : string
84698    {
84699        return 'an array ' . $this->toString();
84700    }
84701}
84702<?php
84703
84704declare (strict_types=1);
84705/*
84706 * This file is part of PHPUnit.
84707 *
84708 * (c) Sebastian Bergmann <sebastian@phpunit.de>
84709 *
84710 * For the full copyright and license information, please view the LICENSE
84711 * file that was distributed with this source code.
84712 */
84713namespace PHPUnit\Framework\Constraint;
84714
84715use SplObjectStorage;
84716/**
84717 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
84718 */
84719final class TraversableContainsIdentical extends \PHPUnit\Framework\Constraint\TraversableContains
84720{
84721    /**
84722     * Evaluates the constraint for parameter $other. Returns true if the
84723     * constraint is met, false otherwise.
84724     *
84725     * @param mixed $other value or object to evaluate
84726     */
84727    protected function matches($other) : bool
84728    {
84729        if ($other instanceof SplObjectStorage) {
84730            return $other->contains($this->value());
84731        }
84732        foreach ($other as $element) {
84733            if ($this->value() === $element) {
84734                return \true;
84735            }
84736        }
84737        return \false;
84738    }
84739}
84740<?php
84741
84742declare (strict_types=1);
84743/*
84744 * This file is part of PHPUnit.
84745 *
84746 * (c) Sebastian Bergmann <sebastian@phpunit.de>
84747 *
84748 * For the full copyright and license information, please view the LICENSE
84749 * file that was distributed with this source code.
84750 */
84751namespace PHPUnit\Framework\Constraint;
84752
84753use function is_array;
84754use function sprintf;
84755/**
84756 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
84757 */
84758abstract class TraversableContains extends \PHPUnit\Framework\Constraint\Constraint
84759{
84760    /**
84761     * @var mixed
84762     */
84763    private $value;
84764    public function __construct($value)
84765    {
84766        $this->value = $value;
84767    }
84768    /**
84769     * Returns a string representation of the constraint.
84770     *
84771     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
84772     */
84773    public function toString() : string
84774    {
84775        return 'contains ' . $this->exporter()->export($this->value);
84776    }
84777    /**
84778     * Returns the description of the failure.
84779     *
84780     * The beginning of failure messages is "Failed asserting that" in most
84781     * cases. This method should return the second part of that sentence.
84782     *
84783     * @param mixed $other evaluated value or object
84784     *
84785     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
84786     */
84787    protected function failureDescription($other) : string
84788    {
84789        return sprintf('%s %s', is_array($other) ? 'an array' : 'a traversable', $this->toString());
84790    }
84791    protected function value()
84792    {
84793        return $this->value;
84794    }
84795}
84796<?php
84797
84798declare (strict_types=1);
84799/*
84800 * This file is part of PHPUnit.
84801 *
84802 * (c) Sebastian Bergmann <sebastian@phpunit.de>
84803 *
84804 * For the full copyright and license information, please view the LICENSE
84805 * file that was distributed with this source code.
84806 */
84807namespace PHPUnit\Framework\Constraint;
84808
84809use SplObjectStorage;
84810/**
84811 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
84812 */
84813final class TraversableContainsEqual extends \PHPUnit\Framework\Constraint\TraversableContains
84814{
84815    /**
84816     * Evaluates the constraint for parameter $other. Returns true if the
84817     * constraint is met, false otherwise.
84818     *
84819     * @param mixed $other value or object to evaluate
84820     */
84821    protected function matches($other) : bool
84822    {
84823        if ($other instanceof SplObjectStorage) {
84824            return $other->contains($this->value());
84825        }
84826        foreach ($other as $element) {
84827            /* @noinspection TypeUnsafeComparisonInspection */
84828            if ($this->value() == $element) {
84829                return \true;
84830            }
84831        }
84832        return \false;
84833    }
84834}
84835<?php
84836
84837declare (strict_types=1);
84838/*
84839 * This file is part of PHPUnit.
84840 *
84841 * (c) Sebastian Bergmann <sebastian@phpunit.de>
84842 *
84843 * For the full copyright and license information, please view the LICENSE
84844 * file that was distributed with this source code.
84845 */
84846namespace PHPUnit\Framework\Constraint;
84847
84848use PHPUnit\Framework\ExpectationFailedException;
84849use Traversable;
84850/**
84851 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
84852 */
84853final class TraversableContainsOnly extends \PHPUnit\Framework\Constraint\Constraint
84854{
84855    /**
84856     * @var Constraint
84857     */
84858    private $constraint;
84859    /**
84860     * @var string
84861     */
84862    private $type;
84863    /**
84864     * @throws \PHPUnit\Framework\Exception
84865     */
84866    public function __construct(string $type, bool $isNativeType = \true)
84867    {
84868        if ($isNativeType) {
84869            $this->constraint = new \PHPUnit\Framework\Constraint\IsType($type);
84870        } else {
84871            $this->constraint = new \PHPUnit\Framework\Constraint\IsInstanceOf($type);
84872        }
84873        $this->type = $type;
84874    }
84875    /**
84876     * Evaluates the constraint for parameter $other.
84877     *
84878     * If $returnResult is set to false (the default), an exception is thrown
84879     * in case of a failure. null is returned otherwise.
84880     *
84881     * If $returnResult is true, the result of the evaluation is returned as
84882     * a boolean value instead: true in case of success, false in case of a
84883     * failure.
84884     *
84885     * @param mixed|Traversable $other
84886     *
84887     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
84888     * @throws ExpectationFailedException
84889     */
84890    public function evaluate($other, string $description = '', bool $returnResult = \false) : ?bool
84891    {
84892        $success = \true;
84893        foreach ($other as $item) {
84894            if (!$this->constraint->evaluate($item, '', \true)) {
84895                $success = \false;
84896                break;
84897            }
84898        }
84899        if ($returnResult) {
84900            return $success;
84901        }
84902        if (!$success) {
84903            $this->fail($other, $description);
84904        }
84905        return null;
84906    }
84907    /**
84908     * Returns a string representation of the constraint.
84909     */
84910    public function toString() : string
84911    {
84912        return 'contains only values of type "' . $this->type . '"';
84913    }
84914}
84915<?php
84916
84917declare (strict_types=1);
84918/*
84919 * This file is part of PHPUnit.
84920 *
84921 * (c) Sebastian Bergmann <sebastian@phpunit.de>
84922 *
84923 * For the full copyright and license information, please view the LICENSE
84924 * file that was distributed with this source code.
84925 */
84926namespace PHPUnit\Framework\Constraint;
84927
84928use function sprintf;
84929use Countable;
84930use PHPUnit\Framework\ExpectationFailedException;
84931use PHPUnit\Framework\SelfDescribing;
84932use PHPUnit\SebastianBergmann\Comparator\ComparisonFailure;
84933use PHPUnit\SebastianBergmann\Exporter\Exporter;
84934/**
84935 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
84936 */
84937abstract class Constraint implements Countable, SelfDescribing
84938{
84939    /**
84940     * @var ?Exporter
84941     */
84942    private $exporter;
84943    /**
84944     * Evaluates the constraint for parameter $other.
84945     *
84946     * If $returnResult is set to false (the default), an exception is thrown
84947     * in case of a failure. null is returned otherwise.
84948     *
84949     * If $returnResult is true, the result of the evaluation is returned as
84950     * a boolean value instead: true in case of success, false in case of a
84951     * failure.
84952     *
84953     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
84954     * @throws ExpectationFailedException
84955     */
84956    public function evaluate($other, string $description = '', bool $returnResult = \false) : ?bool
84957    {
84958        $success = \false;
84959        if ($this->matches($other)) {
84960            $success = \true;
84961        }
84962        if ($returnResult) {
84963            return $success;
84964        }
84965        if (!$success) {
84966            $this->fail($other, $description);
84967        }
84968        return null;
84969    }
84970    /**
84971     * Counts the number of constraint elements.
84972     */
84973    public function count() : int
84974    {
84975        return 1;
84976    }
84977    protected function exporter() : Exporter
84978    {
84979        if ($this->exporter === null) {
84980            $this->exporter = new Exporter();
84981        }
84982        return $this->exporter;
84983    }
84984    /**
84985     * Evaluates the constraint for parameter $other. Returns true if the
84986     * constraint is met, false otherwise.
84987     *
84988     * This method can be overridden to implement the evaluation algorithm.
84989     *
84990     * @param mixed $other value or object to evaluate
84991     * @codeCoverageIgnore
84992     */
84993    protected function matches($other) : bool
84994    {
84995        return \false;
84996    }
84997    /**
84998     * Throws an exception for the given compared value and test description.
84999     *
85000     * @param mixed             $other             evaluated value or object
85001     * @param string            $description       Additional information about the test
85002     * @param ComparisonFailure $comparisonFailure
85003     *
85004     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
85005     * @throws ExpectationFailedException
85006     *
85007     * @psalm-return never-return
85008     */
85009    protected function fail($other, $description, ComparisonFailure $comparisonFailure = null) : void
85010    {
85011        $failureDescription = sprintf('Failed asserting that %s.', $this->failureDescription($other));
85012        $additionalFailureDescription = $this->additionalFailureDescription($other);
85013        if ($additionalFailureDescription) {
85014            $failureDescription .= "\n" . $additionalFailureDescription;
85015        }
85016        if (!empty($description)) {
85017            $failureDescription = $description . "\n" . $failureDescription;
85018        }
85019        throw new ExpectationFailedException($failureDescription, $comparisonFailure);
85020    }
85021    /**
85022     * Return additional failure description where needed.
85023     *
85024     * The function can be overridden to provide additional failure
85025     * information like a diff
85026     *
85027     * @param mixed $other evaluated value or object
85028     */
85029    protected function additionalFailureDescription($other) : string
85030    {
85031        return '';
85032    }
85033    /**
85034     * Returns the description of the failure.
85035     *
85036     * The beginning of failure messages is "Failed asserting that" in most
85037     * cases. This method should return the second part of that sentence.
85038     *
85039     * To provide additional failure information additionalFailureDescription
85040     * can be used.
85041     *
85042     * @param mixed $other evaluated value or object
85043     *
85044     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
85045     */
85046    protected function failureDescription($other) : string
85047    {
85048        return $this->exporter()->export($other) . ' ' . $this->toString();
85049    }
85050    /**
85051     * Returns a custom string representation of the constraint object when it
85052     * appears in context of an $operator expression.
85053     *
85054     * The purpose of this method is to provide meaningful descriptive string
85055     * in context of operators such as LogicalNot. Native PHPUnit constraints
85056     * are supported out of the box by LogicalNot, but externally developed
85057     * ones had no way to provide correct strings in this context.
85058     *
85059     * The method shall return empty string, when it does not handle
85060     * customization by itself.
85061     *
85062     * @param Operator $operator the $operator of the expression
85063     * @param mixed    $role     role of $this constraint in the $operator expression
85064     */
85065    protected function toStringInContext(\PHPUnit\Framework\Constraint\Operator $operator, $role) : string
85066    {
85067        return '';
85068    }
85069    /**
85070     * Returns the description of the failure when this constraint appears in
85071     * context of an $operator expression.
85072     *
85073     * The purpose of this method is to provide meaningful failue description
85074     * in context of operators such as LogicalNot. Native PHPUnit constraints
85075     * are supported out of the box by LogicalNot, but externally developed
85076     * ones had no way to provide correct messages in this context.
85077     *
85078     * The method shall return empty string, when it does not handle
85079     * customization by itself.
85080     *
85081     * @param Operator $operator the $operator of the expression
85082     * @param mixed    $role     role of $this constraint in the $operator expression
85083     * @param mixed    $other    evaluated value or object
85084     */
85085    protected function failureDescriptionInContext(\PHPUnit\Framework\Constraint\Operator $operator, $role, $other) : string
85086    {
85087        $string = $this->toStringInContext($operator, $role);
85088        if ($string === '') {
85089            return '';
85090        }
85091        return $this->exporter()->export($other) . ' ' . $string;
85092    }
85093    /**
85094     * Reduces the sub-expression starting at $this by skipping degenerate
85095     * sub-expression and returns first descendant constraint that starts
85096     * a non-reducible sub-expression.
85097     *
85098     * Returns $this for terminal constraints and for operators that start
85099     * non-reducible sub-expression, or the nearest descendant of $this that
85100     * starts a non-reducible sub-expression.
85101     *
85102     * A constraint expression may be modelled as a tree with non-terminal
85103     * nodes (operators) and terminal nodes. For example:
85104     *
85105     *      LogicalOr           (operator, non-terminal)
85106     *      + LogicalAnd        (operator, non-terminal)
85107     *      | + IsType('int')   (terminal)
85108     *      | + GreaterThan(10) (terminal)
85109     *      + LogicalNot        (operator, non-terminal)
85110     *        + IsType('array') (terminal)
85111     *
85112     * A degenerate sub-expression is a part of the tree, that effectively does
85113     * not contribute to the evaluation of the expression it appears in. An example
85114     * of degenerate sub-expression is a BinaryOperator constructed with single
85115     * operand or nested BinaryOperators, each with single operand. An
85116     * expression involving a degenerate sub-expression is equivalent to a
85117     * reduced expression with the degenerate sub-expression removed, for example
85118     *
85119     *      LogicalAnd          (operator)
85120     *      + LogicalOr         (degenerate operator)
85121     *      | + LogicalAnd      (degenerate operator)
85122     *      |   + IsType('int') (terminal)
85123     *      + GreaterThan(10)   (terminal)
85124     *
85125     * is equivalent to
85126     *
85127     *      LogicalAnd          (operator)
85128     *      + IsType('int')     (terminal)
85129     *      + GreaterThan(10)   (terminal)
85130     *
85131     * because the subexpression
85132     *
85133     *      + LogicalOr
85134     *        + LogicalAnd
85135     *          + -
85136     *
85137     * is degenerate. Calling reduce() on the LogicalOr object above, as well
85138     * as on LogicalAnd, shall return the IsType('int') instance.
85139     *
85140     * Other specific reductions can be implemented, for example cascade of
85141     * LogicalNot operators
85142     *
85143     *      + LogicalNot
85144     *        + LogicalNot
85145     *          +LogicalNot
85146     *           + IsTrue
85147     *
85148     * can be reduced to
85149     *
85150     *      LogicalNot
85151     *      + IsTrue
85152     */
85153    protected function reduce() : self
85154    {
85155        return $this;
85156    }
85157}
85158<?php
85159
85160declare (strict_types=1);
85161/*
85162 * This file is part of PHPUnit.
85163 *
85164 * (c) Sebastian Bergmann <sebastian@phpunit.de>
85165 *
85166 * For the full copyright and license information, please view the LICENSE
85167 * file that was distributed with this source code.
85168 */
85169namespace PHPUnit\Framework\Constraint;
85170
85171use const JSON_ERROR_CTRL_CHAR;
85172use const JSON_ERROR_DEPTH;
85173use const JSON_ERROR_NONE;
85174use const JSON_ERROR_STATE_MISMATCH;
85175use const JSON_ERROR_SYNTAX;
85176use const JSON_ERROR_UTF8;
85177use function strtolower;
85178/**
85179 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
85180 */
85181final class JsonMatchesErrorMessageProvider
85182{
85183    /**
85184     * Translates JSON error to a human readable string.
85185     */
85186    public static function determineJsonError(string $error, string $prefix = '') : ?string
85187    {
85188        switch ($error) {
85189            case \JSON_ERROR_NONE:
85190                return null;
85191            case \JSON_ERROR_DEPTH:
85192                return $prefix . 'Maximum stack depth exceeded';
85193            case \JSON_ERROR_STATE_MISMATCH:
85194                return $prefix . 'Underflow or the modes mismatch';
85195            case \JSON_ERROR_CTRL_CHAR:
85196                return $prefix . 'Unexpected control character found';
85197            case \JSON_ERROR_SYNTAX:
85198                return $prefix . 'Syntax error, malformed JSON';
85199            case \JSON_ERROR_UTF8:
85200                return $prefix . 'Malformed UTF-8 characters, possibly incorrectly encoded';
85201            default:
85202                return $prefix . 'Unknown error';
85203        }
85204    }
85205    /**
85206     * Translates a given type to a human readable message prefix.
85207     */
85208    public static function translateTypeToPrefix(string $type) : string
85209    {
85210        switch (strtolower($type)) {
85211            case 'expected':
85212                $prefix = 'Expected value JSON decode error - ';
85213                break;
85214            case 'actual':
85215                $prefix = 'Actual value JSON decode error - ';
85216                break;
85217            default:
85218                $prefix = '';
85219                break;
85220        }
85221        return $prefix;
85222    }
85223}
85224<?php
85225
85226declare (strict_types=1);
85227/*
85228 * This file is part of PHPUnit.
85229 *
85230 * (c) Sebastian Bergmann <sebastian@phpunit.de>
85231 *
85232 * For the full copyright and license information, please view the LICENSE
85233 * file that was distributed with this source code.
85234 */
85235namespace PHPUnit\Framework\Constraint;
85236
85237use function json_decode;
85238use function sprintf;
85239use PHPUnit\Framework\ExpectationFailedException;
85240use PHPUnit\Util\Json;
85241use PHPUnit\SebastianBergmann\Comparator\ComparisonFailure;
85242/**
85243 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
85244 */
85245final class JsonMatches extends \PHPUnit\Framework\Constraint\Constraint
85246{
85247    /**
85248     * @var string
85249     */
85250    private $value;
85251    public function __construct(string $value)
85252    {
85253        $this->value = $value;
85254    }
85255    /**
85256     * Returns a string representation of the object.
85257     */
85258    public function toString() : string
85259    {
85260        return sprintf('matches JSON string "%s"', $this->value);
85261    }
85262    /**
85263     * Evaluates the constraint for parameter $other. Returns true if the
85264     * constraint is met, false otherwise.
85265     *
85266     * This method can be overridden to implement the evaluation algorithm.
85267     *
85268     * @param mixed $other value or object to evaluate
85269     */
85270    protected function matches($other) : bool
85271    {
85272        [$error, $recodedOther] = Json::canonicalize($other);
85273        if ($error) {
85274            return \false;
85275        }
85276        [$error, $recodedValue] = Json::canonicalize($this->value);
85277        if ($error) {
85278            return \false;
85279        }
85280        return $recodedOther == $recodedValue;
85281    }
85282    /**
85283     * Throws an exception for the given compared value and test description.
85284     *
85285     * @param mixed             $other             evaluated value or object
85286     * @param string            $description       Additional information about the test
85287     * @param ComparisonFailure $comparisonFailure
85288     *
85289     * @throws \PHPUnit\Framework\Exception
85290     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
85291     * @throws ExpectationFailedException
85292     *
85293     * @psalm-return never-return
85294     */
85295    protected function fail($other, $description, ComparisonFailure $comparisonFailure = null) : void
85296    {
85297        if ($comparisonFailure === null) {
85298            [$error, $recodedOther] = Json::canonicalize($other);
85299            if ($error) {
85300                parent::fail($other, $description);
85301            }
85302            [$error, $recodedValue] = Json::canonicalize($this->value);
85303            if ($error) {
85304                parent::fail($other, $description);
85305            }
85306            $comparisonFailure = new ComparisonFailure(json_decode($this->value), json_decode($other), Json::prettify($recodedValue), Json::prettify($recodedOther), \false, 'Failed asserting that two json values are equal.');
85307        }
85308        parent::fail($other, $description, $comparisonFailure);
85309    }
85310}
85311<?php
85312
85313declare (strict_types=1);
85314/*
85315 * This file is part of PHPUnit.
85316 *
85317 * (c) Sebastian Bergmann <sebastian@phpunit.de>
85318 *
85319 * For the full copyright and license information, please view the LICENSE
85320 * file that was distributed with this source code.
85321 */
85322namespace PHPUnit\Framework\Constraint;
85323
85324use const DIRECTORY_SEPARATOR;
85325use function explode;
85326use function implode;
85327use function preg_match;
85328use function preg_quote;
85329use function preg_replace;
85330use function strtr;
85331use PHPUnit\SebastianBergmann\Diff\Differ;
85332use PHPUnit\SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder;
85333/**
85334 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
85335 */
85336final class StringMatchesFormatDescription extends \PHPUnit\Framework\Constraint\RegularExpression
85337{
85338    /**
85339     * @var string
85340     */
85341    private $string;
85342    public function __construct(string $string)
85343    {
85344        parent::__construct($this->createPatternFromFormat($this->convertNewlines($string)));
85345        $this->string = $string;
85346    }
85347    /**
85348     * Evaluates the constraint for parameter $other. Returns true if the
85349     * constraint is met, false otherwise.
85350     *
85351     * @param mixed $other value or object to evaluate
85352     */
85353    protected function matches($other) : bool
85354    {
85355        return parent::matches($this->convertNewlines($other));
85356    }
85357    protected function failureDescription($other) : string
85358    {
85359        return 'string matches format description';
85360    }
85361    protected function additionalFailureDescription($other) : string
85362    {
85363        $from = explode("\n", $this->string);
85364        $to = explode("\n", $this->convertNewlines($other));
85365        foreach ($from as $index => $line) {
85366            if (isset($to[$index]) && $line !== $to[$index]) {
85367                $line = $this->createPatternFromFormat($line);
85368                if (preg_match($line, $to[$index]) > 0) {
85369                    $from[$index] = $to[$index];
85370                }
85371            }
85372        }
85373        $this->string = implode("\n", $from);
85374        $other = implode("\n", $to);
85375        return (new Differ(new UnifiedDiffOutputBuilder("--- Expected\n+++ Actual\n")))->diff($this->string, $other);
85376    }
85377    private function createPatternFromFormat(string $string) : string
85378    {
85379        $string = strtr(preg_quote($string, '/'), ['%%' => '%', '%e' => '\\' . \DIRECTORY_SEPARATOR, '%s' => '[^\\r\\n]+', '%S' => '[^\\r\\n]*', '%a' => '.+', '%A' => '.*', '%w' => '\\s*', '%i' => '[+-]?\\d+', '%d' => '\\d+', '%x' => '[0-9a-fA-F]+', '%f' => '[+-]?\\.?\\d+\\.?\\d*(?:[Ee][+-]?\\d+)?', '%c' => '.']);
85380        return '/^' . $string . '$/s';
85381    }
85382    private function convertNewlines(string $text) : string
85383    {
85384        return preg_replace('/\\r\\n/', "\n", $text);
85385    }
85386}
85387<?php
85388
85389declare (strict_types=1);
85390/*
85391 * This file is part of PHPUnit.
85392 *
85393 * (c) Sebastian Bergmann <sebastian@phpunit.de>
85394 *
85395 * For the full copyright and license information, please view the LICENSE
85396 * file that was distributed with this source code.
85397 */
85398namespace PHPUnit\Framework\Constraint;
85399
85400use function json_decode;
85401use function json_last_error;
85402use function sprintf;
85403/**
85404 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
85405 */
85406final class IsJson extends \PHPUnit\Framework\Constraint\Constraint
85407{
85408    /**
85409     * Returns a string representation of the constraint.
85410     */
85411    public function toString() : string
85412    {
85413        return 'is valid JSON';
85414    }
85415    /**
85416     * Evaluates the constraint for parameter $other. Returns true if the
85417     * constraint is met, false otherwise.
85418     *
85419     * @param mixed $other value or object to evaluate
85420     */
85421    protected function matches($other) : bool
85422    {
85423        if ($other === '') {
85424            return \false;
85425        }
85426        json_decode($other);
85427        if (json_last_error()) {
85428            return \false;
85429        }
85430        return \true;
85431    }
85432    /**
85433     * Returns the description of the failure.
85434     *
85435     * The beginning of failure messages is "Failed asserting that" in most
85436     * cases. This method should return the second part of that sentence.
85437     *
85438     * @param mixed $other evaluated value or object
85439     *
85440     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
85441     */
85442    protected function failureDescription($other) : string
85443    {
85444        if ($other === '') {
85445            return 'an empty string is valid JSON';
85446        }
85447        json_decode($other);
85448        $error = (string) \PHPUnit\Framework\Constraint\JsonMatchesErrorMessageProvider::determineJsonError((string) json_last_error());
85449        return sprintf('%s is valid JSON (%s)', $this->exporter()->shortenedExport($other), $error);
85450    }
85451}
85452<?php
85453
85454declare (strict_types=1);
85455/*
85456 * This file is part of PHPUnit.
85457 *
85458 * (c) Sebastian Bergmann <sebastian@phpunit.de>
85459 *
85460 * For the full copyright and license information, please view the LICENSE
85461 * file that was distributed with this source code.
85462 */
85463namespace PHPUnit\Framework\Constraint;
85464
85465use function strlen;
85466use function strpos;
85467use PHPUnit\Framework\InvalidArgumentException;
85468/**
85469 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
85470 */
85471final class StringStartsWith extends \PHPUnit\Framework\Constraint\Constraint
85472{
85473    /**
85474     * @var string
85475     */
85476    private $prefix;
85477    public function __construct(string $prefix)
85478    {
85479        if (strlen($prefix) === 0) {
85480            throw InvalidArgumentException::create(1, 'non-empty string');
85481        }
85482        $this->prefix = $prefix;
85483    }
85484    /**
85485     * Returns a string representation of the constraint.
85486     */
85487    public function toString() : string
85488    {
85489        return 'starts with "' . $this->prefix . '"';
85490    }
85491    /**
85492     * Evaluates the constraint for parameter $other. Returns true if the
85493     * constraint is met, false otherwise.
85494     *
85495     * @param mixed $other value or object to evaluate
85496     */
85497    protected function matches($other) : bool
85498    {
85499        return strpos((string) $other, $this->prefix) === 0;
85500    }
85501}
85502<?php
85503
85504declare (strict_types=1);
85505/*
85506 * This file is part of PHPUnit.
85507 *
85508 * (c) Sebastian Bergmann <sebastian@phpunit.de>
85509 *
85510 * For the full copyright and license information, please view the LICENSE
85511 * file that was distributed with this source code.
85512 */
85513namespace PHPUnit\Framework\Constraint;
85514
85515use function mb_stripos;
85516use function mb_strtolower;
85517use function sprintf;
85518use function strpos;
85519/**
85520 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
85521 */
85522final class StringContains extends \PHPUnit\Framework\Constraint\Constraint
85523{
85524    /**
85525     * @var string
85526     */
85527    private $string;
85528    /**
85529     * @var bool
85530     */
85531    private $ignoreCase;
85532    public function __construct(string $string, bool $ignoreCase = \false)
85533    {
85534        $this->string = $string;
85535        $this->ignoreCase = $ignoreCase;
85536    }
85537    /**
85538     * Returns a string representation of the constraint.
85539     */
85540    public function toString() : string
85541    {
85542        if ($this->ignoreCase) {
85543            $string = mb_strtolower($this->string, 'UTF-8');
85544        } else {
85545            $string = $this->string;
85546        }
85547        return sprintf('contains "%s"', $string);
85548    }
85549    /**
85550     * Evaluates the constraint for parameter $other. Returns true if the
85551     * constraint is met, false otherwise.
85552     *
85553     * @param mixed $other value or object to evaluate
85554     */
85555    protected function matches($other) : bool
85556    {
85557        if ('' === $this->string) {
85558            return \true;
85559        }
85560        if ($this->ignoreCase) {
85561            /*
85562             * We must use the multi byte safe version so we can accurately compare non latin upper characters with
85563             * their lowercase equivalents.
85564             */
85565            return mb_stripos($other, $this->string, 0, 'UTF-8') !== \false;
85566        }
85567        /*
85568         * Use the non multi byte safe functions to see if the string is contained in $other.
85569         *
85570         * This function is very fast and we don't care about the character position in the string.
85571         *
85572         * Additionally, we want this method to be binary safe so we can check if some binary data is in other binary
85573         * data.
85574         */
85575        return strpos($other, $this->string) !== \false;
85576    }
85577}
85578<?php
85579
85580declare (strict_types=1);
85581/*
85582 * This file is part of PHPUnit.
85583 *
85584 * (c) Sebastian Bergmann <sebastian@phpunit.de>
85585 *
85586 * For the full copyright and license information, please view the LICENSE
85587 * file that was distributed with this source code.
85588 */
85589namespace PHPUnit\Framework\Constraint;
85590
85591use function preg_match;
85592use function sprintf;
85593/**
85594 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
85595 */
85596class RegularExpression extends \PHPUnit\Framework\Constraint\Constraint
85597{
85598    /**
85599     * @var string
85600     */
85601    private $pattern;
85602    public function __construct(string $pattern)
85603    {
85604        $this->pattern = $pattern;
85605    }
85606    /**
85607     * Returns a string representation of the constraint.
85608     */
85609    public function toString() : string
85610    {
85611        return sprintf('matches PCRE pattern "%s"', $this->pattern);
85612    }
85613    /**
85614     * Evaluates the constraint for parameter $other. Returns true if the
85615     * constraint is met, false otherwise.
85616     *
85617     * @param mixed $other value or object to evaluate
85618     */
85619    protected function matches($other) : bool
85620    {
85621        return preg_match($this->pattern, $other) > 0;
85622    }
85623}
85624<?php
85625
85626declare (strict_types=1);
85627/*
85628 * This file is part of PHPUnit.
85629 *
85630 * (c) Sebastian Bergmann <sebastian@phpunit.de>
85631 *
85632 * For the full copyright and license information, please view the LICENSE
85633 * file that was distributed with this source code.
85634 */
85635namespace PHPUnit\Framework\Constraint;
85636
85637use function strlen;
85638use function substr;
85639/**
85640 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
85641 */
85642final class StringEndsWith extends \PHPUnit\Framework\Constraint\Constraint
85643{
85644    /**
85645     * @var string
85646     */
85647    private $suffix;
85648    public function __construct(string $suffix)
85649    {
85650        $this->suffix = $suffix;
85651    }
85652    /**
85653     * Returns a string representation of the constraint.
85654     */
85655    public function toString() : string
85656    {
85657        return 'ends with "' . $this->suffix . '"';
85658    }
85659    /**
85660     * Evaluates the constraint for parameter $other. Returns true if the
85661     * constraint is met, false otherwise.
85662     *
85663     * @param mixed $other value or object to evaluate
85664     */
85665    protected function matches($other) : bool
85666    {
85667        return substr($other, 0 - strlen($this->suffix)) === $this->suffix;
85668    }
85669}
85670<?php
85671
85672declare (strict_types=1);
85673/*
85674 * This file is part of PHPUnit.
85675 *
85676 * (c) Sebastian Bergmann <sebastian@phpunit.de>
85677 *
85678 * For the full copyright and license information, please view the LICENSE
85679 * file that was distributed with this source code.
85680 */
85681namespace PHPUnit\Framework\Constraint;
85682
85683/**
85684 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
85685 */
85686final class IsNull extends \PHPUnit\Framework\Constraint\Constraint
85687{
85688    /**
85689     * Returns a string representation of the constraint.
85690     */
85691    public function toString() : string
85692    {
85693        return 'is null';
85694    }
85695    /**
85696     * Evaluates the constraint for parameter $other. Returns true if the
85697     * constraint is met, false otherwise.
85698     *
85699     * @param mixed $other value or object to evaluate
85700     */
85701    protected function matches($other) : bool
85702    {
85703        return $other === null;
85704    }
85705}
85706<?php
85707
85708declare (strict_types=1);
85709/*
85710 * This file is part of PHPUnit.
85711 *
85712 * (c) Sebastian Bergmann <sebastian@phpunit.de>
85713 *
85714 * For the full copyright and license information, please view the LICENSE
85715 * file that was distributed with this source code.
85716 */
85717namespace PHPUnit\Framework\Constraint;
85718
85719use function gettype;
85720use function is_array;
85721use function is_bool;
85722use function is_callable;
85723use function is_float;
85724use function is_int;
85725use function is_iterable;
85726use function is_numeric;
85727use function is_object;
85728use function is_scalar;
85729use function is_string;
85730use function sprintf;
85731/**
85732 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
85733 */
85734final class IsType extends \PHPUnit\Framework\Constraint\Constraint
85735{
85736    /**
85737     * @var string
85738     */
85739    public const TYPE_ARRAY = 'array';
85740    /**
85741     * @var string
85742     */
85743    public const TYPE_BOOL = 'bool';
85744    /**
85745     * @var string
85746     */
85747    public const TYPE_FLOAT = 'float';
85748    /**
85749     * @var string
85750     */
85751    public const TYPE_INT = 'int';
85752    /**
85753     * @var string
85754     */
85755    public const TYPE_NULL = 'null';
85756    /**
85757     * @var string
85758     */
85759    public const TYPE_NUMERIC = 'numeric';
85760    /**
85761     * @var string
85762     */
85763    public const TYPE_OBJECT = 'object';
85764    /**
85765     * @var string
85766     */
85767    public const TYPE_RESOURCE = 'resource';
85768    /**
85769     * @var string
85770     */
85771    public const TYPE_CLOSED_RESOURCE = 'resource (closed)';
85772    /**
85773     * @var string
85774     */
85775    public const TYPE_STRING = 'string';
85776    /**
85777     * @var string
85778     */
85779    public const TYPE_SCALAR = 'scalar';
85780    /**
85781     * @var string
85782     */
85783    public const TYPE_CALLABLE = 'callable';
85784    /**
85785     * @var string
85786     */
85787    public const TYPE_ITERABLE = 'iterable';
85788    /**
85789     * @var array<string,bool>
85790     */
85791    private const KNOWN_TYPES = ['array' => \true, 'boolean' => \true, 'bool' => \true, 'double' => \true, 'float' => \true, 'integer' => \true, 'int' => \true, 'null' => \true, 'numeric' => \true, 'object' => \true, 'real' => \true, 'resource' => \true, 'resource (closed)' => \true, 'string' => \true, 'scalar' => \true, 'callable' => \true, 'iterable' => \true];
85792    /**
85793     * @var string
85794     */
85795    private $type;
85796    /**
85797     * @throws \PHPUnit\Framework\Exception
85798     */
85799    public function __construct(string $type)
85800    {
85801        if (!isset(self::KNOWN_TYPES[$type])) {
85802            throw new \PHPUnit\Framework\Exception(sprintf('Type specified for PHPUnit\\Framework\\Constraint\\IsType <%s> ' . 'is not a valid type.', $type));
85803        }
85804        $this->type = $type;
85805    }
85806    /**
85807     * Returns a string representation of the constraint.
85808     */
85809    public function toString() : string
85810    {
85811        return sprintf('is of type "%s"', $this->type);
85812    }
85813    /**
85814     * Evaluates the constraint for parameter $other. Returns true if the
85815     * constraint is met, false otherwise.
85816     *
85817     * @param mixed $other value or object to evaluate
85818     */
85819    protected function matches($other) : bool
85820    {
85821        switch ($this->type) {
85822            case 'numeric':
85823                return is_numeric($other);
85824            case 'integer':
85825            case 'int':
85826                return is_int($other);
85827            case 'double':
85828            case 'float':
85829            case 'real':
85830                return is_float($other);
85831            case 'string':
85832                return is_string($other);
85833            case 'boolean':
85834            case 'bool':
85835                return is_bool($other);
85836            case 'null':
85837                return null === $other;
85838            case 'array':
85839                return is_array($other);
85840            case 'object':
85841                return is_object($other);
85842            case 'resource':
85843                $type = gettype($other);
85844                return $type === 'resource' || $type === 'resource (closed)';
85845            case 'resource (closed)':
85846                return gettype($other) === 'resource (closed)';
85847            case 'scalar':
85848                return is_scalar($other);
85849            case 'callable':
85850                return is_callable($other);
85851            case 'iterable':
85852                return is_iterable($other);
85853            default:
85854                return \false;
85855        }
85856    }
85857}
85858<?php
85859
85860declare (strict_types=1);
85861/*
85862 * This file is part of PHPUnit.
85863 *
85864 * (c) Sebastian Bergmann <sebastian@phpunit.de>
85865 *
85866 * For the full copyright and license information, please view the LICENSE
85867 * file that was distributed with this source code.
85868 */
85869namespace PHPUnit\Framework\Constraint;
85870
85871use function sprintf;
85872use ReflectionClass;
85873use ReflectionException;
85874/**
85875 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
85876 */
85877final class IsInstanceOf extends \PHPUnit\Framework\Constraint\Constraint
85878{
85879    /**
85880     * @var string
85881     */
85882    private $className;
85883    public function __construct(string $className)
85884    {
85885        $this->className = $className;
85886    }
85887    /**
85888     * Returns a string representation of the constraint.
85889     */
85890    public function toString() : string
85891    {
85892        return sprintf('is instance of %s "%s"', $this->getType(), $this->className);
85893    }
85894    /**
85895     * Evaluates the constraint for parameter $other. Returns true if the
85896     * constraint is met, false otherwise.
85897     *
85898     * @param mixed $other value or object to evaluate
85899     */
85900    protected function matches($other) : bool
85901    {
85902        return $other instanceof $this->className;
85903    }
85904    /**
85905     * Returns the description of the failure.
85906     *
85907     * The beginning of failure messages is "Failed asserting that" in most
85908     * cases. This method should return the second part of that sentence.
85909     *
85910     * @param mixed $other evaluated value or object
85911     *
85912     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
85913     */
85914    protected function failureDescription($other) : string
85915    {
85916        return sprintf('%s is an instance of %s "%s"', $this->exporter()->shortenedExport($other), $this->getType(), $this->className);
85917    }
85918    private function getType() : string
85919    {
85920        try {
85921            $reflection = new ReflectionClass($this->className);
85922            if ($reflection->isInterface()) {
85923                return 'interface';
85924            }
85925        } catch (ReflectionException $e) {
85926        }
85927        return 'class';
85928    }
85929}
85930<?php
85931
85932declare (strict_types=1);
85933/*
85934 * This file is part of PHPUnit.
85935 *
85936 * (c) Sebastian Bergmann <sebastian@phpunit.de>
85937 *
85938 * For the full copyright and license information, please view the LICENSE
85939 * file that was distributed with this source code.
85940 */
85941namespace PHPUnit\Framework;
85942
85943use function array_filter;
85944use function array_map;
85945use function array_values;
85946use function count;
85947use function explode;
85948use function in_array;
85949use function strpos;
85950use function trim;
85951/**
85952 * @internal This class is not covered by the backward compatibility promise for PHPUnit
85953 */
85954final class ExecutionOrderDependency
85955{
85956    /**
85957     * @var string
85958     */
85959    private $className = '';
85960    /**
85961     * @var string
85962     */
85963    private $methodName = '';
85964    /**
85965     * @var bool
85966     */
85967    private $useShallowClone = \false;
85968    /**
85969     * @var bool
85970     */
85971    private $useDeepClone = \false;
85972    public static function createFromDependsAnnotation(string $className, string $annotation) : self
85973    {
85974        // Split clone option and target
85975        $parts = explode(' ', trim($annotation), 2);
85976        if (count($parts) === 1) {
85977            $cloneOption = '';
85978            $target = $parts[0];
85979        } else {
85980            $cloneOption = $parts[0];
85981            $target = $parts[1];
85982        }
85983        // Prefix provided class for targets assumed to be in scope
85984        if ($target !== '' && strpos($target, '::') === \false) {
85985            $target = $className . '::' . $target;
85986        }
85987        return new self($target, null, $cloneOption);
85988    }
85989    /**
85990     * @psalm-param list<ExecutionOrderDependency> $dependencies
85991     *
85992     * @psalm-return list<ExecutionOrderDependency>
85993     */
85994    public static function filterInvalid(array $dependencies) : array
85995    {
85996        return array_values(array_filter($dependencies, static function (self $d) {
85997            return $d->isValid();
85998        }));
85999    }
86000    /**
86001     * @psalm-param list<ExecutionOrderDependency> $existing
86002     * @psalm-param list<ExecutionOrderDependency> $additional
86003     *
86004     * @psalm-return list<ExecutionOrderDependency>
86005     */
86006    public static function mergeUnique(array $existing, array $additional) : array
86007    {
86008        $existingTargets = array_map(static function ($dependency) {
86009            return $dependency->getTarget();
86010        }, $existing);
86011        foreach ($additional as $dependency) {
86012            if (in_array($dependency->getTarget(), $existingTargets, \true)) {
86013                continue;
86014            }
86015            $existingTargets[] = $dependency->getTarget();
86016            $existing[] = $dependency;
86017        }
86018        return $existing;
86019    }
86020    /**
86021     * @psalm-param list<ExecutionOrderDependency> $left
86022     * @psalm-param list<ExecutionOrderDependency> $right
86023     *
86024     * @psalm-return list<ExecutionOrderDependency>
86025     */
86026    public static function diff(array $left, array $right) : array
86027    {
86028        if ($right === []) {
86029            return $left;
86030        }
86031        if ($left === []) {
86032            return [];
86033        }
86034        $diff = [];
86035        $rightTargets = array_map(static function ($dependency) {
86036            return $dependency->getTarget();
86037        }, $right);
86038        foreach ($left as $dependency) {
86039            if (in_array($dependency->getTarget(), $rightTargets, \true)) {
86040                continue;
86041            }
86042            $diff[] = $dependency;
86043        }
86044        return $diff;
86045    }
86046    public function __construct(string $classOrCallableName, ?string $methodName = null, ?string $option = null)
86047    {
86048        if ($classOrCallableName === '') {
86049            return;
86050        }
86051        if (strpos($classOrCallableName, '::') !== \false) {
86052            [$this->className, $this->methodName] = explode('::', $classOrCallableName);
86053        } else {
86054            $this->className = $classOrCallableName;
86055            $this->methodName = !empty($methodName) ? $methodName : 'class';
86056        }
86057        if ($option === 'clone') {
86058            $this->useDeepClone = \true;
86059        } elseif ($option === 'shallowClone') {
86060            $this->useShallowClone = \true;
86061        }
86062    }
86063    public function __toString() : string
86064    {
86065        return $this->getTarget();
86066    }
86067    public function isValid() : bool
86068    {
86069        // Invalid dependencies can be declared and are skipped by the runner
86070        return $this->className !== '' && $this->methodName !== '';
86071    }
86072    public function useShallowClone() : bool
86073    {
86074        return $this->useShallowClone;
86075    }
86076    public function useDeepClone() : bool
86077    {
86078        return $this->useDeepClone;
86079    }
86080    public function targetIsClass() : bool
86081    {
86082        return $this->methodName === 'class';
86083    }
86084    public function getTarget() : string
86085    {
86086        return $this->isValid() ? $this->className . '::' . $this->methodName : '';
86087    }
86088    public function getTargetClassName() : string
86089    {
86090        return $this->className;
86091    }
86092}
86093<?php
86094
86095declare (strict_types=1);
86096/*
86097 * This file is part of PHPUnit.
86098 *
86099 * (c) Sebastian Bergmann <sebastian@phpunit.de>
86100 *
86101 * For the full copyright and license information, please view the LICENSE
86102 * file that was distributed with this source code.
86103 */
86104namespace PHPUnit\Framework;
86105
86106use Throwable;
86107/**
86108 * @deprecated Use the `TestHook` interfaces instead
86109 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
86110 */
86111interface TestListener
86112{
86113    /**
86114     * An error occurred.
86115     *
86116     * @deprecated Use `AfterTestErrorHook::executeAfterTestError` instead
86117     */
86118    public function addError(\PHPUnit\Framework\Test $test, Throwable $t, float $time) : void;
86119    /**
86120     * A warning occurred.
86121     *
86122     * @deprecated Use `AfterTestWarningHook::executeAfterTestWarning` instead
86123     */
86124    public function addWarning(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\Warning $e, float $time) : void;
86125    /**
86126     * A failure occurred.
86127     *
86128     * @deprecated Use `AfterTestFailureHook::executeAfterTestFailure` instead
86129     */
86130    public function addFailure(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\AssertionFailedError $e, float $time) : void;
86131    /**
86132     * Incomplete test.
86133     *
86134     * @deprecated Use `AfterIncompleteTestHook::executeAfterIncompleteTest` instead
86135     */
86136    public function addIncompleteTest(\PHPUnit\Framework\Test $test, Throwable $t, float $time) : void;
86137    /**
86138     * Risky test.
86139     *
86140     * @deprecated Use `AfterRiskyTestHook::executeAfterRiskyTest` instead
86141     */
86142    public function addRiskyTest(\PHPUnit\Framework\Test $test, Throwable $t, float $time) : void;
86143    /**
86144     * Skipped test.
86145     *
86146     * @deprecated Use `AfterSkippedTestHook::executeAfterSkippedTest` instead
86147     */
86148    public function addSkippedTest(\PHPUnit\Framework\Test $test, Throwable $t, float $time) : void;
86149    /**
86150     * A test suite started.
86151     */
86152    public function startTestSuite(\PHPUnit\Framework\TestSuite $suite) : void;
86153    /**
86154     * A test suite ended.
86155     */
86156    public function endTestSuite(\PHPUnit\Framework\TestSuite $suite) : void;
86157    /**
86158     * A test started.
86159     *
86160     * @deprecated Use `BeforeTestHook::executeBeforeTest` instead
86161     */
86162    public function startTest(\PHPUnit\Framework\Test $test) : void;
86163    /**
86164     * A test ended.
86165     *
86166     * @deprecated Use `AfterTestHook::executeAfterTest` instead
86167     */
86168    public function endTest(\PHPUnit\Framework\Test $test, float $time) : void;
86169}
86170<?php
86171
86172declare (strict_types=1);
86173/*
86174 * This file is part of PHPUnit.
86175 *
86176 * (c) Sebastian Bergmann <sebastian@phpunit.de>
86177 *
86178 * For the full copyright and license information, please view the LICENSE
86179 * file that was distributed with this source code.
86180 */
86181namespace PHPUnit\Framework;
86182
86183use function assert;
86184use function count;
86185use function get_class;
86186use function sprintf;
86187use function trim;
86188use PHPUnit\Util\Filter;
86189use PHPUnit\Util\InvalidDataSetException;
86190use PHPUnit\Util\Test as TestUtil;
86191use ReflectionClass;
86192use Throwable;
86193/**
86194 * @internal This class is not covered by the backward compatibility promise for PHPUnit
86195 */
86196final class TestBuilder
86197{
86198    public function build(ReflectionClass $theClass, string $methodName) : \PHPUnit\Framework\Test
86199    {
86200        $className = $theClass->getName();
86201        if (!$theClass->isInstantiable()) {
86202            return new \PHPUnit\Framework\ErrorTestCase(sprintf('Cannot instantiate class "%s".', $className));
86203        }
86204        $backupSettings = TestUtil::getBackupSettings($className, $methodName);
86205        $preserveGlobalState = TestUtil::getPreserveGlobalStateSettings($className, $methodName);
86206        $runTestInSeparateProcess = TestUtil::getProcessIsolationSettings($className, $methodName);
86207        $runClassInSeparateProcess = TestUtil::getClassProcessIsolationSettings($className, $methodName);
86208        $constructor = $theClass->getConstructor();
86209        if ($constructor === null) {
86210            throw new \PHPUnit\Framework\Exception('No valid test provided.');
86211        }
86212        $parameters = $constructor->getParameters();
86213        // TestCase() or TestCase($name)
86214        if (count($parameters) < 2) {
86215            $test = $this->buildTestWithoutData($className);
86216        } else {
86217            try {
86218                $data = TestUtil::getProvidedData($className, $methodName);
86219            } catch (\PHPUnit\Framework\IncompleteTestError $e) {
86220                $message = sprintf("Test for %s::%s marked incomplete by data provider\n%s", $className, $methodName, $this->throwableToString($e));
86221                $data = new \PHPUnit\Framework\IncompleteTestCase($className, $methodName, $message);
86222            } catch (\PHPUnit\Framework\SkippedTestError $e) {
86223                $message = sprintf("Test for %s::%s skipped by data provider\n%s", $className, $methodName, $this->throwableToString($e));
86224                $data = new \PHPUnit\Framework\SkippedTestCase($className, $methodName, $message);
86225            } catch (Throwable $t) {
86226                $message = sprintf("The data provider specified for %s::%s is invalid.\n%s", $className, $methodName, $this->throwableToString($t));
86227                $data = new \PHPUnit\Framework\ErrorTestCase($message);
86228            }
86229            // Test method with @dataProvider.
86230            if (isset($data)) {
86231                $test = $this->buildDataProviderTestSuite($methodName, $className, $data, $runTestInSeparateProcess, $preserveGlobalState, $runClassInSeparateProcess, $backupSettings);
86232            } else {
86233                $test = $this->buildTestWithoutData($className);
86234            }
86235        }
86236        if ($test instanceof \PHPUnit\Framework\TestCase) {
86237            $test->setName($methodName);
86238            $this->configureTestCase($test, $runTestInSeparateProcess, $preserveGlobalState, $runClassInSeparateProcess, $backupSettings);
86239        }
86240        return $test;
86241    }
86242    /** @psalm-param class-string $className */
86243    private function buildTestWithoutData(string $className)
86244    {
86245        return new $className();
86246    }
86247    /** @psalm-param class-string $className */
86248    private function buildDataProviderTestSuite(string $methodName, string $className, $data, bool $runTestInSeparateProcess, ?bool $preserveGlobalState, bool $runClassInSeparateProcess, array $backupSettings) : \PHPUnit\Framework\DataProviderTestSuite
86249    {
86250        $dataProviderTestSuite = new \PHPUnit\Framework\DataProviderTestSuite($className . '::' . $methodName);
86251        $groups = TestUtil::getGroups($className, $methodName);
86252        if ($data instanceof \PHPUnit\Framework\ErrorTestCase || $data instanceof \PHPUnit\Framework\SkippedTestCase || $data instanceof \PHPUnit\Framework\IncompleteTestCase) {
86253            $dataProviderTestSuite->addTest($data, $groups);
86254        } else {
86255            foreach ($data as $_dataName => $_data) {
86256                $_test = new $className($methodName, $_data, $_dataName);
86257                assert($_test instanceof \PHPUnit\Framework\TestCase);
86258                $this->configureTestCase($_test, $runTestInSeparateProcess, $preserveGlobalState, $runClassInSeparateProcess, $backupSettings);
86259                $dataProviderTestSuite->addTest($_test, $groups);
86260            }
86261        }
86262        return $dataProviderTestSuite;
86263    }
86264    private function configureTestCase(\PHPUnit\Framework\TestCase $test, bool $runTestInSeparateProcess, ?bool $preserveGlobalState, bool $runClassInSeparateProcess, array $backupSettings) : void
86265    {
86266        if ($runTestInSeparateProcess) {
86267            $test->setRunTestInSeparateProcess(\true);
86268            if ($preserveGlobalState !== null) {
86269                $test->setPreserveGlobalState($preserveGlobalState);
86270            }
86271        }
86272        if ($runClassInSeparateProcess) {
86273            $test->setRunClassInSeparateProcess(\true);
86274            if ($preserveGlobalState !== null) {
86275                $test->setPreserveGlobalState($preserveGlobalState);
86276            }
86277        }
86278        if ($backupSettings['backupGlobals'] !== null) {
86279            $test->setBackupGlobals($backupSettings['backupGlobals']);
86280        }
86281        if ($backupSettings['backupStaticAttributes'] !== null) {
86282            $test->setBackupStaticAttributes($backupSettings['backupStaticAttributes']);
86283        }
86284    }
86285    private function throwableToString(Throwable $t) : string
86286    {
86287        $message = $t->getMessage();
86288        if (empty(trim($message))) {
86289            $message = '<no message>';
86290        }
86291        if ($t instanceof InvalidDataSetException) {
86292            return sprintf("%s\n%s", $message, Filter::getFilteredStacktrace($t));
86293        }
86294        return sprintf("%s: %s\n%s", get_class($t), $message, Filter::getFilteredStacktrace($t));
86295    }
86296}
86297<?php
86298
86299declare (strict_types=1);
86300/*
86301 * This file is part of PHPUnit.
86302 *
86303 * (c) Sebastian Bergmann <sebastian@phpunit.de>
86304 *
86305 * For the full copyright and license information, please view the LICENSE
86306 * file that was distributed with this source code.
86307 */
86308namespace PHPUnit\Framework;
86309
86310use const PHP_EOL;
86311use function count;
86312use function function_exists;
86313use function get_class;
86314use function sprintf;
86315use AssertionError;
86316use Countable;
86317use Error;
86318use PHPUnit\Util\ErrorHandler;
86319use PHPUnit\Util\ExcludeList;
86320use PHPUnit\Util\Printer;
86321use PHPUnit\Util\Test as TestUtil;
86322use ReflectionClass;
86323use ReflectionException;
86324use PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage;
86325use PHPUnit\SebastianBergmann\CodeCoverage\Exception as OriginalCodeCoverageException;
86326use PHPUnit\SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException;
86327use PHPUnit\SebastianBergmann\Invoker\Invoker;
86328use PHPUnit\SebastianBergmann\Invoker\TimeoutException;
86329use PHPUnit\SebastianBergmann\ResourceOperations\ResourceOperations;
86330use PHPUnit\SebastianBergmann\Timer\Timer;
86331use Throwable;
86332/**
86333 * @internal This class is not covered by the backward compatibility promise for PHPUnit
86334 */
86335final class TestResult implements Countable
86336{
86337    /**
86338     * @var array
86339     */
86340    private $passed = [];
86341    /**
86342     * @var array<string>
86343     */
86344    private $passedTestClasses = [];
86345    /**
86346     * @var bool
86347     */
86348    private $currentTestSuiteFailed = \false;
86349    /**
86350     * @var TestFailure[]
86351     */
86352    private $errors = [];
86353    /**
86354     * @var TestFailure[]
86355     */
86356    private $failures = [];
86357    /**
86358     * @var TestFailure[]
86359     */
86360    private $warnings = [];
86361    /**
86362     * @var TestFailure[]
86363     */
86364    private $notImplemented = [];
86365    /**
86366     * @var TestFailure[]
86367     */
86368    private $risky = [];
86369    /**
86370     * @var TestFailure[]
86371     */
86372    private $skipped = [];
86373    /**
86374     * @deprecated Use the `TestHook` interfaces instead
86375     *
86376     * @var TestListener[]
86377     */
86378    private $listeners = [];
86379    /**
86380     * @var int
86381     */
86382    private $runTests = 0;
86383    /**
86384     * @var float
86385     */
86386    private $time = 0;
86387    /**
86388     * Code Coverage information.
86389     *
86390     * @var CodeCoverage
86391     */
86392    private $codeCoverage;
86393    /**
86394     * @var bool
86395     */
86396    private $convertDeprecationsToExceptions = \false;
86397    /**
86398     * @var bool
86399     */
86400    private $convertErrorsToExceptions = \true;
86401    /**
86402     * @var bool
86403     */
86404    private $convertNoticesToExceptions = \true;
86405    /**
86406     * @var bool
86407     */
86408    private $convertWarningsToExceptions = \true;
86409    /**
86410     * @var bool
86411     */
86412    private $stop = \false;
86413    /**
86414     * @var bool
86415     */
86416    private $stopOnError = \false;
86417    /**
86418     * @var bool
86419     */
86420    private $stopOnFailure = \false;
86421    /**
86422     * @var bool
86423     */
86424    private $stopOnWarning = \false;
86425    /**
86426     * @var bool
86427     */
86428    private $beStrictAboutTestsThatDoNotTestAnything = \true;
86429    /**
86430     * @var bool
86431     */
86432    private $beStrictAboutOutputDuringTests = \false;
86433    /**
86434     * @var bool
86435     */
86436    private $beStrictAboutTodoAnnotatedTests = \false;
86437    /**
86438     * @var bool
86439     */
86440    private $beStrictAboutResourceUsageDuringSmallTests = \false;
86441    /**
86442     * @var bool
86443     */
86444    private $enforceTimeLimit = \false;
86445    /**
86446     * @var bool
86447     */
86448    private $forceCoversAnnotation = \false;
86449    /**
86450     * @var int
86451     */
86452    private $timeoutForSmallTests = 1;
86453    /**
86454     * @var int
86455     */
86456    private $timeoutForMediumTests = 10;
86457    /**
86458     * @var int
86459     */
86460    private $timeoutForLargeTests = 60;
86461    /**
86462     * @var bool
86463     */
86464    private $stopOnRisky = \false;
86465    /**
86466     * @var bool
86467     */
86468    private $stopOnIncomplete = \false;
86469    /**
86470     * @var bool
86471     */
86472    private $stopOnSkipped = \false;
86473    /**
86474     * @var bool
86475     */
86476    private $lastTestFailed = \false;
86477    /**
86478     * @var int
86479     */
86480    private $defaultTimeLimit = 0;
86481    /**
86482     * @var bool
86483     */
86484    private $stopOnDefect = \false;
86485    /**
86486     * @var bool
86487     */
86488    private $registerMockObjectsFromTestArgumentsRecursively = \false;
86489    /**
86490     * @deprecated Use the `TestHook` interfaces instead
86491     *
86492     * @codeCoverageIgnore
86493     *
86494     * Registers a TestListener.
86495     */
86496    public function addListener(\PHPUnit\Framework\TestListener $listener) : void
86497    {
86498        $this->listeners[] = $listener;
86499    }
86500    /**
86501     * @deprecated Use the `TestHook` interfaces instead
86502     *
86503     * @codeCoverageIgnore
86504     *
86505     * Unregisters a TestListener.
86506     */
86507    public function removeListener(\PHPUnit\Framework\TestListener $listener) : void
86508    {
86509        foreach ($this->listeners as $key => $_listener) {
86510            if ($listener === $_listener) {
86511                unset($this->listeners[$key]);
86512            }
86513        }
86514    }
86515    /**
86516     * @deprecated Use the `TestHook` interfaces instead
86517     *
86518     * @codeCoverageIgnore
86519     *
86520     * Flushes all flushable TestListeners.
86521     */
86522    public function flushListeners() : void
86523    {
86524        foreach ($this->listeners as $listener) {
86525            if ($listener instanceof Printer) {
86526                $listener->flush();
86527            }
86528        }
86529    }
86530    /**
86531     * Adds an error to the list of errors.
86532     */
86533    public function addError(\PHPUnit\Framework\Test $test, Throwable $t, float $time) : void
86534    {
86535        if ($t instanceof \PHPUnit\Framework\RiskyTestError) {
86536            $this->recordRisky($test, $t);
86537            $notifyMethod = 'addRiskyTest';
86538            if ($test instanceof \PHPUnit\Framework\TestCase) {
86539                $test->markAsRisky();
86540            }
86541            if ($this->stopOnRisky || $this->stopOnDefect) {
86542                $this->stop();
86543            }
86544        } elseif ($t instanceof \PHPUnit\Framework\IncompleteTest) {
86545            $this->recordNotImplemented($test, $t);
86546            $notifyMethod = 'addIncompleteTest';
86547            if ($this->stopOnIncomplete) {
86548                $this->stop();
86549            }
86550        } elseif ($t instanceof \PHPUnit\Framework\SkippedTest) {
86551            $this->recordSkipped($test, $t);
86552            $notifyMethod = 'addSkippedTest';
86553            if ($this->stopOnSkipped) {
86554                $this->stop();
86555            }
86556        } else {
86557            $this->recordError($test, $t);
86558            $notifyMethod = 'addError';
86559            if ($this->stopOnError || $this->stopOnFailure) {
86560                $this->stop();
86561            }
86562        }
86563        // @see https://github.com/sebastianbergmann/phpunit/issues/1953
86564        if ($t instanceof Error) {
86565            $t = new \PHPUnit\Framework\ExceptionWrapper($t);
86566        }
86567        foreach ($this->listeners as $listener) {
86568            $listener->{$notifyMethod}($test, $t, $time);
86569        }
86570        $this->lastTestFailed = \true;
86571        $this->time += $time;
86572    }
86573    /**
86574     * Adds a warning to the list of warnings.
86575     * The passed in exception caused the warning.
86576     */
86577    public function addWarning(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\Warning $e, float $time) : void
86578    {
86579        if ($this->stopOnWarning || $this->stopOnDefect) {
86580            $this->stop();
86581        }
86582        $this->recordWarning($test, $e);
86583        foreach ($this->listeners as $listener) {
86584            $listener->addWarning($test, $e, $time);
86585        }
86586        $this->time += $time;
86587    }
86588    /**
86589     * Adds a failure to the list of failures.
86590     * The passed in exception caused the failure.
86591     */
86592    public function addFailure(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\AssertionFailedError $e, float $time) : void
86593    {
86594        if ($e instanceof \PHPUnit\Framework\RiskyTestError || $e instanceof \PHPUnit\Framework\OutputError) {
86595            $this->recordRisky($test, $e);
86596            $notifyMethod = 'addRiskyTest';
86597            if ($test instanceof \PHPUnit\Framework\TestCase) {
86598                $test->markAsRisky();
86599            }
86600            if ($this->stopOnRisky || $this->stopOnDefect) {
86601                $this->stop();
86602            }
86603        } elseif ($e instanceof \PHPUnit\Framework\IncompleteTest) {
86604            $this->recordNotImplemented($test, $e);
86605            $notifyMethod = 'addIncompleteTest';
86606            if ($this->stopOnIncomplete) {
86607                $this->stop();
86608            }
86609        } elseif ($e instanceof \PHPUnit\Framework\SkippedTest) {
86610            $this->recordSkipped($test, $e);
86611            $notifyMethod = 'addSkippedTest';
86612            if ($this->stopOnSkipped) {
86613                $this->stop();
86614            }
86615        } else {
86616            $this->failures[] = new \PHPUnit\Framework\TestFailure($test, $e);
86617            $notifyMethod = 'addFailure';
86618            if ($this->stopOnFailure || $this->stopOnDefect) {
86619                $this->stop();
86620            }
86621        }
86622        foreach ($this->listeners as $listener) {
86623            $listener->{$notifyMethod}($test, $e, $time);
86624        }
86625        $this->lastTestFailed = \true;
86626        $this->time += $time;
86627    }
86628    /**
86629     * Informs the result that a test suite will be started.
86630     */
86631    public function startTestSuite(\PHPUnit\Framework\TestSuite $suite) : void
86632    {
86633        $this->currentTestSuiteFailed = \false;
86634        foreach ($this->listeners as $listener) {
86635            $listener->startTestSuite($suite);
86636        }
86637    }
86638    /**
86639     * Informs the result that a test suite was completed.
86640     */
86641    public function endTestSuite(\PHPUnit\Framework\TestSuite $suite) : void
86642    {
86643        if (!$this->currentTestSuiteFailed) {
86644            $this->passedTestClasses[] = $suite->getName();
86645        }
86646        foreach ($this->listeners as $listener) {
86647            $listener->endTestSuite($suite);
86648        }
86649    }
86650    /**
86651     * Informs the result that a test will be started.
86652     */
86653    public function startTest(\PHPUnit\Framework\Test $test) : void
86654    {
86655        $this->lastTestFailed = \false;
86656        $this->runTests += count($test);
86657        foreach ($this->listeners as $listener) {
86658            $listener->startTest($test);
86659        }
86660    }
86661    /**
86662     * Informs the result that a test was completed.
86663     *
86664     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
86665     */
86666    public function endTest(\PHPUnit\Framework\Test $test, float $time) : void
86667    {
86668        foreach ($this->listeners as $listener) {
86669            $listener->endTest($test, $time);
86670        }
86671        if (!$this->lastTestFailed && $test instanceof \PHPUnit\Framework\TestCase) {
86672            $class = get_class($test);
86673            $key = $class . '::' . $test->getName();
86674            $this->passed[$key] = ['result' => $test->getResult(), 'size' => \PHPUnit\Util\Test::getSize($class, $test->getName(\false))];
86675            $this->time += $time;
86676        }
86677        if ($this->lastTestFailed && $test instanceof \PHPUnit\Framework\TestCase) {
86678            $this->currentTestSuiteFailed = \true;
86679        }
86680    }
86681    /**
86682     * Returns true if no risky test occurred.
86683     */
86684    public function allHarmless() : bool
86685    {
86686        return $this->riskyCount() === 0;
86687    }
86688    /**
86689     * Gets the number of risky tests.
86690     */
86691    public function riskyCount() : int
86692    {
86693        return count($this->risky);
86694    }
86695    /**
86696     * Returns true if no incomplete test occurred.
86697     */
86698    public function allCompletelyImplemented() : bool
86699    {
86700        return $this->notImplementedCount() === 0;
86701    }
86702    /**
86703     * Gets the number of incomplete tests.
86704     */
86705    public function notImplementedCount() : int
86706    {
86707        return count($this->notImplemented);
86708    }
86709    /**
86710     * Returns an array of TestFailure objects for the risky tests.
86711     *
86712     * @return TestFailure[]
86713     */
86714    public function risky() : array
86715    {
86716        return $this->risky;
86717    }
86718    /**
86719     * Returns an array of TestFailure objects for the incomplete tests.
86720     *
86721     * @return TestFailure[]
86722     */
86723    public function notImplemented() : array
86724    {
86725        return $this->notImplemented;
86726    }
86727    /**
86728     * Returns true if no test has been skipped.
86729     */
86730    public function noneSkipped() : bool
86731    {
86732        return $this->skippedCount() === 0;
86733    }
86734    /**
86735     * Gets the number of skipped tests.
86736     */
86737    public function skippedCount() : int
86738    {
86739        return count($this->skipped);
86740    }
86741    /**
86742     * Returns an array of TestFailure objects for the skipped tests.
86743     *
86744     * @return TestFailure[]
86745     */
86746    public function skipped() : array
86747    {
86748        return $this->skipped;
86749    }
86750    /**
86751     * Gets the number of detected errors.
86752     */
86753    public function errorCount() : int
86754    {
86755        return count($this->errors);
86756    }
86757    /**
86758     * Returns an array of TestFailure objects for the errors.
86759     *
86760     * @return TestFailure[]
86761     */
86762    public function errors() : array
86763    {
86764        return $this->errors;
86765    }
86766    /**
86767     * Gets the number of detected failures.
86768     */
86769    public function failureCount() : int
86770    {
86771        return count($this->failures);
86772    }
86773    /**
86774     * Returns an array of TestFailure objects for the failures.
86775     *
86776     * @return TestFailure[]
86777     */
86778    public function failures() : array
86779    {
86780        return $this->failures;
86781    }
86782    /**
86783     * Gets the number of detected warnings.
86784     */
86785    public function warningCount() : int
86786    {
86787        return count($this->warnings);
86788    }
86789    /**
86790     * Returns an array of TestFailure objects for the warnings.
86791     *
86792     * @return TestFailure[]
86793     */
86794    public function warnings() : array
86795    {
86796        return $this->warnings;
86797    }
86798    /**
86799     * Returns the names of the tests that have passed.
86800     */
86801    public function passed() : array
86802    {
86803        return $this->passed;
86804    }
86805    /**
86806     * Returns the names of the TestSuites that have passed.
86807     *
86808     * This enables @depends-annotations for TestClassName::class
86809     */
86810    public function passedClasses() : array
86811    {
86812        return $this->passedTestClasses;
86813    }
86814    /**
86815     * Returns whether code coverage information should be collected.
86816     */
86817    public function getCollectCodeCoverageInformation() : bool
86818    {
86819        return $this->codeCoverage !== null;
86820    }
86821    /**
86822     * Runs a TestCase.
86823     *
86824     * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException
86825     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
86826     * @throws CodeCoverageException
86827     * @throws UnintentionallyCoveredCodeException
86828     */
86829    public function run(\PHPUnit\Framework\Test $test) : void
86830    {
86831        \PHPUnit\Framework\Assert::resetCount();
86832        if ($test instanceof \PHPUnit\Framework\TestCase) {
86833            $test->setRegisterMockObjectsFromTestArgumentsRecursively($this->registerMockObjectsFromTestArgumentsRecursively);
86834            $isAnyCoverageRequired = TestUtil::requiresCodeCoverageDataCollection($test);
86835        }
86836        $error = \false;
86837        $failure = \false;
86838        $warning = \false;
86839        $incomplete = \false;
86840        $risky = \false;
86841        $skipped = \false;
86842        $this->startTest($test);
86843        if ($this->convertDeprecationsToExceptions || $this->convertErrorsToExceptions || $this->convertNoticesToExceptions || $this->convertWarningsToExceptions) {
86844            $errorHandler = new ErrorHandler($this->convertDeprecationsToExceptions, $this->convertErrorsToExceptions, $this->convertNoticesToExceptions, $this->convertWarningsToExceptions);
86845            $errorHandler->register();
86846        }
86847        $collectCodeCoverage = $this->codeCoverage !== null && !$test instanceof \PHPUnit\Framework\ErrorTestCase && !$test instanceof \PHPUnit\Framework\WarningTestCase && $isAnyCoverageRequired;
86848        if ($collectCodeCoverage) {
86849            $this->codeCoverage->start($test);
86850        }
86851        $monitorFunctions = $this->beStrictAboutResourceUsageDuringSmallTests && !$test instanceof \PHPUnit\Framework\ErrorTestCase && !$test instanceof \PHPUnit\Framework\WarningTestCase && $test->getSize() === \PHPUnit\Util\Test::SMALL && function_exists('xdebug_start_function_monitor');
86852        if ($monitorFunctions) {
86853            /* @noinspection ForgottenDebugOutputInspection */
86854            \xdebug_start_function_monitor(ResourceOperations::getFunctions());
86855        }
86856        $timer = new Timer();
86857        $timer->start();
86858        try {
86859            $invoker = new Invoker();
86860            if (!$test instanceof \PHPUnit\Framework\ErrorTestCase && !$test instanceof \PHPUnit\Framework\WarningTestCase && $this->enforceTimeLimit && ($this->defaultTimeLimit || $test->getSize() != \PHPUnit\Util\Test::UNKNOWN) && $invoker->canInvokeWithTimeout()) {
86861                switch ($test->getSize()) {
86862                    case \PHPUnit\Util\Test::SMALL:
86863                        $_timeout = $this->timeoutForSmallTests;
86864                        break;
86865                    case \PHPUnit\Util\Test::MEDIUM:
86866                        $_timeout = $this->timeoutForMediumTests;
86867                        break;
86868                    case \PHPUnit\Util\Test::LARGE:
86869                        $_timeout = $this->timeoutForLargeTests;
86870                        break;
86871                    case \PHPUnit\Util\Test::UNKNOWN:
86872                        $_timeout = $this->defaultTimeLimit;
86873                        break;
86874                }
86875                $invoker->invoke([$test, 'runBare'], [], $_timeout);
86876            } else {
86877                $test->runBare();
86878            }
86879        } catch (TimeoutException $e) {
86880            $this->addFailure($test, new \PHPUnit\Framework\RiskyTestError($e->getMessage()), $_timeout);
86881            $risky = \true;
86882        } catch (\PHPUnit\Framework\AssertionFailedError $e) {
86883            $failure = \true;
86884            if ($e instanceof \PHPUnit\Framework\RiskyTestError) {
86885                $risky = \true;
86886            } elseif ($e instanceof \PHPUnit\Framework\IncompleteTestError) {
86887                $incomplete = \true;
86888            } elseif ($e instanceof \PHPUnit\Framework\SkippedTestError) {
86889                $skipped = \true;
86890            }
86891        } catch (AssertionError $e) {
86892            $test->addToAssertionCount(1);
86893            $failure = \true;
86894            $frame = $e->getTrace()[0];
86895            $e = new \PHPUnit\Framework\AssertionFailedError(sprintf('%s in %s:%s', $e->getMessage(), $frame['file'], $frame['line']));
86896        } catch (\PHPUnit\Framework\Warning $e) {
86897            $warning = \true;
86898        } catch (\PHPUnit\Framework\Exception $e) {
86899            $error = \true;
86900        } catch (Throwable $e) {
86901            $e = new \PHPUnit\Framework\ExceptionWrapper($e);
86902            $error = \true;
86903        }
86904        $time = $timer->stop()->asSeconds();
86905        $test->addToAssertionCount(\PHPUnit\Framework\Assert::getCount());
86906        if ($monitorFunctions) {
86907            $excludeList = new ExcludeList();
86908            /** @noinspection ForgottenDebugOutputInspection */
86909            $functions = \xdebug_get_monitored_functions();
86910            /* @noinspection ForgottenDebugOutputInspection */
86911            \xdebug_stop_function_monitor();
86912            foreach ($functions as $function) {
86913                if (!$excludeList->isExcluded($function['filename'])) {
86914                    $this->addFailure($test, new \PHPUnit\Framework\RiskyTestError(sprintf('%s() used in %s:%s', $function['function'], $function['filename'], $function['lineno'])), $time);
86915                }
86916            }
86917        }
86918        if ($this->beStrictAboutTestsThatDoNotTestAnything && $test->getNumAssertions() === 0) {
86919            $risky = \true;
86920        }
86921        if ($this->forceCoversAnnotation && !$error && !$failure && !$warning && !$incomplete && !$skipped && !$risky) {
86922            $annotations = TestUtil::parseTestMethodAnnotations(get_class($test), $test->getName(\false));
86923            if (!isset($annotations['class']['covers']) && !isset($annotations['method']['covers']) && !isset($annotations['class']['coversNothing']) && !isset($annotations['method']['coversNothing'])) {
86924                $this->addFailure($test, new \PHPUnit\Framework\MissingCoversAnnotationException('This test does not have a @covers annotation but is expected to have one'), $time);
86925                $risky = \true;
86926            }
86927        }
86928        if ($collectCodeCoverage) {
86929            $append = !$risky && !$incomplete && !$skipped;
86930            $linesToBeCovered = [];
86931            $linesToBeUsed = [];
86932            if ($append && $test instanceof \PHPUnit\Framework\TestCase) {
86933                try {
86934                    $linesToBeCovered = \PHPUnit\Util\Test::getLinesToBeCovered(get_class($test), $test->getName(\false));
86935                    $linesToBeUsed = \PHPUnit\Util\Test::getLinesToBeUsed(get_class($test), $test->getName(\false));
86936                } catch (\PHPUnit\Framework\InvalidCoversTargetException $cce) {
86937                    $this->addWarning($test, new \PHPUnit\Framework\Warning($cce->getMessage()), $time);
86938                }
86939            }
86940            try {
86941                $this->codeCoverage->stop($append, $linesToBeCovered, $linesToBeUsed);
86942            } catch (UnintentionallyCoveredCodeException $cce) {
86943                $unintentionallyCoveredCodeError = new \PHPUnit\Framework\UnintentionallyCoveredCodeError('This test executed code that is not listed as code to be covered or used:' . \PHP_EOL . $cce->getMessage());
86944            } catch (OriginalCodeCoverageException $cce) {
86945                $error = \true;
86946                $e = $e ?? $cce;
86947            }
86948        }
86949        if (isset($errorHandler)) {
86950            $errorHandler->unregister();
86951            unset($errorHandler);
86952        }
86953        if ($error) {
86954            $this->addError($test, $e, $time);
86955        } elseif ($failure) {
86956            $this->addFailure($test, $e, $time);
86957        } elseif ($warning) {
86958            $this->addWarning($test, $e, $time);
86959        } elseif (isset($unintentionallyCoveredCodeError)) {
86960            $this->addFailure($test, $unintentionallyCoveredCodeError, $time);
86961        } elseif ($this->beStrictAboutTestsThatDoNotTestAnything && !$test->doesNotPerformAssertions() && $test->getNumAssertions() === 0) {
86962            try {
86963                $reflected = new ReflectionClass($test);
86964                // @codeCoverageIgnoreStart
86965            } catch (ReflectionException $e) {
86966                throw new \PHPUnit\Framework\Exception($e->getMessage(), (int) $e->getCode(), $e);
86967            }
86968            // @codeCoverageIgnoreEnd
86969            $name = $test->getName(\false);
86970            if ($name && $reflected->hasMethod($name)) {
86971                try {
86972                    $reflected = $reflected->getMethod($name);
86973                    // @codeCoverageIgnoreStart
86974                } catch (ReflectionException $e) {
86975                    throw new \PHPUnit\Framework\Exception($e->getMessage(), (int) $e->getCode(), $e);
86976                }
86977                // @codeCoverageIgnoreEnd
86978            }
86979            $this->addFailure($test, new \PHPUnit\Framework\RiskyTestError(sprintf("This test did not perform any assertions\n\n%s:%d", $reflected->getFileName(), $reflected->getStartLine())), $time);
86980        } elseif ($this->beStrictAboutTestsThatDoNotTestAnything && $test->doesNotPerformAssertions() && $test->getNumAssertions() > 0) {
86981            $this->addFailure($test, new \PHPUnit\Framework\RiskyTestError(sprintf('This test is annotated with "@doesNotPerformAssertions" but performed %d assertions', $test->getNumAssertions())), $time);
86982        } elseif ($this->beStrictAboutOutputDuringTests && $test->hasOutput()) {
86983            $this->addFailure($test, new \PHPUnit\Framework\OutputError(sprintf('This test printed output: %s', $test->getActualOutput())), $time);
86984        } elseif ($this->beStrictAboutTodoAnnotatedTests && $test instanceof \PHPUnit\Framework\TestCase) {
86985            $annotations = TestUtil::parseTestMethodAnnotations(get_class($test), $test->getName(\false));
86986            if (isset($annotations['method']['todo'])) {
86987                $this->addFailure($test, new \PHPUnit\Framework\RiskyTestError('Test method is annotated with @todo'), $time);
86988            }
86989        }
86990        $this->endTest($test, $time);
86991    }
86992    /**
86993     * Gets the number of run tests.
86994     */
86995    public function count() : int
86996    {
86997        return $this->runTests;
86998    }
86999    /**
87000     * Checks whether the test run should stop.
87001     */
87002    public function shouldStop() : bool
87003    {
87004        return $this->stop;
87005    }
87006    /**
87007     * Marks that the test run should stop.
87008     */
87009    public function stop() : void
87010    {
87011        $this->stop = \true;
87012    }
87013    /**
87014     * Returns the code coverage object.
87015     */
87016    public function getCodeCoverage() : ?CodeCoverage
87017    {
87018        return $this->codeCoverage;
87019    }
87020    /**
87021     * Sets the code coverage object.
87022     */
87023    public function setCodeCoverage(CodeCoverage $codeCoverage) : void
87024    {
87025        $this->codeCoverage = $codeCoverage;
87026    }
87027    /**
87028     * Enables or disables the deprecation-to-exception conversion.
87029     */
87030    public function convertDeprecationsToExceptions(bool $flag) : void
87031    {
87032        $this->convertDeprecationsToExceptions = $flag;
87033    }
87034    /**
87035     * Returns the deprecation-to-exception conversion setting.
87036     */
87037    public function getConvertDeprecationsToExceptions() : bool
87038    {
87039        return $this->convertDeprecationsToExceptions;
87040    }
87041    /**
87042     * Enables or disables the error-to-exception conversion.
87043     */
87044    public function convertErrorsToExceptions(bool $flag) : void
87045    {
87046        $this->convertErrorsToExceptions = $flag;
87047    }
87048    /**
87049     * Returns the error-to-exception conversion setting.
87050     */
87051    public function getConvertErrorsToExceptions() : bool
87052    {
87053        return $this->convertErrorsToExceptions;
87054    }
87055    /**
87056     * Enables or disables the notice-to-exception conversion.
87057     */
87058    public function convertNoticesToExceptions(bool $flag) : void
87059    {
87060        $this->convertNoticesToExceptions = $flag;
87061    }
87062    /**
87063     * Returns the notice-to-exception conversion setting.
87064     */
87065    public function getConvertNoticesToExceptions() : bool
87066    {
87067        return $this->convertNoticesToExceptions;
87068    }
87069    /**
87070     * Enables or disables the warning-to-exception conversion.
87071     */
87072    public function convertWarningsToExceptions(bool $flag) : void
87073    {
87074        $this->convertWarningsToExceptions = $flag;
87075    }
87076    /**
87077     * Returns the warning-to-exception conversion setting.
87078     */
87079    public function getConvertWarningsToExceptions() : bool
87080    {
87081        return $this->convertWarningsToExceptions;
87082    }
87083    /**
87084     * Enables or disables the stopping when an error occurs.
87085     */
87086    public function stopOnError(bool $flag) : void
87087    {
87088        $this->stopOnError = $flag;
87089    }
87090    /**
87091     * Enables or disables the stopping when a failure occurs.
87092     */
87093    public function stopOnFailure(bool $flag) : void
87094    {
87095        $this->stopOnFailure = $flag;
87096    }
87097    /**
87098     * Enables or disables the stopping when a warning occurs.
87099     */
87100    public function stopOnWarning(bool $flag) : void
87101    {
87102        $this->stopOnWarning = $flag;
87103    }
87104    public function beStrictAboutTestsThatDoNotTestAnything(bool $flag) : void
87105    {
87106        $this->beStrictAboutTestsThatDoNotTestAnything = $flag;
87107    }
87108    public function isStrictAboutTestsThatDoNotTestAnything() : bool
87109    {
87110        return $this->beStrictAboutTestsThatDoNotTestAnything;
87111    }
87112    public function beStrictAboutOutputDuringTests(bool $flag) : void
87113    {
87114        $this->beStrictAboutOutputDuringTests = $flag;
87115    }
87116    public function isStrictAboutOutputDuringTests() : bool
87117    {
87118        return $this->beStrictAboutOutputDuringTests;
87119    }
87120    public function beStrictAboutResourceUsageDuringSmallTests(bool $flag) : void
87121    {
87122        $this->beStrictAboutResourceUsageDuringSmallTests = $flag;
87123    }
87124    public function isStrictAboutResourceUsageDuringSmallTests() : bool
87125    {
87126        return $this->beStrictAboutResourceUsageDuringSmallTests;
87127    }
87128    public function enforceTimeLimit(bool $flag) : void
87129    {
87130        $this->enforceTimeLimit = $flag;
87131    }
87132    public function enforcesTimeLimit() : bool
87133    {
87134        return $this->enforceTimeLimit;
87135    }
87136    public function beStrictAboutTodoAnnotatedTests(bool $flag) : void
87137    {
87138        $this->beStrictAboutTodoAnnotatedTests = $flag;
87139    }
87140    public function isStrictAboutTodoAnnotatedTests() : bool
87141    {
87142        return $this->beStrictAboutTodoAnnotatedTests;
87143    }
87144    public function forceCoversAnnotation() : void
87145    {
87146        $this->forceCoversAnnotation = \true;
87147    }
87148    public function forcesCoversAnnotation() : bool
87149    {
87150        return $this->forceCoversAnnotation;
87151    }
87152    /**
87153     * Enables or disables the stopping for risky tests.
87154     */
87155    public function stopOnRisky(bool $flag) : void
87156    {
87157        $this->stopOnRisky = $flag;
87158    }
87159    /**
87160     * Enables or disables the stopping for incomplete tests.
87161     */
87162    public function stopOnIncomplete(bool $flag) : void
87163    {
87164        $this->stopOnIncomplete = $flag;
87165    }
87166    /**
87167     * Enables or disables the stopping for skipped tests.
87168     */
87169    public function stopOnSkipped(bool $flag) : void
87170    {
87171        $this->stopOnSkipped = $flag;
87172    }
87173    /**
87174     * Enables or disables the stopping for defects: error, failure, warning.
87175     */
87176    public function stopOnDefect(bool $flag) : void
87177    {
87178        $this->stopOnDefect = $flag;
87179    }
87180    /**
87181     * Returns the time spent running the tests.
87182     */
87183    public function time() : float
87184    {
87185        return $this->time;
87186    }
87187    /**
87188     * Returns whether the entire test was successful or not.
87189     */
87190    public function wasSuccessful() : bool
87191    {
87192        return $this->wasSuccessfulIgnoringWarnings() && empty($this->warnings);
87193    }
87194    public function wasSuccessfulIgnoringWarnings() : bool
87195    {
87196        return empty($this->errors) && empty($this->failures);
87197    }
87198    public function wasSuccessfulAndNoTestIsRiskyOrSkippedOrIncomplete() : bool
87199    {
87200        return $this->wasSuccessful() && $this->allHarmless() && $this->allCompletelyImplemented() && $this->noneSkipped();
87201    }
87202    /**
87203     * Sets the default timeout for tests.
87204     */
87205    public function setDefaultTimeLimit(int $timeout) : void
87206    {
87207        $this->defaultTimeLimit = $timeout;
87208    }
87209    /**
87210     * Sets the timeout for small tests.
87211     */
87212    public function setTimeoutForSmallTests(int $timeout) : void
87213    {
87214        $this->timeoutForSmallTests = $timeout;
87215    }
87216    /**
87217     * Sets the timeout for medium tests.
87218     */
87219    public function setTimeoutForMediumTests(int $timeout) : void
87220    {
87221        $this->timeoutForMediumTests = $timeout;
87222    }
87223    /**
87224     * Sets the timeout for large tests.
87225     */
87226    public function setTimeoutForLargeTests(int $timeout) : void
87227    {
87228        $this->timeoutForLargeTests = $timeout;
87229    }
87230    /**
87231     * Returns the set timeout for large tests.
87232     */
87233    public function getTimeoutForLargeTests() : int
87234    {
87235        return $this->timeoutForLargeTests;
87236    }
87237    public function setRegisterMockObjectsFromTestArgumentsRecursively(bool $flag) : void
87238    {
87239        $this->registerMockObjectsFromTestArgumentsRecursively = $flag;
87240    }
87241    private function recordError(\PHPUnit\Framework\Test $test, Throwable $t) : void
87242    {
87243        $this->errors[] = new \PHPUnit\Framework\TestFailure($test, $t);
87244    }
87245    private function recordNotImplemented(\PHPUnit\Framework\Test $test, Throwable $t) : void
87246    {
87247        $this->notImplemented[] = new \PHPUnit\Framework\TestFailure($test, $t);
87248    }
87249    private function recordRisky(\PHPUnit\Framework\Test $test, Throwable $t) : void
87250    {
87251        $this->risky[] = new \PHPUnit\Framework\TestFailure($test, $t);
87252    }
87253    private function recordSkipped(\PHPUnit\Framework\Test $test, Throwable $t) : void
87254    {
87255        $this->skipped[] = new \PHPUnit\Framework\TestFailure($test, $t);
87256    }
87257    private function recordWarning(\PHPUnit\Framework\Test $test, Throwable $t) : void
87258    {
87259        $this->warnings[] = new \PHPUnit\Framework\TestFailure($test, $t);
87260    }
87261}
87262<?php
87263
87264declare (strict_types=1);
87265/*
87266 * This file is part of PHPUnit.
87267 *
87268 * (c) Sebastian Bergmann <sebastian@phpunit.de>
87269 *
87270 * For the full copyright and license information, please view the LICENSE
87271 * file that was distributed with this source code.
87272 */
87273namespace PHPUnit\Framework;
87274
87275/**
87276 * @internal This class is not covered by the backward compatibility promise for PHPUnit
87277 */
87278interface Reorderable
87279{
87280    public function sortId() : string;
87281    /**
87282     * @return list<ExecutionOrderDependency>
87283     */
87284    public function provides() : array;
87285    /**
87286     * @return list<ExecutionOrderDependency>
87287     */
87288    public function requires() : array;
87289}
87290<?php
87291
87292declare (strict_types=1);
87293/*
87294 * This file is part of PHPUnit.
87295 *
87296 * (c) Sebastian Bergmann <sebastian@phpunit.de>
87297 *
87298 * For the full copyright and license information, please view the LICENSE
87299 * file that was distributed with this source code.
87300 */
87301namespace PHPUnit\Framework;
87302
87303use Throwable;
87304/**
87305 * @deprecated The `TestListener` interface is deprecated
87306 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
87307 */
87308trait TestListenerDefaultImplementation
87309{
87310    public function addError(\PHPUnit\Framework\Test $test, Throwable $t, float $time) : void
87311    {
87312    }
87313    public function addWarning(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\Warning $e, float $time) : void
87314    {
87315    }
87316    public function addFailure(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\AssertionFailedError $e, float $time) : void
87317    {
87318    }
87319    public function addIncompleteTest(\PHPUnit\Framework\Test $test, Throwable $t, float $time) : void
87320    {
87321    }
87322    public function addRiskyTest(\PHPUnit\Framework\Test $test, Throwable $t, float $time) : void
87323    {
87324    }
87325    public function addSkippedTest(\PHPUnit\Framework\Test $test, Throwable $t, float $time) : void
87326    {
87327    }
87328    public function startTestSuite(\PHPUnit\Framework\TestSuite $suite) : void
87329    {
87330    }
87331    public function endTestSuite(\PHPUnit\Framework\TestSuite $suite) : void
87332    {
87333    }
87334    public function startTest(\PHPUnit\Framework\Test $test) : void
87335    {
87336    }
87337    public function endTest(\PHPUnit\Framework\Test $test, float $time) : void
87338    {
87339    }
87340}
87341<?php
87342
87343declare (strict_types=1);
87344/*
87345 * This file is part of PHPUnit.
87346 *
87347 * (c) Sebastian Bergmann <sebastian@phpunit.de>
87348 *
87349 * For the full copyright and license information, please view the LICENSE
87350 * file that was distributed with this source code.
87351 */
87352namespace PHPUnit\Framework\Error;
87353
87354use PHPUnit\Framework\Exception;
87355/**
87356 * @internal
87357 */
87358class Error extends Exception
87359{
87360    public function __construct(string $message, int $code, string $file, int $line, \Exception $previous = null)
87361    {
87362        parent::__construct($message, $code, $previous);
87363        $this->file = $file;
87364        $this->line = $line;
87365    }
87366}
87367<?php
87368
87369declare (strict_types=1);
87370/*
87371 * This file is part of PHPUnit.
87372 *
87373 * (c) Sebastian Bergmann <sebastian@phpunit.de>
87374 *
87375 * For the full copyright and license information, please view the LICENSE
87376 * file that was distributed with this source code.
87377 */
87378namespace PHPUnit\Framework\Error;
87379
87380/**
87381 * @internal
87382 */
87383final class Warning extends \PHPUnit\Framework\Error\Error
87384{
87385}
87386<?php
87387
87388declare (strict_types=1);
87389/*
87390 * This file is part of PHPUnit.
87391 *
87392 * (c) Sebastian Bergmann <sebastian@phpunit.de>
87393 *
87394 * For the full copyright and license information, please view the LICENSE
87395 * file that was distributed with this source code.
87396 */
87397namespace PHPUnit\Framework\Error;
87398
87399/**
87400 * @internal
87401 */
87402final class Deprecated extends \PHPUnit\Framework\Error\Error
87403{
87404}
87405<?php
87406
87407declare (strict_types=1);
87408/*
87409 * This file is part of PHPUnit.
87410 *
87411 * (c) Sebastian Bergmann <sebastian@phpunit.de>
87412 *
87413 * For the full copyright and license information, please view the LICENSE
87414 * file that was distributed with this source code.
87415 */
87416namespace PHPUnit\Framework\Error;
87417
87418/**
87419 * @internal
87420 */
87421final class Notice extends \PHPUnit\Framework\Error\Error
87422{
87423}
87424<?php
87425
87426declare (strict_types=1);
87427/*
87428 * This file is part of PHPUnit.
87429 *
87430 * (c) Sebastian Bergmann <sebastian@phpunit.de>
87431 *
87432 * For the full copyright and license information, please view the LICENSE
87433 * file that was distributed with this source code.
87434 */
87435namespace PHPUnit\Framework;
87436
87437use function array_keys;
87438use function get_class;
87439use function spl_object_hash;
87440use PHPUnit\Util\Filter;
87441use Throwable;
87442/**
87443 * Wraps Exceptions thrown by code under test.
87444 *
87445 * Re-instantiates Exceptions thrown by user-space code to retain their original
87446 * class names, properties, and stack traces (but without arguments).
87447 *
87448 * Unlike PHPUnit\Framework\Exception, the complete stack of previous Exceptions
87449 * is processed.
87450 *
87451 * @internal This class is not covered by the backward compatibility promise for PHPUnit
87452 */
87453final class ExceptionWrapper extends \PHPUnit\Framework\Exception
87454{
87455    /**
87456     * @var string
87457     */
87458    protected $className;
87459    /**
87460     * @var null|ExceptionWrapper
87461     */
87462    protected $previous;
87463    public function __construct(Throwable $t)
87464    {
87465        // PDOException::getCode() is a string.
87466        // @see https://php.net/manual/en/class.pdoexception.php#95812
87467        parent::__construct($t->getMessage(), (int) $t->getCode());
87468        $this->setOriginalException($t);
87469    }
87470    public function __toString() : string
87471    {
87472        $string = \PHPUnit\Framework\TestFailure::exceptionToString($this);
87473        if ($trace = Filter::getFilteredStacktrace($this)) {
87474            $string .= "\n" . $trace;
87475        }
87476        if ($this->previous) {
87477            $string .= "\nCaused by\n" . $this->previous;
87478        }
87479        return $string;
87480    }
87481    public function getClassName() : string
87482    {
87483        return $this->className;
87484    }
87485    public function getPreviousWrapped() : ?self
87486    {
87487        return $this->previous;
87488    }
87489    public function setClassName(string $className) : void
87490    {
87491        $this->className = $className;
87492    }
87493    public function setOriginalException(Throwable $t) : void
87494    {
87495        $this->originalException($t);
87496        $this->className = get_class($t);
87497        $this->file = $t->getFile();
87498        $this->line = $t->getLine();
87499        $this->serializableTrace = $t->getTrace();
87500        foreach (array_keys($this->serializableTrace) as $key) {
87501            unset($this->serializableTrace[$key]['args']);
87502        }
87503        if ($t->getPrevious()) {
87504            $this->previous = new self($t->getPrevious());
87505        }
87506    }
87507    public function getOriginalException() : ?Throwable
87508    {
87509        return $this->originalException();
87510    }
87511    /**
87512     * Method to contain static originalException to exclude it from stacktrace to prevent the stacktrace contents,
87513     * which can be quite big, from being garbage-collected, thus blocking memory until shutdown.
87514     *
87515     * Approach works both for var_dump() and var_export() and print_r().
87516     */
87517    private function originalException(Throwable $exceptionToStore = null) : ?Throwable
87518    {
87519        static $originalExceptions;
87520        $instanceId = spl_object_hash($this);
87521        if ($exceptionToStore) {
87522            $originalExceptions[$instanceId] = $exceptionToStore;
87523        }
87524        return $originalExceptions[$instanceId] ?? null;
87525    }
87526}
87527<?php
87528
87529declare (strict_types=1);
87530/*
87531 * This file is part of PHPUnit.
87532 *
87533 * (c) Sebastian Bergmann <sebastian@phpunit.de>
87534 *
87535 * For the full copyright and license information, please view the LICENSE
87536 * file that was distributed with this source code.
87537 */
87538namespace PHPUnit\Framework;
87539
87540/**
87541 * @internal This class is not covered by the backward compatibility promise for PHPUnit
87542 */
87543final class IncompleteTestCase extends \PHPUnit\Framework\TestCase
87544{
87545    /**
87546     * @var bool
87547     */
87548    protected $backupGlobals = \false;
87549    /**
87550     * @var bool
87551     */
87552    protected $backupStaticAttributes = \false;
87553    /**
87554     * @var bool
87555     */
87556    protected $runTestInSeparateProcess = \false;
87557    /**
87558     * @var string
87559     */
87560    private $message;
87561    public function __construct(string $className, string $methodName, string $message = '')
87562    {
87563        parent::__construct($className . '::' . $methodName);
87564        $this->message = $message;
87565    }
87566    public function getMessage() : string
87567    {
87568        return $this->message;
87569    }
87570    /**
87571     * Returns a string representation of the test case.
87572     *
87573     * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
87574     */
87575    public function toString() : string
87576    {
87577        return $this->getName();
87578    }
87579    /**
87580     * @throws Exception
87581     */
87582    protected function runTest() : void
87583    {
87584        $this->markTestIncomplete($this->message);
87585    }
87586}
87587<?php
87588
87589declare (strict_types=1);
87590/*
87591 * This file is part of PHPUnit.
87592 *
87593 * (c) Sebastian Bergmann <sebastian@phpunit.de>
87594 *
87595 * For the full copyright and license information, please view the LICENSE
87596 * file that was distributed with this source code.
87597 */
87598namespace PHPUnit;
87599
87600use Throwable;
87601/**
87602 * @internal This class is not covered by the backward compatibility promise for PHPUnit
87603 */
87604interface Exception extends Throwable
87605{
87606}
87607<?php
87608
87609declare (strict_types=1);
87610/*
87611 * This file is part of sebastian/exporter.
87612 *
87613 * (c) Sebastian Bergmann <sebastian@phpunit.de>
87614 *
87615 * For the full copyright and license information, please view the LICENSE
87616 * file that was distributed with this source code.
87617 */
87618namespace PHPUnit\SebastianBergmann\Exporter;
87619
87620use function bin2hex;
87621use function count;
87622use function function_exists;
87623use function get_class;
87624use function get_resource_type;
87625use function implode;
87626use function is_array;
87627use function is_float;
87628use function is_object;
87629use function is_resource;
87630use function is_string;
87631use function mb_strlen;
87632use function mb_substr;
87633use function preg_match;
87634use function spl_object_hash;
87635use function sprintf;
87636use function str_repeat;
87637use function str_replace;
87638use function strlen;
87639use function substr;
87640use function var_export;
87641use PHPUnit\SebastianBergmann\RecursionContext\Context;
87642use SplObjectStorage;
87643/**
87644 * A nifty utility for visualizing PHP variables.
87645 *
87646 * <code>
87647 * <?php
87648 * use SebastianBergmann\Exporter\Exporter;
87649 *
87650 * $exporter = new Exporter;
87651 * print $exporter->export(new Exception);
87652 * </code>
87653 */
87654class Exporter
87655{
87656    /**
87657     * Exports a value as a string.
87658     *
87659     * The output of this method is similar to the output of print_r(), but
87660     * improved in various aspects:
87661     *
87662     *  - NULL is rendered as "null" (instead of "")
87663     *  - TRUE is rendered as "true" (instead of "1")
87664     *  - FALSE is rendered as "false" (instead of "")
87665     *  - Strings are always quoted with single quotes
87666     *  - Carriage returns and newlines are normalized to \n
87667     *  - Recursion and repeated rendering is treated properly
87668     *
87669     * @param int $indentation The indentation level of the 2nd+ line
87670     *
87671     * @return string
87672     */
87673    public function export($value, $indentation = 0)
87674    {
87675        return $this->recursiveExport($value, $indentation);
87676    }
87677    /**
87678     * @param array<mixed> $data
87679     * @param Context      $context
87680     *
87681     * @return string
87682     */
87683    public function shortenedRecursiveExport(&$data, Context $context = null)
87684    {
87685        $result = [];
87686        $exporter = new self();
87687        if (!$context) {
87688            $context = new Context();
87689        }
87690        $array = $data;
87691        $context->add($data);
87692        foreach ($array as $key => $value) {
87693            if (is_array($value)) {
87694                if ($context->contains($data[$key]) !== \false) {
87695                    $result[] = '*RECURSION*';
87696                } else {
87697                    $result[] = sprintf('array(%s)', $this->shortenedRecursiveExport($data[$key], $context));
87698                }
87699            } else {
87700                $result[] = $exporter->shortenedExport($value);
87701            }
87702        }
87703        return implode(', ', $result);
87704    }
87705    /**
87706     * Exports a value into a single-line string.
87707     *
87708     * The output of this method is similar to the output of
87709     * SebastianBergmann\Exporter\Exporter::export().
87710     *
87711     * Newlines are replaced by the visible string '\n'.
87712     * Contents of arrays and objects (if any) are replaced by '...'.
87713     *
87714     * @return string
87715     *
87716     * @see    SebastianBergmann\Exporter\Exporter::export
87717     */
87718    public function shortenedExport($value)
87719    {
87720        if (is_string($value)) {
87721            $string = str_replace("\n", '', $this->export($value));
87722            if (function_exists('mb_strlen')) {
87723                if (mb_strlen($string) > 40) {
87724                    $string = mb_substr($string, 0, 30) . '...' . mb_substr($string, -7);
87725                }
87726            } else {
87727                if (strlen($string) > 40) {
87728                    $string = substr($string, 0, 30) . '...' . substr($string, -7);
87729                }
87730            }
87731            return $string;
87732        }
87733        if (is_object($value)) {
87734            return sprintf('%s Object (%s)', get_class($value), count($this->toArray($value)) > 0 ? '...' : '');
87735        }
87736        if (is_array($value)) {
87737            return sprintf('Array (%s)', count($value) > 0 ? '...' : '');
87738        }
87739        return $this->export($value);
87740    }
87741    /**
87742     * Converts an object to an array containing all of its private, protected
87743     * and public properties.
87744     *
87745     * @return array
87746     */
87747    public function toArray($value)
87748    {
87749        if (!is_object($value)) {
87750            return (array) $value;
87751        }
87752        $array = [];
87753        foreach ((array) $value as $key => $val) {
87754            // Exception traces commonly reference hundreds to thousands of
87755            // objects currently loaded in memory. Including them in the result
87756            // has a severe negative performance impact.
87757            if ("\0Error\0trace" === $key || "\0Exception\0trace" === $key) {
87758                continue;
87759            }
87760            // properties are transformed to keys in the following way:
87761            // private   $property => "\0Classname\0property"
87762            // protected $property => "\0*\0property"
87763            // public    $property => "property"
87764            if (preg_match('/^\\0.+\\0(.+)$/', (string) $key, $matches)) {
87765                $key = $matches[1];
87766            }
87767            // See https://github.com/php/php-src/commit/5721132
87768            if ($key === "\0gcdata") {
87769                continue;
87770            }
87771            $array[$key] = $val;
87772        }
87773        // Some internal classes like SplObjectStorage don't work with the
87774        // above (fast) mechanism nor with reflection in Zend.
87775        // Format the output similarly to print_r() in this case
87776        if ($value instanceof SplObjectStorage) {
87777            foreach ($value as $key => $val) {
87778                $array[spl_object_hash($val)] = ['obj' => $val, 'inf' => $value->getInfo()];
87779            }
87780        }
87781        return $array;
87782    }
87783    /**
87784     * Recursive implementation of export.
87785     *
87786     * @param mixed                                       $value       The value to export
87787     * @param int                                         $indentation The indentation level of the 2nd+ line
87788     * @param \SebastianBergmann\RecursionContext\Context $processed   Previously processed objects
87789     *
87790     * @return string
87791     *
87792     * @see    SebastianBergmann\Exporter\Exporter::export
87793     */
87794    protected function recursiveExport(&$value, $indentation, $processed = null)
87795    {
87796        if ($value === null) {
87797            return 'null';
87798        }
87799        if ($value === \true) {
87800            return 'true';
87801        }
87802        if ($value === \false) {
87803            return 'false';
87804        }
87805        if (is_float($value) && (float) (int) $value === $value) {
87806            return "{$value}.0";
87807        }
87808        if (is_resource($value)) {
87809            return sprintf('resource(%d) of type (%s)', $value, get_resource_type($value));
87810        }
87811        if (is_string($value)) {
87812            // Match for most non printable chars somewhat taking multibyte chars into account
87813            if (preg_match('/[^\\x09-\\x0d\\x1b\\x20-\\xff]/', $value)) {
87814                return 'Binary String: 0x' . bin2hex($value);
87815            }
87816            return "'" . str_replace('<lf>', "\n", str_replace(["\r\n", "\n\r", "\r", "\n"], ['\\r\\n<lf>', '\\n\\r<lf>', '\\r<lf>', '\\n<lf>'], $value)) . "'";
87817        }
87818        $whitespace = str_repeat(' ', (int) (4 * $indentation));
87819        if (!$processed) {
87820            $processed = new Context();
87821        }
87822        if (is_array($value)) {
87823            if (($key = $processed->contains($value)) !== \false) {
87824                return 'Array &' . $key;
87825            }
87826            $array = $value;
87827            $key = $processed->add($value);
87828            $values = '';
87829            if (count($array) > 0) {
87830                foreach ($array as $k => $v) {
87831                    $values .= sprintf('%s    %s => %s' . "\n", $whitespace, $this->recursiveExport($k, $indentation), $this->recursiveExport($value[$k], $indentation + 1, $processed));
87832                }
87833                $values = "\n" . $values . $whitespace;
87834            }
87835            return sprintf('Array &%s (%s)', $key, $values);
87836        }
87837        if (is_object($value)) {
87838            $class = get_class($value);
87839            if ($hash = $processed->contains($value)) {
87840                return sprintf('%s Object &%s', $class, $hash);
87841            }
87842            $hash = $processed->add($value);
87843            $values = '';
87844            $array = $this->toArray($value);
87845            if (count($array) > 0) {
87846                foreach ($array as $k => $v) {
87847                    $values .= sprintf('%s    %s => %s' . "\n", $whitespace, $this->recursiveExport($k, $indentation), $this->recursiveExport($v, $indentation + 1, $processed));
87848                }
87849                $values = "\n" . $values . $whitespace;
87850            }
87851            return sprintf('%s Object &%s (%s)', $class, $hash, $values);
87852        }
87853        return var_export($value, \true);
87854    }
87855}
87856Exporter
87857
87858Copyright (c) 2002-2020, Sebastian Bergmann <sebastian@phpunit.de>.
87859All rights reserved.
87860
87861Redistribution and use in source and binary forms, with or without
87862modification, are permitted provided that the following conditions
87863are met:
87864
87865 * Redistributions of source code must retain the above copyright
87866   notice, this list of conditions and the following disclaimer.
87867
87868 * Redistributions in binary form must reproduce the above copyright
87869   notice, this list of conditions and the following disclaimer in
87870   the documentation and/or other materials provided with the
87871   distribution.
87872
87873 * Neither the name of Sebastian Bergmann nor the names of his
87874   contributors may be used to endorse or promote products derived
87875   from this software without specific prior written permission.
87876
87877THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
87878"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
87879LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
87880FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
87881COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
87882INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
87883BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
87884LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
87885CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
87886LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
87887ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
87888POSSIBILITY OF SUCH DAMAGE.
87889<?php
87890
87891declare (strict_types=1);
87892/*
87893 * This file is part of phpunit/php-file-iterator.
87894 *
87895 * (c) Sebastian Bergmann <sebastian@phpunit.de>
87896 *
87897 * For the full copyright and license information, please view the LICENSE
87898 * file that was distributed with this source code.
87899 */
87900namespace PHPUnit\SebastianBergmann\FileIterator;
87901
87902use const DIRECTORY_SEPARATOR;
87903use function array_unique;
87904use function count;
87905use function dirname;
87906use function explode;
87907use function is_file;
87908use function is_string;
87909use function realpath;
87910use function sort;
87911class Facade
87912{
87913    /**
87914     * @param array|string $paths
87915     * @param array|string $suffixes
87916     * @param array|string $prefixes
87917     */
87918    public function getFilesAsArray($paths, $suffixes = '', $prefixes = '', array $exclude = [], bool $commonPath = \false) : array
87919    {
87920        if (is_string($paths)) {
87921            $paths = [$paths];
87922        }
87923        $iterator = (new Factory())->getFileIterator($paths, $suffixes, $prefixes, $exclude);
87924        $files = [];
87925        foreach ($iterator as $file) {
87926            $file = $file->getRealPath();
87927            if ($file) {
87928                $files[] = $file;
87929            }
87930        }
87931        foreach ($paths as $path) {
87932            if (is_file($path)) {
87933                $files[] = realpath($path);
87934            }
87935        }
87936        $files = array_unique($files);
87937        sort($files);
87938        if ($commonPath) {
87939            return ['commonPath' => $this->getCommonPath($files), 'files' => $files];
87940        }
87941        return $files;
87942    }
87943    protected function getCommonPath(array $files) : string
87944    {
87945        $count = count($files);
87946        if ($count === 0) {
87947            return '';
87948        }
87949        if ($count === 1) {
87950            return dirname($files[0]) . \DIRECTORY_SEPARATOR;
87951        }
87952        $_files = [];
87953        foreach ($files as $file) {
87954            $_files[] = $_fileParts = explode(\DIRECTORY_SEPARATOR, $file);
87955            if (empty($_fileParts[0])) {
87956                $_fileParts[0] = \DIRECTORY_SEPARATOR;
87957            }
87958        }
87959        $common = '';
87960        $done = \false;
87961        $j = 0;
87962        $count--;
87963        while (!$done) {
87964            for ($i = 0; $i < $count; $i++) {
87965                if ($_files[$i][$j] != $_files[$i + 1][$j]) {
87966                    $done = \true;
87967                    break;
87968                }
87969            }
87970            if (!$done) {
87971                $common .= $_files[0][$j];
87972                if ($j > 0) {
87973                    $common .= \DIRECTORY_SEPARATOR;
87974                }
87975            }
87976            $j++;
87977        }
87978        return \DIRECTORY_SEPARATOR . $common;
87979    }
87980}
87981<?php
87982
87983declare (strict_types=1);
87984/*
87985 * This file is part of phpunit/php-file-iterator.
87986 *
87987 * (c) Sebastian Bergmann <sebastian@phpunit.de>
87988 *
87989 * For the full copyright and license information, please view the LICENSE
87990 * file that was distributed with this source code.
87991 */
87992namespace PHPUnit\SebastianBergmann\FileIterator;
87993
87994use const GLOB_ONLYDIR;
87995use function array_filter;
87996use function array_map;
87997use function array_merge;
87998use function glob;
87999use function is_dir;
88000use function is_string;
88001use function realpath;
88002use AppendIterator;
88003use RecursiveDirectoryIterator;
88004use RecursiveIteratorIterator;
88005class Factory
88006{
88007    /**
88008     * @param array|string $paths
88009     * @param array|string $suffixes
88010     * @param array|string $prefixes
88011     */
88012    public function getFileIterator($paths, $suffixes = '', $prefixes = '', array $exclude = []) : AppendIterator
88013    {
88014        if (is_string($paths)) {
88015            $paths = [$paths];
88016        }
88017        $paths = $this->getPathsAfterResolvingWildcards($paths);
88018        $exclude = $this->getPathsAfterResolvingWildcards($exclude);
88019        if (is_string($prefixes)) {
88020            if ($prefixes !== '') {
88021                $prefixes = [$prefixes];
88022            } else {
88023                $prefixes = [];
88024            }
88025        }
88026        if (is_string($suffixes)) {
88027            if ($suffixes !== '') {
88028                $suffixes = [$suffixes];
88029            } else {
88030                $suffixes = [];
88031            }
88032        }
88033        $iterator = new AppendIterator();
88034        foreach ($paths as $path) {
88035            if (is_dir($path)) {
88036                $iterator->append(new Iterator($path, new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::FOLLOW_SYMLINKS | RecursiveDirectoryIterator::SKIP_DOTS)), $suffixes, $prefixes, $exclude));
88037            }
88038        }
88039        return $iterator;
88040    }
88041    protected function getPathsAfterResolvingWildcards(array $paths) : array
88042    {
88043        $_paths = [];
88044        foreach ($paths as $path) {
88045            if ($locals = glob($path, \GLOB_ONLYDIR)) {
88046                $_paths = array_merge($_paths, array_map('\\realpath', $locals));
88047            } else {
88048                $_paths[] = realpath($path);
88049            }
88050        }
88051        return array_filter($_paths);
88052    }
88053}
88054<?php
88055
88056declare (strict_types=1);
88057/*
88058 * This file is part of phpunit/php-file-iterator.
88059 *
88060 * (c) Sebastian Bergmann <sebastian@phpunit.de>
88061 *
88062 * For the full copyright and license information, please view the LICENSE
88063 * file that was distributed with this source code.
88064 */
88065namespace PHPUnit\SebastianBergmann\FileIterator;
88066
88067use function array_filter;
88068use function array_map;
88069use function preg_match;
88070use function realpath;
88071use function str_replace;
88072use function strlen;
88073use function strpos;
88074use function substr;
88075use FilterIterator;
88076class Iterator extends FilterIterator
88077{
88078    public const PREFIX = 0;
88079    public const SUFFIX = 1;
88080    /**
88081     * @var string
88082     */
88083    private $basePath;
88084    /**
88085     * @var array
88086     */
88087    private $suffixes = [];
88088    /**
88089     * @var array
88090     */
88091    private $prefixes = [];
88092    /**
88093     * @var array
88094     */
88095    private $exclude = [];
88096    public function __construct(string $basePath, \Iterator $iterator, array $suffixes = [], array $prefixes = [], array $exclude = [])
88097    {
88098        $this->basePath = realpath($basePath);
88099        $this->prefixes = $prefixes;
88100        $this->suffixes = $suffixes;
88101        $this->exclude = array_filter(array_map('realpath', $exclude));
88102        parent::__construct($iterator);
88103    }
88104    public function accept() : bool
88105    {
88106        $current = $this->getInnerIterator()->current();
88107        $filename = $current->getFilename();
88108        $realPath = $current->getRealPath();
88109        if ($realPath === \false) {
88110            return \false;
88111        }
88112        return $this->acceptPath($realPath) && $this->acceptPrefix($filename) && $this->acceptSuffix($filename);
88113    }
88114    private function acceptPath(string $path) : bool
88115    {
88116        // Filter files in hidden directories by checking path that is relative to the base path.
88117        if (preg_match('=/\\.[^/]*/=', str_replace($this->basePath, '', $path))) {
88118            return \false;
88119        }
88120        foreach ($this->exclude as $exclude) {
88121            if (strpos($path, $exclude) === 0) {
88122                return \false;
88123            }
88124        }
88125        return \true;
88126    }
88127    private function acceptPrefix(string $filename) : bool
88128    {
88129        return $this->acceptSubString($filename, $this->prefixes, self::PREFIX);
88130    }
88131    private function acceptSuffix(string $filename) : bool
88132    {
88133        return $this->acceptSubString($filename, $this->suffixes, self::SUFFIX);
88134    }
88135    private function acceptSubString(string $filename, array $subStrings, int $type) : bool
88136    {
88137        if (empty($subStrings)) {
88138            return \true;
88139        }
88140        $matched = \false;
88141        foreach ($subStrings as $string) {
88142            if ($type === self::PREFIX && strpos($filename, $string) === 0 || $type === self::SUFFIX && substr($filename, -1 * strlen($string)) === $string) {
88143                $matched = \true;
88144                break;
88145            }
88146        }
88147        return $matched;
88148    }
88149}
88150php-file-iterator
88151
88152Copyright (c) 2009-2020, Sebastian Bergmann <sebastian@phpunit.de>.
88153All rights reserved.
88154
88155Redistribution and use in source and binary forms, with or without
88156modification, are permitted provided that the following conditions
88157are met:
88158
88159 * Redistributions of source code must retain the above copyright
88160   notice, this list of conditions and the following disclaimer.
88161
88162 * Redistributions in binary form must reproduce the above copyright
88163   notice, this list of conditions and the following disclaimer in
88164   the documentation and/or other materials provided with the
88165   distribution.
88166
88167 * Neither the name of Sebastian Bergmann nor the names of his
88168   contributors may be used to endorse or promote products derived
88169   from this software without specific prior written permission.
88170
88171THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
88172"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
88173LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
88174FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
88175COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
88176INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
88177BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
88178LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
88179CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
88180LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
88181ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
88182POSSIBILITY OF SUCH DAMAGE.
88183<?php
88184
88185/*
88186 * This file is part of the Prophecy.
88187 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
88188 *     Marcello Duarte <marcello.duarte@gmail.com>
88189 *
88190 * For the full copyright and license information, please view the LICENSE
88191 * file that was distributed with this source code.
88192 */
88193namespace Prophecy\Prophecy;
88194
88195/**
88196 * Basic prophecies revealer.
88197 *
88198 * @author Konstantin Kudryashov <ever.zet@gmail.com>
88199 */
88200class Revealer implements \Prophecy\Prophecy\RevealerInterface
88201{
88202    /**
88203     * Unwraps value(s).
88204     *
88205     * @param mixed $value
88206     *
88207     * @return mixed
88208     */
88209    public function reveal($value)
88210    {
88211        if (\is_array($value)) {
88212            return \array_map(array($this, __FUNCTION__), $value);
88213        }
88214        if (!\is_object($value)) {
88215            return $value;
88216        }
88217        if ($value instanceof \Prophecy\Prophecy\ProphecyInterface) {
88218            $value = $value->reveal();
88219        }
88220        return $value;
88221    }
88222}
88223<?php
88224
88225/*
88226 * This file is part of the Prophecy.
88227 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
88228 *     Marcello Duarte <marcello.duarte@gmail.com>
88229 *
88230 * For the full copyright and license information, please view the LICENSE
88231 * file that was distributed with this source code.
88232 */
88233namespace Prophecy\Prophecy;
88234
88235use Prophecy\Argument;
88236use Prophecy\Prophet;
88237use Prophecy\Promise;
88238use Prophecy\Prediction;
88239use Prophecy\Exception\Doubler\MethodNotFoundException;
88240use Prophecy\Exception\InvalidArgumentException;
88241use Prophecy\Exception\Prophecy\MethodProphecyException;
88242use ReflectionNamedType;
88243use ReflectionType;
88244use ReflectionUnionType;
88245/**
88246 * Method prophecy.
88247 *
88248 * @author Konstantin Kudryashov <ever.zet@gmail.com>
88249 */
88250class MethodProphecy
88251{
88252    private $objectProphecy;
88253    private $methodName;
88254    private $argumentsWildcard;
88255    private $promise;
88256    private $prediction;
88257    private $checkedPredictions = array();
88258    private $bound = \false;
88259    private $voidReturnType = \false;
88260    /**
88261     * Initializes method prophecy.
88262     *
88263     * @param ObjectProphecy                        $objectProphecy
88264     * @param string                                $methodName
88265     * @param null|Argument\ArgumentsWildcard|array $arguments
88266     *
88267     * @throws \Prophecy\Exception\Doubler\MethodNotFoundException If method not found
88268     */
88269    public function __construct(\Prophecy\Prophecy\ObjectProphecy $objectProphecy, $methodName, $arguments = null)
88270    {
88271        $double = $objectProphecy->reveal();
88272        if (!\method_exists($double, $methodName)) {
88273            throw new MethodNotFoundException(\sprintf('Method `%s::%s()` is not defined.', \get_class($double), $methodName), \get_class($double), $methodName, $arguments);
88274        }
88275        $this->objectProphecy = $objectProphecy;
88276        $this->methodName = $methodName;
88277        $reflectedMethod = new \ReflectionMethod($double, $methodName);
88278        if ($reflectedMethod->isFinal()) {
88279            throw new MethodProphecyException(\sprintf("Can not add prophecy for a method `%s::%s()`\n" . "as it is a final method.", \get_class($double), $methodName), $this);
88280        }
88281        if (null !== $arguments) {
88282            $this->withArguments($arguments);
88283        }
88284        $hasTentativeReturnType = \method_exists($reflectedMethod, 'hasTentativeReturnType') && $reflectedMethod->hasTentativeReturnType();
88285        if (\true === $reflectedMethod->hasReturnType() || $hasTentativeReturnType) {
88286            if ($hasTentativeReturnType) {
88287                $reflectionType = $reflectedMethod->getTentativeReturnType();
88288            } else {
88289                $reflectionType = $reflectedMethod->getReturnType();
88290            }
88291            if ($reflectionType instanceof ReflectionNamedType) {
88292                $types = [$reflectionType];
88293            } elseif ($reflectionType instanceof ReflectionUnionType) {
88294                $types = $reflectionType->getTypes();
88295            }
88296            $types = \array_map(function (ReflectionType $type) {
88297                return $type->getName();
88298            }, $types);
88299            \usort($types, static function (string $type1, string $type2) {
88300                // null is lowest priority
88301                if ($type2 == 'null') {
88302                    return -1;
88303                } elseif ($type1 == 'null') {
88304                    return 1;
88305                }
88306                // objects are higher priority than scalars
88307                $isObject = static function ($type) {
88308                    return \class_exists($type) || \interface_exists($type);
88309                };
88310                if ($isObject($type1) && !$isObject($type2)) {
88311                    return -1;
88312                } elseif (!$isObject($type1) && $isObject($type2)) {
88313                    return 1;
88314                }
88315                // don't sort both-scalars or both-objects
88316                return 0;
88317            });
88318            $defaultType = $types[0];
88319            if ('void' === $defaultType) {
88320                $this->voidReturnType = \true;
88321            }
88322            $this->will(function () use($defaultType) {
88323                switch ($defaultType) {
88324                    case 'void':
88325                        return;
88326                    case 'string':
88327                        return '';
88328                    case 'float':
88329                        return 0.0;
88330                    case 'int':
88331                        return 0;
88332                    case 'bool':
88333                        return \false;
88334                    case 'array':
88335                        return array();
88336                    case 'callable':
88337                    case 'Closure':
88338                        return function () {
88339                        };
88340                    case 'Traversable':
88341                    case 'Generator':
88342                        return (function () {
88343                            yield;
88344                        })();
88345                    default:
88346                        $prophet = new Prophet();
88347                        return $prophet->prophesize($defaultType)->reveal();
88348                }
88349            });
88350        }
88351    }
88352    /**
88353     * Sets argument wildcard.
88354     *
88355     * @param array|Argument\ArgumentsWildcard $arguments
88356     *
88357     * @return $this
88358     *
88359     * @throws \Prophecy\Exception\InvalidArgumentException
88360     */
88361    public function withArguments($arguments)
88362    {
88363        if (\is_array($arguments)) {
88364            $arguments = new Argument\ArgumentsWildcard($arguments);
88365        }
88366        if (!$arguments instanceof Argument\ArgumentsWildcard) {
88367            throw new InvalidArgumentException(\sprintf("Either an array or an instance of ArgumentsWildcard expected as\n" . 'a `MethodProphecy::withArguments()` argument, but got %s.', \gettype($arguments)));
88368        }
88369        $this->argumentsWildcard = $arguments;
88370        return $this;
88371    }
88372    /**
88373     * Sets custom promise to the prophecy.
88374     *
88375     * @param callable|Promise\PromiseInterface $promise
88376     *
88377     * @return $this
88378     *
88379     * @throws \Prophecy\Exception\InvalidArgumentException
88380     */
88381    public function will($promise)
88382    {
88383        if (\is_callable($promise)) {
88384            $promise = new Promise\CallbackPromise($promise);
88385        }
88386        if (!$promise instanceof Promise\PromiseInterface) {
88387            throw new InvalidArgumentException(\sprintf('Expected callable or instance of PromiseInterface, but got %s.', \gettype($promise)));
88388        }
88389        $this->bindToObjectProphecy();
88390        $this->promise = $promise;
88391        return $this;
88392    }
88393    /**
88394     * Sets return promise to the prophecy.
88395     *
88396     * @see \Prophecy\Promise\ReturnPromise
88397     *
88398     * @return $this
88399     */
88400    public function willReturn()
88401    {
88402        if ($this->voidReturnType) {
88403            throw new MethodProphecyException("The method \"{$this->methodName}\" has a void return type, and so cannot return anything", $this);
88404        }
88405        return $this->will(new Promise\ReturnPromise(\func_get_args()));
88406    }
88407    /**
88408     * @param array $items
88409     * @param mixed $return
88410     *
88411     * @return $this
88412     *
88413     * @throws \Prophecy\Exception\InvalidArgumentException
88414     */
88415    public function willYield($items, $return = null)
88416    {
88417        if ($this->voidReturnType) {
88418            throw new MethodProphecyException("The method \"{$this->methodName}\" has a void return type, and so cannot yield anything", $this);
88419        }
88420        if (!\is_array($items)) {
88421            throw new InvalidArgumentException(\sprintf('Expected array, but got %s.', \gettype($items)));
88422        }
88423        $generator = function () use($items, $return) {
88424            yield from $items;
88425            return $return;
88426        };
88427        return $this->will($generator);
88428    }
88429    /**
88430     * Sets return argument promise to the prophecy.
88431     *
88432     * @param int $index The zero-indexed number of the argument to return
88433     *
88434     * @see \Prophecy\Promise\ReturnArgumentPromise
88435     *
88436     * @return $this
88437     */
88438    public function willReturnArgument($index = 0)
88439    {
88440        if ($this->voidReturnType) {
88441            throw new MethodProphecyException("The method \"{$this->methodName}\" has a void return type", $this);
88442        }
88443        return $this->will(new Promise\ReturnArgumentPromise($index));
88444    }
88445    /**
88446     * Sets throw promise to the prophecy.
88447     *
88448     * @see \Prophecy\Promise\ThrowPromise
88449     *
88450     * @param string|\Exception $exception Exception class or instance
88451     *
88452     * @return $this
88453     */
88454    public function willThrow($exception)
88455    {
88456        return $this->will(new Promise\ThrowPromise($exception));
88457    }
88458    /**
88459     * Sets custom prediction to the prophecy.
88460     *
88461     * @param callable|Prediction\PredictionInterface $prediction
88462     *
88463     * @return $this
88464     *
88465     * @throws \Prophecy\Exception\InvalidArgumentException
88466     */
88467    public function should($prediction)
88468    {
88469        if (\is_callable($prediction)) {
88470            $prediction = new Prediction\CallbackPrediction($prediction);
88471        }
88472        if (!$prediction instanceof Prediction\PredictionInterface) {
88473            throw new InvalidArgumentException(\sprintf('Expected callable or instance of PredictionInterface, but got %s.', \gettype($prediction)));
88474        }
88475        $this->bindToObjectProphecy();
88476        $this->prediction = $prediction;
88477        return $this;
88478    }
88479    /**
88480     * Sets call prediction to the prophecy.
88481     *
88482     * @see \Prophecy\Prediction\CallPrediction
88483     *
88484     * @return $this
88485     */
88486    public function shouldBeCalled()
88487    {
88488        return $this->should(new Prediction\CallPrediction());
88489    }
88490    /**
88491     * Sets no calls prediction to the prophecy.
88492     *
88493     * @see \Prophecy\Prediction\NoCallsPrediction
88494     *
88495     * @return $this
88496     */
88497    public function shouldNotBeCalled()
88498    {
88499        return $this->should(new Prediction\NoCallsPrediction());
88500    }
88501    /**
88502     * Sets call times prediction to the prophecy.
88503     *
88504     * @see \Prophecy\Prediction\CallTimesPrediction
88505     *
88506     * @param $count
88507     *
88508     * @return $this
88509     */
88510    public function shouldBeCalledTimes($count)
88511    {
88512        return $this->should(new Prediction\CallTimesPrediction($count));
88513    }
88514    /**
88515     * Sets call times prediction to the prophecy.
88516     *
88517     * @see \Prophecy\Prediction\CallTimesPrediction
88518     *
88519     * @return $this
88520     */
88521    public function shouldBeCalledOnce()
88522    {
88523        return $this->shouldBeCalledTimes(1);
88524    }
88525    /**
88526     * Checks provided prediction immediately.
88527     *
88528     * @param callable|Prediction\PredictionInterface $prediction
88529     *
88530     * @return $this
88531     *
88532     * @throws \Prophecy\Exception\InvalidArgumentException
88533     */
88534    public function shouldHave($prediction)
88535    {
88536        if (\is_callable($prediction)) {
88537            $prediction = new Prediction\CallbackPrediction($prediction);
88538        }
88539        if (!$prediction instanceof Prediction\PredictionInterface) {
88540            throw new InvalidArgumentException(\sprintf('Expected callable or instance of PredictionInterface, but got %s.', \gettype($prediction)));
88541        }
88542        if (null === $this->promise && !$this->voidReturnType) {
88543            $this->willReturn();
88544        }
88545        $calls = $this->getObjectProphecy()->findProphecyMethodCalls($this->getMethodName(), $this->getArgumentsWildcard());
88546        try {
88547            $prediction->check($calls, $this->getObjectProphecy(), $this);
88548            $this->checkedPredictions[] = $prediction;
88549        } catch (\Exception $e) {
88550            $this->checkedPredictions[] = $prediction;
88551            throw $e;
88552        }
88553        return $this;
88554    }
88555    /**
88556     * Checks call prediction.
88557     *
88558     * @see \Prophecy\Prediction\CallPrediction
88559     *
88560     * @return $this
88561     */
88562    public function shouldHaveBeenCalled()
88563    {
88564        return $this->shouldHave(new Prediction\CallPrediction());
88565    }
88566    /**
88567     * Checks no calls prediction.
88568     *
88569     * @see \Prophecy\Prediction\NoCallsPrediction
88570     *
88571     * @return $this
88572     */
88573    public function shouldNotHaveBeenCalled()
88574    {
88575        return $this->shouldHave(new Prediction\NoCallsPrediction());
88576    }
88577    /**
88578     * Checks no calls prediction.
88579     *
88580     * @see \Prophecy\Prediction\NoCallsPrediction
88581     * @deprecated
88582     *
88583     * @return $this
88584     */
88585    public function shouldNotBeenCalled()
88586    {
88587        return $this->shouldNotHaveBeenCalled();
88588    }
88589    /**
88590     * Checks call times prediction.
88591     *
88592     * @see \Prophecy\Prediction\CallTimesPrediction
88593     *
88594     * @param int $count
88595     *
88596     * @return $this
88597     */
88598    public function shouldHaveBeenCalledTimes($count)
88599    {
88600        return $this->shouldHave(new Prediction\CallTimesPrediction($count));
88601    }
88602    /**
88603     * Checks call times prediction.
88604     *
88605     * @see \Prophecy\Prediction\CallTimesPrediction
88606     *
88607     * @return $this
88608     */
88609    public function shouldHaveBeenCalledOnce()
88610    {
88611        return $this->shouldHaveBeenCalledTimes(1);
88612    }
88613    /**
88614     * Checks currently registered [with should(...)] prediction.
88615     */
88616    public function checkPrediction()
88617    {
88618        if (null === $this->prediction) {
88619            return;
88620        }
88621        $this->shouldHave($this->prediction);
88622    }
88623    /**
88624     * Returns currently registered promise.
88625     *
88626     * @return null|Promise\PromiseInterface
88627     */
88628    public function getPromise()
88629    {
88630        return $this->promise;
88631    }
88632    /**
88633     * Returns currently registered prediction.
88634     *
88635     * @return null|Prediction\PredictionInterface
88636     */
88637    public function getPrediction()
88638    {
88639        return $this->prediction;
88640    }
88641    /**
88642     * Returns predictions that were checked on this object.
88643     *
88644     * @return Prediction\PredictionInterface[]
88645     */
88646    public function getCheckedPredictions()
88647    {
88648        return $this->checkedPredictions;
88649    }
88650    /**
88651     * Returns object prophecy this method prophecy is tied to.
88652     *
88653     * @return ObjectProphecy
88654     */
88655    public function getObjectProphecy()
88656    {
88657        return $this->objectProphecy;
88658    }
88659    /**
88660     * Returns method name.
88661     *
88662     * @return string
88663     */
88664    public function getMethodName()
88665    {
88666        return $this->methodName;
88667    }
88668    /**
88669     * Returns arguments wildcard.
88670     *
88671     * @return Argument\ArgumentsWildcard
88672     */
88673    public function getArgumentsWildcard()
88674    {
88675        return $this->argumentsWildcard;
88676    }
88677    /**
88678     * @return bool
88679     */
88680    public function hasReturnVoid()
88681    {
88682        return $this->voidReturnType;
88683    }
88684    private function bindToObjectProphecy()
88685    {
88686        if ($this->bound) {
88687            return;
88688        }
88689        $this->getObjectProphecy()->addMethodProphecy($this);
88690        $this->bound = \true;
88691    }
88692}
88693<?php
88694
88695/*
88696 * This file is part of the Prophecy.
88697 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
88698 *     Marcello Duarte <marcello.duarte@gmail.com>
88699 *
88700 * For the full copyright and license information, please view the LICENSE
88701 * file that was distributed with this source code.
88702 */
88703namespace Prophecy\Prophecy;
88704
88705/**
88706 * Prophecies revealer interface.
88707 *
88708 * @author Konstantin Kudryashov <ever.zet@gmail.com>
88709 */
88710interface RevealerInterface
88711{
88712    /**
88713     * Unwraps value(s).
88714     *
88715     * @param mixed $value
88716     *
88717     * @return mixed
88718     */
88719    public function reveal($value);
88720}
88721<?php
88722
88723/*
88724 * This file is part of the Prophecy.
88725 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
88726 *     Marcello Duarte <marcello.duarte@gmail.com>
88727 *
88728 * For the full copyright and license information, please view the LICENSE
88729 * file that was distributed with this source code.
88730 */
88731namespace Prophecy\Prophecy;
88732
88733/**
88734 * Controllable doubles interface.
88735 *
88736 * @author Konstantin Kudryashov <ever.zet@gmail.com>
88737 */
88738interface ProphecySubjectInterface
88739{
88740    /**
88741     * Sets subject prophecy.
88742     *
88743     * @param ProphecyInterface $prophecy
88744     */
88745    public function setProphecy(\Prophecy\Prophecy\ProphecyInterface $prophecy);
88746    /**
88747     * Returns subject prophecy.
88748     *
88749     * @return ProphecyInterface
88750     */
88751    public function getProphecy();
88752}
88753<?php
88754
88755/*
88756 * This file is part of the Prophecy.
88757 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
88758 *     Marcello Duarte <marcello.duarte@gmail.com>
88759 *
88760 * For the full copyright and license information, please view the LICENSE
88761 * file that was distributed with this source code.
88762 */
88763namespace Prophecy\Prophecy;
88764
88765/**
88766 * Core Prophecy interface.
88767 *
88768 * @author Konstantin Kudryashov <ever.zet@gmail.com>
88769 */
88770interface ProphecyInterface
88771{
88772    /**
88773     * Reveals prophecy object (double) .
88774     *
88775     * @return object
88776     */
88777    public function reveal();
88778}
88779<?php
88780
88781/*
88782 * This file is part of the Prophecy.
88783 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
88784 *     Marcello Duarte <marcello.duarte@gmail.com>
88785 *
88786 * For the full copyright and license information, please view the LICENSE
88787 * file that was distributed with this source code.
88788 */
88789namespace Prophecy\Prophecy;
88790
88791use PHPUnit\SebastianBergmann\Comparator\ComparisonFailure;
88792use Prophecy\Comparator\Factory as ComparatorFactory;
88793use Prophecy\Call\Call;
88794use Prophecy\Doubler\LazyDouble;
88795use Prophecy\Argument\ArgumentsWildcard;
88796use Prophecy\Call\CallCenter;
88797use Prophecy\Exception\Prophecy\ObjectProphecyException;
88798use Prophecy\Exception\Prophecy\MethodProphecyException;
88799use Prophecy\Exception\Prediction\AggregateException;
88800use Prophecy\Exception\Prediction\PredictionException;
88801/**
88802 * Object prophecy.
88803 *
88804 * @author Konstantin Kudryashov <ever.zet@gmail.com>
88805 */
88806class ObjectProphecy implements \Prophecy\Prophecy\ProphecyInterface
88807{
88808    private $lazyDouble;
88809    private $callCenter;
88810    private $revealer;
88811    private $comparatorFactory;
88812    /**
88813     * @var MethodProphecy[][]
88814     */
88815    private $methodProphecies = array();
88816    /**
88817     * Initializes object prophecy.
88818     *
88819     * @param LazyDouble        $lazyDouble
88820     * @param CallCenter        $callCenter
88821     * @param RevealerInterface $revealer
88822     * @param ComparatorFactory $comparatorFactory
88823     */
88824    public function __construct(LazyDouble $lazyDouble, CallCenter $callCenter = null, \Prophecy\Prophecy\RevealerInterface $revealer = null, ComparatorFactory $comparatorFactory = null)
88825    {
88826        $this->lazyDouble = $lazyDouble;
88827        $this->callCenter = $callCenter ?: new CallCenter();
88828        $this->revealer = $revealer ?: new \Prophecy\Prophecy\Revealer();
88829        $this->comparatorFactory = $comparatorFactory ?: ComparatorFactory::getInstance();
88830    }
88831    /**
88832     * Forces double to extend specific class.
88833     *
88834     * @param string $class
88835     *
88836     * @return $this
88837     */
88838    public function willExtend($class)
88839    {
88840        $this->lazyDouble->setParentClass($class);
88841        return $this;
88842    }
88843    /**
88844     * Forces double to implement specific interface.
88845     *
88846     * @param string $interface
88847     *
88848     * @return $this
88849     */
88850    public function willImplement($interface)
88851    {
88852        $this->lazyDouble->addInterface($interface);
88853        return $this;
88854    }
88855    /**
88856     * Sets constructor arguments.
88857     *
88858     * @param array $arguments
88859     *
88860     * @return $this
88861     */
88862    public function willBeConstructedWith(array $arguments = null)
88863    {
88864        $this->lazyDouble->setArguments($arguments);
88865        return $this;
88866    }
88867    /**
88868     * Reveals double.
88869     *
88870     * @return object
88871     *
88872     * @throws \Prophecy\Exception\Prophecy\ObjectProphecyException If double doesn't implement needed interface
88873     */
88874    public function reveal()
88875    {
88876        $double = $this->lazyDouble->getInstance();
88877        if (null === $double || !$double instanceof \Prophecy\Prophecy\ProphecySubjectInterface) {
88878            throw new ObjectProphecyException("Generated double must implement ProphecySubjectInterface, but it does not.\n" . 'It seems you have wrongly configured doubler without required ClassPatch.', $this);
88879        }
88880        $double->setProphecy($this);
88881        return $double;
88882    }
88883    /**
88884     * Adds method prophecy to object prophecy.
88885     *
88886     * @param MethodProphecy $methodProphecy
88887     *
88888     * @throws \Prophecy\Exception\Prophecy\MethodProphecyException If method prophecy doesn't
88889     *                                                              have arguments wildcard
88890     */
88891    public function addMethodProphecy(\Prophecy\Prophecy\MethodProphecy $methodProphecy)
88892    {
88893        $argumentsWildcard = $methodProphecy->getArgumentsWildcard();
88894        if (null === $argumentsWildcard) {
88895            throw new MethodProphecyException(\sprintf("Can not add prophecy for a method `%s::%s()`\n" . "as you did not specify arguments wildcard for it.", \get_class($this->reveal()), $methodProphecy->getMethodName()), $methodProphecy);
88896        }
88897        $methodName = \strtolower($methodProphecy->getMethodName());
88898        if (!isset($this->methodProphecies[$methodName])) {
88899            $this->methodProphecies[$methodName] = array();
88900        }
88901        $this->methodProphecies[$methodName][] = $methodProphecy;
88902    }
88903    /**
88904     * Returns either all or related to single method prophecies.
88905     *
88906     * @param null|string $methodName
88907     *
88908     * @return MethodProphecy[]
88909     */
88910    public function getMethodProphecies($methodName = null)
88911    {
88912        if (null === $methodName) {
88913            return $this->methodProphecies;
88914        }
88915        $methodName = \strtolower($methodName);
88916        if (!isset($this->methodProphecies[$methodName])) {
88917            return array();
88918        }
88919        return $this->methodProphecies[$methodName];
88920    }
88921    /**
88922     * Makes specific method call.
88923     *
88924     * @param string $methodName
88925     * @param array  $arguments
88926     *
88927     * @return mixed
88928     */
88929    public function makeProphecyMethodCall($methodName, array $arguments)
88930    {
88931        $arguments = $this->revealer->reveal($arguments);
88932        $return = $this->callCenter->makeCall($this, $methodName, $arguments);
88933        return $this->revealer->reveal($return);
88934    }
88935    /**
88936     * Finds calls by method name & arguments wildcard.
88937     *
88938     * @param string            $methodName
88939     * @param ArgumentsWildcard $wildcard
88940     *
88941     * @return Call[]
88942     */
88943    public function findProphecyMethodCalls($methodName, ArgumentsWildcard $wildcard)
88944    {
88945        return $this->callCenter->findCalls($methodName, $wildcard);
88946    }
88947    /**
88948     * Checks that registered method predictions do not fail.
88949     *
88950     * @throws \Prophecy\Exception\Prediction\AggregateException If any of registered predictions fail
88951     * @throws \Prophecy\Exception\Call\UnexpectedCallException
88952     */
88953    public function checkProphecyMethodsPredictions()
88954    {
88955        $exception = new AggregateException(\sprintf("%s:\n", \get_class($this->reveal())));
88956        $exception->setObjectProphecy($this);
88957        $this->callCenter->checkUnexpectedCalls();
88958        foreach ($this->methodProphecies as $prophecies) {
88959            foreach ($prophecies as $prophecy) {
88960                try {
88961                    $prophecy->checkPrediction();
88962                } catch (PredictionException $e) {
88963                    $exception->append($e);
88964                }
88965            }
88966        }
88967        if (\count($exception->getExceptions())) {
88968            throw $exception;
88969        }
88970    }
88971    /**
88972     * Creates new method prophecy using specified method name and arguments.
88973     *
88974     * @param string $methodName
88975     * @param array  $arguments
88976     *
88977     * @return MethodProphecy
88978     */
88979    public function __call($methodName, array $arguments)
88980    {
88981        $arguments = new ArgumentsWildcard($this->revealer->reveal($arguments));
88982        foreach ($this->getMethodProphecies($methodName) as $prophecy) {
88983            $argumentsWildcard = $prophecy->getArgumentsWildcard();
88984            $comparator = $this->comparatorFactory->getComparatorFor($argumentsWildcard, $arguments);
88985            try {
88986                $comparator->assertEquals($argumentsWildcard, $arguments);
88987                return $prophecy;
88988            } catch (ComparisonFailure $failure) {
88989            }
88990        }
88991        return new \Prophecy\Prophecy\MethodProphecy($this, $methodName, $arguments);
88992    }
88993    /**
88994     * Tries to get property value from double.
88995     *
88996     * @param string $name
88997     *
88998     * @return mixed
88999     */
89000    public function __get($name)
89001    {
89002        return $this->reveal()->{$name};
89003    }
89004    /**
89005     * Tries to set property value to double.
89006     *
89007     * @param string $name
89008     * @param mixed  $value
89009     */
89010    public function __set($name, $value)
89011    {
89012        $this->reveal()->{$name} = $this->revealer->reveal($value);
89013    }
89014}
89015<?php
89016
89017/*
89018 * This file is part of the Prophecy.
89019 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
89020 *     Marcello Duarte <marcello.duarte@gmail.com>
89021 *
89022 * For the full copyright and license information, please view the LICENSE
89023 * file that was distributed with this source code.
89024 */
89025namespace Prophecy;
89026
89027use Prophecy\Argument\Token;
89028/**
89029 * Argument tokens shortcuts.
89030 *
89031 * @author Konstantin Kudryashov <ever.zet@gmail.com>
89032 */
89033class Argument
89034{
89035    /**
89036     * Checks that argument is exact value or object.
89037     *
89038     * @param mixed $value
89039     *
89040     * @return Token\ExactValueToken
89041     */
89042    public static function exact($value)
89043    {
89044        return new Token\ExactValueToken($value);
89045    }
89046    /**
89047     * Checks that argument is of specific type or instance of specific class.
89048     *
89049     * @param string $type Type name (`integer`, `string`) or full class name
89050     *
89051     * @return Token\TypeToken
89052     */
89053    public static function type($type)
89054    {
89055        return new Token\TypeToken($type);
89056    }
89057    /**
89058     * Checks that argument object has specific state.
89059     *
89060     * @param string $methodName
89061     * @param mixed  $value
89062     *
89063     * @return Token\ObjectStateToken
89064     */
89065    public static function which($methodName, $value)
89066    {
89067        return new Token\ObjectStateToken($methodName, $value);
89068    }
89069    /**
89070     * Checks that argument matches provided callback.
89071     *
89072     * @param callable $callback
89073     *
89074     * @return Token\CallbackToken
89075     */
89076    public static function that($callback)
89077    {
89078        return new Token\CallbackToken($callback);
89079    }
89080    /**
89081     * Matches any single value.
89082     *
89083     * @return Token\AnyValueToken
89084     */
89085    public static function any()
89086    {
89087        return new Token\AnyValueToken();
89088    }
89089    /**
89090     * Matches all values to the rest of the signature.
89091     *
89092     * @return Token\AnyValuesToken
89093     */
89094    public static function cetera()
89095    {
89096        return new Token\AnyValuesToken();
89097    }
89098    /**
89099     * Checks that argument matches all tokens
89100     *
89101     * @param mixed ... a list of tokens
89102     *
89103     * @return Token\LogicalAndToken
89104     */
89105    public static function allOf()
89106    {
89107        return new Token\LogicalAndToken(\func_get_args());
89108    }
89109    /**
89110     * Checks that argument array or countable object has exact number of elements.
89111     *
89112     * @param integer $value array elements count
89113     *
89114     * @return Token\ArrayCountToken
89115     */
89116    public static function size($value)
89117    {
89118        return new Token\ArrayCountToken($value);
89119    }
89120    /**
89121     * Checks that argument array contains (key, value) pair
89122     *
89123     * @param mixed $key   exact value or token
89124     * @param mixed $value exact value or token
89125     *
89126     * @return Token\ArrayEntryToken
89127     */
89128    public static function withEntry($key, $value)
89129    {
89130        return new Token\ArrayEntryToken($key, $value);
89131    }
89132    /**
89133     * Checks that arguments array entries all match value
89134     *
89135     * @param mixed $value
89136     *
89137     * @return Token\ArrayEveryEntryToken
89138     */
89139    public static function withEveryEntry($value)
89140    {
89141        return new Token\ArrayEveryEntryToken($value);
89142    }
89143    /**
89144     * Checks that argument array contains value
89145     *
89146     * @param mixed $value
89147     *
89148     * @return Token\ArrayEntryToken
89149     */
89150    public static function containing($value)
89151    {
89152        return new Token\ArrayEntryToken(self::any(), $value);
89153    }
89154    /**
89155     * Checks that argument array has key
89156     *
89157     * @param mixed $key exact value or token
89158     *
89159     * @return Token\ArrayEntryToken
89160     */
89161    public static function withKey($key)
89162    {
89163        return new Token\ArrayEntryToken($key, self::any());
89164    }
89165    /**
89166     * Checks that argument does not match the value|token.
89167     *
89168     * @param mixed $value either exact value or argument token
89169     *
89170     * @return Token\LogicalNotToken
89171     */
89172    public static function not($value)
89173    {
89174        return new Token\LogicalNotToken($value);
89175    }
89176    /**
89177     * @param string $value
89178     *
89179     * @return Token\StringContainsToken
89180     */
89181    public static function containingString($value)
89182    {
89183        return new Token\StringContainsToken($value);
89184    }
89185    /**
89186     * Checks that argument is identical value.
89187     *
89188     * @param mixed $value
89189     *
89190     * @return Token\IdenticalValueToken
89191     */
89192    public static function is($value)
89193    {
89194        return new Token\IdenticalValueToken($value);
89195    }
89196    /**
89197     * Check that argument is same value when rounding to the
89198     * given precision.
89199     *
89200     * @param float $value
89201     * @param float $precision
89202     *
89203     * @return Token\ApproximateValueToken
89204     */
89205    public static function approximate($value, $precision = 0)
89206    {
89207        return new Token\ApproximateValueToken($value, $precision);
89208    }
89209    /**
89210     * Checks that argument is in array.
89211     *
89212     * @param array $value
89213     *
89214     * @return Token\InArrayToken
89215     */
89216    public static function in($value)
89217    {
89218        return new Token\InArrayToken($value);
89219    }
89220    /**
89221     * Checks that argument is not in array.
89222     *
89223     * @param array $value
89224     *
89225     * @return Token\NotInArrayToken
89226     */
89227    public static function notIn($value)
89228    {
89229        return new Token\NotInArrayToken($value);
89230    }
89231}
89232<?php
89233
89234/*
89235 * This file is part of the Prophecy.
89236 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
89237 *     Marcello Duarte <marcello.duarte@gmail.com>
89238 *
89239 * For the full copyright and license information, please view the LICENSE
89240 * file that was distributed with this source code.
89241 */
89242namespace Prophecy\Util;
89243
89244use Prophecy\Call\Call;
89245/**
89246 * String utility.
89247 *
89248 * @author Konstantin Kudryashov <ever.zet@gmail.com>
89249 */
89250class StringUtil
89251{
89252    private $verbose;
89253    /**
89254     * @param bool $verbose
89255     */
89256    public function __construct($verbose = \true)
89257    {
89258        $this->verbose = $verbose;
89259    }
89260    /**
89261     * Stringifies any provided value.
89262     *
89263     * @param mixed   $value
89264     * @param boolean $exportObject
89265     *
89266     * @return string
89267     */
89268    public function stringify($value, $exportObject = \true)
89269    {
89270        if (\is_array($value)) {
89271            if (\range(0, \count($value) - 1) === \array_keys($value)) {
89272                return '[' . \implode(', ', \array_map(array($this, __FUNCTION__), $value)) . ']';
89273            }
89274            $stringify = array($this, __FUNCTION__);
89275            return '[' . \implode(', ', \array_map(function ($item, $key) use($stringify) {
89276                return (\is_integer($key) ? $key : '"' . $key . '"') . ' => ' . \call_user_func($stringify, $item);
89277            }, $value, \array_keys($value))) . ']';
89278        }
89279        if (\is_resource($value)) {
89280            return \get_resource_type($value) . ':' . $value;
89281        }
89282        if (\is_object($value)) {
89283            return $exportObject ? \Prophecy\Util\ExportUtil::export($value) : \sprintf('%s:%s', \get_class($value), \spl_object_hash($value));
89284        }
89285        if (\true === $value || \false === $value) {
89286            return $value ? 'true' : 'false';
89287        }
89288        if (\is_string($value)) {
89289            $str = \sprintf('"%s"', \str_replace("\n", '\\n', $value));
89290            if (!$this->verbose && 50 <= \strlen($str)) {
89291                return \substr($str, 0, 50) . '"...';
89292            }
89293            return $str;
89294        }
89295        if (null === $value) {
89296            return 'null';
89297        }
89298        return (string) $value;
89299    }
89300    /**
89301     * Stringifies provided array of calls.
89302     *
89303     * @param Call[] $calls Array of Call instances
89304     *
89305     * @return string
89306     */
89307    public function stringifyCalls(array $calls)
89308    {
89309        $self = $this;
89310        return \implode(\PHP_EOL, \array_map(function (Call $call) use($self) {
89311            return \sprintf('  - %s(%s) @ %s', $call->getMethodName(), \implode(', ', \array_map(array($self, 'stringify'), $call->getArguments())), \str_replace(\GETCWD() . \DIRECTORY_SEPARATOR, '', $call->getCallPlace()));
89312        }, $calls));
89313    }
89314}
89315<?php
89316
89317namespace Prophecy\Util;
89318
89319use Prophecy\Prophecy\ProphecyInterface;
89320use PHPUnit\SebastianBergmann\RecursionContext\Context;
89321/*
89322 * This file is part of the Prophecy.
89323 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
89324 *     Marcello Duarte <marcello.duarte@gmail.com>
89325 *
89326 * For the full copyright and license information, please view the LICENSE
89327 * file that was distributed with this source code.
89328 */
89329/**
89330 * This class is a modification from sebastianbergmann/exporter
89331 * @see https://github.com/sebastianbergmann/exporter
89332 */
89333class ExportUtil
89334{
89335    /**
89336     * Exports a value as a string
89337     *
89338     * The output of this method is similar to the output of print_r(), but
89339     * improved in various aspects:
89340     *
89341     *  - NULL is rendered as "null" (instead of "")
89342     *  - TRUE is rendered as "true" (instead of "1")
89343     *  - FALSE is rendered as "false" (instead of "")
89344     *  - Strings are always quoted with single quotes
89345     *  - Carriage returns and newlines are normalized to \n
89346     *  - Recursion and repeated rendering is treated properly
89347     *
89348     * @param  mixed  $value
89349     * @param  int    $indentation The indentation level of the 2nd+ line
89350     * @return string
89351     */
89352    public static function export($value, $indentation = 0)
89353    {
89354        return self::recursiveExport($value, $indentation);
89355    }
89356    /**
89357     * Converts an object to an array containing all of its private, protected
89358     * and public properties.
89359     *
89360     * @param  mixed $value
89361     * @return array
89362     */
89363    public static function toArray($value)
89364    {
89365        if (!\is_object($value)) {
89366            return (array) $value;
89367        }
89368        $array = array();
89369        foreach ((array) $value as $key => $val) {
89370            // properties are transformed to keys in the following way:
89371            // private   $property => "\0Classname\0property"
89372            // protected $property => "\0*\0property"
89373            // public    $property => "property"
89374            if (\preg_match('/^\\0.+\\0(.+)$/', $key, $matches)) {
89375                $key = $matches[1];
89376            }
89377            // See https://github.com/php/php-src/commit/5721132
89378            if ($key === "\0gcdata") {
89379                continue;
89380            }
89381            $array[$key] = $val;
89382        }
89383        // Some internal classes like SplObjectStorage don't work with the
89384        // above (fast) mechanism nor with reflection in Zend.
89385        // Format the output similarly to print_r() in this case
89386        if ($value instanceof \SplObjectStorage) {
89387            // However, the fast method does work in HHVM, and exposes the
89388            // internal implementation. Hide it again.
89389            if (\property_exists('\\SplObjectStorage', '__storage')) {
89390                unset($array['__storage']);
89391            } elseif (\property_exists('\\SplObjectStorage', 'storage')) {
89392                unset($array['storage']);
89393            }
89394            if (\property_exists('\\SplObjectStorage', '__key')) {
89395                unset($array['__key']);
89396            }
89397            foreach ($value as $key => $val) {
89398                $array[\spl_object_hash($val)] = array('obj' => $val, 'inf' => $value->getInfo());
89399            }
89400        }
89401        return $array;
89402    }
89403    /**
89404     * Recursive implementation of export
89405     *
89406     * @param  mixed                                       $value       The value to export
89407     * @param  int                                         $indentation The indentation level of the 2nd+ line
89408     * @param  \SebastianBergmann\RecursionContext\Context $processed   Previously processed objects
89409     * @return string
89410     * @see    SebastianBergmann\Exporter\Exporter::export
89411     */
89412    protected static function recursiveExport(&$value, $indentation, $processed = null)
89413    {
89414        if ($value === null) {
89415            return 'null';
89416        }
89417        if ($value === \true) {
89418            return 'true';
89419        }
89420        if ($value === \false) {
89421            return 'false';
89422        }
89423        if (\is_float($value) && \floatval(\intval($value)) === $value) {
89424            return "{$value}.0";
89425        }
89426        if (\is_resource($value)) {
89427            return \sprintf('resource(%d) of type (%s)', $value, \get_resource_type($value));
89428        }
89429        if (\is_string($value)) {
89430            // Match for most non printable chars somewhat taking multibyte chars into account
89431            if (\preg_match('/[^\\x09-\\x0d\\x20-\\xff]/', $value)) {
89432                return 'Binary String: 0x' . \bin2hex($value);
89433            }
89434            return "'" . \str_replace(array("\r\n", "\n\r", "\r"), array("\n", "\n", "\n"), $value) . "'";
89435        }
89436        $whitespace = \str_repeat(' ', 4 * $indentation);
89437        if (!$processed) {
89438            $processed = new Context();
89439        }
89440        if (\is_array($value)) {
89441            if (($key = $processed->contains($value)) !== \false) {
89442                return 'Array &' . $key;
89443            }
89444            $array = $value;
89445            $key = $processed->add($value);
89446            $values = '';
89447            if (\count($array) > 0) {
89448                foreach ($array as $k => $v) {
89449                    $values .= \sprintf('%s    %s => %s' . "\n", $whitespace, self::recursiveExport($k, $indentation), self::recursiveExport($value[$k], $indentation + 1, $processed));
89450                }
89451                $values = "\n" . $values . $whitespace;
89452            }
89453            return \sprintf('Array &%s (%s)', $key, $values);
89454        }
89455        if (\is_object($value)) {
89456            $class = \get_class($value);
89457            if ($hash = $processed->contains($value)) {
89458                return \sprintf('%s:%s Object', $class, $hash);
89459            }
89460            $hash = $processed->add($value);
89461            $values = '';
89462            $array = self::toArray($value);
89463            if (\count($array) > 0) {
89464                foreach ($array as $k => $v) {
89465                    $values .= \sprintf('%s    %s => %s' . "\n", $whitespace, self::recursiveExport($k, $indentation), self::recursiveExport($v, $indentation + 1, $processed));
89466                }
89467                $values = "\n" . $values . $whitespace;
89468            }
89469            return \sprintf('%s:%s Object (%s)', $class, $hash, $values);
89470        }
89471        return \var_export($value, \true);
89472    }
89473}
89474<?php
89475
89476/*
89477 * This file is part of the Prophecy.
89478 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
89479 *     Marcello Duarte <marcello.duarte@gmail.com>
89480 *
89481 * For the full copyright and license information, please view the LICENSE
89482 * file that was distributed with this source code.
89483 */
89484namespace Prophecy\Exception\Prophecy;
89485
89486use Prophecy\Exception\Exception;
89487interface ProphecyException extends Exception
89488{
89489}
89490<?php
89491
89492/*
89493 * This file is part of the Prophecy.
89494 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
89495 *     Marcello Duarte <marcello.duarte@gmail.com>
89496 *
89497 * For the full copyright and license information, please view the LICENSE
89498 * file that was distributed with this source code.
89499 */
89500namespace Prophecy\Exception\Prophecy;
89501
89502use Prophecy\Prophecy\MethodProphecy;
89503class MethodProphecyException extends \Prophecy\Exception\Prophecy\ObjectProphecyException
89504{
89505    private $methodProphecy;
89506    public function __construct($message, MethodProphecy $methodProphecy)
89507    {
89508        parent::__construct($message, $methodProphecy->getObjectProphecy());
89509        $this->methodProphecy = $methodProphecy;
89510    }
89511    /**
89512     * @return MethodProphecy
89513     */
89514    public function getMethodProphecy()
89515    {
89516        return $this->methodProphecy;
89517    }
89518}
89519<?php
89520
89521/*
89522 * This file is part of the Prophecy.
89523 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
89524 *     Marcello Duarte <marcello.duarte@gmail.com>
89525 *
89526 * For the full copyright and license information, please view the LICENSE
89527 * file that was distributed with this source code.
89528 */
89529namespace Prophecy\Exception\Prophecy;
89530
89531use Prophecy\Prophecy\ObjectProphecy;
89532class ObjectProphecyException extends \RuntimeException implements \Prophecy\Exception\Prophecy\ProphecyException
89533{
89534    private $objectProphecy;
89535    public function __construct($message, ObjectProphecy $objectProphecy)
89536    {
89537        parent::__construct($message);
89538        $this->objectProphecy = $objectProphecy;
89539    }
89540    /**
89541     * @return ObjectProphecy
89542     */
89543    public function getObjectProphecy()
89544    {
89545        return $this->objectProphecy;
89546    }
89547}
89548<?php
89549
89550/*
89551 * This file is part of the Prophecy.
89552 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
89553 *     Marcello Duarte <marcello.duarte@gmail.com>
89554 *
89555 * For the full copyright and license information, please view the LICENSE
89556 * file that was distributed with this source code.
89557 */
89558namespace Prophecy\Exception\Prediction;
89559
89560use Prophecy\Prophecy\MethodProphecy;
89561class UnexpectedCallsCountException extends \Prophecy\Exception\Prediction\UnexpectedCallsException
89562{
89563    private $expectedCount;
89564    public function __construct($message, MethodProphecy $methodProphecy, $count, array $calls)
89565    {
89566        parent::__construct($message, $methodProphecy, $calls);
89567        $this->expectedCount = \intval($count);
89568    }
89569    public function getExpectedCount()
89570    {
89571        return $this->expectedCount;
89572    }
89573}
89574<?php
89575
89576/*
89577 * This file is part of the Prophecy.
89578 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
89579 *     Marcello Duarte <marcello.duarte@gmail.com>
89580 *
89581 * For the full copyright and license information, please view the LICENSE
89582 * file that was distributed with this source code.
89583 */
89584namespace Prophecy\Exception\Prediction;
89585
89586use Prophecy\Prophecy\MethodProphecy;
89587use Prophecy\Exception\Prophecy\MethodProphecyException;
89588class UnexpectedCallsException extends MethodProphecyException implements \Prophecy\Exception\Prediction\PredictionException
89589{
89590    private $calls = array();
89591    public function __construct($message, MethodProphecy $methodProphecy, array $calls)
89592    {
89593        parent::__construct($message, $methodProphecy);
89594        $this->calls = $calls;
89595    }
89596    public function getCalls()
89597    {
89598        return $this->calls;
89599    }
89600}
89601<?php
89602
89603/*
89604 * This file is part of the Prophecy.
89605 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
89606 *     Marcello Duarte <marcello.duarte@gmail.com>
89607 *
89608 * For the full copyright and license information, please view the LICENSE
89609 * file that was distributed with this source code.
89610 */
89611namespace Prophecy\Exception\Prediction;
89612
89613use RuntimeException;
89614/**
89615 * Basic failed prediction exception.
89616 * Use it for custom prediction failures.
89617 *
89618 * @author Konstantin Kudryashov <ever.zet@gmail.com>
89619 */
89620class FailedPredictionException extends RuntimeException implements \Prophecy\Exception\Prediction\PredictionException
89621{
89622}
89623<?php
89624
89625/*
89626 * This file is part of the Prophecy.
89627 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
89628 *     Marcello Duarte <marcello.duarte@gmail.com>
89629 *
89630 * For the full copyright and license information, please view the LICENSE
89631 * file that was distributed with this source code.
89632 */
89633namespace Prophecy\Exception\Prediction;
89634
89635use Prophecy\Prophecy\ObjectProphecy;
89636class AggregateException extends \RuntimeException implements \Prophecy\Exception\Prediction\PredictionException
89637{
89638    private $exceptions = array();
89639    private $objectProphecy;
89640    public function append(\Prophecy\Exception\Prediction\PredictionException $exception)
89641    {
89642        $message = $exception->getMessage();
89643        $message = \strtr($message, array("\n" => "\n  ")) . "\n";
89644        $message = empty($this->exceptions) ? $message : "\n" . $message;
89645        $this->message = \rtrim($this->message . $message);
89646        $this->exceptions[] = $exception;
89647    }
89648    /**
89649     * @return PredictionException[]
89650     */
89651    public function getExceptions()
89652    {
89653        return $this->exceptions;
89654    }
89655    public function setObjectProphecy(ObjectProphecy $objectProphecy)
89656    {
89657        $this->objectProphecy = $objectProphecy;
89658    }
89659    /**
89660     * @return ObjectProphecy
89661     */
89662    public function getObjectProphecy()
89663    {
89664        return $this->objectProphecy;
89665    }
89666}
89667<?php
89668
89669/*
89670 * This file is part of the Prophecy.
89671 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
89672 *     Marcello Duarte <marcello.duarte@gmail.com>
89673 *
89674 * For the full copyright and license information, please view the LICENSE
89675 * file that was distributed with this source code.
89676 */
89677namespace Prophecy\Exception\Prediction;
89678
89679use Prophecy\Exception\Prophecy\MethodProphecyException;
89680class NoCallsException extends MethodProphecyException implements \Prophecy\Exception\Prediction\PredictionException
89681{
89682}
89683<?php
89684
89685/*
89686 * This file is part of the Prophecy.
89687 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
89688 *     Marcello Duarte <marcello.duarte@gmail.com>
89689 *
89690 * For the full copyright and license information, please view the LICENSE
89691 * file that was distributed with this source code.
89692 */
89693namespace Prophecy\Exception\Prediction;
89694
89695use Prophecy\Exception\Exception;
89696interface PredictionException extends Exception
89697{
89698}
89699<?php
89700
89701/*
89702 * This file is part of the Prophecy.
89703 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
89704 *     Marcello Duarte <marcello.duarte@gmail.com>
89705 *
89706 * For the full copyright and license information, please view the LICENSE
89707 * file that was distributed with this source code.
89708 */
89709namespace Prophecy\Exception\Call;
89710
89711use Prophecy\Exception\Prophecy\ObjectProphecyException;
89712use Prophecy\Prophecy\ObjectProphecy;
89713class UnexpectedCallException extends ObjectProphecyException
89714{
89715    private $methodName;
89716    private $arguments;
89717    public function __construct($message, ObjectProphecy $objectProphecy, $methodName, array $arguments)
89718    {
89719        parent::__construct($message, $objectProphecy);
89720        $this->methodName = $methodName;
89721        $this->arguments = $arguments;
89722    }
89723    public function getMethodName()
89724    {
89725        return $this->methodName;
89726    }
89727    public function getArguments()
89728    {
89729        return $this->arguments;
89730    }
89731}
89732<?php
89733
89734/*
89735 * This file is part of the Prophecy.
89736 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
89737 *     Marcello Duarte <marcello.duarte@gmail.com>
89738 *
89739 * For the full copyright and license information, please view the LICENSE
89740 * file that was distributed with this source code.
89741 */
89742namespace Prophecy\Exception;
89743
89744/**
89745 * Core Prophecy exception interface.
89746 * All Prophecy exceptions implement it.
89747 *
89748 * @author Konstantin Kudryashov <ever.zet@gmail.com>
89749 */
89750interface Exception extends \Throwable
89751{
89752}
89753<?php
89754
89755/*
89756 * This file is part of the Prophecy.
89757 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
89758 *     Marcello Duarte <marcello.duarte@gmail.com>
89759 *
89760 * For the full copyright and license information, please view the LICENSE
89761 * file that was distributed with this source code.
89762 */
89763namespace Prophecy\Exception\Doubler;
89764
89765class MethodNotFoundException extends \Prophecy\Exception\Doubler\DoubleException
89766{
89767    /**
89768     * @var string|object
89769     */
89770    private $classname;
89771    /**
89772     * @var string
89773     */
89774    private $methodName;
89775    /**
89776     * @var array
89777     */
89778    private $arguments;
89779    /**
89780     * @param string $message
89781     * @param string|object $classname
89782     * @param string $methodName
89783     * @param null|Argument\ArgumentsWildcard|array $arguments
89784     */
89785    public function __construct($message, $classname, $methodName, $arguments = null)
89786    {
89787        parent::__construct($message);
89788        $this->classname = $classname;
89789        $this->methodName = $methodName;
89790        $this->arguments = $arguments;
89791    }
89792    public function getClassname()
89793    {
89794        return $this->classname;
89795    }
89796    public function getMethodName()
89797    {
89798        return $this->methodName;
89799    }
89800    public function getArguments()
89801    {
89802        return $this->arguments;
89803    }
89804}
89805<?php
89806
89807/*
89808 * This file is part of the Prophecy.
89809 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
89810 *     Marcello Duarte <marcello.duarte@gmail.com>
89811 *
89812 * For the full copyright and license information, please view the LICENSE
89813 * file that was distributed with this source code.
89814 */
89815namespace Prophecy\Exception\Doubler;
89816
89817class ClassNotFoundException extends \Prophecy\Exception\Doubler\DoubleException
89818{
89819    private $classname;
89820    /**
89821     * @param string $message
89822     * @param string $classname
89823     */
89824    public function __construct($message, $classname)
89825    {
89826        parent::__construct($message);
89827        $this->classname = $classname;
89828    }
89829    public function getClassname()
89830    {
89831        return $this->classname;
89832    }
89833}
89834<?php
89835
89836/*
89837 * This file is part of the Prophecy.
89838 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
89839 *     Marcello Duarte <marcello.duarte@gmail.com>
89840 *
89841 * For the full copyright and license information, please view the LICENSE
89842 * file that was distributed with this source code.
89843 */
89844namespace Prophecy\Exception\Doubler;
89845
89846use ReflectionClass;
89847class ClassMirrorException extends \RuntimeException implements \Prophecy\Exception\Doubler\DoublerException
89848{
89849    private $class;
89850    public function __construct($message, ReflectionClass $class)
89851    {
89852        parent::__construct($message);
89853        $this->class = $class;
89854    }
89855    public function getReflectedClass()
89856    {
89857        return $this->class;
89858    }
89859}
89860<?php
89861
89862/*
89863 * This file is part of the Prophecy.
89864 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
89865 *     Marcello Duarte <marcello.duarte@gmail.com>
89866 *
89867 * For the full copyright and license information, please view the LICENSE
89868 * file that was distributed with this source code.
89869 */
89870namespace Prophecy\Exception\Doubler;
89871
89872use Prophecy\Exception\Exception;
89873interface DoublerException extends Exception
89874{
89875}
89876<?php
89877
89878/*
89879 * This file is part of the Prophecy.
89880 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
89881 *     Marcello Duarte <marcello.duarte@gmail.com>
89882 *
89883 * For the full copyright and license information, please view the LICENSE
89884 * file that was distributed with this source code.
89885 */
89886namespace Prophecy\Exception\Doubler;
89887
89888class InterfaceNotFoundException extends \Prophecy\Exception\Doubler\ClassNotFoundException
89889{
89890    public function getInterfaceName()
89891    {
89892        return $this->getClassname();
89893    }
89894}
89895<?php
89896
89897/*
89898 * This file is part of the Prophecy.
89899 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
89900 *     Marcello Duarte <marcello.duarte@gmail.com>
89901 *
89902 * For the full copyright and license information, please view the LICENSE
89903 * file that was distributed with this source code.
89904 */
89905namespace Prophecy\Exception\Doubler;
89906
89907class ReturnByReferenceException extends \Prophecy\Exception\Doubler\DoubleException
89908{
89909    private $classname;
89910    private $methodName;
89911    /**
89912     * @param string $message
89913     * @param string $classname
89914     * @param string $methodName
89915     */
89916    public function __construct($message, $classname, $methodName)
89917    {
89918        parent::__construct($message);
89919        $this->classname = $classname;
89920        $this->methodName = $methodName;
89921    }
89922    public function getClassname()
89923    {
89924        return $this->classname;
89925    }
89926    public function getMethodName()
89927    {
89928        return $this->methodName;
89929    }
89930}
89931<?php
89932
89933namespace Prophecy\Exception\Doubler;
89934
89935class MethodNotExtendableException extends \Prophecy\Exception\Doubler\DoubleException
89936{
89937    private $methodName;
89938    private $className;
89939    /**
89940     * @param string $message
89941     * @param string $className
89942     * @param string $methodName
89943     */
89944    public function __construct($message, $className, $methodName)
89945    {
89946        parent::__construct($message);
89947        $this->methodName = $methodName;
89948        $this->className = $className;
89949    }
89950    /**
89951     * @return string
89952     */
89953    public function getMethodName()
89954    {
89955        return $this->methodName;
89956    }
89957    /**
89958     * @return string
89959     */
89960    public function getClassName()
89961    {
89962        return $this->className;
89963    }
89964}
89965<?php
89966
89967/*
89968 * This file is part of the Prophecy.
89969 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
89970 *     Marcello Duarte <marcello.duarte@gmail.com>
89971 *
89972 * For the full copyright and license information, please view the LICENSE
89973 * file that was distributed with this source code.
89974 */
89975namespace Prophecy\Exception\Doubler;
89976
89977use RuntimeException;
89978class DoubleException extends RuntimeException implements \Prophecy\Exception\Doubler\DoublerException
89979{
89980}
89981<?php
89982
89983/*
89984 * This file is part of the Prophecy.
89985 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
89986 *     Marcello Duarte <marcello.duarte@gmail.com>
89987 *
89988 * For the full copyright and license information, please view the LICENSE
89989 * file that was distributed with this source code.
89990 */
89991namespace Prophecy\Exception\Doubler;
89992
89993use Prophecy\Doubler\Generator\Node\ClassNode;
89994class ClassCreatorException extends \RuntimeException implements \Prophecy\Exception\Doubler\DoublerException
89995{
89996    private $node;
89997    public function __construct($message, ClassNode $node)
89998    {
89999        parent::__construct($message);
90000        $this->node = $node;
90001    }
90002    public function getClassNode()
90003    {
90004        return $this->node;
90005    }
90006}
90007<?php
90008
90009/*
90010 * This file is part of the Prophecy.
90011 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
90012 *     Marcello Duarte <marcello.duarte@gmail.com>
90013 *
90014 * For the full copyright and license information, please view the LICENSE
90015 * file that was distributed with this source code.
90016 */
90017namespace Prophecy\Exception;
90018
90019class InvalidArgumentException extends \InvalidArgumentException implements \Prophecy\Exception\Exception
90020{
90021}
90022<?php
90023
90024/*
90025 * This file is part of the Prophecy.
90026 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
90027 *     Marcello Duarte <marcello.duarte@gmail.com>
90028 *
90029 * For the full copyright and license information, please view the LICENSE
90030 * file that was distributed with this source code.
90031 */
90032namespace Prophecy\Promise;
90033
90034use Prophecy\Prophecy\ObjectProphecy;
90035use Prophecy\Prophecy\MethodProphecy;
90036/**
90037 * Promise interface.
90038 * Promises are logical blocks, tied to `will...` keyword.
90039 *
90040 * @author Konstantin Kudryashov <ever.zet@gmail.com>
90041 */
90042interface PromiseInterface
90043{
90044    /**
90045     * Evaluates promise.
90046     *
90047     * @param array          $args
90048     * @param ObjectProphecy $object
90049     * @param MethodProphecy $method
90050     *
90051     * @return mixed
90052     */
90053    public function execute(array $args, ObjectProphecy $object, MethodProphecy $method);
90054}
90055<?php
90056
90057/*
90058 * This file is part of the Prophecy.
90059 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
90060 *     Marcello Duarte <marcello.duarte@gmail.com>
90061 *
90062 * For the full copyright and license information, please view the LICENSE
90063 * file that was distributed with this source code.
90064 */
90065namespace Prophecy\Promise;
90066
90067use PHPUnit\Doctrine\Instantiator\Instantiator;
90068use Prophecy\Prophecy\ObjectProphecy;
90069use Prophecy\Prophecy\MethodProphecy;
90070use Prophecy\Exception\InvalidArgumentException;
90071use ReflectionClass;
90072/**
90073 * Throw promise.
90074 *
90075 * @author Konstantin Kudryashov <ever.zet@gmail.com>
90076 */
90077class ThrowPromise implements \Prophecy\Promise\PromiseInterface
90078{
90079    private $exception;
90080    /**
90081     * @var \Doctrine\Instantiator\Instantiator
90082     */
90083    private $instantiator;
90084    /**
90085     * Initializes promise.
90086     *
90087     * @param string|\Exception|\Throwable $exception Exception class name or instance
90088     *
90089     * @throws \Prophecy\Exception\InvalidArgumentException
90090     */
90091    public function __construct($exception)
90092    {
90093        if (\is_string($exception)) {
90094            if (!\class_exists($exception) && !\interface_exists($exception) || !$this->isAValidThrowable($exception)) {
90095                throw new InvalidArgumentException(\sprintf('Exception / Throwable class or instance expected as argument to ThrowPromise, but got %s.', $exception));
90096            }
90097        } elseif (!$exception instanceof \Exception && !$exception instanceof \Throwable) {
90098            throw new InvalidArgumentException(\sprintf('Exception / Throwable class or instance expected as argument to ThrowPromise, but got %s.', \is_object($exception) ? \get_class($exception) : \gettype($exception)));
90099        }
90100        $this->exception = $exception;
90101    }
90102    /**
90103     * Throws predefined exception.
90104     *
90105     * @param array          $args
90106     * @param ObjectProphecy $object
90107     * @param MethodProphecy $method
90108     *
90109     * @throws object
90110     */
90111    public function execute(array $args, ObjectProphecy $object, MethodProphecy $method)
90112    {
90113        if (\is_string($this->exception)) {
90114            $classname = $this->exception;
90115            $reflection = new ReflectionClass($classname);
90116            $constructor = $reflection->getConstructor();
90117            if ($constructor->isPublic() && 0 == $constructor->getNumberOfRequiredParameters()) {
90118                throw $reflection->newInstance();
90119            }
90120            if (!$this->instantiator) {
90121                $this->instantiator = new Instantiator();
90122            }
90123            throw $this->instantiator->instantiate($classname);
90124        }
90125        throw $this->exception;
90126    }
90127    /**
90128     * @param string $exception
90129     *
90130     * @return bool
90131     */
90132    private function isAValidThrowable($exception)
90133    {
90134        return \is_a($exception, 'Exception', \true) || \is_a($exception, 'Throwable', \true);
90135    }
90136}
90137<?php
90138
90139/*
90140 * This file is part of the Prophecy.
90141 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
90142 *     Marcello Duarte <marcello.duarte@gmail.com>
90143 *
90144 * For the full copyright and license information, please view the LICENSE
90145 * file that was distributed with this source code.
90146 */
90147namespace Prophecy\Promise;
90148
90149use Prophecy\Prophecy\ObjectProphecy;
90150use Prophecy\Prophecy\MethodProphecy;
90151/**
90152 * Return promise.
90153 *
90154 * @author Konstantin Kudryashov <ever.zet@gmail.com>
90155 */
90156class ReturnPromise implements \Prophecy\Promise\PromiseInterface
90157{
90158    private $returnValues = array();
90159    /**
90160     * Initializes promise.
90161     *
90162     * @param array $returnValues Array of values
90163     */
90164    public function __construct(array $returnValues)
90165    {
90166        $this->returnValues = $returnValues;
90167    }
90168    /**
90169     * Returns saved values one by one until last one, then continuously returns last value.
90170     *
90171     * @param array          $args
90172     * @param ObjectProphecy $object
90173     * @param MethodProphecy $method
90174     *
90175     * @return mixed
90176     */
90177    public function execute(array $args, ObjectProphecy $object, MethodProphecy $method)
90178    {
90179        $value = \array_shift($this->returnValues);
90180        if (!\count($this->returnValues)) {
90181            $this->returnValues[] = $value;
90182        }
90183        return $value;
90184    }
90185}
90186<?php
90187
90188/*
90189 * This file is part of the Prophecy.
90190 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
90191 *     Marcello Duarte <marcello.duarte@gmail.com>
90192 *
90193 * For the full copyright and license information, please view the LICENSE
90194 * file that was distributed with this source code.
90195 */
90196namespace Prophecy\Promise;
90197
90198use Prophecy\Exception\InvalidArgumentException;
90199use Prophecy\Prophecy\ObjectProphecy;
90200use Prophecy\Prophecy\MethodProphecy;
90201/**
90202 * Return argument promise.
90203 *
90204 * @author Konstantin Kudryashov <ever.zet@gmail.com>
90205 */
90206class ReturnArgumentPromise implements \Prophecy\Promise\PromiseInterface
90207{
90208    /**
90209     * @var int
90210     */
90211    private $index;
90212    /**
90213     * Initializes callback promise.
90214     *
90215     * @param int $index The zero-indexed number of the argument to return
90216     *
90217     * @throws \Prophecy\Exception\InvalidArgumentException
90218     */
90219    public function __construct($index = 0)
90220    {
90221        if (!\is_int($index) || $index < 0) {
90222            throw new InvalidArgumentException(\sprintf('Zero-based index expected as argument to ReturnArgumentPromise, but got %s.', $index));
90223        }
90224        $this->index = $index;
90225    }
90226    /**
90227     * Returns nth argument if has one, null otherwise.
90228     *
90229     * @param array          $args
90230     * @param ObjectProphecy $object
90231     * @param MethodProphecy $method
90232     *
90233     * @return null|mixed
90234     */
90235    public function execute(array $args, ObjectProphecy $object, MethodProphecy $method)
90236    {
90237        return \count($args) > $this->index ? $args[$this->index] : null;
90238    }
90239}
90240<?php
90241
90242/*
90243 * This file is part of the Prophecy.
90244 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
90245 *     Marcello Duarte <marcello.duarte@gmail.com>
90246 *
90247 * For the full copyright and license information, please view the LICENSE
90248 * file that was distributed with this source code.
90249 */
90250namespace Prophecy\Promise;
90251
90252use Prophecy\Prophecy\ObjectProphecy;
90253use Prophecy\Prophecy\MethodProphecy;
90254use Prophecy\Exception\InvalidArgumentException;
90255use Closure;
90256use ReflectionFunction;
90257/**
90258 * Callback promise.
90259 *
90260 * @author Konstantin Kudryashov <ever.zet@gmail.com>
90261 */
90262class CallbackPromise implements \Prophecy\Promise\PromiseInterface
90263{
90264    private $callback;
90265    /**
90266     * Initializes callback promise.
90267     *
90268     * @param callable $callback Custom callback
90269     *
90270     * @throws \Prophecy\Exception\InvalidArgumentException
90271     */
90272    public function __construct($callback)
90273    {
90274        if (!\is_callable($callback)) {
90275            throw new InvalidArgumentException(\sprintf('Callable expected as an argument to CallbackPromise, but got %s.', \gettype($callback)));
90276        }
90277        $this->callback = $callback;
90278    }
90279    /**
90280     * Evaluates promise callback.
90281     *
90282     * @param array          $args
90283     * @param ObjectProphecy $object
90284     * @param MethodProphecy $method
90285     *
90286     * @return mixed
90287     */
90288    public function execute(array $args, ObjectProphecy $object, MethodProphecy $method)
90289    {
90290        $callback = $this->callback;
90291        if ($callback instanceof Closure && \method_exists('Closure', 'bind') && (new ReflectionFunction($callback))->getClosureThis() !== null) {
90292            $callback = Closure::bind($callback, $object);
90293        }
90294        return \call_user_func($callback, $args, $object, $method);
90295    }
90296}
90297<?php
90298
90299/*
90300 * This file is part of the Prophecy.
90301 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
90302 *     Marcello Duarte <marcello.duarte@gmail.com>
90303 *
90304 * For the full copyright and license information, please view the LICENSE
90305 * file that was distributed with this source code.
90306 */
90307namespace Prophecy\Prediction;
90308
90309use Prophecy\Call\Call;
90310use Prophecy\Prophecy\ObjectProphecy;
90311use Prophecy\Prophecy\MethodProphecy;
90312use Prophecy\Exception\InvalidArgumentException;
90313use Closure;
90314use ReflectionFunction;
90315/**
90316 * Callback prediction.
90317 *
90318 * @author Konstantin Kudryashov <ever.zet@gmail.com>
90319 */
90320class CallbackPrediction implements \Prophecy\Prediction\PredictionInterface
90321{
90322    private $callback;
90323    /**
90324     * Initializes callback prediction.
90325     *
90326     * @param callable $callback Custom callback
90327     *
90328     * @throws \Prophecy\Exception\InvalidArgumentException
90329     */
90330    public function __construct($callback)
90331    {
90332        if (!\is_callable($callback)) {
90333            throw new InvalidArgumentException(\sprintf('Callable expected as an argument to CallbackPrediction, but got %s.', \gettype($callback)));
90334        }
90335        $this->callback = $callback;
90336    }
90337    /**
90338     * Executes preset callback.
90339     *
90340     * @param Call[]         $calls
90341     * @param ObjectProphecy $object
90342     * @param MethodProphecy $method
90343     */
90344    public function check(array $calls, ObjectProphecy $object, MethodProphecy $method)
90345    {
90346        $callback = $this->callback;
90347        if ($callback instanceof Closure && \method_exists('Closure', 'bind') && (new ReflectionFunction($callback))->getClosureThis() !== null) {
90348            $callback = Closure::bind($callback, $object);
90349        }
90350        \call_user_func($callback, $calls, $object, $method);
90351    }
90352}
90353<?php
90354
90355/*
90356 * This file is part of the Prophecy.
90357 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
90358 *     Marcello Duarte <marcello.duarte@gmail.com>
90359 *
90360 * For the full copyright and license information, please view the LICENSE
90361 * file that was distributed with this source code.
90362 */
90363namespace Prophecy\Prediction;
90364
90365use Prophecy\Call\Call;
90366use Prophecy\Prophecy\ObjectProphecy;
90367use Prophecy\Prophecy\MethodProphecy;
90368use Prophecy\Argument\ArgumentsWildcard;
90369use Prophecy\Argument\Token\AnyValuesToken;
90370use Prophecy\Util\StringUtil;
90371use Prophecy\Exception\Prediction\NoCallsException;
90372/**
90373 * Call prediction.
90374 *
90375 * @author Konstantin Kudryashov <ever.zet@gmail.com>
90376 */
90377class CallPrediction implements \Prophecy\Prediction\PredictionInterface
90378{
90379    private $util;
90380    /**
90381     * Initializes prediction.
90382     *
90383     * @param StringUtil $util
90384     */
90385    public function __construct(StringUtil $util = null)
90386    {
90387        $this->util = $util ?: new StringUtil();
90388    }
90389    /**
90390     * Tests that there was at least one call.
90391     *
90392     * @param Call[]         $calls
90393     * @param ObjectProphecy $object
90394     * @param MethodProphecy $method
90395     *
90396     * @throws \Prophecy\Exception\Prediction\NoCallsException
90397     */
90398    public function check(array $calls, ObjectProphecy $object, MethodProphecy $method)
90399    {
90400        if (\count($calls)) {
90401            return;
90402        }
90403        $methodCalls = $object->findProphecyMethodCalls($method->getMethodName(), new ArgumentsWildcard(array(new AnyValuesToken())));
90404        if (\count($methodCalls)) {
90405            throw new NoCallsException(\sprintf("No calls have been made that match:\n" . "  %s->%s(%s)\n" . "but expected at least one.\n" . "Recorded `%s(...)` calls:\n%s", \get_class($object->reveal()), $method->getMethodName(), $method->getArgumentsWildcard(), $method->getMethodName(), $this->util->stringifyCalls($methodCalls)), $method);
90406        }
90407        throw new NoCallsException(\sprintf("No calls have been made that match:\n" . "  %s->%s(%s)\n" . "but expected at least one.", \get_class($object->reveal()), $method->getMethodName(), $method->getArgumentsWildcard()), $method);
90408    }
90409}
90410<?php
90411
90412/*
90413 * This file is part of the Prophecy.
90414 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
90415 *     Marcello Duarte <marcello.duarte@gmail.com>
90416 *
90417 * For the full copyright and license information, please view the LICENSE
90418 * file that was distributed with this source code.
90419 */
90420namespace Prophecy\Prediction;
90421
90422use Prophecy\Call\Call;
90423use Prophecy\Prophecy\ObjectProphecy;
90424use Prophecy\Prophecy\MethodProphecy;
90425use Prophecy\Argument\ArgumentsWildcard;
90426use Prophecy\Argument\Token\AnyValuesToken;
90427use Prophecy\Util\StringUtil;
90428use Prophecy\Exception\Prediction\UnexpectedCallsCountException;
90429/**
90430 * Prediction interface.
90431 * Predictions are logical test blocks, tied to `should...` keyword.
90432 *
90433 * @author Konstantin Kudryashov <ever.zet@gmail.com>
90434 */
90435class CallTimesPrediction implements \Prophecy\Prediction\PredictionInterface
90436{
90437    private $times;
90438    private $util;
90439    /**
90440     * Initializes prediction.
90441     *
90442     * @param int        $times
90443     * @param StringUtil $util
90444     */
90445    public function __construct($times, StringUtil $util = null)
90446    {
90447        $this->times = \intval($times);
90448        $this->util = $util ?: new StringUtil();
90449    }
90450    /**
90451     * Tests that there was exact amount of calls made.
90452     *
90453     * @param Call[]         $calls
90454     * @param ObjectProphecy $object
90455     * @param MethodProphecy $method
90456     *
90457     * @throws \Prophecy\Exception\Prediction\UnexpectedCallsCountException
90458     */
90459    public function check(array $calls, ObjectProphecy $object, MethodProphecy $method)
90460    {
90461        if ($this->times == \count($calls)) {
90462            return;
90463        }
90464        $methodCalls = $object->findProphecyMethodCalls($method->getMethodName(), new ArgumentsWildcard(array(new AnyValuesToken())));
90465        if (\count($calls)) {
90466            $message = \sprintf("Expected exactly %d calls that match:\n" . "  %s->%s(%s)\n" . "but %d were made:\n%s", $this->times, \get_class($object->reveal()), $method->getMethodName(), $method->getArgumentsWildcard(), \count($calls), $this->util->stringifyCalls($calls));
90467        } elseif (\count($methodCalls)) {
90468            $message = \sprintf("Expected exactly %d calls that match:\n" . "  %s->%s(%s)\n" . "but none were made.\n" . "Recorded `%s(...)` calls:\n%s", $this->times, \get_class($object->reveal()), $method->getMethodName(), $method->getArgumentsWildcard(), $method->getMethodName(), $this->util->stringifyCalls($methodCalls));
90469        } else {
90470            $message = \sprintf("Expected exactly %d calls that match:\n" . "  %s->%s(%s)\n" . "but none were made.", $this->times, \get_class($object->reveal()), $method->getMethodName(), $method->getArgumentsWildcard());
90471        }
90472        throw new UnexpectedCallsCountException($message, $method, $this->times, $calls);
90473    }
90474}
90475<?php
90476
90477/*
90478 * This file is part of the Prophecy.
90479 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
90480 *     Marcello Duarte <marcello.duarte@gmail.com>
90481 *
90482 * For the full copyright and license information, please view the LICENSE
90483 * file that was distributed with this source code.
90484 */
90485namespace Prophecy\Prediction;
90486
90487use Prophecy\Call\Call;
90488use Prophecy\Prophecy\ObjectProphecy;
90489use Prophecy\Prophecy\MethodProphecy;
90490/**
90491 * Prediction interface.
90492 * Predictions are logical test blocks, tied to `should...` keyword.
90493 *
90494 * @author Konstantin Kudryashov <ever.zet@gmail.com>
90495 */
90496interface PredictionInterface
90497{
90498    /**
90499     * Tests that double fulfilled prediction.
90500     *
90501     * @param Call[]        $calls
90502     * @param ObjectProphecy $object
90503     * @param MethodProphecy $method
90504     *
90505     * @throws object
90506     * @return void
90507     */
90508    public function check(array $calls, ObjectProphecy $object, MethodProphecy $method);
90509}
90510<?php
90511
90512/*
90513 * This file is part of the Prophecy.
90514 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
90515 *     Marcello Duarte <marcello.duarte@gmail.com>
90516 *
90517 * For the full copyright and license information, please view the LICENSE
90518 * file that was distributed with this source code.
90519 */
90520namespace Prophecy\Prediction;
90521
90522use Prophecy\Call\Call;
90523use Prophecy\Prophecy\ObjectProphecy;
90524use Prophecy\Prophecy\MethodProphecy;
90525use Prophecy\Util\StringUtil;
90526use Prophecy\Exception\Prediction\UnexpectedCallsException;
90527/**
90528 * No calls prediction.
90529 *
90530 * @author Konstantin Kudryashov <ever.zet@gmail.com>
90531 */
90532class NoCallsPrediction implements \Prophecy\Prediction\PredictionInterface
90533{
90534    private $util;
90535    /**
90536     * Initializes prediction.
90537     *
90538     * @param null|StringUtil $util
90539     */
90540    public function __construct(StringUtil $util = null)
90541    {
90542        $this->util = $util ?: new StringUtil();
90543    }
90544    /**
90545     * Tests that there were no calls made.
90546     *
90547     * @param Call[]         $calls
90548     * @param ObjectProphecy $object
90549     * @param MethodProphecy $method
90550     *
90551     * @throws \Prophecy\Exception\Prediction\UnexpectedCallsException
90552     */
90553    public function check(array $calls, ObjectProphecy $object, MethodProphecy $method)
90554    {
90555        if (!\count($calls)) {
90556            return;
90557        }
90558        $verb = \count($calls) === 1 ? 'was' : 'were';
90559        throw new UnexpectedCallsException(\sprintf("No calls expected that match:\n" . "  %s->%s(%s)\n" . "but %d %s made:\n%s", \get_class($object->reveal()), $method->getMethodName(), $method->getArgumentsWildcard(), \count($calls), $verb, $this->util->stringifyCalls($calls)), $method, $calls);
90560    }
90561}
90562<?php
90563
90564/*
90565 * This file is part of the Prophecy.
90566 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
90567 *     Marcello Duarte <marcello.duarte@gmail.com>
90568 *
90569 * For the full copyright and license information, please view the LICENSE
90570 * file that was distributed with this source code.
90571 */
90572namespace Prophecy\PhpDocumentor;
90573
90574use PHPUnit\phpDocumentor\Reflection\DocBlock;
90575use PHPUnit\phpDocumentor\Reflection\DocBlock\Tag\MethodTag as LegacyMethodTag;
90576/**
90577 * @author Théo FIDRY <theo.fidry@gmail.com>
90578 *
90579 * @internal
90580 */
90581final class LegacyClassTagRetriever implements \Prophecy\PhpDocumentor\MethodTagRetrieverInterface
90582{
90583    /**
90584     * @param \ReflectionClass $reflectionClass
90585     *
90586     * @return LegacyMethodTag[]
90587     */
90588    public function getTagList(\ReflectionClass $reflectionClass)
90589    {
90590        $phpdoc = new DocBlock($reflectionClass->getDocComment());
90591        return $phpdoc->getTagsByName('method');
90592    }
90593}
90594<?php
90595
90596/*
90597 * This file is part of the Prophecy.
90598 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
90599 *     Marcello Duarte <marcello.duarte@gmail.com>
90600 *
90601 * For the full copyright and license information, please view the LICENSE
90602 * file that was distributed with this source code.
90603 */
90604namespace Prophecy\PhpDocumentor;
90605
90606use PHPUnit\phpDocumentor\Reflection\DocBlock\Tag\MethodTag as LegacyMethodTag;
90607use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Method;
90608/**
90609 * @author Théo FIDRY <theo.fidry@gmail.com>
90610 *
90611 * @internal
90612 */
90613interface MethodTagRetrieverInterface
90614{
90615    /**
90616     * @param \ReflectionClass $reflectionClass
90617     *
90618     * @return LegacyMethodTag[]|Method[]
90619     */
90620    public function getTagList(\ReflectionClass $reflectionClass);
90621}
90622<?php
90623
90624/*
90625 * This file is part of the Prophecy.
90626 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
90627 *     Marcello Duarte <marcello.duarte@gmail.com>
90628 *
90629 * For the full copyright and license information, please view the LICENSE
90630 * file that was distributed with this source code.
90631 */
90632namespace Prophecy\PhpDocumentor;
90633
90634use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Method;
90635use PHPUnit\phpDocumentor\Reflection\DocBlockFactory;
90636use PHPUnit\phpDocumentor\Reflection\Types\ContextFactory;
90637/**
90638 * @author Théo FIDRY <theo.fidry@gmail.com>
90639 *
90640 * @internal
90641 */
90642final class ClassTagRetriever implements \Prophecy\PhpDocumentor\MethodTagRetrieverInterface
90643{
90644    private $docBlockFactory;
90645    private $contextFactory;
90646    public function __construct()
90647    {
90648        $this->docBlockFactory = DocBlockFactory::createInstance();
90649        $this->contextFactory = new ContextFactory();
90650    }
90651    /**
90652     * @param \ReflectionClass $reflectionClass
90653     *
90654     * @return Method[]
90655     */
90656    public function getTagList(\ReflectionClass $reflectionClass)
90657    {
90658        try {
90659            $phpdoc = $this->docBlockFactory->create($reflectionClass, $this->contextFactory->createFromReflector($reflectionClass));
90660            $methods = array();
90661            foreach ($phpdoc->getTagsByName('method') as $tag) {
90662                if ($tag instanceof Method) {
90663                    $methods[] = $tag;
90664                }
90665            }
90666            return $methods;
90667        } catch (\InvalidArgumentException $e) {
90668            return array();
90669        }
90670    }
90671}
90672<?php
90673
90674/*
90675 * This file is part of the Prophecy.
90676 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
90677 *     Marcello Duarte <marcello.duarte@gmail.com>
90678 *
90679 * For the full copyright and license information, please view the LICENSE
90680 * file that was distributed with this source code.
90681 */
90682namespace Prophecy\PhpDocumentor;
90683
90684use PHPUnit\phpDocumentor\Reflection\DocBlock\Tag\MethodTag as LegacyMethodTag;
90685use PHPUnit\phpDocumentor\Reflection\DocBlock\Tags\Method;
90686/**
90687 * @author Théo FIDRY <theo.fidry@gmail.com>
90688 *
90689 * @internal
90690 */
90691final class ClassAndInterfaceTagRetriever implements \Prophecy\PhpDocumentor\MethodTagRetrieverInterface
90692{
90693    private $classRetriever;
90694    public function __construct(\Prophecy\PhpDocumentor\MethodTagRetrieverInterface $classRetriever = null)
90695    {
90696        if (null !== $classRetriever) {
90697            $this->classRetriever = $classRetriever;
90698            return;
90699        }
90700        $this->classRetriever = \class_exists('PHPUnit\\phpDocumentor\\Reflection\\DocBlockFactory') && \class_exists('PHPUnit\\phpDocumentor\\Reflection\\Types\\ContextFactory') ? new \Prophecy\PhpDocumentor\ClassTagRetriever() : new \Prophecy\PhpDocumentor\LegacyClassTagRetriever();
90701    }
90702    /**
90703     * @param \ReflectionClass $reflectionClass
90704     *
90705     * @return LegacyMethodTag[]|Method[]
90706     */
90707    public function getTagList(\ReflectionClass $reflectionClass)
90708    {
90709        return \array_merge($this->classRetriever->getTagList($reflectionClass), $this->getInterfacesTagList($reflectionClass));
90710    }
90711    /**
90712     * @param \ReflectionClass $reflectionClass
90713     *
90714     * @return LegacyMethodTag[]|Method[]
90715     */
90716    private function getInterfacesTagList(\ReflectionClass $reflectionClass)
90717    {
90718        $interfaces = $reflectionClass->getInterfaces();
90719        $tagList = array();
90720        foreach ($interfaces as $interface) {
90721            $tagList = \array_merge($tagList, $this->classRetriever->getTagList($interface));
90722        }
90723        return $tagList;
90724    }
90725}
90726<?php
90727
90728/*
90729 * This file is part of the Prophecy.
90730 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
90731 *     Marcello Duarte <marcello.duarte@gmail.com>
90732 *
90733 * For the full copyright and license information, please view the LICENSE
90734 * file that was distributed with this source code.
90735 */
90736namespace Prophecy\Call;
90737
90738use Prophecy\Exception\Prophecy\MethodProphecyException;
90739use Prophecy\Prophecy\ObjectProphecy;
90740use Prophecy\Argument\ArgumentsWildcard;
90741use Prophecy\Util\StringUtil;
90742use Prophecy\Exception\Call\UnexpectedCallException;
90743use SplObjectStorage;
90744/**
90745 * Calls receiver & manager.
90746 *
90747 * @author Konstantin Kudryashov <ever.zet@gmail.com>
90748 */
90749class CallCenter
90750{
90751    private $util;
90752    /**
90753     * @var Call[]
90754     */
90755    private $recordedCalls = array();
90756    /**
90757     * @var SplObjectStorage
90758     */
90759    private $unexpectedCalls;
90760    /**
90761     * Initializes call center.
90762     *
90763     * @param StringUtil $util
90764     */
90765    public function __construct(StringUtil $util = null)
90766    {
90767        $this->util = $util ?: new StringUtil();
90768        $this->unexpectedCalls = new SplObjectStorage();
90769    }
90770    /**
90771     * Makes and records specific method call for object prophecy.
90772     *
90773     * @param ObjectProphecy $prophecy
90774     * @param string         $methodName
90775     * @param array          $arguments
90776     *
90777     * @return mixed Returns null if no promise for prophecy found or promise return value.
90778     *
90779     * @throws \Prophecy\Exception\Call\UnexpectedCallException If no appropriate method prophecy found
90780     */
90781    public function makeCall(ObjectProphecy $prophecy, $methodName, array $arguments)
90782    {
90783        // For efficiency exclude 'args' from the generated backtrace
90784        // Limit backtrace to last 3 calls as we don't use the rest
90785        $backtrace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 3);
90786        $file = $line = null;
90787        if (isset($backtrace[2]) && isset($backtrace[2]['file'])) {
90788            $file = $backtrace[2]['file'];
90789            $line = $backtrace[2]['line'];
90790        }
90791        // If no method prophecies defined, then it's a dummy, so we'll just return null
90792        if ('__destruct' === \strtolower($methodName) || 0 == \count($prophecy->getMethodProphecies())) {
90793            $this->recordedCalls[] = new \Prophecy\Call\Call($methodName, $arguments, null, null, $file, $line);
90794            return null;
90795        }
90796        // There are method prophecies, so it's a fake/stub. Searching prophecy for this call
90797        $matches = $this->findMethodProphecies($prophecy, $methodName, $arguments);
90798        // If fake/stub doesn't have method prophecy for this call - throw exception
90799        if (!\count($matches)) {
90800            $this->unexpectedCalls->attach(new \Prophecy\Call\Call($methodName, $arguments, null, null, $file, $line), $prophecy);
90801            $this->recordedCalls[] = new \Prophecy\Call\Call($methodName, $arguments, null, null, $file, $line);
90802            return null;
90803        }
90804        // Sort matches by their score value
90805        @\usort($matches, function ($match1, $match2) {
90806            return $match2[0] - $match1[0];
90807        });
90808        $score = $matches[0][0];
90809        // If Highest rated method prophecy has a promise - execute it or return null instead
90810        $methodProphecy = $matches[0][1];
90811        $returnValue = null;
90812        $exception = null;
90813        if ($promise = $methodProphecy->getPromise()) {
90814            try {
90815                $returnValue = $promise->execute($arguments, $prophecy, $methodProphecy);
90816            } catch (\Exception $e) {
90817                $exception = $e;
90818            }
90819        }
90820        if ($methodProphecy->hasReturnVoid() && $returnValue !== null) {
90821            throw new MethodProphecyException("The method \"{$methodName}\" has a void return type, but the promise returned a value", $methodProphecy);
90822        }
90823        $this->recordedCalls[] = $call = new \Prophecy\Call\Call($methodName, $arguments, $returnValue, $exception, $file, $line);
90824        $call->addScore($methodProphecy->getArgumentsWildcard(), $score);
90825        if (null !== $exception) {
90826            throw $exception;
90827        }
90828        return $returnValue;
90829    }
90830    /**
90831     * Searches for calls by method name & arguments wildcard.
90832     *
90833     * @param string            $methodName
90834     * @param ArgumentsWildcard $wildcard
90835     *
90836     * @return Call[]
90837     */
90838    public function findCalls($methodName, ArgumentsWildcard $wildcard)
90839    {
90840        $methodName = \strtolower($methodName);
90841        return \array_values(\array_filter($this->recordedCalls, function (\Prophecy\Call\Call $call) use($methodName, $wildcard) {
90842            return $methodName === \strtolower($call->getMethodName()) && 0 < $call->getScore($wildcard);
90843        }));
90844    }
90845    /**
90846     * @throws UnexpectedCallException
90847     */
90848    public function checkUnexpectedCalls()
90849    {
90850        /** @var Call $call */
90851        foreach ($this->unexpectedCalls as $call) {
90852            $prophecy = $this->unexpectedCalls[$call];
90853            // If fake/stub doesn't have method prophecy for this call - throw exception
90854            if (!\count($this->findMethodProphecies($prophecy, $call->getMethodName(), $call->getArguments()))) {
90855                throw $this->createUnexpectedCallException($prophecy, $call->getMethodName(), $call->getArguments());
90856            }
90857        }
90858    }
90859    private function createUnexpectedCallException(ObjectProphecy $prophecy, $methodName, array $arguments)
90860    {
90861        $classname = \get_class($prophecy->reveal());
90862        $indentationLength = 8;
90863        // looks good
90864        $argstring = \implode(",\n", $this->indentArguments(\array_map(array($this->util, 'stringify'), $arguments), $indentationLength));
90865        $expected = array();
90866        foreach (\array_merge(...\array_values($prophecy->getMethodProphecies())) as $methodProphecy) {
90867            $expected[] = \sprintf("  - %s(\n" . "%s\n" . "    )", $methodProphecy->getMethodName(), \implode(",\n", $this->indentArguments(\array_map('strval', $methodProphecy->getArgumentsWildcard()->getTokens()), $indentationLength)));
90868        }
90869        return new UnexpectedCallException(\sprintf("Unexpected method call on %s:\n" . "  - %s(\n" . "%s\n" . "    )\n" . "expected calls were:\n" . "%s", $classname, $methodName, $argstring, \implode("\n", $expected)), $prophecy, $methodName, $arguments);
90870    }
90871    private function indentArguments(array $arguments, $indentationLength)
90872    {
90873        return \preg_replace_callback('/^/m', function () use($indentationLength) {
90874            return \str_repeat(' ', $indentationLength);
90875        }, $arguments);
90876    }
90877    /**
90878     * @param ObjectProphecy $prophecy
90879     * @param string $methodName
90880     * @param array $arguments
90881     *
90882     * @return array
90883     */
90884    private function findMethodProphecies(ObjectProphecy $prophecy, $methodName, array $arguments)
90885    {
90886        $matches = array();
90887        foreach ($prophecy->getMethodProphecies($methodName) as $methodProphecy) {
90888            if (0 < ($score = $methodProphecy->getArgumentsWildcard()->scoreArguments($arguments))) {
90889                $matches[] = array($score, $methodProphecy);
90890            }
90891        }
90892        return $matches;
90893    }
90894}
90895<?php
90896
90897/*
90898 * This file is part of the Prophecy.
90899 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
90900 *     Marcello Duarte <marcello.duarte@gmail.com>
90901 *
90902 * For the full copyright and license information, please view the LICENSE
90903 * file that was distributed with this source code.
90904 */
90905namespace Prophecy\Call;
90906
90907use Exception;
90908use Prophecy\Argument\ArgumentsWildcard;
90909/**
90910 * Call object.
90911 *
90912 * @author Konstantin Kudryashov <ever.zet@gmail.com>
90913 */
90914class Call
90915{
90916    private $methodName;
90917    private $arguments;
90918    private $returnValue;
90919    private $exception;
90920    private $file;
90921    private $line;
90922    private $scores;
90923    /**
90924     * Initializes call.
90925     *
90926     * @param string      $methodName
90927     * @param array       $arguments
90928     * @param mixed       $returnValue
90929     * @param Exception   $exception
90930     * @param null|string $file
90931     * @param null|int    $line
90932     */
90933    public function __construct($methodName, array $arguments, $returnValue, Exception $exception = null, $file, $line)
90934    {
90935        $this->methodName = $methodName;
90936        $this->arguments = $arguments;
90937        $this->returnValue = $returnValue;
90938        $this->exception = $exception;
90939        $this->scores = new \SplObjectStorage();
90940        if ($file) {
90941            $this->file = $file;
90942            $this->line = \intval($line);
90943        }
90944    }
90945    /**
90946     * Returns called method name.
90947     *
90948     * @return string
90949     */
90950    public function getMethodName()
90951    {
90952        return $this->methodName;
90953    }
90954    /**
90955     * Returns called method arguments.
90956     *
90957     * @return array
90958     */
90959    public function getArguments()
90960    {
90961        return $this->arguments;
90962    }
90963    /**
90964     * Returns called method return value.
90965     *
90966     * @return null|mixed
90967     */
90968    public function getReturnValue()
90969    {
90970        return $this->returnValue;
90971    }
90972    /**
90973     * Returns exception that call thrown.
90974     *
90975     * @return null|Exception
90976     */
90977    public function getException()
90978    {
90979        return $this->exception;
90980    }
90981    /**
90982     * Returns callee filename.
90983     *
90984     * @return string
90985     */
90986    public function getFile()
90987    {
90988        return $this->file;
90989    }
90990    /**
90991     * Returns callee line number.
90992     *
90993     * @return int
90994     */
90995    public function getLine()
90996    {
90997        return $this->line;
90998    }
90999    /**
91000     * Returns short notation for callee place.
91001     *
91002     * @return string
91003     */
91004    public function getCallPlace()
91005    {
91006        if (null === $this->file) {
91007            return 'unknown';
91008        }
91009        return \sprintf('%s:%d', $this->file, $this->line);
91010    }
91011    /**
91012     * Adds the wildcard match score for the provided wildcard.
91013     *
91014     * @param ArgumentsWildcard $wildcard
91015     * @param false|int $score
91016     *
91017     * @return $this
91018     */
91019    public function addScore(ArgumentsWildcard $wildcard, $score)
91020    {
91021        $this->scores[$wildcard] = $score;
91022        return $this;
91023    }
91024    /**
91025     * Returns wildcard match score for the provided wildcard. The score is
91026     * calculated if not already done.
91027     *
91028     * @param ArgumentsWildcard $wildcard
91029     *
91030     * @return false|int False OR integer score (higher - better)
91031     */
91032    public function getScore(ArgumentsWildcard $wildcard)
91033    {
91034        if (isset($this->scores[$wildcard])) {
91035            return $this->scores[$wildcard];
91036        }
91037        return $this->scores[$wildcard] = $wildcard->scoreArguments($this->getArguments());
91038    }
91039}
91040<?php
91041
91042/*
91043 * This file is part of the Prophecy.
91044 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
91045 *     Marcello Duarte <marcello.duarte@gmail.com>
91046 *
91047 * For the full copyright and license information, please view the LICENSE
91048 * file that was distributed with this source code.
91049 */
91050namespace Prophecy\Comparator;
91051
91052use Prophecy\Prophecy\ProphecyInterface;
91053use PHPUnit\SebastianBergmann\Comparator\ObjectComparator;
91054class ProphecyComparator extends ObjectComparator
91055{
91056    public function accepts($expected, $actual)
91057    {
91058        return \is_object($expected) && \is_object($actual) && $actual instanceof ProphecyInterface;
91059    }
91060    public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = \false, $ignoreCase = \false, array &$processed = array())
91061    {
91062        parent::assertEquals($expected, $actual->reveal(), $delta, $canonicalize, $ignoreCase, $processed);
91063    }
91064}
91065<?php
91066
91067/*
91068 * This file is part of the Prophecy.
91069 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
91070 *     Marcello Duarte <marcello.duarte@gmail.com>
91071 *
91072 * For the full copyright and license information, please view the LICENSE
91073 * file that was distributed with this source code.
91074 */
91075namespace Prophecy\Comparator;
91076
91077use PHPUnit\SebastianBergmann\Comparator\Factory as BaseFactory;
91078/**
91079 * Prophecy comparator factory.
91080 *
91081 * @author Konstantin Kudryashov <ever.zet@gmail.com>
91082 */
91083final class Factory extends BaseFactory
91084{
91085    /**
91086     * @var Factory
91087     */
91088    private static $instance;
91089    public function __construct()
91090    {
91091        parent::__construct();
91092        $this->register(new \Prophecy\Comparator\ClosureComparator());
91093        $this->register(new \Prophecy\Comparator\ProphecyComparator());
91094    }
91095    /**
91096     * @return Factory
91097     */
91098    public static function getInstance()
91099    {
91100        if (self::$instance === null) {
91101            self::$instance = new \Prophecy\Comparator\Factory();
91102        }
91103        return self::$instance;
91104    }
91105}
91106<?php
91107
91108/*
91109 * This file is part of the Prophecy.
91110 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
91111 *     Marcello Duarte <marcello.duarte@gmail.com>
91112 *
91113 * For the full copyright and license information, please view the LICENSE
91114 * file that was distributed with this source code.
91115 */
91116namespace Prophecy\Comparator;
91117
91118use PHPUnit\SebastianBergmann\Comparator\Comparator;
91119use PHPUnit\SebastianBergmann\Comparator\ComparisonFailure;
91120/**
91121 * Closure comparator.
91122 *
91123 * @author Konstantin Kudryashov <ever.zet@gmail.com>
91124 */
91125final class ClosureComparator extends Comparator
91126{
91127    public function accepts($expected, $actual)
91128    {
91129        return \is_object($expected) && $expected instanceof \Closure && \is_object($actual) && $actual instanceof \Closure;
91130    }
91131    public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = \false, $ignoreCase = \false, array &$processed = array())
91132    {
91133        if ($expected !== $actual) {
91134            throw new ComparisonFailure(
91135                $expected,
91136                $actual,
91137                // we don't need a diff
91138                '',
91139                '',
91140                \false,
91141                'all closures are different if not identical'
91142            );
91143        }
91144    }
91145}
91146<?php
91147
91148/*
91149 * This file is part of the Prophecy.
91150 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
91151 *     Marcello Duarte <marcello.duarte@gmail.com>
91152 *
91153 * For the full copyright and license information, please view the LICENSE
91154 * file that was distributed with this source code.
91155 */
91156namespace Prophecy;
91157
91158use Prophecy\Doubler\CachedDoubler;
91159use Prophecy\Doubler\Doubler;
91160use Prophecy\Doubler\LazyDouble;
91161use Prophecy\Doubler\ClassPatch;
91162use Prophecy\Prophecy\ObjectProphecy;
91163use Prophecy\Prophecy\RevealerInterface;
91164use Prophecy\Prophecy\Revealer;
91165use Prophecy\Call\CallCenter;
91166use Prophecy\Util\StringUtil;
91167use Prophecy\Exception\Prediction\PredictionException;
91168use Prophecy\Exception\Prediction\AggregateException;
91169/**
91170 * Prophet creates prophecies.
91171 *
91172 * @author Konstantin Kudryashov <ever.zet@gmail.com>
91173 */
91174class Prophet
91175{
91176    private $doubler;
91177    private $revealer;
91178    private $util;
91179    /**
91180     * @var ObjectProphecy[]
91181     */
91182    private $prophecies = array();
91183    /**
91184     * Initializes Prophet.
91185     *
91186     * @param null|Doubler           $doubler
91187     * @param null|RevealerInterface $revealer
91188     * @param null|StringUtil        $util
91189     */
91190    public function __construct(Doubler $doubler = null, RevealerInterface $revealer = null, StringUtil $util = null)
91191    {
91192        if (null === $doubler) {
91193            $doubler = new CachedDoubler();
91194            $doubler->registerClassPatch(new ClassPatch\SplFileInfoPatch());
91195            $doubler->registerClassPatch(new ClassPatch\TraversablePatch());
91196            $doubler->registerClassPatch(new ClassPatch\ThrowablePatch());
91197            $doubler->registerClassPatch(new ClassPatch\DisableConstructorPatch());
91198            $doubler->registerClassPatch(new ClassPatch\ProphecySubjectPatch());
91199            $doubler->registerClassPatch(new ClassPatch\ReflectionClassNewInstancePatch());
91200            $doubler->registerClassPatch(new ClassPatch\HhvmExceptionPatch());
91201            $doubler->registerClassPatch(new ClassPatch\MagicCallPatch());
91202            $doubler->registerClassPatch(new ClassPatch\KeywordPatch());
91203        }
91204        $this->doubler = $doubler;
91205        $this->revealer = $revealer ?: new Revealer();
91206        $this->util = $util ?: new StringUtil();
91207    }
91208    /**
91209     * Creates new object prophecy.
91210     *
91211     * @param null|string $classOrInterface Class or interface name
91212     *
91213     * @return ObjectProphecy
91214     */
91215    public function prophesize($classOrInterface = null)
91216    {
91217        $this->prophecies[] = $prophecy = new ObjectProphecy(new LazyDouble($this->doubler), new CallCenter($this->util), $this->revealer);
91218        if ($classOrInterface && \class_exists($classOrInterface)) {
91219            return $prophecy->willExtend($classOrInterface);
91220        }
91221        if ($classOrInterface && \interface_exists($classOrInterface)) {
91222            return $prophecy->willImplement($classOrInterface);
91223        }
91224        return $prophecy;
91225    }
91226    /**
91227     * Returns all created object prophecies.
91228     *
91229     * @return ObjectProphecy[]
91230     */
91231    public function getProphecies()
91232    {
91233        return $this->prophecies;
91234    }
91235    /**
91236     * Returns Doubler instance assigned to this Prophet.
91237     *
91238     * @return Doubler
91239     */
91240    public function getDoubler()
91241    {
91242        return $this->doubler;
91243    }
91244    /**
91245     * Checks all predictions defined by prophecies of this Prophet.
91246     *
91247     * @throws Exception\Prediction\AggregateException If any prediction fails
91248     */
91249    public function checkPredictions()
91250    {
91251        $exception = new AggregateException("Some predictions failed:\n");
91252        foreach ($this->prophecies as $prophecy) {
91253            try {
91254                $prophecy->checkProphecyMethodsPredictions();
91255            } catch (PredictionException $e) {
91256                $exception->append($e);
91257            }
91258        }
91259        if (\count($exception->getExceptions())) {
91260            throw $exception;
91261        }
91262    }
91263}
91264<?php
91265
91266/*
91267 * This file is part of the Prophecy.
91268 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
91269 *     Marcello Duarte <marcello.duarte@gmail.com>
91270 *
91271 * For the full copyright and license information, please view the LICENSE
91272 * file that was distributed with this source code.
91273 */
91274namespace Prophecy\Doubler;
91275
91276use ReflectionClass;
91277/**
91278 * Name generator.
91279 * Generates classname for double.
91280 *
91281 * @author Konstantin Kudryashov <ever.zet@gmail.com>
91282 */
91283class NameGenerator
91284{
91285    private static $counter = 1;
91286    /**
91287     * Generates name.
91288     *
91289     * @param ReflectionClass   $class
91290     * @param ReflectionClass[] $interfaces
91291     *
91292     * @return string
91293     */
91294    public function name(ReflectionClass $class = null, array $interfaces)
91295    {
91296        $parts = array();
91297        if (null !== $class) {
91298            $parts[] = $class->getName();
91299        } else {
91300            foreach ($interfaces as $interface) {
91301                $parts[] = $interface->getShortName();
91302            }
91303        }
91304        if (!\count($parts)) {
91305            $parts[] = 'stdClass';
91306        }
91307        return \sprintf('Double\\%s\\P%d', \implode('\\', $parts), self::$counter++);
91308    }
91309}
91310<?php
91311
91312/*
91313 * This file is part of the Prophecy.
91314 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
91315 *     Marcello Duarte <marcello.duarte@gmail.com>
91316 *
91317 * For the full copyright and license information, please view the LICENSE
91318 * file that was distributed with this source code.
91319 */
91320namespace Prophecy\Doubler;
91321
91322use Prophecy\Exception\Doubler\DoubleException;
91323use Prophecy\Exception\Doubler\ClassNotFoundException;
91324use Prophecy\Exception\Doubler\InterfaceNotFoundException;
91325use ReflectionClass;
91326/**
91327 * Lazy double.
91328 * Gives simple interface to describe double before creating it.
91329 *
91330 * @author Konstantin Kudryashov <ever.zet@gmail.com>
91331 */
91332class LazyDouble
91333{
91334    private $doubler;
91335    private $class;
91336    private $interfaces = array();
91337    private $arguments = null;
91338    private $double;
91339    /**
91340     * Initializes lazy double.
91341     *
91342     * @param Doubler $doubler
91343     */
91344    public function __construct(\Prophecy\Doubler\Doubler $doubler)
91345    {
91346        $this->doubler = $doubler;
91347    }
91348    /**
91349     * Tells doubler to use specific class as parent one for double.
91350     *
91351     * @param string|ReflectionClass $class
91352     *
91353     * @throws \Prophecy\Exception\Doubler\ClassNotFoundException
91354     * @throws \Prophecy\Exception\Doubler\DoubleException
91355     */
91356    public function setParentClass($class)
91357    {
91358        if (null !== $this->double) {
91359            throw new DoubleException('Can not extend class with already instantiated double.');
91360        }
91361        if (!$class instanceof ReflectionClass) {
91362            if (!\class_exists($class)) {
91363                throw new ClassNotFoundException(\sprintf('Class %s not found.', $class), $class);
91364            }
91365            $class = new ReflectionClass($class);
91366        }
91367        $this->class = $class;
91368    }
91369    /**
91370     * Tells doubler to implement specific interface with double.
91371     *
91372     * @param string|ReflectionClass $interface
91373     *
91374     * @throws \Prophecy\Exception\Doubler\InterfaceNotFoundException
91375     * @throws \Prophecy\Exception\Doubler\DoubleException
91376     */
91377    public function addInterface($interface)
91378    {
91379        if (null !== $this->double) {
91380            throw new DoubleException('Can not implement interface with already instantiated double.');
91381        }
91382        if (!$interface instanceof ReflectionClass) {
91383            if (!\interface_exists($interface)) {
91384                throw new InterfaceNotFoundException(\sprintf('Interface %s not found.', $interface), $interface);
91385            }
91386            $interface = new ReflectionClass($interface);
91387        }
91388        $this->interfaces[] = $interface;
91389    }
91390    /**
91391     * Sets constructor arguments.
91392     *
91393     * @param array $arguments
91394     */
91395    public function setArguments(array $arguments = null)
91396    {
91397        $this->arguments = $arguments;
91398    }
91399    /**
91400     * Creates double instance or returns already created one.
91401     *
91402     * @return DoubleInterface
91403     */
91404    public function getInstance()
91405    {
91406        if (null === $this->double) {
91407            if (null !== $this->arguments) {
91408                return $this->double = $this->doubler->double($this->class, $this->interfaces, $this->arguments);
91409            }
91410            $this->double = $this->doubler->double($this->class, $this->interfaces);
91411        }
91412        return $this->double;
91413    }
91414}
91415<?php
91416
91417/*
91418 * This file is part of the Prophecy.
91419 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
91420 *     Marcello Duarte <marcello.duarte@gmail.com>
91421 *
91422 * For the full copyright and license information, please view the LICENSE
91423 * file that was distributed with this source code.
91424 */
91425namespace Prophecy\Doubler;
91426
91427use ReflectionClass;
91428/**
91429 * Cached class doubler.
91430 * Prevents mirroring/creation of the same structure twice.
91431 *
91432 * @author Konstantin Kudryashov <ever.zet@gmail.com>
91433 */
91434class CachedDoubler extends \Prophecy\Doubler\Doubler
91435{
91436    private static $classes = array();
91437    /**
91438     * {@inheritdoc}
91439     */
91440    protected function createDoubleClass(ReflectionClass $class = null, array $interfaces)
91441    {
91442        $classId = $this->generateClassId($class, $interfaces);
91443        if (isset(self::$classes[$classId])) {
91444            return self::$classes[$classId];
91445        }
91446        return self::$classes[$classId] = parent::createDoubleClass($class, $interfaces);
91447    }
91448    /**
91449     * @param ReflectionClass   $class
91450     * @param ReflectionClass[] $interfaces
91451     *
91452     * @return string
91453     */
91454    private function generateClassId(ReflectionClass $class = null, array $interfaces)
91455    {
91456        $parts = array();
91457        if (null !== $class) {
91458            $parts[] = $class->getName();
91459        }
91460        foreach ($interfaces as $interface) {
91461            $parts[] = $interface->getName();
91462        }
91463        foreach ($this->getClassPatches() as $patch) {
91464            $parts[] = \get_class($patch);
91465        }
91466        \sort($parts);
91467        return \md5(\implode('', $parts));
91468    }
91469    public function resetCache()
91470    {
91471        self::$classes = array();
91472    }
91473}
91474<?php
91475
91476/*
91477 * This file is part of the Prophecy.
91478 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
91479 *     Marcello Duarte <marcello.duarte@gmail.com>
91480 *
91481 * For the full copyright and license information, please view the LICENSE
91482 * file that was distributed with this source code.
91483 */
91484namespace Prophecy\Doubler;
91485
91486/**
91487 * Core double interface.
91488 * All doubled classes will implement this one.
91489 *
91490 * @author Konstantin Kudryashov <ever.zet@gmail.com>
91491 */
91492interface DoubleInterface
91493{
91494}
91495<?php
91496
91497namespace Prophecy\Doubler\Generator;
91498
91499/**
91500 * Tells whether a keyword refers to a class or to a built-in type for the
91501 * current version of php
91502 *
91503 * @deprecated in favour of Node\TypeNodeAbstract
91504 */
91505final class TypeHintReference
91506{
91507    public function isBuiltInParamTypeHint($type)
91508    {
91509        switch ($type) {
91510            case 'self':
91511            case 'array':
91512            case 'callable':
91513            case 'bool':
91514            case 'float':
91515            case 'int':
91516            case 'string':
91517            case 'iterable':
91518            case 'object':
91519                return \true;
91520            case 'mixed':
91521                return \PHP_VERSION_ID >= 80000;
91522            default:
91523                return \false;
91524        }
91525    }
91526    public function isBuiltInReturnTypeHint($type)
91527    {
91528        if ($type === 'void') {
91529            return \true;
91530        }
91531        return $this->isBuiltInParamTypeHint($type);
91532    }
91533}
91534<?php
91535
91536/*
91537 * This file is part of the Prophecy.
91538 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
91539 *     Marcello Duarte <marcello.duarte@gmail.com>
91540 *
91541 * For the full copyright and license information, please view the LICENSE
91542 * file that was distributed with this source code.
91543 */
91544namespace Prophecy\Doubler\Generator;
91545
91546use Prophecy\Doubler\Generator\Node\ReturnTypeNode;
91547use Prophecy\Doubler\Generator\Node\TypeNodeAbstract;
91548/**
91549 * Class code creator.
91550 * Generates PHP code for specific class node tree.
91551 *
91552 * @author Konstantin Kudryashov <ever.zet@gmail.com>
91553 */
91554class ClassCodeGenerator
91555{
91556    public function __construct(\Prophecy\Doubler\Generator\TypeHintReference $typeHintReference = null)
91557    {
91558    }
91559    /**
91560     * Generates PHP code for class node.
91561     *
91562     * @param string         $classname
91563     * @param Node\ClassNode $class
91564     *
91565     * @return string
91566     */
91567    public function generate($classname, \Prophecy\Doubler\Generator\Node\ClassNode $class)
91568    {
91569        $parts = \explode('\\', $classname);
91570        $classname = \array_pop($parts);
91571        $namespace = \implode('\\', $parts);
91572        $code = \sprintf("class %s extends \\%s implements %s {\n", $classname, $class->getParentClass(), \implode(', ', \array_map(function ($interface) {
91573            return '\\' . $interface;
91574        }, $class->getInterfaces())));
91575        foreach ($class->getProperties() as $name => $visibility) {
91576            $code .= \sprintf("%s \$%s;\n", $visibility, $name);
91577        }
91578        $code .= "\n";
91579        foreach ($class->getMethods() as $method) {
91580            $code .= $this->generateMethod($method) . "\n";
91581        }
91582        $code .= "\n}";
91583        return \sprintf("namespace %s {\n%s\n}", $namespace, $code);
91584    }
91585    private function generateMethod(\Prophecy\Doubler\Generator\Node\MethodNode $method)
91586    {
91587        $php = \sprintf("%s %s function %s%s(%s)%s {\n", $method->getVisibility(), $method->isStatic() ? 'static' : '', $method->returnsReference() ? '&' : '', $method->getName(), \implode(', ', $this->generateArguments($method->getArguments())), ($ret = $this->generateTypes($method->getReturnTypeNode())) ? ': ' . $ret : '');
91588        $php .= $method->getCode() . "\n";
91589        return $php . '}';
91590    }
91591    private function generateTypes(TypeNodeAbstract $typeNode) : string
91592    {
91593        if (!$typeNode->getTypes()) {
91594            return '';
91595        }
91596        // When we require PHP 8 we can stop generating ?foo nullables and remove this first block
91597        if ($typeNode->canUseNullShorthand()) {
91598            return \sprintf('?%s', $typeNode->getNonNullTypes()[0]);
91599        } else {
91600            return \join('|', $typeNode->getTypes());
91601        }
91602    }
91603    private function generateArguments(array $arguments)
91604    {
91605        return \array_map(function (\Prophecy\Doubler\Generator\Node\ArgumentNode $argument) {
91606            $php = $this->generateTypes($argument->getTypeNode());
91607            $php .= ' ' . ($argument->isPassedByReference() ? '&' : '');
91608            $php .= $argument->isVariadic() ? '...' : '';
91609            $php .= '$' . $argument->getName();
91610            if ($argument->isOptional() && !$argument->isVariadic()) {
91611                $php .= ' = ' . \var_export($argument->getDefault(), \true);
91612            }
91613            return $php;
91614        }, $arguments);
91615    }
91616}
91617<?php
91618
91619/*
91620 * This file is part of the Prophecy.
91621 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
91622 *     Marcello Duarte <marcello.duarte@gmail.com>
91623 *
91624 * For the full copyright and license information, please view the LICENSE
91625 * file that was distributed with this source code.
91626 */
91627namespace Prophecy\Doubler\Generator;
91628
91629use Prophecy\Exception\Doubler\ClassCreatorException;
91630/**
91631 * Class creator.
91632 * Creates specific class in current environment.
91633 *
91634 * @author Konstantin Kudryashov <ever.zet@gmail.com>
91635 */
91636class ClassCreator
91637{
91638    private $generator;
91639    /**
91640     * Initializes creator.
91641     *
91642     * @param ClassCodeGenerator $generator
91643     */
91644    public function __construct(\Prophecy\Doubler\Generator\ClassCodeGenerator $generator = null)
91645    {
91646        $this->generator = $generator ?: new \Prophecy\Doubler\Generator\ClassCodeGenerator();
91647    }
91648    /**
91649     * Creates class.
91650     *
91651     * @param string         $classname
91652     * @param Node\ClassNode $class
91653     *
91654     * @return mixed
91655     *
91656     * @throws \Prophecy\Exception\Doubler\ClassCreatorException
91657     */
91658    public function create($classname, \Prophecy\Doubler\Generator\Node\ClassNode $class)
91659    {
91660        $code = $this->generator->generate($classname, $class);
91661        $return = eval($code);
91662        if (!\class_exists($classname, \false)) {
91663            if (\count($class->getInterfaces())) {
91664                throw new ClassCreatorException(\sprintf('Could not double `%s` and implement interfaces: [%s].', $class->getParentClass(), \implode(', ', $class->getInterfaces())), $class);
91665            }
91666            throw new ClassCreatorException(\sprintf('Could not double `%s`.', $class->getParentClass()), $class);
91667        }
91668        return $return;
91669    }
91670}
91671<?php
91672
91673namespace Prophecy\Doubler\Generator\Node;
91674
91675use Prophecy\Exception\Doubler\DoubleException;
91676final class ReturnTypeNode extends \Prophecy\Doubler\Generator\Node\TypeNodeAbstract
91677{
91678    protected function getRealType(string $type) : string
91679    {
91680        switch ($type) {
91681            case 'void':
91682            case 'never':
91683                return $type;
91684            default:
91685                return parent::getRealType($type);
91686        }
91687    }
91688    protected function guardIsValidType()
91689    {
91690        if (isset($this->types['void']) && \count($this->types) !== 1) {
91691            throw new DoubleException('void cannot be part of a union');
91692        }
91693        if (isset($this->types['never']) && \count($this->types) !== 1) {
91694            throw new DoubleException('never cannot be part of a union');
91695        }
91696        parent::guardIsValidType();
91697    }
91698    /**
91699     * @deprecated use hasReturnStatement
91700     */
91701    public function isVoid()
91702    {
91703        return $this->types == ['void' => 'void'];
91704    }
91705    public function hasReturnStatement() : bool
91706    {
91707        return $this->types !== ['void' => 'void'] && $this->types !== ['never' => 'never'];
91708    }
91709}
91710<?php
91711
91712namespace Prophecy\Doubler\Generator\Node;
91713
91714use Prophecy\Exception\Doubler\DoubleException;
91715class ArgumentTypeNode extends \Prophecy\Doubler\Generator\Node\TypeNodeAbstract
91716{
91717}
91718<?php
91719
91720namespace Prophecy\Doubler\Generator\Node;
91721
91722use Prophecy\Exception\Doubler\DoubleException;
91723abstract class TypeNodeAbstract
91724{
91725    /** @var string[] */
91726    protected $types = [];
91727    public function __construct(string ...$types)
91728    {
91729        foreach ($types as $type) {
91730            $type = $this->getRealType($type);
91731            $this->types[$type] = $type;
91732        }
91733        $this->guardIsValidType();
91734    }
91735    public function canUseNullShorthand() : bool
91736    {
91737        return isset($this->types['null']) && \count($this->types) <= 2;
91738    }
91739    public function getTypes() : array
91740    {
91741        return \array_values($this->types);
91742    }
91743    public function getNonNullTypes() : array
91744    {
91745        $nonNullTypes = $this->types;
91746        unset($nonNullTypes['null']);
91747        return \array_values($nonNullTypes);
91748    }
91749    protected function prefixWithNsSeparator(string $type) : string
91750    {
91751        return '\\' . \ltrim($type, '\\');
91752    }
91753    protected function getRealType(string $type) : string
91754    {
91755        switch ($type) {
91756            // type aliases
91757            case 'double':
91758            case 'real':
91759                return 'float';
91760            case 'boolean':
91761                return 'bool';
91762            case 'integer':
91763                return 'int';
91764            //  built in types
91765            case 'self':
91766            case 'array':
91767            case 'callable':
91768            case 'bool':
91769            case 'false':
91770            case 'float':
91771            case 'int':
91772            case 'string':
91773            case 'iterable':
91774            case 'object':
91775            case 'null':
91776                return $type;
91777            case 'mixed':
91778                return \PHP_VERSION_ID < 80000 ? $this->prefixWithNsSeparator($type) : $type;
91779            default:
91780                return $this->prefixWithNsSeparator($type);
91781        }
91782    }
91783    protected function guardIsValidType()
91784    {
91785        if ($this->types == ['null' => 'null']) {
91786            throw new DoubleException('Type cannot be standalone null');
91787        }
91788        if ($this->types == ['false' => 'false']) {
91789            throw new DoubleException('Type cannot be standalone false');
91790        }
91791        if ($this->types == ['false' => 'false', 'null' => 'null']) {
91792            throw new DoubleException('Type cannot be nullable false');
91793        }
91794        if (\PHP_VERSION_ID >= 80000 && isset($this->types['mixed']) && \count($this->types) !== 1) {
91795            throw new DoubleException('mixed cannot be part of a union');
91796        }
91797    }
91798}
91799<?php
91800
91801/*
91802 * This file is part of the Prophecy.
91803 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
91804 *     Marcello Duarte <marcello.duarte@gmail.com>
91805 *
91806 * For the full copyright and license information, please view the LICENSE
91807 * file that was distributed with this source code.
91808 */
91809namespace Prophecy\Doubler\Generator\Node;
91810
91811use Prophecy\Exception\Doubler\MethodNotExtendableException;
91812use Prophecy\Exception\InvalidArgumentException;
91813/**
91814 * Class node.
91815 *
91816 * @author Konstantin Kudryashov <ever.zet@gmail.com>
91817 */
91818class ClassNode
91819{
91820    private $parentClass = 'stdClass';
91821    private $interfaces = array();
91822    private $properties = array();
91823    private $unextendableMethods = array();
91824    /**
91825     * @var MethodNode[]
91826     */
91827    private $methods = array();
91828    public function getParentClass()
91829    {
91830        return $this->parentClass;
91831    }
91832    /**
91833     * @param string $class
91834     */
91835    public function setParentClass($class)
91836    {
91837        $this->parentClass = $class ?: 'stdClass';
91838    }
91839    /**
91840     * @return string[]
91841     */
91842    public function getInterfaces()
91843    {
91844        return $this->interfaces;
91845    }
91846    /**
91847     * @param string $interface
91848     */
91849    public function addInterface($interface)
91850    {
91851        if ($this->hasInterface($interface)) {
91852            return;
91853        }
91854        \array_unshift($this->interfaces, $interface);
91855    }
91856    /**
91857     * @param string $interface
91858     *
91859     * @return bool
91860     */
91861    public function hasInterface($interface)
91862    {
91863        return \in_array($interface, $this->interfaces);
91864    }
91865    public function getProperties()
91866    {
91867        return $this->properties;
91868    }
91869    public function addProperty($name, $visibility = 'public')
91870    {
91871        $visibility = \strtolower($visibility);
91872        if (!\in_array($visibility, array('public', 'private', 'protected'))) {
91873            throw new InvalidArgumentException(\sprintf('`%s` property visibility is not supported.', $visibility));
91874        }
91875        $this->properties[$name] = $visibility;
91876    }
91877    /**
91878     * @return MethodNode[]
91879     */
91880    public function getMethods()
91881    {
91882        return $this->methods;
91883    }
91884    public function addMethod(\Prophecy\Doubler\Generator\Node\MethodNode $method, $force = \false)
91885    {
91886        if (!$this->isExtendable($method->getName())) {
91887            $message = \sprintf('Method `%s` is not extendable, so can not be added.', $method->getName());
91888            throw new MethodNotExtendableException($message, $this->getParentClass(), $method->getName());
91889        }
91890        if ($force || !isset($this->methods[$method->getName()])) {
91891            $this->methods[$method->getName()] = $method;
91892        }
91893    }
91894    public function removeMethod($name)
91895    {
91896        unset($this->methods[$name]);
91897    }
91898    /**
91899     * @param string $name
91900     *
91901     * @return MethodNode|null
91902     */
91903    public function getMethod($name)
91904    {
91905        return $this->hasMethod($name) ? $this->methods[$name] : null;
91906    }
91907    /**
91908     * @param string $name
91909     *
91910     * @return bool
91911     */
91912    public function hasMethod($name)
91913    {
91914        return isset($this->methods[$name]);
91915    }
91916    /**
91917     * @return string[]
91918     */
91919    public function getUnextendableMethods()
91920    {
91921        return $this->unextendableMethods;
91922    }
91923    /**
91924     * @param string $unextendableMethod
91925     */
91926    public function addUnextendableMethod($unextendableMethod)
91927    {
91928        if (!$this->isExtendable($unextendableMethod)) {
91929            return;
91930        }
91931        $this->unextendableMethods[] = $unextendableMethod;
91932    }
91933    /**
91934     * @param string $method
91935     * @return bool
91936     */
91937    public function isExtendable($method)
91938    {
91939        return !\in_array($method, $this->unextendableMethods);
91940    }
91941}
91942<?php
91943
91944/*
91945 * This file is part of the Prophecy.
91946 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
91947 *     Marcello Duarte <marcello.duarte@gmail.com>
91948 *
91949 * For the full copyright and license information, please view the LICENSE
91950 * file that was distributed with this source code.
91951 */
91952namespace Prophecy\Doubler\Generator\Node;
91953
91954use Prophecy\Doubler\Generator\TypeHintReference;
91955use Prophecy\Exception\InvalidArgumentException;
91956/**
91957 * Method node.
91958 *
91959 * @author Konstantin Kudryashov <ever.zet@gmail.com>
91960 */
91961class MethodNode
91962{
91963    private $name;
91964    private $code;
91965    private $visibility = 'public';
91966    private $static = \false;
91967    private $returnsReference = \false;
91968    /** @var ReturnTypeNode */
91969    private $returnTypeNode;
91970    /**
91971     * @var ArgumentNode[]
91972     */
91973    private $arguments = array();
91974    /**
91975     * @param string $name
91976     * @param string $code
91977     */
91978    public function __construct($name, $code = null, TypeHintReference $typeHintReference = null)
91979    {
91980        $this->name = $name;
91981        $this->code = $code;
91982        $this->returnTypeNode = new \Prophecy\Doubler\Generator\Node\ReturnTypeNode();
91983    }
91984    public function getVisibility()
91985    {
91986        return $this->visibility;
91987    }
91988    /**
91989     * @param string $visibility
91990     */
91991    public function setVisibility($visibility)
91992    {
91993        $visibility = \strtolower($visibility);
91994        if (!\in_array($visibility, array('public', 'private', 'protected'))) {
91995            throw new InvalidArgumentException(\sprintf('`%s` method visibility is not supported.', $visibility));
91996        }
91997        $this->visibility = $visibility;
91998    }
91999    public function isStatic()
92000    {
92001        return $this->static;
92002    }
92003    public function setStatic($static = \true)
92004    {
92005        $this->static = (bool) $static;
92006    }
92007    public function returnsReference()
92008    {
92009        return $this->returnsReference;
92010    }
92011    public function setReturnsReference()
92012    {
92013        $this->returnsReference = \true;
92014    }
92015    public function getName()
92016    {
92017        return $this->name;
92018    }
92019    public function addArgument(\Prophecy\Doubler\Generator\Node\ArgumentNode $argument)
92020    {
92021        $this->arguments[] = $argument;
92022    }
92023    /**
92024     * @return ArgumentNode[]
92025     */
92026    public function getArguments()
92027    {
92028        return $this->arguments;
92029    }
92030    /**
92031     * @deprecated use getReturnTypeNode instead
92032     * @return bool
92033     */
92034    public function hasReturnType()
92035    {
92036        return (bool) $this->returnTypeNode->getNonNullTypes();
92037    }
92038    public function setReturnTypeNode(\Prophecy\Doubler\Generator\Node\ReturnTypeNode $returnTypeNode) : void
92039    {
92040        $this->returnTypeNode = $returnTypeNode;
92041    }
92042    /**
92043     * @deprecated use setReturnTypeNode instead
92044     * @param string $type
92045     */
92046    public function setReturnType($type = null)
92047    {
92048        $this->returnTypeNode = $type === '' || $type === null ? new \Prophecy\Doubler\Generator\Node\ReturnTypeNode() : new \Prophecy\Doubler\Generator\Node\ReturnTypeNode($type);
92049    }
92050    /**
92051     * @deprecated use setReturnTypeNode instead
92052     * @param bool $bool
92053     */
92054    public function setNullableReturnType($bool = \true)
92055    {
92056        if ($bool) {
92057            $this->returnTypeNode = new \Prophecy\Doubler\Generator\Node\ReturnTypeNode('null', ...$this->returnTypeNode->getTypes());
92058        } else {
92059            $this->returnTypeNode = new \Prophecy\Doubler\Generator\Node\ReturnTypeNode(...$this->returnTypeNode->getNonNullTypes());
92060        }
92061    }
92062    /**
92063     * @deprecated use getReturnTypeNode instead
92064     * @return string|null
92065     */
92066    public function getReturnType()
92067    {
92068        if ($types = $this->returnTypeNode->getNonNullTypes()) {
92069            return $types[0];
92070        }
92071        return null;
92072    }
92073    public function getReturnTypeNode() : \Prophecy\Doubler\Generator\Node\ReturnTypeNode
92074    {
92075        return $this->returnTypeNode;
92076    }
92077    /**
92078     * @deprecated use getReturnTypeNode instead
92079     * @return bool
92080     */
92081    public function hasNullableReturnType()
92082    {
92083        return $this->returnTypeNode->canUseNullShorthand();
92084    }
92085    /**
92086     * @param string $code
92087     */
92088    public function setCode($code)
92089    {
92090        $this->code = $code;
92091    }
92092    public function getCode()
92093    {
92094        if ($this->returnsReference) {
92095            return "throw new \\Prophecy\\Exception\\Doubler\\ReturnByReferenceException('Returning by reference not supported', get_class(\$this), '{$this->name}');";
92096        }
92097        return (string) $this->code;
92098    }
92099    public function useParentCode()
92100    {
92101        $this->code = \sprintf('return parent::%s(%s);', $this->getName(), \implode(', ', \array_map(array($this, 'generateArgument'), $this->arguments)));
92102    }
92103    private function generateArgument(\Prophecy\Doubler\Generator\Node\ArgumentNode $arg)
92104    {
92105        $argument = '$' . $arg->getName();
92106        if ($arg->isVariadic()) {
92107            $argument = '...' . $argument;
92108        }
92109        return $argument;
92110    }
92111}
92112<?php
92113
92114/*
92115 * This file is part of the Prophecy.
92116 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
92117 *     Marcello Duarte <marcello.duarte@gmail.com>
92118 *
92119 * For the full copyright and license information, please view the LICENSE
92120 * file that was distributed with this source code.
92121 */
92122namespace Prophecy\Doubler\Generator\Node;
92123
92124/**
92125 * Argument node.
92126 *
92127 * @author Konstantin Kudryashov <ever.zet@gmail.com>
92128 */
92129class ArgumentNode
92130{
92131    private $name;
92132    private $default;
92133    private $optional = \false;
92134    private $byReference = \false;
92135    private $isVariadic = \false;
92136    /** @var ArgumentTypeNode */
92137    private $typeNode;
92138    /**
92139     * @param string $name
92140     */
92141    public function __construct($name)
92142    {
92143        $this->name = $name;
92144        $this->typeNode = new \Prophecy\Doubler\Generator\Node\ArgumentTypeNode();
92145    }
92146    public function getName()
92147    {
92148        return $this->name;
92149    }
92150    public function setTypeNode(\Prophecy\Doubler\Generator\Node\ArgumentTypeNode $typeNode)
92151    {
92152        $this->typeNode = $typeNode;
92153    }
92154    public function getTypeNode() : \Prophecy\Doubler\Generator\Node\ArgumentTypeNode
92155    {
92156        return $this->typeNode;
92157    }
92158    public function hasDefault()
92159    {
92160        return $this->isOptional() && !$this->isVariadic();
92161    }
92162    public function getDefault()
92163    {
92164        return $this->default;
92165    }
92166    public function setDefault($default = null)
92167    {
92168        $this->optional = \true;
92169        $this->default = $default;
92170    }
92171    public function isOptional()
92172    {
92173        return $this->optional;
92174    }
92175    public function setAsPassedByReference($byReference = \true)
92176    {
92177        $this->byReference = $byReference;
92178    }
92179    public function isPassedByReference()
92180    {
92181        return $this->byReference;
92182    }
92183    public function setAsVariadic($isVariadic = \true)
92184    {
92185        $this->isVariadic = $isVariadic;
92186    }
92187    public function isVariadic()
92188    {
92189        return $this->isVariadic;
92190    }
92191    /**
92192     * @deprecated use getArgumentTypeNode instead
92193     * @return string|null
92194     */
92195    public function getTypeHint()
92196    {
92197        $type = $this->typeNode->getNonNullTypes() ? $this->typeNode->getNonNullTypes()[0] : null;
92198        return $type ? \ltrim($type, '\\') : null;
92199    }
92200    /**
92201     * @deprecated use setArgumentTypeNode instead
92202     * @param string|null $typeHint
92203     */
92204    public function setTypeHint($typeHint = null)
92205    {
92206        $this->typeNode = $typeHint === null ? new \Prophecy\Doubler\Generator\Node\ArgumentTypeNode() : new \Prophecy\Doubler\Generator\Node\ArgumentTypeNode($typeHint);
92207    }
92208    /**
92209     * @deprecated use getArgumentTypeNode instead
92210     * @return bool
92211     */
92212    public function isNullable()
92213    {
92214        return $this->typeNode->canUseNullShorthand();
92215    }
92216    /**
92217     * @deprecated use getArgumentTypeNode instead
92218     * @param bool $isNullable
92219     */
92220    public function setAsNullable($isNullable = \true)
92221    {
92222        $nonNullTypes = $this->typeNode->getNonNullTypes();
92223        $this->typeNode = $isNullable ? new \Prophecy\Doubler\Generator\Node\ArgumentTypeNode('null', ...$nonNullTypes) : new \Prophecy\Doubler\Generator\Node\ArgumentTypeNode(...$nonNullTypes);
92224    }
92225}
92226<?php
92227
92228/*
92229 * This file is part of the Prophecy.
92230 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
92231 *     Marcello Duarte <marcello.duarte@gmail.com>
92232 *
92233 * For the full copyright and license information, please view the LICENSE
92234 * file that was distributed with this source code.
92235 */
92236namespace Prophecy\Doubler\Generator;
92237
92238use Prophecy\Doubler\Generator\Node\ArgumentTypeNode;
92239use Prophecy\Doubler\Generator\Node\ReturnTypeNode;
92240use Prophecy\Exception\InvalidArgumentException;
92241use Prophecy\Exception\Doubler\ClassMirrorException;
92242use ReflectionClass;
92243use PHPUnit\ReflectionIntersectionType;
92244use ReflectionMethod;
92245use ReflectionNamedType;
92246use ReflectionParameter;
92247use ReflectionType;
92248use ReflectionUnionType;
92249/**
92250 * Class mirror.
92251 * Core doubler class. Mirrors specific class and/or interfaces into class node tree.
92252 *
92253 * @author Konstantin Kudryashov <ever.zet@gmail.com>
92254 */
92255class ClassMirror
92256{
92257    private static $reflectableMethods = array('__construct', '__destruct', '__sleep', '__wakeup', '__toString', '__call', '__invoke');
92258    /**
92259     * Reflects provided arguments into class node.
92260     *
92261     * @param ReflectionClass|null $class
92262     * @param ReflectionClass[] $interfaces
92263     *
92264     * @return Node\ClassNode
92265     *
92266     */
92267    public function reflect(?ReflectionClass $class, array $interfaces)
92268    {
92269        $node = new \Prophecy\Doubler\Generator\Node\ClassNode();
92270        if (null !== $class) {
92271            if (\true === $class->isInterface()) {
92272                throw new InvalidArgumentException(\sprintf("Could not reflect %s as a class, because it\n" . "is interface - use the second argument instead.", $class->getName()));
92273            }
92274            $this->reflectClassToNode($class, $node);
92275        }
92276        foreach ($interfaces as $interface) {
92277            if (!$interface instanceof ReflectionClass) {
92278                throw new InvalidArgumentException(\sprintf("[ReflectionClass \$interface1 [, ReflectionClass \$interface2]] array expected as\n" . "a second argument to `ClassMirror::reflect(...)`, but got %s.", \is_object($interface) ? \get_class($interface) . ' class' : \gettype($interface)));
92279            }
92280            if (\false === $interface->isInterface()) {
92281                throw new InvalidArgumentException(\sprintf("Could not reflect %s as an interface, because it\n" . "is class - use the first argument instead.", $interface->getName()));
92282            }
92283            $this->reflectInterfaceToNode($interface, $node);
92284        }
92285        $node->addInterface('Prophecy\\Doubler\\Generator\\ReflectionInterface');
92286        return $node;
92287    }
92288    private function reflectClassToNode(ReflectionClass $class, \Prophecy\Doubler\Generator\Node\ClassNode $node)
92289    {
92290        if (\true === $class->isFinal()) {
92291            throw new ClassMirrorException(\sprintf('Could not reflect class %s as it is marked final.', $class->getName()), $class);
92292        }
92293        $node->setParentClass($class->getName());
92294        foreach ($class->getMethods(ReflectionMethod::IS_ABSTRACT) as $method) {
92295            if (\false === $method->isProtected()) {
92296                continue;
92297            }
92298            $this->reflectMethodToNode($method, $node);
92299        }
92300        foreach ($class->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
92301            if (0 === \strpos($method->getName(), '_') && !\in_array($method->getName(), self::$reflectableMethods)) {
92302                continue;
92303            }
92304            if (\true === $method->isFinal()) {
92305                $node->addUnextendableMethod($method->getName());
92306                continue;
92307            }
92308            $this->reflectMethodToNode($method, $node);
92309        }
92310    }
92311    private function reflectInterfaceToNode(ReflectionClass $interface, \Prophecy\Doubler\Generator\Node\ClassNode $node)
92312    {
92313        $node->addInterface($interface->getName());
92314        foreach ($interface->getMethods() as $method) {
92315            $this->reflectMethodToNode($method, $node);
92316        }
92317    }
92318    private function reflectMethodToNode(ReflectionMethod $method, \Prophecy\Doubler\Generator\Node\ClassNode $classNode)
92319    {
92320        $node = new \Prophecy\Doubler\Generator\Node\MethodNode($method->getName());
92321        if (\true === $method->isProtected()) {
92322            $node->setVisibility('protected');
92323        }
92324        if (\true === $method->isStatic()) {
92325            $node->setStatic();
92326        }
92327        if (\true === $method->returnsReference()) {
92328            $node->setReturnsReference();
92329        }
92330        if ($method->hasReturnType()) {
92331            $returnTypes = $this->getTypeHints($method->getReturnType(), $method->getDeclaringClass(), $method->getReturnType()->allowsNull());
92332            $node->setReturnTypeNode(new ReturnTypeNode(...$returnTypes));
92333        } elseif (\method_exists($method, 'hasTentativeReturnType') && $method->hasTentativeReturnType()) {
92334            $returnTypes = $this->getTypeHints($method->getTentativeReturnType(), $method->getDeclaringClass(), $method->getTentativeReturnType()->allowsNull());
92335            $node->setReturnTypeNode(new ReturnTypeNode(...$returnTypes));
92336        }
92337        if (\is_array($params = $method->getParameters()) && \count($params)) {
92338            foreach ($params as $param) {
92339                $this->reflectArgumentToNode($param, $node);
92340            }
92341        }
92342        $classNode->addMethod($node);
92343    }
92344    private function reflectArgumentToNode(ReflectionParameter $parameter, \Prophecy\Doubler\Generator\Node\MethodNode $methodNode)
92345    {
92346        $name = $parameter->getName() == '...' ? '__dot_dot_dot__' : $parameter->getName();
92347        $node = new \Prophecy\Doubler\Generator\Node\ArgumentNode($name);
92348        $typeHints = $this->getTypeHints($parameter->getType(), $parameter->getDeclaringClass(), $parameter->allowsNull());
92349        $node->setTypeNode(new ArgumentTypeNode(...$typeHints));
92350        if ($parameter->isVariadic()) {
92351            $node->setAsVariadic();
92352        }
92353        if ($this->hasDefaultValue($parameter)) {
92354            $node->setDefault($this->getDefaultValue($parameter));
92355        }
92356        if ($parameter->isPassedByReference()) {
92357            $node->setAsPassedByReference();
92358        }
92359        $methodNode->addArgument($node);
92360    }
92361    private function hasDefaultValue(ReflectionParameter $parameter)
92362    {
92363        if ($parameter->isVariadic()) {
92364            return \false;
92365        }
92366        if ($parameter->isDefaultValueAvailable()) {
92367            return \true;
92368        }
92369        return $parameter->isOptional() || $parameter->allowsNull() && $parameter->getType() && \PHP_VERSION_ID < 80100;
92370    }
92371    private function getDefaultValue(ReflectionParameter $parameter)
92372    {
92373        if (!$parameter->isDefaultValueAvailable()) {
92374            return null;
92375        }
92376        return $parameter->getDefaultValue();
92377    }
92378    private function getTypeHints(?ReflectionType $type, ?ReflectionClass $class, bool $allowsNull) : array
92379    {
92380        $types = [];
92381        if ($type instanceof ReflectionNamedType) {
92382            $types = [$type->getName()];
92383        } elseif ($type instanceof ReflectionUnionType) {
92384            $types = $type->getTypes();
92385        } elseif ($type instanceof ReflectionIntersectionType) {
92386            throw new ClassMirrorException('Doubling intersection types is not supported', $class);
92387        } elseif (\is_object($type)) {
92388            throw new ClassMirrorException('Unknown reflection type ' . \get_class($type), $class);
92389        }
92390        $types = \array_map(function (string $type) use($class) {
92391            if ($type === 'self') {
92392                return $class->getName();
92393            }
92394            if ($type === 'parent') {
92395                return $class->getParentClass()->getName();
92396            }
92397            return $type;
92398        }, $types);
92399        if ($types && $types != ['mixed'] && $allowsNull) {
92400            $types[] = 'null';
92401        }
92402        return $types;
92403    }
92404}
92405<?php
92406
92407/*
92408 * This file is part of the Prophecy.
92409 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
92410 *     Marcello Duarte <marcello.duarte@gmail.com>
92411 *
92412 * For the full copyright and license information, please view the LICENSE
92413 * file that was distributed with this source code.
92414 */
92415namespace Prophecy\Doubler\Generator;
92416
92417/**
92418 * Reflection interface.
92419 * All reflected classes implement this interface.
92420 *
92421 * @author Konstantin Kudryashov <ever.zet@gmail.com>
92422 */
92423interface ReflectionInterface
92424{
92425}
92426<?php
92427
92428/*
92429 * This file is part of the Prophecy.
92430 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
92431 *     Marcello Duarte <marcello.duarte@gmail.com>
92432 *
92433 * For the full copyright and license information, please view the LICENSE
92434 * file that was distributed with this source code.
92435 */
92436namespace Prophecy\Doubler;
92437
92438use PHPUnit\Doctrine\Instantiator\Instantiator;
92439use Prophecy\Doubler\ClassPatch\ClassPatchInterface;
92440use Prophecy\Doubler\Generator\ClassMirror;
92441use Prophecy\Doubler\Generator\ClassCreator;
92442use Prophecy\Exception\InvalidArgumentException;
92443use ReflectionClass;
92444/**
92445 * Cached class doubler.
92446 * Prevents mirroring/creation of the same structure twice.
92447 *
92448 * @author Konstantin Kudryashov <ever.zet@gmail.com>
92449 */
92450class Doubler
92451{
92452    private $mirror;
92453    private $creator;
92454    private $namer;
92455    /**
92456     * @var ClassPatchInterface[]
92457     */
92458    private $patches = array();
92459    /**
92460     * @var \Doctrine\Instantiator\Instantiator
92461     */
92462    private $instantiator;
92463    /**
92464     * Initializes doubler.
92465     *
92466     * @param ClassMirror   $mirror
92467     * @param ClassCreator  $creator
92468     * @param NameGenerator $namer
92469     */
92470    public function __construct(ClassMirror $mirror = null, ClassCreator $creator = null, \Prophecy\Doubler\NameGenerator $namer = null)
92471    {
92472        $this->mirror = $mirror ?: new ClassMirror();
92473        $this->creator = $creator ?: new ClassCreator();
92474        $this->namer = $namer ?: new \Prophecy\Doubler\NameGenerator();
92475    }
92476    /**
92477     * Returns list of registered class patches.
92478     *
92479     * @return ClassPatchInterface[]
92480     */
92481    public function getClassPatches()
92482    {
92483        return $this->patches;
92484    }
92485    /**
92486     * Registers new class patch.
92487     *
92488     * @param ClassPatchInterface $patch
92489     */
92490    public function registerClassPatch(ClassPatchInterface $patch)
92491    {
92492        $this->patches[] = $patch;
92493        @\usort($this->patches, function (ClassPatchInterface $patch1, ClassPatchInterface $patch2) {
92494            return $patch2->getPriority() - $patch1->getPriority();
92495        });
92496    }
92497    /**
92498     * Creates double from specific class or/and list of interfaces.
92499     *
92500     * @param ReflectionClass   $class
92501     * @param ReflectionClass[] $interfaces Array of ReflectionClass instances
92502     * @param array             $args       Constructor arguments
92503     *
92504     * @return DoubleInterface
92505     *
92506     * @throws \Prophecy\Exception\InvalidArgumentException
92507     */
92508    public function double(ReflectionClass $class = null, array $interfaces, array $args = null)
92509    {
92510        foreach ($interfaces as $interface) {
92511            if (!$interface instanceof ReflectionClass) {
92512                throw new InvalidArgumentException(\sprintf("[ReflectionClass \$interface1 [, ReflectionClass \$interface2]] array expected as\n" . "a second argument to `Doubler::double(...)`, but got %s.", \is_object($interface) ? \get_class($interface) . ' class' : \gettype($interface)));
92513            }
92514        }
92515        $classname = $this->createDoubleClass($class, $interfaces);
92516        $reflection = new ReflectionClass($classname);
92517        if (null !== $args) {
92518            return $reflection->newInstanceArgs($args);
92519        }
92520        if (null === ($constructor = $reflection->getConstructor()) || $constructor->isPublic() && !$constructor->isFinal()) {
92521            return $reflection->newInstance();
92522        }
92523        if (!$this->instantiator) {
92524            $this->instantiator = new Instantiator();
92525        }
92526        return $this->instantiator->instantiate($classname);
92527    }
92528    /**
92529     * Creates double class and returns its FQN.
92530     *
92531     * @param ReflectionClass   $class
92532     * @param ReflectionClass[] $interfaces
92533     *
92534     * @return string
92535     */
92536    protected function createDoubleClass(ReflectionClass $class = null, array $interfaces)
92537    {
92538        $name = $this->namer->name($class, $interfaces);
92539        $node = $this->mirror->reflect($class, $interfaces);
92540        foreach ($this->patches as $patch) {
92541            if ($patch->supports($node)) {
92542                $patch->apply($node);
92543            }
92544        }
92545        $this->creator->create($name, $node);
92546        return $name;
92547    }
92548}
92549<?php
92550
92551namespace Prophecy\Doubler\ClassPatch;
92552
92553use Prophecy\Doubler\Generator\Node\ClassNode;
92554use Prophecy\Exception\Doubler\ClassCreatorException;
92555class ThrowablePatch implements \Prophecy\Doubler\ClassPatch\ClassPatchInterface
92556{
92557    /**
92558     * Checks if patch supports specific class node.
92559     *
92560     * @param ClassNode $node
92561     * @return bool
92562     */
92563    public function supports(ClassNode $node)
92564    {
92565        return $this->implementsAThrowableInterface($node) && $this->doesNotExtendAThrowableClass($node);
92566    }
92567    /**
92568     * @param ClassNode $node
92569     * @return bool
92570     */
92571    private function implementsAThrowableInterface(ClassNode $node)
92572    {
92573        foreach ($node->getInterfaces() as $type) {
92574            if (\is_a($type, 'Throwable', \true)) {
92575                return \true;
92576            }
92577        }
92578        return \false;
92579    }
92580    /**
92581     * @param ClassNode $node
92582     * @return bool
92583     */
92584    private function doesNotExtendAThrowableClass(ClassNode $node)
92585    {
92586        return !\is_a($node->getParentClass(), 'Throwable', \true);
92587    }
92588    /**
92589     * Applies patch to the specific class node.
92590     *
92591     * @param ClassNode $node
92592     *
92593     * @return void
92594     */
92595    public function apply(ClassNode $node)
92596    {
92597        $this->checkItCanBeDoubled($node);
92598        $this->setParentClassToException($node);
92599    }
92600    private function checkItCanBeDoubled(ClassNode $node)
92601    {
92602        $className = $node->getParentClass();
92603        if ($className !== 'stdClass') {
92604            throw new ClassCreatorException(\sprintf('Cannot double concrete class %s as well as implement Traversable', $className), $node);
92605        }
92606    }
92607    private function setParentClassToException(ClassNode $node)
92608    {
92609        $node->setParentClass('Exception');
92610        $node->removeMethod('getMessage');
92611        $node->removeMethod('getCode');
92612        $node->removeMethod('getFile');
92613        $node->removeMethod('getLine');
92614        $node->removeMethod('getTrace');
92615        $node->removeMethod('getPrevious');
92616        $node->removeMethod('getNext');
92617        $node->removeMethod('getTraceAsString');
92618    }
92619    /**
92620     * Returns patch priority, which determines when patch will be applied.
92621     *
92622     * @return int Priority number (higher - earlier)
92623     */
92624    public function getPriority()
92625    {
92626        return 100;
92627    }
92628}
92629<?php
92630
92631/*
92632 * This file is part of the Prophecy.
92633 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
92634 *     Marcello Duarte <marcello.duarte@gmail.com>
92635 *
92636 * For the full copyright and license information, please view the LICENSE
92637 * file that was distributed with this source code.
92638 */
92639namespace Prophecy\Doubler\ClassPatch;
92640
92641use Prophecy\Doubler\Generator\Node\ClassNode;
92642use Prophecy\Doubler\Generator\Node\MethodNode;
92643/**
92644 * Disable constructor.
92645 * Makes all constructor arguments optional.
92646 *
92647 * @author Konstantin Kudryashov <ever.zet@gmail.com>
92648 */
92649class DisableConstructorPatch implements \Prophecy\Doubler\ClassPatch\ClassPatchInterface
92650{
92651    /**
92652     * Checks if class has `__construct` method.
92653     *
92654     * @param ClassNode $node
92655     *
92656     * @return bool
92657     */
92658    public function supports(ClassNode $node)
92659    {
92660        return \true;
92661    }
92662    /**
92663     * Makes all class constructor arguments optional.
92664     *
92665     * @param ClassNode $node
92666     */
92667    public function apply(ClassNode $node)
92668    {
92669        if (!$node->isExtendable('__construct')) {
92670            return;
92671        }
92672        if (!$node->hasMethod('__construct')) {
92673            $node->addMethod(new MethodNode('__construct', ''));
92674            return;
92675        }
92676        $constructor = $node->getMethod('__construct');
92677        foreach ($constructor->getArguments() as $argument) {
92678            $argument->setDefault(null);
92679        }
92680        $constructor->setCode(<<<PHP
92681if (0 < func_num_args()) {
92682    call_user_func_array(array('parent', '__construct'), func_get_args());
92683}
92684PHP
92685);
92686    }
92687    /**
92688     * Returns patch priority, which determines when patch will be applied.
92689     *
92690     * @return int Priority number (higher - earlier)
92691     */
92692    public function getPriority()
92693    {
92694        return 100;
92695    }
92696}
92697<?php
92698
92699/*
92700 * This file is part of the Prophecy.
92701 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
92702 *     Marcello Duarte <marcello.duarte@gmail.com>
92703 *
92704 * For the full copyright and license information, please view the LICENSE
92705 * file that was distributed with this source code.
92706 */
92707namespace Prophecy\Doubler\ClassPatch;
92708
92709use Prophecy\Doubler\Generator\Node\ArgumentNode;
92710use Prophecy\Doubler\Generator\Node\ClassNode;
92711use Prophecy\Doubler\Generator\Node\MethodNode;
92712use Prophecy\PhpDocumentor\ClassAndInterfaceTagRetriever;
92713use Prophecy\PhpDocumentor\MethodTagRetrieverInterface;
92714/**
92715 * Discover Magical API using "@method" PHPDoc format.
92716 *
92717 * @author Thomas Tourlourat <thomas@tourlourat.com>
92718 * @author Kévin Dunglas <dunglas@gmail.com>
92719 * @author Théo FIDRY <theo.fidry@gmail.com>
92720 */
92721class MagicCallPatch implements \Prophecy\Doubler\ClassPatch\ClassPatchInterface
92722{
92723    const MAGIC_METHODS_WITH_ARGUMENTS = ['__call', '__callStatic', '__get', '__isset', '__set', '__set_state', '__unserialize', '__unset'];
92724    private $tagRetriever;
92725    public function __construct(MethodTagRetrieverInterface $tagRetriever = null)
92726    {
92727        $this->tagRetriever = null === $tagRetriever ? new ClassAndInterfaceTagRetriever() : $tagRetriever;
92728    }
92729    /**
92730     * Support any class
92731     *
92732     * @param ClassNode $node
92733     *
92734     * @return boolean
92735     */
92736    public function supports(ClassNode $node)
92737    {
92738        return \true;
92739    }
92740    /**
92741     * Discover Magical API
92742     *
92743     * @param ClassNode $node
92744     */
92745    public function apply(ClassNode $node)
92746    {
92747        $types = \array_filter($node->getInterfaces(), function ($interface) {
92748            return 0 !== \strpos($interface, 'Prophecy\\');
92749        });
92750        $types[] = $node->getParentClass();
92751        foreach ($types as $type) {
92752            $reflectionClass = new \ReflectionClass($type);
92753            while ($reflectionClass) {
92754                $tagList = $this->tagRetriever->getTagList($reflectionClass);
92755                foreach ($tagList as $tag) {
92756                    $methodName = $tag->getMethodName();
92757                    if (empty($methodName)) {
92758                        continue;
92759                    }
92760                    if (!$reflectionClass->hasMethod($methodName)) {
92761                        $methodNode = new MethodNode($methodName);
92762                        // only magic methods can have a contract that needs to be enforced
92763                        if (\in_array($methodName, self::MAGIC_METHODS_WITH_ARGUMENTS)) {
92764                            foreach ($tag->getArguments() as $argument) {
92765                                $argumentNode = new ArgumentNode($argument['name']);
92766                                $methodNode->addArgument($argumentNode);
92767                            }
92768                        }
92769                        $methodNode->setStatic($tag->isStatic());
92770                        $node->addMethod($methodNode);
92771                    }
92772                }
92773                $reflectionClass = $reflectionClass->getParentClass();
92774            }
92775        }
92776    }
92777    /**
92778     * Returns patch priority, which determines when patch will be applied.
92779     *
92780     * @return integer Priority number (higher - earlier)
92781     */
92782    public function getPriority()
92783    {
92784        return 50;
92785    }
92786}
92787<?php
92788
92789/*
92790 * This file is part of the Prophecy.
92791 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
92792 *     Marcello Duarte <marcello.duarte@gmail.com>
92793 *
92794 * For the full copyright and license information, please view the LICENSE
92795 * file that was distributed with this source code.
92796 */
92797namespace Prophecy\Doubler\ClassPatch;
92798
92799use Prophecy\Doubler\Generator\Node\ClassNode;
92800/**
92801 * Class patch interface.
92802 * Class patches extend doubles functionality or help
92803 * Prophecy to avoid some internal PHP bugs.
92804 *
92805 * @author Konstantin Kudryashov <ever.zet@gmail.com>
92806 */
92807interface ClassPatchInterface
92808{
92809    /**
92810     * Checks if patch supports specific class node.
92811     *
92812     * @param ClassNode $node
92813     *
92814     * @return bool
92815     */
92816    public function supports(ClassNode $node);
92817    /**
92818     * Applies patch to the specific class node.
92819     *
92820     * @param ClassNode $node
92821     * @return void
92822     */
92823    public function apply(ClassNode $node);
92824    /**
92825     * Returns patch priority, which determines when patch will be applied.
92826     *
92827     * @return int Priority number (higher - earlier)
92828     */
92829    public function getPriority();
92830}
92831<?php
92832
92833/*
92834 * This file is part of the Prophecy.
92835 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
92836 *     Marcello Duarte <marcello.duarte@gmail.com>
92837 *
92838 * For the full copyright and license information, please view the LICENSE
92839 * file that was distributed with this source code.
92840 */
92841namespace Prophecy\Doubler\ClassPatch;
92842
92843use Prophecy\Doubler\Generator\Node\ArgumentTypeNode;
92844use Prophecy\Doubler\Generator\Node\ClassNode;
92845use Prophecy\Doubler\Generator\Node\MethodNode;
92846use Prophecy\Doubler\Generator\Node\ArgumentNode;
92847use Prophecy\Doubler\Generator\Node\ReturnTypeNode;
92848/**
92849 * Add Prophecy functionality to the double.
92850 * This is a core class patch for Prophecy.
92851 *
92852 * @author Konstantin Kudryashov <ever.zet@gmail.com>
92853 */
92854class ProphecySubjectPatch implements \Prophecy\Doubler\ClassPatch\ClassPatchInterface
92855{
92856    /**
92857     * Always returns true.
92858     *
92859     * @param ClassNode $node
92860     *
92861     * @return bool
92862     */
92863    public function supports(ClassNode $node)
92864    {
92865        return \true;
92866    }
92867    /**
92868     * Apply Prophecy functionality to class node.
92869     *
92870     * @param ClassNode $node
92871     */
92872    public function apply(ClassNode $node)
92873    {
92874        $node->addInterface('Prophecy\\Prophecy\\ProphecySubjectInterface');
92875        $node->addProperty('objectProphecyClosure', 'private');
92876        foreach ($node->getMethods() as $name => $method) {
92877            if ('__construct' === \strtolower($name)) {
92878                continue;
92879            }
92880            if (!$method->getReturnTypeNode()->hasReturnStatement()) {
92881                $method->setCode('$this->getProphecy()->makeProphecyMethodCall(__FUNCTION__, func_get_args());');
92882            } else {
92883                $method->setCode('return $this->getProphecy()->makeProphecyMethodCall(__FUNCTION__, func_get_args());');
92884            }
92885        }
92886        $prophecySetter = new MethodNode('setProphecy');
92887        $prophecyArgument = new ArgumentNode('prophecy');
92888        $prophecyArgument->setTypeNode(new ArgumentTypeNode('Prophecy\\Prophecy\\ProphecyInterface'));
92889        $prophecySetter->addArgument($prophecyArgument);
92890        $prophecySetter->setCode(<<<PHP
92891if (null === \$this->objectProphecyClosure) {
92892    \$this->objectProphecyClosure = static function () use (\$prophecy) {
92893        return \$prophecy;
92894    };
92895}
92896PHP
92897);
92898        $prophecyGetter = new MethodNode('getProphecy');
92899        $prophecyGetter->setCode('return \\call_user_func($this->objectProphecyClosure);');
92900        if ($node->hasMethod('__call')) {
92901            $__call = $node->getMethod('__call');
92902        } else {
92903            $__call = new MethodNode('__call');
92904            $__call->addArgument(new ArgumentNode('name'));
92905            $__call->addArgument(new ArgumentNode('arguments'));
92906            $node->addMethod($__call, \true);
92907        }
92908        $__call->setCode(<<<PHP
92909throw new \\Prophecy\\Exception\\Doubler\\MethodNotFoundException(
92910    sprintf('Method `%s::%s()` not found.', get_class(\$this), func_get_arg(0)),
92911    get_class(\$this), func_get_arg(0)
92912);
92913PHP
92914);
92915        $node->addMethod($prophecySetter, \true);
92916        $node->addMethod($prophecyGetter, \true);
92917    }
92918    /**
92919     * Returns patch priority, which determines when patch will be applied.
92920     *
92921     * @return int Priority number (higher - earlier)
92922     */
92923    public function getPriority()
92924    {
92925        return 0;
92926    }
92927}
92928<?php
92929
92930/*
92931 * This file is part of the Prophecy.
92932 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
92933 *     Marcello Duarte <marcello.duarte@gmail.com>
92934 *
92935 * For the full copyright and license information, please view the LICENSE
92936 * file that was distributed with this source code.
92937 */
92938namespace Prophecy\Doubler\ClassPatch;
92939
92940use Prophecy\Doubler\Generator\Node\ClassNode;
92941use Prophecy\Doubler\Generator\Node\MethodNode;
92942/**
92943 * SplFileInfo patch.
92944 * Makes SplFileInfo and derivative classes usable with Prophecy.
92945 *
92946 * @author Konstantin Kudryashov <ever.zet@gmail.com>
92947 */
92948class SplFileInfoPatch implements \Prophecy\Doubler\ClassPatch\ClassPatchInterface
92949{
92950    /**
92951     * Supports everything that extends SplFileInfo.
92952     *
92953     * @param ClassNode $node
92954     *
92955     * @return bool
92956     */
92957    public function supports(ClassNode $node)
92958    {
92959        if (null === $node->getParentClass()) {
92960            return \false;
92961        }
92962        return 'SplFileInfo' === $node->getParentClass() || \is_subclass_of($node->getParentClass(), 'SplFileInfo');
92963    }
92964    /**
92965     * Updated constructor code to call parent one with dummy file argument.
92966     *
92967     * @param ClassNode $node
92968     */
92969    public function apply(ClassNode $node)
92970    {
92971        if ($node->hasMethod('__construct')) {
92972            $constructor = $node->getMethod('__construct');
92973        } else {
92974            $constructor = new MethodNode('__construct');
92975            $node->addMethod($constructor);
92976        }
92977        if ($this->nodeIsDirectoryIterator($node)) {
92978            $constructor->setCode('return parent::__construct("' . __DIR__ . '");');
92979            return;
92980        }
92981        if ($this->nodeIsSplFileObject($node)) {
92982            $filePath = \str_replace('\\', '\\\\', __FILE__);
92983            $constructor->setCode('return parent::__construct("' . $filePath . '");');
92984            return;
92985        }
92986        if ($this->nodeIsSymfonySplFileInfo($node)) {
92987            $filePath = \str_replace('\\', '\\\\', __FILE__);
92988            $constructor->setCode('return parent::__construct("' . $filePath . '", "", "");');
92989            return;
92990        }
92991        $constructor->useParentCode();
92992    }
92993    /**
92994     * Returns patch priority, which determines when patch will be applied.
92995     *
92996     * @return int Priority number (higher - earlier)
92997     */
92998    public function getPriority()
92999    {
93000        return 50;
93001    }
93002    /**
93003     * @param ClassNode $node
93004     * @return boolean
93005     */
93006    private function nodeIsDirectoryIterator(ClassNode $node)
93007    {
93008        $parent = $node->getParentClass();
93009        return 'DirectoryIterator' === $parent || \is_subclass_of($parent, 'DirectoryIterator');
93010    }
93011    /**
93012     * @param ClassNode $node
93013     * @return boolean
93014     */
93015    private function nodeIsSplFileObject(ClassNode $node)
93016    {
93017        $parent = $node->getParentClass();
93018        return 'SplFileObject' === $parent || \is_subclass_of($parent, 'SplFileObject');
93019    }
93020    /**
93021     * @param ClassNode $node
93022     * @return boolean
93023     */
93024    private function nodeIsSymfonySplFileInfo(ClassNode $node)
93025    {
93026        $parent = $node->getParentClass();
93027        return 'Symfony\\Component\\Finder\\SplFileInfo' === $parent;
93028    }
93029}
93030<?php
93031
93032/*
93033 * This file is part of the Prophecy.
93034 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
93035 *     Marcello Duarte <marcello.duarte@gmail.com>
93036 *
93037 * For the full copyright and license information, please view the LICENSE
93038 * file that was distributed with this source code.
93039 */
93040namespace Prophecy\Doubler\ClassPatch;
93041
93042use Prophecy\Doubler\Generator\Node\ClassNode;
93043/**
93044 * Remove method functionality from the double which will clash with php keywords.
93045 *
93046 * @author Milan Magudia <milan@magudia.com>
93047 */
93048class KeywordPatch implements \Prophecy\Doubler\ClassPatch\ClassPatchInterface
93049{
93050    /**
93051     * Support any class
93052     *
93053     * @param ClassNode $node
93054     *
93055     * @return boolean
93056     */
93057    public function supports(ClassNode $node)
93058    {
93059        return \true;
93060    }
93061    /**
93062     * Remove methods that clash with php keywords
93063     *
93064     * @param ClassNode $node
93065     */
93066    public function apply(ClassNode $node)
93067    {
93068        $methodNames = \array_keys($node->getMethods());
93069        $methodsToRemove = \array_intersect($methodNames, $this->getKeywords());
93070        foreach ($methodsToRemove as $methodName) {
93071            $node->removeMethod($methodName);
93072        }
93073    }
93074    /**
93075     * Returns patch priority, which determines when patch will be applied.
93076     *
93077     * @return int Priority number (higher - earlier)
93078     */
93079    public function getPriority()
93080    {
93081        return 49;
93082    }
93083    /**
93084     * Returns array of php keywords.
93085     *
93086     * @return array
93087     */
93088    private function getKeywords()
93089    {
93090        return ['__halt_compiler'];
93091    }
93092}
93093<?php
93094
93095/*
93096 * This file is part of the Prophecy.
93097 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
93098 *     Marcello Duarte <marcello.duarte@gmail.com>
93099 *
93100 * For the full copyright and license information, please view the LICENSE
93101 * file that was distributed with this source code.
93102 */
93103namespace Prophecy\Doubler\ClassPatch;
93104
93105use Prophecy\Doubler\Generator\Node\ClassNode;
93106/**
93107 * Exception patch for HHVM to remove the stubs from special methods
93108 *
93109 * @author Christophe Coevoet <stof@notk.org>
93110 */
93111class HhvmExceptionPatch implements \Prophecy\Doubler\ClassPatch\ClassPatchInterface
93112{
93113    /**
93114     * Supports exceptions on HHVM.
93115     *
93116     * @param ClassNode $node
93117     *
93118     * @return bool
93119     */
93120    public function supports(ClassNode $node)
93121    {
93122        if (!\defined('HHVM_VERSION')) {
93123            return \false;
93124        }
93125        return 'Exception' === $node->getParentClass() || \is_subclass_of($node->getParentClass(), 'Exception');
93126    }
93127    /**
93128     * Removes special exception static methods from the doubled methods.
93129     *
93130     * @param ClassNode $node
93131     *
93132     * @return void
93133     */
93134    public function apply(ClassNode $node)
93135    {
93136        if ($node->hasMethod('setTraceOptions')) {
93137            $node->getMethod('setTraceOptions')->useParentCode();
93138        }
93139        if ($node->hasMethod('getTraceOptions')) {
93140            $node->getMethod('getTraceOptions')->useParentCode();
93141        }
93142    }
93143    /**
93144     * {@inheritdoc}
93145     */
93146    public function getPriority()
93147    {
93148        return -50;
93149    }
93150}
93151<?php
93152
93153/*
93154 * This file is part of the Prophecy.
93155 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
93156 *     Marcello Duarte <marcello.duarte@gmail.com>
93157 *
93158 * For the full copyright and license information, please view the LICENSE
93159 * file that was distributed with this source code.
93160 */
93161namespace Prophecy\Doubler\ClassPatch;
93162
93163use Prophecy\Doubler\Generator\Node\ClassNode;
93164use Prophecy\Doubler\Generator\Node\MethodNode;
93165use Prophecy\Doubler\Generator\Node\ReturnTypeNode;
93166/**
93167 * Traversable interface patch.
93168 * Forces classes that implement interfaces, that extend Traversable to also implement Iterator.
93169 *
93170 * @author Konstantin Kudryashov <ever.zet@gmail.com>
93171 */
93172class TraversablePatch implements \Prophecy\Doubler\ClassPatch\ClassPatchInterface
93173{
93174    /**
93175     * Supports nodetree, that implement Traversable, but not Iterator or IteratorAggregate.
93176     *
93177     * @param ClassNode $node
93178     *
93179     * @return bool
93180     */
93181    public function supports(ClassNode $node)
93182    {
93183        if (\in_array('Iterator', $node->getInterfaces())) {
93184            return \false;
93185        }
93186        if (\in_array('IteratorAggregate', $node->getInterfaces())) {
93187            return \false;
93188        }
93189        foreach ($node->getInterfaces() as $interface) {
93190            if ('Traversable' !== $interface && !\is_subclass_of($interface, 'Traversable')) {
93191                continue;
93192            }
93193            if ('Iterator' === $interface || \is_subclass_of($interface, 'Iterator')) {
93194                continue;
93195            }
93196            if ('IteratorAggregate' === $interface || \is_subclass_of($interface, 'IteratorAggregate')) {
93197                continue;
93198            }
93199            return \true;
93200        }
93201        return \false;
93202    }
93203    /**
93204     * Forces class to implement Iterator interface.
93205     *
93206     * @param ClassNode $node
93207     */
93208    public function apply(ClassNode $node)
93209    {
93210        $node->addInterface('Iterator');
93211        $currentMethod = new MethodNode('current');
93212        \PHP_VERSION_ID >= 80100 && $currentMethod->setReturnTypeNode(new ReturnTypeNode('mixed'));
93213        $node->addMethod($currentMethod);
93214        $keyMethod = new MethodNode('key');
93215        \PHP_VERSION_ID >= 80100 && $keyMethod->setReturnTypeNode(new ReturnTypeNode('mixed'));
93216        $node->addMethod($keyMethod);
93217        $nextMethod = new MethodNode('next');
93218        \PHP_VERSION_ID >= 80100 && $nextMethod->setReturnTypeNode(new ReturnTypeNode('void'));
93219        $node->addMethod($nextMethod);
93220        $rewindMethod = new MethodNode('rewind');
93221        \PHP_VERSION_ID >= 80100 && $rewindMethod->setReturnTypeNode(new ReturnTypeNode('void'));
93222        $node->addMethod($rewindMethod);
93223        $validMethod = new MethodNode('valid');
93224        \PHP_VERSION_ID >= 80100 && $validMethod->setReturnTypeNode(new ReturnTypeNode('bool'));
93225        $node->addMethod($validMethod);
93226    }
93227    /**
93228     * Returns patch priority, which determines when patch will be applied.
93229     *
93230     * @return int Priority number (higher - earlier)
93231     */
93232    public function getPriority()
93233    {
93234        return 100;
93235    }
93236}
93237<?php
93238
93239/*
93240 * This file is part of the Prophecy.
93241 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
93242 *     Marcello Duarte <marcello.duarte@gmail.com>
93243 *
93244 * For the full copyright and license information, please view the LICENSE
93245 * file that was distributed with this source code.
93246 */
93247namespace Prophecy\Doubler\ClassPatch;
93248
93249use Prophecy\Doubler\Generator\Node\ClassNode;
93250/**
93251 * ReflectionClass::newInstance patch.
93252 * Makes first argument of newInstance optional, since it works but signature is misleading
93253 *
93254 * @author Florian Klein <florian.klein@free.fr>
93255 */
93256class ReflectionClassNewInstancePatch implements \Prophecy\Doubler\ClassPatch\ClassPatchInterface
93257{
93258    /**
93259     * Supports ReflectionClass
93260     *
93261     * @param ClassNode $node
93262     *
93263     * @return bool
93264     */
93265    public function supports(ClassNode $node)
93266    {
93267        return 'ReflectionClass' === $node->getParentClass();
93268    }
93269    /**
93270     * Updates newInstance's first argument to make it optional
93271     *
93272     * @param ClassNode $node
93273     */
93274    public function apply(ClassNode $node)
93275    {
93276        foreach ($node->getMethod('newInstance')->getArguments() as $argument) {
93277            $argument->setDefault(null);
93278        }
93279    }
93280    /**
93281     * Returns patch priority, which determines when patch will be applied.
93282     *
93283     * @return int Priority number (higher = earlier)
93284     */
93285    public function getPriority()
93286    {
93287        return 50;
93288    }
93289}
93290<?php
93291
93292/*
93293 * This file is part of the Prophecy.
93294 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
93295 *     Marcello Duarte <marcello.duarte@gmail.com>
93296 *
93297 * For the full copyright and license information, please view the LICENSE
93298 * file that was distributed with this source code.
93299 */
93300namespace Prophecy\Argument\Token;
93301
93302/**
93303 * Logical NOT token.
93304 *
93305 * @author Boris Mikhaylov <kaguxmail@gmail.com>
93306 */
93307class LogicalNotToken implements \Prophecy\Argument\Token\TokenInterface
93308{
93309    /** @var \Prophecy\Argument\Token\TokenInterface  */
93310    private $token;
93311    /**
93312     * @param mixed $value exact value or token
93313     */
93314    public function __construct($value)
93315    {
93316        $this->token = $value instanceof \Prophecy\Argument\Token\TokenInterface ? $value : new \Prophecy\Argument\Token\ExactValueToken($value);
93317    }
93318    /**
93319     * Scores 4 when preset token does not match the argument.
93320     *
93321     * @param $argument
93322     *
93323     * @return bool|int
93324     */
93325    public function scoreArgument($argument)
93326    {
93327        return \false === $this->token->scoreArgument($argument) ? 4 : \false;
93328    }
93329    /**
93330     * Returns true if preset token is last.
93331     *
93332     * @return bool|int
93333     */
93334    public function isLast()
93335    {
93336        return $this->token->isLast();
93337    }
93338    /**
93339     * Returns originating token.
93340     *
93341     * @return TokenInterface
93342     */
93343    public function getOriginatingToken()
93344    {
93345        return $this->token;
93346    }
93347    /**
93348     * Returns string representation for token.
93349     *
93350     * @return string
93351     */
93352    public function __toString()
93353    {
93354        return \sprintf('not(%s)', $this->token);
93355    }
93356}
93357<?php
93358
93359/*
93360 * This file is part of the Prophecy.
93361 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
93362 *     Marcello Duarte <marcello.duarte@gmail.com>
93363 *
93364 * For the full copyright and license information, please view the LICENSE
93365 * file that was distributed with this source code.
93366 */
93367namespace Prophecy\Argument\Token;
93368
93369/**
93370 * Array every entry token.
93371 *
93372 * @author Adrien Brault <adrien.brault@gmail.com>
93373 */
93374class ArrayEveryEntryToken implements \Prophecy\Argument\Token\TokenInterface
93375{
93376    /**
93377     * @var TokenInterface
93378     */
93379    private $value;
93380    /**
93381     * @param mixed $value exact value or token
93382     */
93383    public function __construct($value)
93384    {
93385        if (!$value instanceof \Prophecy\Argument\Token\TokenInterface) {
93386            $value = new \Prophecy\Argument\Token\ExactValueToken($value);
93387        }
93388        $this->value = $value;
93389    }
93390    /**
93391     * {@inheritdoc}
93392     */
93393    public function scoreArgument($argument)
93394    {
93395        if (!$argument instanceof \Traversable && !\is_array($argument)) {
93396            return \false;
93397        }
93398        $scores = array();
93399        foreach ($argument as $key => $argumentEntry) {
93400            $scores[] = $this->value->scoreArgument($argumentEntry);
93401        }
93402        if (empty($scores) || \in_array(\false, $scores, \true)) {
93403            return \false;
93404        }
93405        return \array_sum($scores) / \count($scores);
93406    }
93407    /**
93408     * {@inheritdoc}
93409     */
93410    public function isLast()
93411    {
93412        return \false;
93413    }
93414    /**
93415     * {@inheritdoc}
93416     */
93417    public function __toString()
93418    {
93419        return \sprintf('[%s, ..., %s]', $this->value, $this->value);
93420    }
93421    /**
93422     * @return TokenInterface
93423     */
93424    public function getValue()
93425    {
93426        return $this->value;
93427    }
93428}
93429<?php
93430
93431/*
93432 * This file is part of the Prophecy.
93433 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
93434 *     Marcello Duarte <marcello.duarte@gmail.com>
93435 *
93436 * For the full copyright and license information, please view the LICENSE
93437 * file that was distributed with this source code.
93438 */
93439namespace Prophecy\Argument\Token;
93440
93441/**
93442 * Logical AND token.
93443 *
93444 * @author Boris Mikhaylov <kaguxmail@gmail.com>
93445 */
93446class LogicalAndToken implements \Prophecy\Argument\Token\TokenInterface
93447{
93448    private $tokens = array();
93449    /**
93450     * @param array $arguments exact values or tokens
93451     */
93452    public function __construct(array $arguments)
93453    {
93454        foreach ($arguments as $argument) {
93455            if (!$argument instanceof \Prophecy\Argument\Token\TokenInterface) {
93456                $argument = new \Prophecy\Argument\Token\ExactValueToken($argument);
93457            }
93458            $this->tokens[] = $argument;
93459        }
93460    }
93461    /**
93462     * Scores maximum score from scores returned by tokens for this argument if all of them score.
93463     *
93464     * @param $argument
93465     *
93466     * @return bool|int
93467     */
93468    public function scoreArgument($argument)
93469    {
93470        if (0 === \count($this->tokens)) {
93471            return \false;
93472        }
93473        $maxScore = 0;
93474        foreach ($this->tokens as $token) {
93475            $score = $token->scoreArgument($argument);
93476            if (\false === $score) {
93477                return \false;
93478            }
93479            $maxScore = \max($score, $maxScore);
93480        }
93481        return $maxScore;
93482    }
93483    /**
93484     * Returns false.
93485     *
93486     * @return boolean
93487     */
93488    public function isLast()
93489    {
93490        return \false;
93491    }
93492    /**
93493     * Returns string representation for token.
93494     *
93495     * @return string
93496     */
93497    public function __toString()
93498    {
93499        return \sprintf('bool(%s)', \implode(' AND ', $this->tokens));
93500    }
93501}
93502<?php
93503
93504/*
93505 * This file is part of the Prophecy.
93506 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
93507 *     Marcello Duarte <marcello.duarte@gmail.com>
93508 *
93509 * For the full copyright and license information, please view the LICENSE
93510 * file that was distributed with this source code.
93511 */
93512namespace Prophecy\Argument\Token;
93513
93514use Prophecy\Exception\InvalidArgumentException;
93515/**
93516 * Array entry token.
93517 *
93518 * @author Boris Mikhaylov <kaguxmail@gmail.com>
93519 */
93520class ArrayEntryToken implements \Prophecy\Argument\Token\TokenInterface
93521{
93522    /** @var \Prophecy\Argument\Token\TokenInterface */
93523    private $key;
93524    /** @var \Prophecy\Argument\Token\TokenInterface */
93525    private $value;
93526    /**
93527     * @param mixed $key   exact value or token
93528     * @param mixed $value exact value or token
93529     */
93530    public function __construct($key, $value)
93531    {
93532        $this->key = $this->wrapIntoExactValueToken($key);
93533        $this->value = $this->wrapIntoExactValueToken($value);
93534    }
93535    /**
93536     * Scores half of combined scores from key and value tokens for same entry. Capped at 8.
93537     * If argument implements \ArrayAccess without \Traversable, then key token is restricted to ExactValueToken.
93538     *
93539     * @param array|\ArrayAccess|\Traversable $argument
93540     *
93541     * @throws \Prophecy\Exception\InvalidArgumentException
93542     * @return bool|int
93543     */
93544    public function scoreArgument($argument)
93545    {
93546        if ($argument instanceof \Traversable) {
93547            $argument = \iterator_to_array($argument);
93548        }
93549        if ($argument instanceof \ArrayAccess) {
93550            $argument = $this->convertArrayAccessToEntry($argument);
93551        }
93552        if (!\is_array($argument) || empty($argument)) {
93553            return \false;
93554        }
93555        $keyScores = \array_map(array($this->key, 'scoreArgument'), \array_keys($argument));
93556        $valueScores = \array_map(array($this->value, 'scoreArgument'), $argument);
93557        $scoreEntry = function ($value, $key) {
93558            return $value && $key ? \min(8, ($key + $value) / 2) : \false;
93559        };
93560        return \max(\array_map($scoreEntry, $valueScores, $keyScores));
93561    }
93562    /**
93563     * Returns false.
93564     *
93565     * @return boolean
93566     */
93567    public function isLast()
93568    {
93569        return \false;
93570    }
93571    /**
93572     * Returns string representation for token.
93573     *
93574     * @return string
93575     */
93576    public function __toString()
93577    {
93578        return \sprintf('[..., %s => %s, ...]', $this->key, $this->value);
93579    }
93580    /**
93581     * Returns key
93582     *
93583     * @return TokenInterface
93584     */
93585    public function getKey()
93586    {
93587        return $this->key;
93588    }
93589    /**
93590     * Returns value
93591     *
93592     * @return TokenInterface
93593     */
93594    public function getValue()
93595    {
93596        return $this->value;
93597    }
93598    /**
93599     * Wraps non token $value into ExactValueToken
93600     *
93601     * @param $value
93602     * @return TokenInterface
93603     */
93604    private function wrapIntoExactValueToken($value)
93605    {
93606        return $value instanceof \Prophecy\Argument\Token\TokenInterface ? $value : new \Prophecy\Argument\Token\ExactValueToken($value);
93607    }
93608    /**
93609     * Converts instance of \ArrayAccess to key => value array entry
93610     *
93611     * @param \ArrayAccess $object
93612     *
93613     * @return array|null
93614     * @throws \Prophecy\Exception\InvalidArgumentException
93615     */
93616    private function convertArrayAccessToEntry(\ArrayAccess $object)
93617    {
93618        if (!$this->key instanceof \Prophecy\Argument\Token\ExactValueToken) {
93619            throw new InvalidArgumentException(\sprintf('You can only use exact value tokens to match key of ArrayAccess object' . \PHP_EOL . 'But you used `%s`.', $this->key));
93620        }
93621        $key = $this->key->getValue();
93622        return $object->offsetExists($key) ? array($key => $object[$key]) : array();
93623    }
93624}
93625<?php
93626
93627/*
93628 * This file is part of the Prophecy.
93629 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
93630 *     Marcello Duarte <marcello.duarte@gmail.com>
93631 *
93632 * For the full copyright and license information, please view the LICENSE
93633 * file that was distributed with this source code.
93634 */
93635namespace Prophecy\Argument\Token;
93636
93637/**
93638 * Check if values is not in array
93639 *
93640 * @author Vinícius Alonso <vba321@hotmail.com>
93641 */
93642class NotInArrayToken implements \Prophecy\Argument\Token\TokenInterface
93643{
93644    private $token = array();
93645    private $strict;
93646    /**
93647     * @param array $arguments tokens
93648     * @param bool $strict
93649     */
93650    public function __construct(array $arguments, $strict = \true)
93651    {
93652        $this->token = $arguments;
93653        $this->strict = $strict;
93654    }
93655    /**
93656     * Return scores 8 score if argument is in array.
93657     *
93658     * @param $argument
93659     *
93660     * @return bool|int
93661     */
93662    public function scoreArgument($argument)
93663    {
93664        if (\count($this->token) === 0) {
93665            return \false;
93666        }
93667        if (!\in_array($argument, $this->token, $this->strict)) {
93668            return 8;
93669        }
93670        return \false;
93671    }
93672    /**
93673     * Returns false.
93674     *
93675     * @return boolean
93676     */
93677    public function isLast()
93678    {
93679        return \false;
93680    }
93681    /**
93682     * Returns string representation for token.
93683     *
93684     * @return string
93685     */
93686    public function __toString()
93687    {
93688        $arrayAsString = \implode(', ', $this->token);
93689        return "[{$arrayAsString}]";
93690    }
93691}
93692<?php
93693
93694/*
93695 * This file is part of the Prophecy.
93696 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
93697 *     Marcello Duarte <marcello.duarte@gmail.com>
93698 *
93699 * For the full copyright and license information, please view the LICENSE
93700 * file that was distributed with this source code.
93701 */
93702namespace Prophecy\Argument\Token;
93703
93704use Prophecy\Util\StringUtil;
93705/**
93706 * Identical value token.
93707 *
93708 * @author Florian Voutzinos <florian@voutzinos.com>
93709 */
93710class IdenticalValueToken implements \Prophecy\Argument\Token\TokenInterface
93711{
93712    private $value;
93713    private $string;
93714    private $util;
93715    /**
93716     * Initializes token.
93717     *
93718     * @param mixed      $value
93719     * @param StringUtil $util
93720     */
93721    public function __construct($value, StringUtil $util = null)
93722    {
93723        $this->value = $value;
93724        $this->util = $util ?: new StringUtil();
93725    }
93726    /**
93727     * Scores 11 if argument matches preset value.
93728     *
93729     * @param $argument
93730     *
93731     * @return bool|int
93732     */
93733    public function scoreArgument($argument)
93734    {
93735        return $argument === $this->value ? 11 : \false;
93736    }
93737    /**
93738     * Returns false.
93739     *
93740     * @return bool
93741     */
93742    public function isLast()
93743    {
93744        return \false;
93745    }
93746    /**
93747     * Returns string representation for token.
93748     *
93749     * @return string
93750     */
93751    public function __toString()
93752    {
93753        if (null === $this->string) {
93754            $this->string = \sprintf('identical(%s)', $this->util->stringify($this->value));
93755        }
93756        return $this->string;
93757    }
93758}
93759<?php
93760
93761/*
93762 * This file is part of the Prophecy.
93763 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
93764 *     Marcello Duarte <marcello.duarte@gmail.com>
93765 *
93766 * For the full copyright and license information, please view the LICENSE
93767 * file that was distributed with this source code.
93768 */
93769namespace Prophecy\Argument\Token;
93770
93771use Prophecy\Exception\InvalidArgumentException;
93772/**
93773 * Value type token.
93774 *
93775 * @author Konstantin Kudryashov <ever.zet@gmail.com>
93776 */
93777class TypeToken implements \Prophecy\Argument\Token\TokenInterface
93778{
93779    private $type;
93780    /**
93781     * @param string $type
93782     */
93783    public function __construct($type)
93784    {
93785        $checker = "is_{$type}";
93786        if (!\function_exists($checker) && !\interface_exists($type) && !\class_exists($type)) {
93787            throw new InvalidArgumentException(\sprintf('Type or class name expected as an argument to TypeToken, but got %s.', $type));
93788        }
93789        $this->type = $type;
93790    }
93791    /**
93792     * Scores 5 if argument has the same type this token was constructed with.
93793     *
93794     * @param $argument
93795     *
93796     * @return bool|int
93797     */
93798    public function scoreArgument($argument)
93799    {
93800        $checker = "is_{$this->type}";
93801        if (\function_exists($checker)) {
93802            return \call_user_func($checker, $argument) ? 5 : \false;
93803        }
93804        return $argument instanceof $this->type ? 5 : \false;
93805    }
93806    /**
93807     * Returns false.
93808     *
93809     * @return bool
93810     */
93811    public function isLast()
93812    {
93813        return \false;
93814    }
93815    /**
93816     * Returns string representation for token.
93817     *
93818     * @return string
93819     */
93820    public function __toString()
93821    {
93822        return \sprintf('type(%s)', $this->type);
93823    }
93824}
93825<?php
93826
93827/*
93828 * This file is part of the Prophecy.
93829 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
93830 *     Marcello Duarte <marcello.duarte@gmail.com>
93831 *
93832 * For the full copyright and license information, please view the LICENSE
93833 * file that was distributed with this source code.
93834 */
93835namespace Prophecy\Argument\Token;
93836
93837use PHPUnit\SebastianBergmann\Comparator\ComparisonFailure;
93838use Prophecy\Comparator\Factory as ComparatorFactory;
93839use Prophecy\Util\StringUtil;
93840/**
93841 * Object state-checker token.
93842 *
93843 * @author Konstantin Kudryashov <ever.zet@gmail.com>
93844 */
93845class ObjectStateToken implements \Prophecy\Argument\Token\TokenInterface
93846{
93847    private $name;
93848    private $value;
93849    private $util;
93850    private $comparatorFactory;
93851    /**
93852     * Initializes token.
93853     *
93854     * @param string            $methodName
93855     * @param mixed             $value             Expected return value
93856     * @param null|StringUtil   $util
93857     * @param ComparatorFactory $comparatorFactory
93858     */
93859    public function __construct($methodName, $value, StringUtil $util = null, ComparatorFactory $comparatorFactory = null)
93860    {
93861        $this->name = $methodName;
93862        $this->value = $value;
93863        $this->util = $util ?: new StringUtil();
93864        $this->comparatorFactory = $comparatorFactory ?: ComparatorFactory::getInstance();
93865    }
93866    /**
93867     * Scores 8 if argument is an object, which method returns expected value.
93868     *
93869     * @param mixed $argument
93870     *
93871     * @return bool|int
93872     */
93873    public function scoreArgument($argument)
93874    {
93875        if (\is_object($argument) && \method_exists($argument, $this->name)) {
93876            $actual = \call_user_func(array($argument, $this->name));
93877            $comparator = $this->comparatorFactory->getComparatorFor($this->value, $actual);
93878            try {
93879                $comparator->assertEquals($this->value, $actual);
93880                return 8;
93881            } catch (ComparisonFailure $failure) {
93882                return \false;
93883            }
93884        }
93885        if (\is_object($argument) && \property_exists($argument, $this->name)) {
93886            return $argument->{$this->name} === $this->value ? 8 : \false;
93887        }
93888        return \false;
93889    }
93890    /**
93891     * Returns false.
93892     *
93893     * @return bool
93894     */
93895    public function isLast()
93896    {
93897        return \false;
93898    }
93899    /**
93900     * Returns string representation for token.
93901     *
93902     * @return string
93903     */
93904    public function __toString()
93905    {
93906        return \sprintf('state(%s(), %s)', $this->name, $this->util->stringify($this->value));
93907    }
93908}
93909<?php
93910
93911/*
93912 * This file is part of the Prophecy.
93913 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
93914 *     Marcello Duarte <marcello.duarte@gmail.com>
93915 *
93916 * For the full copyright and license information, please view the LICENSE
93917 * file that was distributed with this source code.
93918 */
93919namespace Prophecy\Argument\Token;
93920
93921/**
93922 * Check if values is in array
93923 *
93924 * @author Vinícius Alonso <vba321@hotmail.com>
93925 */
93926class InArrayToken implements \Prophecy\Argument\Token\TokenInterface
93927{
93928    private $token = array();
93929    private $strict;
93930    /**
93931     * @param array $arguments tokens
93932     * @param bool $strict
93933     */
93934    public function __construct(array $arguments, $strict = \true)
93935    {
93936        $this->token = $arguments;
93937        $this->strict = $strict;
93938    }
93939    /**
93940     * Return scores 8 score if argument is in array.
93941     *
93942     * @param $argument
93943     *
93944     * @return bool|int
93945     */
93946    public function scoreArgument($argument)
93947    {
93948        if (\count($this->token) === 0) {
93949            return \false;
93950        }
93951        if (\in_array($argument, $this->token, $this->strict)) {
93952            return 8;
93953        }
93954        return \false;
93955    }
93956    /**
93957     * Returns false.
93958     *
93959     * @return boolean
93960     */
93961    public function isLast()
93962    {
93963        return \false;
93964    }
93965    /**
93966     * Returns string representation for token.
93967     *
93968     * @return string
93969     */
93970    public function __toString()
93971    {
93972        $arrayAsString = \implode(', ', $this->token);
93973        return "[{$arrayAsString}]";
93974    }
93975}
93976<?php
93977
93978/*
93979 * This file is part of the Prophecy.
93980 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
93981 *     Marcello Duarte <marcello.duarte@gmail.com>
93982 *
93983 * For the full copyright and license information, please view the LICENSE
93984 * file that was distributed with this source code.
93985 */
93986namespace Prophecy\Argument\Token;
93987
93988/**
93989 * Any single value token.
93990 *
93991 * @author Konstantin Kudryashov <ever.zet@gmail.com>
93992 */
93993class AnyValueToken implements \Prophecy\Argument\Token\TokenInterface
93994{
93995    /**
93996     * Always scores 3 for any argument.
93997     *
93998     * @param $argument
93999     *
94000     * @return int
94001     */
94002    public function scoreArgument($argument)
94003    {
94004        return 3;
94005    }
94006    /**
94007     * Returns false.
94008     *
94009     * @return bool
94010     */
94011    public function isLast()
94012    {
94013        return \false;
94014    }
94015    /**
94016     * Returns string representation for token.
94017     *
94018     * @return string
94019     */
94020    public function __toString()
94021    {
94022        return '*';
94023    }
94024}
94025<?php
94026
94027/*
94028 * This file is part of the Prophecy.
94029 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
94030 *     Marcello Duarte <marcello.duarte@gmail.com>
94031 *
94032 * For the full copyright and license information, please view the LICENSE
94033 * file that was distributed with this source code.
94034 */
94035namespace Prophecy\Argument\Token;
94036
94037/**
94038 * Approximate value token
94039 *
94040 * @author Daniel Leech <daniel@dantleech.com>
94041 */
94042class ApproximateValueToken implements \Prophecy\Argument\Token\TokenInterface
94043{
94044    private $value;
94045    private $precision;
94046    public function __construct($value, $precision = 0)
94047    {
94048        $this->value = $value;
94049        $this->precision = $precision;
94050    }
94051    /**
94052     * {@inheritdoc}
94053     */
94054    public function scoreArgument($argument)
94055    {
94056        return \round((float) $argument, $this->precision) === \round($this->value, $this->precision) ? 10 : \false;
94057    }
94058    /**
94059     * {@inheritdoc}
94060     */
94061    public function isLast()
94062    {
94063        return \false;
94064    }
94065    /**
94066     * Returns string representation for token.
94067     *
94068     * @return string
94069     */
94070    public function __toString()
94071    {
94072        return \sprintf('≅%s', \round($this->value, $this->precision));
94073    }
94074}
94075<?php
94076
94077/*
94078 * This file is part of the Prophecy.
94079 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
94080 *     Marcello Duarte <marcello.duarte@gmail.com>
94081 *
94082 * For the full copyright and license information, please view the LICENSE
94083 * file that was distributed with this source code.
94084 */
94085namespace Prophecy\Argument\Token;
94086
94087/**
94088 * Any values token.
94089 *
94090 * @author Konstantin Kudryashov <ever.zet@gmail.com>
94091 */
94092class AnyValuesToken implements \Prophecy\Argument\Token\TokenInterface
94093{
94094    /**
94095     * Always scores 2 for any argument.
94096     *
94097     * @param $argument
94098     *
94099     * @return int
94100     */
94101    public function scoreArgument($argument)
94102    {
94103        return 2;
94104    }
94105    /**
94106     * Returns true to stop wildcard from processing other tokens.
94107     *
94108     * @return bool
94109     */
94110    public function isLast()
94111    {
94112        return \true;
94113    }
94114    /**
94115     * Returns string representation for token.
94116     *
94117     * @return string
94118     */
94119    public function __toString()
94120    {
94121        return '* [, ...]';
94122    }
94123}
94124<?php
94125
94126/*
94127 * This file is part of the Prophecy.
94128 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
94129 *     Marcello Duarte <marcello.duarte@gmail.com>
94130 *
94131 * For the full copyright and license information, please view the LICENSE
94132 * file that was distributed with this source code.
94133 */
94134namespace Prophecy\Argument\Token;
94135
94136use PHPUnit\SebastianBergmann\Comparator\ComparisonFailure;
94137use Prophecy\Comparator\Factory as ComparatorFactory;
94138use Prophecy\Util\StringUtil;
94139/**
94140 * Exact value token.
94141 *
94142 * @author Konstantin Kudryashov <ever.zet@gmail.com>
94143 */
94144class ExactValueToken implements \Prophecy\Argument\Token\TokenInterface
94145{
94146    private $value;
94147    private $string;
94148    private $util;
94149    private $comparatorFactory;
94150    /**
94151     * Initializes token.
94152     *
94153     * @param mixed             $value
94154     * @param StringUtil        $util
94155     * @param ComparatorFactory $comparatorFactory
94156     */
94157    public function __construct($value, StringUtil $util = null, ComparatorFactory $comparatorFactory = null)
94158    {
94159        $this->value = $value;
94160        $this->util = $util ?: new StringUtil();
94161        $this->comparatorFactory = $comparatorFactory ?: ComparatorFactory::getInstance();
94162    }
94163    /**
94164     * Scores 10 if argument matches preset value.
94165     *
94166     * @param $argument
94167     *
94168     * @return bool|int
94169     */
94170    public function scoreArgument($argument)
94171    {
94172        if (\is_object($argument) && \is_object($this->value)) {
94173            $comparator = $this->comparatorFactory->getComparatorFor($argument, $this->value);
94174            try {
94175                $comparator->assertEquals($argument, $this->value);
94176                return 10;
94177            } catch (ComparisonFailure $failure) {
94178                return \false;
94179            }
94180        }
94181        // If either one is an object it should be castable to a string
94182        if (\is_object($argument) xor \is_object($this->value)) {
94183            if (\is_object($argument) && !\method_exists($argument, '__toString')) {
94184                return \false;
94185            }
94186            if (\is_object($this->value) && !\method_exists($this->value, '__toString')) {
94187                return \false;
94188            }
94189        } elseif (\is_numeric($argument) && \is_numeric($this->value)) {
94190            // noop
94191        } elseif (\gettype($argument) !== \gettype($this->value)) {
94192            return \false;
94193        }
94194        return $argument == $this->value ? 10 : \false;
94195    }
94196    /**
94197     * Returns preset value against which token checks arguments.
94198     *
94199     * @return mixed
94200     */
94201    public function getValue()
94202    {
94203        return $this->value;
94204    }
94205    /**
94206     * Returns false.
94207     *
94208     * @return bool
94209     */
94210    public function isLast()
94211    {
94212        return \false;
94213    }
94214    /**
94215     * Returns string representation for token.
94216     *
94217     * @return string
94218     */
94219    public function __toString()
94220    {
94221        if (null === $this->string) {
94222            $this->string = \sprintf('exact(%s)', $this->util->stringify($this->value));
94223        }
94224        return $this->string;
94225    }
94226}
94227<?php
94228
94229/*
94230 * This file is part of the Prophecy.
94231 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
94232 *     Marcello Duarte <marcello.duarte@gmail.com>
94233 *
94234 * For the full copyright and license information, please view the LICENSE
94235 * file that was distributed with this source code.
94236 */
94237namespace Prophecy\Argument\Token;
94238
94239/**
94240 * Array elements count token.
94241 *
94242 * @author Boris Mikhaylov <kaguxmail@gmail.com>
94243 */
94244class ArrayCountToken implements \Prophecy\Argument\Token\TokenInterface
94245{
94246    private $count;
94247    /**
94248     * @param integer $value
94249     */
94250    public function __construct($value)
94251    {
94252        $this->count = $value;
94253    }
94254    /**
94255     * Scores 6 when argument has preset number of elements.
94256     *
94257     * @param $argument
94258     *
94259     * @return bool|int
94260     */
94261    public function scoreArgument($argument)
94262    {
94263        return $this->isCountable($argument) && $this->hasProperCount($argument) ? 6 : \false;
94264    }
94265    /**
94266     * Returns false.
94267     *
94268     * @return boolean
94269     */
94270    public function isLast()
94271    {
94272        return \false;
94273    }
94274    /**
94275     * Returns string representation for token.
94276     *
94277     * @return string
94278     */
94279    public function __toString()
94280    {
94281        return \sprintf('count(%s)', $this->count);
94282    }
94283    /**
94284     * Returns true if object is either array or instance of \Countable
94285     *
94286     * @param $argument
94287     * @return bool
94288     */
94289    private function isCountable($argument)
94290    {
94291        return \is_array($argument) || $argument instanceof \Countable;
94292    }
94293    /**
94294     * Returns true if $argument has expected number of elements
94295     *
94296     * @param array|\Countable $argument
94297     *
94298     * @return bool
94299     */
94300    private function hasProperCount($argument)
94301    {
94302        return $this->count === \count($argument);
94303    }
94304}
94305<?php
94306
94307/*
94308 * This file is part of the Prophecy.
94309 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
94310 *     Marcello Duarte <marcello.duarte@gmail.com>
94311 *
94312 * For the full copyright and license information, please view the LICENSE
94313 * file that was distributed with this source code.
94314 */
94315namespace Prophecy\Argument\Token;
94316
94317/**
94318 * String contains token.
94319 *
94320 * @author Peter Mitchell <pete@peterjmit.com>
94321 */
94322class StringContainsToken implements \Prophecy\Argument\Token\TokenInterface
94323{
94324    private $value;
94325    /**
94326     * Initializes token.
94327     *
94328     * @param string $value
94329     */
94330    public function __construct($value)
94331    {
94332        $this->value = $value;
94333    }
94334    public function scoreArgument($argument)
94335    {
94336        return \is_string($argument) && \strpos($argument, $this->value) !== \false ? 6 : \false;
94337    }
94338    /**
94339     * Returns preset value against which token checks arguments.
94340     *
94341     * @return mixed
94342     */
94343    public function getValue()
94344    {
94345        return $this->value;
94346    }
94347    /**
94348     * Returns false.
94349     *
94350     * @return bool
94351     */
94352    public function isLast()
94353    {
94354        return \false;
94355    }
94356    /**
94357     * Returns string representation for token.
94358     *
94359     * @return string
94360     */
94361    public function __toString()
94362    {
94363        return \sprintf('contains("%s")', $this->value);
94364    }
94365}
94366<?php
94367
94368/*
94369 * This file is part of the Prophecy.
94370 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
94371 *     Marcello Duarte <marcello.duarte@gmail.com>
94372 *
94373 * For the full copyright and license information, please view the LICENSE
94374 * file that was distributed with this source code.
94375 */
94376namespace Prophecy\Argument\Token;
94377
94378/**
94379 * Argument token interface.
94380 *
94381 * @author Konstantin Kudryashov <ever.zet@gmail.com>
94382 */
94383interface TokenInterface
94384{
94385    /**
94386     * Calculates token match score for provided argument.
94387     *
94388     * @param $argument
94389     *
94390     * @return bool|int
94391     */
94392    public function scoreArgument($argument);
94393    /**
94394     * Returns true if this token prevents check of other tokens (is last one).
94395     *
94396     * @return bool|int
94397     */
94398    public function isLast();
94399    /**
94400     * Returns string representation for token.
94401     *
94402     * @return string
94403     */
94404    public function __toString();
94405}
94406<?php
94407
94408/*
94409 * This file is part of the Prophecy.
94410 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
94411 *     Marcello Duarte <marcello.duarte@gmail.com>
94412 *
94413 * For the full copyright and license information, please view the LICENSE
94414 * file that was distributed with this source code.
94415 */
94416namespace Prophecy\Argument\Token;
94417
94418use Prophecy\Exception\InvalidArgumentException;
94419/**
94420 * Callback-verified token.
94421 *
94422 * @author Konstantin Kudryashov <ever.zet@gmail.com>
94423 */
94424class CallbackToken implements \Prophecy\Argument\Token\TokenInterface
94425{
94426    private $callback;
94427    /**
94428     * Initializes token.
94429     *
94430     * @param callable $callback
94431     *
94432     * @throws \Prophecy\Exception\InvalidArgumentException
94433     */
94434    public function __construct($callback)
94435    {
94436        if (!\is_callable($callback)) {
94437            throw new InvalidArgumentException(\sprintf('Callable expected as an argument to CallbackToken, but got %s.', \gettype($callback)));
94438        }
94439        $this->callback = $callback;
94440    }
94441    /**
94442     * Scores 7 if callback returns true, false otherwise.
94443     *
94444     * @param $argument
94445     *
94446     * @return bool|int
94447     */
94448    public function scoreArgument($argument)
94449    {
94450        return \call_user_func($this->callback, $argument) ? 7 : \false;
94451    }
94452    /**
94453     * Returns false.
94454     *
94455     * @return bool
94456     */
94457    public function isLast()
94458    {
94459        return \false;
94460    }
94461    /**
94462     * Returns string representation for token.
94463     *
94464     * @return string
94465     */
94466    public function __toString()
94467    {
94468        return 'callback()';
94469    }
94470}
94471<?php
94472
94473/*
94474 * This file is part of the Prophecy.
94475 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
94476 *     Marcello Duarte <marcello.duarte@gmail.com>
94477 *
94478 * For the full copyright and license information, please view the LICENSE
94479 * file that was distributed with this source code.
94480 */
94481namespace Prophecy\Argument;
94482
94483/**
94484 * Arguments wildcarding.
94485 *
94486 * @author Konstantin Kudryashov <ever.zet@gmail.com>
94487 */
94488class ArgumentsWildcard
94489{
94490    /**
94491     * @var Token\TokenInterface[]
94492     */
94493    private $tokens = array();
94494    private $string;
94495    /**
94496     * Initializes wildcard.
94497     *
94498     * @param array $arguments Array of argument tokens or values
94499     */
94500    public function __construct(array $arguments)
94501    {
94502        foreach ($arguments as $argument) {
94503            if (!$argument instanceof \Prophecy\Argument\Token\TokenInterface) {
94504                $argument = new \Prophecy\Argument\Token\ExactValueToken($argument);
94505            }
94506            $this->tokens[] = $argument;
94507        }
94508    }
94509    /**
94510     * Calculates wildcard match score for provided arguments.
94511     *
94512     * @param array $arguments
94513     *
94514     * @return false|int False OR integer score (higher - better)
94515     */
94516    public function scoreArguments(array $arguments)
94517    {
94518        if (0 == \count($arguments) && 0 == \count($this->tokens)) {
94519            return 1;
94520        }
94521        $arguments = \array_values($arguments);
94522        $totalScore = 0;
94523        foreach ($this->tokens as $i => $token) {
94524            $argument = isset($arguments[$i]) ? $arguments[$i] : null;
94525            if (1 >= ($score = $token->scoreArgument($argument))) {
94526                return \false;
94527            }
94528            $totalScore += $score;
94529            if (\true === $token->isLast()) {
94530                return $totalScore;
94531            }
94532        }
94533        if (\count($arguments) > \count($this->tokens)) {
94534            return \false;
94535        }
94536        return $totalScore;
94537    }
94538    /**
94539     * Returns string representation for wildcard.
94540     *
94541     * @return string
94542     */
94543    public function __toString()
94544    {
94545        if (null === $this->string) {
94546            $this->string = \implode(', ', \array_map(function ($token) {
94547                return (string) $token;
94548            }, $this->tokens));
94549        }
94550        return $this->string;
94551    }
94552    /**
94553     * @return array
94554     */
94555    public function getTokens()
94556    {
94557        return $this->tokens;
94558    }
94559}
94560Copyright (c) 2013 Konstantin Kudryashov <ever.zet@gmail.com>
94561Copyright (c) 2013 Marcello Duarte <marcello.duarte@gmail.com>
94562
94563Permission is hereby granted, free of charge, to any person
94564obtaining a copy of this software and associated documentation
94565files (the "Software"), to deal in the Software without
94566restriction, including without limitation the rights to use,
94567copy, modify, merge, publish, distribute, sublicense, and/or sell
94568copies of the Software, and to permit persons to whom the
94569Software is furnished to do so, subject to the following
94570conditions:
94571
94572The above copyright notice and this permission notice shall be
94573included in all copies or substantial portions of the Software.
94574
94575THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
94576EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
94577OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
94578NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
94579HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
94580WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
94581FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
94582OTHER DEALINGS IN THE SOFTWARE.
94583<?php
94584
94585declare (strict_types=1);
94586/*
94587 * This file is part of sebastian/diff.
94588 *
94589 * (c) Sebastian Bergmann <sebastian@phpunit.de>
94590 *
94591 * For the full copyright and license information, please view the LICENSE
94592 * file that was distributed with this source code.
94593 */
94594namespace PHPUnit\SebastianBergmann\Diff\Output;
94595
94596use function fclose;
94597use function fopen;
94598use function fwrite;
94599use function stream_get_contents;
94600use function substr;
94601use PHPUnit\SebastianBergmann\Diff\Differ;
94602/**
94603 * Builds a diff string representation in a loose unified diff format
94604 * listing only changes lines. Does not include line numbers.
94605 */
94606final class DiffOnlyOutputBuilder implements DiffOutputBuilderInterface
94607{
94608    /**
94609     * @var string
94610     */
94611    private $header;
94612    public function __construct(string $header = "--- Original\n+++ New\n")
94613    {
94614        $this->header = $header;
94615    }
94616    public function getDiff(array $diff) : string
94617    {
94618        $buffer = fopen('php://memory', 'r+b');
94619        if ('' !== $this->header) {
94620            fwrite($buffer, $this->header);
94621            if ("\n" !== substr($this->header, -1, 1)) {
94622                fwrite($buffer, "\n");
94623            }
94624        }
94625        foreach ($diff as $diffEntry) {
94626            if ($diffEntry[1] === Differ::ADDED) {
94627                fwrite($buffer, '+' . $diffEntry[0]);
94628            } elseif ($diffEntry[1] === Differ::REMOVED) {
94629                fwrite($buffer, '-' . $diffEntry[0]);
94630            } elseif ($diffEntry[1] === Differ::DIFF_LINE_END_WARNING) {
94631                fwrite($buffer, ' ' . $diffEntry[0]);
94632                continue;
94633                // Warnings should not be tested for line break, it will always be there
94634            } else {
94635                /* Not changed (old) 0 */
94636                continue;
94637                // we didn't write the non changs line, so do not add a line break either
94638            }
94639            $lc = substr($diffEntry[0], -1);
94640            if ($lc !== "\n" && $lc !== "\r") {
94641                fwrite($buffer, "\n");
94642                // \No newline at end of file
94643            }
94644        }
94645        $diff = stream_get_contents($buffer, -1, 0);
94646        fclose($buffer);
94647        return $diff;
94648    }
94649}
94650<?php
94651
94652declare (strict_types=1);
94653/*
94654 * This file is part of sebastian/diff.
94655 *
94656 * (c) Sebastian Bergmann <sebastian@phpunit.de>
94657 *
94658 * For the full copyright and license information, please view the LICENSE
94659 * file that was distributed with this source code.
94660 */
94661namespace PHPUnit\SebastianBergmann\Diff\Output;
94662
94663/**
94664 * Defines how an output builder should take a generated
94665 * diff array and return a string representation of that diff.
94666 */
94667interface DiffOutputBuilderInterface
94668{
94669    public function getDiff(array $diff) : string;
94670}
94671<?php
94672
94673declare (strict_types=1);
94674/*
94675 * This file is part of sebastian/diff.
94676 *
94677 * (c) Sebastian Bergmann <sebastian@phpunit.de>
94678 *
94679 * For the full copyright and license information, please view the LICENSE
94680 * file that was distributed with this source code.
94681 */
94682namespace PHPUnit\SebastianBergmann\Diff\Output;
94683
94684use function array_splice;
94685use function count;
94686use function fclose;
94687use function fopen;
94688use function fwrite;
94689use function max;
94690use function min;
94691use function stream_get_contents;
94692use function strlen;
94693use function substr;
94694use PHPUnit\SebastianBergmann\Diff\Differ;
94695/**
94696 * Builds a diff string representation in unified diff format in chunks.
94697 */
94698final class UnifiedDiffOutputBuilder extends AbstractChunkOutputBuilder
94699{
94700    /**
94701     * @var bool
94702     */
94703    private $collapseRanges = \true;
94704    /**
94705     * @var int >= 0
94706     */
94707    private $commonLineThreshold = 6;
94708    /**
94709     * @var int >= 0
94710     */
94711    private $contextLines = 3;
94712    /**
94713     * @var string
94714     */
94715    private $header;
94716    /**
94717     * @var bool
94718     */
94719    private $addLineNumbers;
94720    public function __construct(string $header = "--- Original\n+++ New\n", bool $addLineNumbers = \false)
94721    {
94722        $this->header = $header;
94723        $this->addLineNumbers = $addLineNumbers;
94724    }
94725    public function getDiff(array $diff) : string
94726    {
94727        $buffer = fopen('php://memory', 'r+b');
94728        if ('' !== $this->header) {
94729            fwrite($buffer, $this->header);
94730            if ("\n" !== substr($this->header, -1, 1)) {
94731                fwrite($buffer, "\n");
94732            }
94733        }
94734        if (0 !== count($diff)) {
94735            $this->writeDiffHunks($buffer, $diff);
94736        }
94737        $diff = stream_get_contents($buffer, -1, 0);
94738        fclose($buffer);
94739        // If the diff is non-empty and last char is not a linebreak: add it.
94740        // This might happen when both the `from` and `to` do not have a trailing linebreak
94741        $last = substr($diff, -1);
94742        return 0 !== strlen($diff) && "\n" !== $last && "\r" !== $last ? $diff . "\n" : $diff;
94743    }
94744    private function writeDiffHunks($output, array $diff) : void
94745    {
94746        // detect "No newline at end of file" and insert into `$diff` if needed
94747        $upperLimit = count($diff);
94748        if (0 === $diff[$upperLimit - 1][1]) {
94749            $lc = substr($diff[$upperLimit - 1][0], -1);
94750            if ("\n" !== $lc) {
94751                array_splice($diff, $upperLimit, 0, [["\n\\ No newline at end of file\n", Differ::NO_LINE_END_EOF_WARNING]]);
94752            }
94753        } else {
94754            // search back for the last `+` and `-` line,
94755            // check if has trailing linebreak, else add under it warning under it
94756            $toFind = [1 => \true, 2 => \true];
94757            for ($i = $upperLimit - 1; $i >= 0; --$i) {
94758                if (isset($toFind[$diff[$i][1]])) {
94759                    unset($toFind[$diff[$i][1]]);
94760                    $lc = substr($diff[$i][0], -1);
94761                    if ("\n" !== $lc) {
94762                        array_splice($diff, $i + 1, 0, [["\n\\ No newline at end of file\n", Differ::NO_LINE_END_EOF_WARNING]]);
94763                    }
94764                    if (!count($toFind)) {
94765                        break;
94766                    }
94767                }
94768            }
94769        }
94770        // write hunks to output buffer
94771        $cutOff = max($this->commonLineThreshold, $this->contextLines);
94772        $hunkCapture = \false;
94773        $sameCount = $toRange = $fromRange = 0;
94774        $toStart = $fromStart = 1;
94775        $i = 0;
94776        /** @var int $i */
94777        foreach ($diff as $i => $entry) {
94778            if (0 === $entry[1]) {
94779                // same
94780                if (\false === $hunkCapture) {
94781                    ++$fromStart;
94782                    ++$toStart;
94783                    continue;
94784                }
94785                ++$sameCount;
94786                ++$toRange;
94787                ++$fromRange;
94788                if ($sameCount === $cutOff) {
94789                    $contextStartOffset = $hunkCapture - $this->contextLines < 0 ? $hunkCapture : $this->contextLines;
94790                    // note: $contextEndOffset = $this->contextLines;
94791                    //
94792                    // because we never go beyond the end of the diff.
94793                    // with the cutoff/contextlines here the follow is never true;
94794                    //
94795                    // if ($i - $cutOff + $this->contextLines + 1 > \count($diff)) {
94796                    //    $contextEndOffset = count($diff) - 1;
94797                    // }
94798                    //
94799                    // ; that would be true for a trailing incomplete hunk case which is dealt with after this loop
94800                    $this->writeHunk($diff, $hunkCapture - $contextStartOffset, $i - $cutOff + $this->contextLines + 1, $fromStart - $contextStartOffset, $fromRange - $cutOff + $contextStartOffset + $this->contextLines, $toStart - $contextStartOffset, $toRange - $cutOff + $contextStartOffset + $this->contextLines, $output);
94801                    $fromStart += $fromRange;
94802                    $toStart += $toRange;
94803                    $hunkCapture = \false;
94804                    $sameCount = $toRange = $fromRange = 0;
94805                }
94806                continue;
94807            }
94808            $sameCount = 0;
94809            if ($entry[1] === Differ::NO_LINE_END_EOF_WARNING) {
94810                continue;
94811            }
94812            if (\false === $hunkCapture) {
94813                $hunkCapture = $i;
94814            }
94815            if (Differ::ADDED === $entry[1]) {
94816                ++$toRange;
94817            }
94818            if (Differ::REMOVED === $entry[1]) {
94819                ++$fromRange;
94820            }
94821        }
94822        if (\false === $hunkCapture) {
94823            return;
94824        }
94825        // we end here when cutoff (commonLineThreshold) was not reached, but we where capturing a hunk,
94826        // do not render hunk till end automatically because the number of context lines might be less than the commonLineThreshold
94827        $contextStartOffset = $hunkCapture - $this->contextLines < 0 ? $hunkCapture : $this->contextLines;
94828        // prevent trying to write out more common lines than there are in the diff _and_
94829        // do not write more than configured through the context lines
94830        $contextEndOffset = min($sameCount, $this->contextLines);
94831        $fromRange -= $sameCount;
94832        $toRange -= $sameCount;
94833        $this->writeHunk($diff, $hunkCapture - $contextStartOffset, $i - $sameCount + $contextEndOffset + 1, $fromStart - $contextStartOffset, $fromRange + $contextStartOffset + $contextEndOffset, $toStart - $contextStartOffset, $toRange + $contextStartOffset + $contextEndOffset, $output);
94834    }
94835    private function writeHunk(array $diff, int $diffStartIndex, int $diffEndIndex, int $fromStart, int $fromRange, int $toStart, int $toRange, $output) : void
94836    {
94837        if ($this->addLineNumbers) {
94838            fwrite($output, '@@ -' . $fromStart);
94839            if (!$this->collapseRanges || 1 !== $fromRange) {
94840                fwrite($output, ',' . $fromRange);
94841            }
94842            fwrite($output, ' +' . $toStart);
94843            if (!$this->collapseRanges || 1 !== $toRange) {
94844                fwrite($output, ',' . $toRange);
94845            }
94846            fwrite($output, " @@\n");
94847        } else {
94848            fwrite($output, "@@ @@\n");
94849        }
94850        for ($i = $diffStartIndex; $i < $diffEndIndex; ++$i) {
94851            if ($diff[$i][1] === Differ::ADDED) {
94852                fwrite($output, '+' . $diff[$i][0]);
94853            } elseif ($diff[$i][1] === Differ::REMOVED) {
94854                fwrite($output, '-' . $diff[$i][0]);
94855            } elseif ($diff[$i][1] === Differ::OLD) {
94856                fwrite($output, ' ' . $diff[$i][0]);
94857            } elseif ($diff[$i][1] === Differ::NO_LINE_END_EOF_WARNING) {
94858                fwrite($output, "\n");
94859                // $diff[$i][0]
94860            } else {
94861                /* Not changed (old) Differ::OLD or Warning Differ::DIFF_LINE_END_WARNING */
94862                fwrite($output, ' ' . $diff[$i][0]);
94863            }
94864        }
94865    }
94866}
94867<?php
94868
94869declare (strict_types=1);
94870/*
94871 * This file is part of sebastian/diff.
94872 *
94873 * (c) Sebastian Bergmann <sebastian@phpunit.de>
94874 *
94875 * For the full copyright and license information, please view the LICENSE
94876 * file that was distributed with this source code.
94877 */
94878namespace PHPUnit\SebastianBergmann\Diff\Output;
94879
94880use function array_merge;
94881use function array_splice;
94882use function count;
94883use function fclose;
94884use function fopen;
94885use function fwrite;
94886use function is_bool;
94887use function is_int;
94888use function is_string;
94889use function max;
94890use function min;
94891use function sprintf;
94892use function stream_get_contents;
94893use function substr;
94894use PHPUnit\SebastianBergmann\Diff\ConfigurationException;
94895use PHPUnit\SebastianBergmann\Diff\Differ;
94896/**
94897 * Strict Unified diff output builder.
94898 *
94899 * Generates (strict) Unified diff's (unidiffs) with hunks.
94900 */
94901final class StrictUnifiedDiffOutputBuilder implements DiffOutputBuilderInterface
94902{
94903    private static $default = [
94904        'collapseRanges' => \true,
94905        // ranges of length one are rendered with the trailing `,1`
94906        'commonLineThreshold' => 6,
94907        // number of same lines before ending a new hunk and creating a new one (if needed)
94908        'contextLines' => 3,
94909        // like `diff:  -u, -U NUM, --unified[=NUM]`, for patch/git apply compatibility best to keep at least @ 3
94910        'fromFile' => null,
94911        'fromFileDate' => null,
94912        'toFile' => null,
94913        'toFileDate' => null,
94914    ];
94915    /**
94916     * @var bool
94917     */
94918    private $changed;
94919    /**
94920     * @var bool
94921     */
94922    private $collapseRanges;
94923    /**
94924     * @var int >= 0
94925     */
94926    private $commonLineThreshold;
94927    /**
94928     * @var string
94929     */
94930    private $header;
94931    /**
94932     * @var int >= 0
94933     */
94934    private $contextLines;
94935    public function __construct(array $options = [])
94936    {
94937        $options = array_merge(self::$default, $options);
94938        if (!is_bool($options['collapseRanges'])) {
94939            throw new ConfigurationException('collapseRanges', 'a bool', $options['collapseRanges']);
94940        }
94941        if (!is_int($options['contextLines']) || $options['contextLines'] < 0) {
94942            throw new ConfigurationException('contextLines', 'an int >= 0', $options['contextLines']);
94943        }
94944        if (!is_int($options['commonLineThreshold']) || $options['commonLineThreshold'] <= 0) {
94945            throw new ConfigurationException('commonLineThreshold', 'an int > 0', $options['commonLineThreshold']);
94946        }
94947        $this->assertString($options, 'fromFile');
94948        $this->assertString($options, 'toFile');
94949        $this->assertStringOrNull($options, 'fromFileDate');
94950        $this->assertStringOrNull($options, 'toFileDate');
94951        $this->header = sprintf("--- %s%s\n+++ %s%s\n", $options['fromFile'], null === $options['fromFileDate'] ? '' : "\t" . $options['fromFileDate'], $options['toFile'], null === $options['toFileDate'] ? '' : "\t" . $options['toFileDate']);
94952        $this->collapseRanges = $options['collapseRanges'];
94953        $this->commonLineThreshold = $options['commonLineThreshold'];
94954        $this->contextLines = $options['contextLines'];
94955    }
94956    public function getDiff(array $diff) : string
94957    {
94958        if (0 === count($diff)) {
94959            return '';
94960        }
94961        $this->changed = \false;
94962        $buffer = fopen('php://memory', 'r+b');
94963        fwrite($buffer, $this->header);
94964        $this->writeDiffHunks($buffer, $diff);
94965        if (!$this->changed) {
94966            fclose($buffer);
94967            return '';
94968        }
94969        $diff = stream_get_contents($buffer, -1, 0);
94970        fclose($buffer);
94971        // If the last char is not a linebreak: add it.
94972        // This might happen when both the `from` and `to` do not have a trailing linebreak
94973        $last = substr($diff, -1);
94974        return "\n" !== $last && "\r" !== $last ? $diff . "\n" : $diff;
94975    }
94976    private function writeDiffHunks($output, array $diff) : void
94977    {
94978        // detect "No newline at end of file" and insert into `$diff` if needed
94979        $upperLimit = count($diff);
94980        if (0 === $diff[$upperLimit - 1][1]) {
94981            $lc = substr($diff[$upperLimit - 1][0], -1);
94982            if ("\n" !== $lc) {
94983                array_splice($diff, $upperLimit, 0, [["\n\\ No newline at end of file\n", Differ::NO_LINE_END_EOF_WARNING]]);
94984            }
94985        } else {
94986            // search back for the last `+` and `-` line,
94987            // check if has trailing linebreak, else add under it warning under it
94988            $toFind = [1 => \true, 2 => \true];
94989            for ($i = $upperLimit - 1; $i >= 0; --$i) {
94990                if (isset($toFind[$diff[$i][1]])) {
94991                    unset($toFind[$diff[$i][1]]);
94992                    $lc = substr($diff[$i][0], -1);
94993                    if ("\n" !== $lc) {
94994                        array_splice($diff, $i + 1, 0, [["\n\\ No newline at end of file\n", Differ::NO_LINE_END_EOF_WARNING]]);
94995                    }
94996                    if (!count($toFind)) {
94997                        break;
94998                    }
94999                }
95000            }
95001        }
95002        // write hunks to output buffer
95003        $cutOff = max($this->commonLineThreshold, $this->contextLines);
95004        $hunkCapture = \false;
95005        $sameCount = $toRange = $fromRange = 0;
95006        $toStart = $fromStart = 1;
95007        $i = 0;
95008        /** @var int $i */
95009        foreach ($diff as $i => $entry) {
95010            if (0 === $entry[1]) {
95011                // same
95012                if (\false === $hunkCapture) {
95013                    ++$fromStart;
95014                    ++$toStart;
95015                    continue;
95016                }
95017                ++$sameCount;
95018                ++$toRange;
95019                ++$fromRange;
95020                if ($sameCount === $cutOff) {
95021                    $contextStartOffset = $hunkCapture - $this->contextLines < 0 ? $hunkCapture : $this->contextLines;
95022                    // note: $contextEndOffset = $this->contextLines;
95023                    //
95024                    // because we never go beyond the end of the diff.
95025                    // with the cutoff/contextlines here the follow is never true;
95026                    //
95027                    // if ($i - $cutOff + $this->contextLines + 1 > \count($diff)) {
95028                    //    $contextEndOffset = count($diff) - 1;
95029                    // }
95030                    //
95031                    // ; that would be true for a trailing incomplete hunk case which is dealt with after this loop
95032                    $this->writeHunk($diff, $hunkCapture - $contextStartOffset, $i - $cutOff + $this->contextLines + 1, $fromStart - $contextStartOffset, $fromRange - $cutOff + $contextStartOffset + $this->contextLines, $toStart - $contextStartOffset, $toRange - $cutOff + $contextStartOffset + $this->contextLines, $output);
95033                    $fromStart += $fromRange;
95034                    $toStart += $toRange;
95035                    $hunkCapture = \false;
95036                    $sameCount = $toRange = $fromRange = 0;
95037                }
95038                continue;
95039            }
95040            $sameCount = 0;
95041            if ($entry[1] === Differ::NO_LINE_END_EOF_WARNING) {
95042                continue;
95043            }
95044            $this->changed = \true;
95045            if (\false === $hunkCapture) {
95046                $hunkCapture = $i;
95047            }
95048            if (Differ::ADDED === $entry[1]) {
95049                // added
95050                ++$toRange;
95051            }
95052            if (Differ::REMOVED === $entry[1]) {
95053                // removed
95054                ++$fromRange;
95055            }
95056        }
95057        if (\false === $hunkCapture) {
95058            return;
95059        }
95060        // we end here when cutoff (commonLineThreshold) was not reached, but we where capturing a hunk,
95061        // do not render hunk till end automatically because the number of context lines might be less than the commonLineThreshold
95062        $contextStartOffset = $hunkCapture - $this->contextLines < 0 ? $hunkCapture : $this->contextLines;
95063        // prevent trying to write out more common lines than there are in the diff _and_
95064        // do not write more than configured through the context lines
95065        $contextEndOffset = min($sameCount, $this->contextLines);
95066        $fromRange -= $sameCount;
95067        $toRange -= $sameCount;
95068        $this->writeHunk($diff, $hunkCapture - $contextStartOffset, $i - $sameCount + $contextEndOffset + 1, $fromStart - $contextStartOffset, $fromRange + $contextStartOffset + $contextEndOffset, $toStart - $contextStartOffset, $toRange + $contextStartOffset + $contextEndOffset, $output);
95069    }
95070    private function writeHunk(array $diff, int $diffStartIndex, int $diffEndIndex, int $fromStart, int $fromRange, int $toStart, int $toRange, $output) : void
95071    {
95072        fwrite($output, '@@ -' . $fromStart);
95073        if (!$this->collapseRanges || 1 !== $fromRange) {
95074            fwrite($output, ',' . $fromRange);
95075        }
95076        fwrite($output, ' +' . $toStart);
95077        if (!$this->collapseRanges || 1 !== $toRange) {
95078            fwrite($output, ',' . $toRange);
95079        }
95080        fwrite($output, " @@\n");
95081        for ($i = $diffStartIndex; $i < $diffEndIndex; ++$i) {
95082            if ($diff[$i][1] === Differ::ADDED) {
95083                $this->changed = \true;
95084                fwrite($output, '+' . $diff[$i][0]);
95085            } elseif ($diff[$i][1] === Differ::REMOVED) {
95086                $this->changed = \true;
95087                fwrite($output, '-' . $diff[$i][0]);
95088            } elseif ($diff[$i][1] === Differ::OLD) {
95089                fwrite($output, ' ' . $diff[$i][0]);
95090            } elseif ($diff[$i][1] === Differ::NO_LINE_END_EOF_WARNING) {
95091                $this->changed = \true;
95092                fwrite($output, $diff[$i][0]);
95093            }
95094            //} elseif ($diff[$i][1] === Differ::DIFF_LINE_END_WARNING) { // custom comment inserted by PHPUnit/diff package
95095            //  skip
95096            //} else {
95097            //  unknown/invalid
95098            //}
95099        }
95100    }
95101    private function assertString(array $options, string $option) : void
95102    {
95103        if (!is_string($options[$option])) {
95104            throw new ConfigurationException($option, 'a string', $options[$option]);
95105        }
95106    }
95107    private function assertStringOrNull(array $options, string $option) : void
95108    {
95109        if (null !== $options[$option] && !is_string($options[$option])) {
95110            throw new ConfigurationException($option, 'a string or <null>', $options[$option]);
95111        }
95112    }
95113}
95114<?php
95115
95116declare (strict_types=1);
95117/*
95118 * This file is part of sebastian/diff.
95119 *
95120 * (c) Sebastian Bergmann <sebastian@phpunit.de>
95121 *
95122 * For the full copyright and license information, please view the LICENSE
95123 * file that was distributed with this source code.
95124 */
95125namespace PHPUnit\SebastianBergmann\Diff\Output;
95126
95127use function count;
95128abstract class AbstractChunkOutputBuilder implements DiffOutputBuilderInterface
95129{
95130    /**
95131     * Takes input of the diff array and returns the common parts.
95132     * Iterates through diff line by line.
95133     */
95134    protected function getCommonChunks(array $diff, int $lineThreshold = 5) : array
95135    {
95136        $diffSize = count($diff);
95137        $capturing = \false;
95138        $chunkStart = 0;
95139        $chunkSize = 0;
95140        $commonChunks = [];
95141        for ($i = 0; $i < $diffSize; ++$i) {
95142            if ($diff[$i][1] === 0) {
95143                if ($capturing === \false) {
95144                    $capturing = \true;
95145                    $chunkStart = $i;
95146                    $chunkSize = 0;
95147                } else {
95148                    ++$chunkSize;
95149                }
95150            } elseif ($capturing !== \false) {
95151                if ($chunkSize >= $lineThreshold) {
95152                    $commonChunks[$chunkStart] = $chunkStart + $chunkSize;
95153                }
95154                $capturing = \false;
95155            }
95156        }
95157        if ($capturing !== \false && $chunkSize >= $lineThreshold) {
95158            $commonChunks[$chunkStart] = $chunkStart + $chunkSize;
95159        }
95160        return $commonChunks;
95161    }
95162}
95163<?php
95164
95165declare (strict_types=1);
95166/*
95167 * This file is part of sebastian/diff.
95168 *
95169 * (c) Sebastian Bergmann <sebastian@phpunit.de>
95170 *
95171 * For the full copyright and license information, please view the LICENSE
95172 * file that was distributed with this source code.
95173 */
95174namespace PHPUnit\SebastianBergmann\Diff;
95175
95176use function get_class;
95177use function gettype;
95178use function is_object;
95179use function sprintf;
95180use Exception;
95181final class ConfigurationException extends InvalidArgumentException
95182{
95183    public function __construct(string $option, string $expected, $value, int $code = 0, Exception $previous = null)
95184    {
95185        parent::__construct(sprintf('Option "%s" must be %s, got "%s".', $option, $expected, is_object($value) ? get_class($value) : (null === $value ? '<null>' : gettype($value) . '#' . $value)), $code, $previous);
95186    }
95187}
95188<?php
95189
95190declare (strict_types=1);
95191/*
95192 * This file is part of sebastian/diff.
95193 *
95194 * (c) Sebastian Bergmann <sebastian@phpunit.de>
95195 *
95196 * For the full copyright and license information, please view the LICENSE
95197 * file that was distributed with this source code.
95198 */
95199namespace PHPUnit\SebastianBergmann\Diff;
95200
95201use Throwable;
95202interface Exception extends Throwable
95203{
95204}
95205<?php
95206
95207declare (strict_types=1);
95208/*
95209 * This file is part of sebastian/diff.
95210 *
95211 * (c) Sebastian Bergmann <sebastian@phpunit.de>
95212 *
95213 * For the full copyright and license information, please view the LICENSE
95214 * file that was distributed with this source code.
95215 */
95216namespace PHPUnit\SebastianBergmann\Diff;
95217
95218class InvalidArgumentException extends \InvalidArgumentException implements Exception
95219{
95220}
95221<?php
95222
95223declare (strict_types=1);
95224/*
95225 * This file is part of sebastian/diff.
95226 *
95227 * (c) Sebastian Bergmann <sebastian@phpunit.de>
95228 *
95229 * For the full copyright and license information, please view the LICENSE
95230 * file that was distributed with this source code.
95231 */
95232namespace PHPUnit\SebastianBergmann\Diff;
95233
95234use function array_reverse;
95235use function count;
95236use function max;
95237use SplFixedArray;
95238final class TimeEfficientLongestCommonSubsequenceCalculator implements LongestCommonSubsequenceCalculator
95239{
95240    /**
95241     * {@inheritdoc}
95242     */
95243    public function calculate(array $from, array $to) : array
95244    {
95245        $common = [];
95246        $fromLength = count($from);
95247        $toLength = count($to);
95248        $width = $fromLength + 1;
95249        $matrix = new SplFixedArray($width * ($toLength + 1));
95250        for ($i = 0; $i <= $fromLength; ++$i) {
95251            $matrix[$i] = 0;
95252        }
95253        for ($j = 0; $j <= $toLength; ++$j) {
95254            $matrix[$j * $width] = 0;
95255        }
95256        for ($i = 1; $i <= $fromLength; ++$i) {
95257            for ($j = 1; $j <= $toLength; ++$j) {
95258                $o = $j * $width + $i;
95259                $matrix[$o] = max($matrix[$o - 1], $matrix[$o - $width], $from[$i - 1] === $to[$j - 1] ? $matrix[$o - $width - 1] + 1 : 0);
95260            }
95261        }
95262        $i = $fromLength;
95263        $j = $toLength;
95264        while ($i > 0 && $j > 0) {
95265            if ($from[$i - 1] === $to[$j - 1]) {
95266                $common[] = $from[$i - 1];
95267                --$i;
95268                --$j;
95269            } else {
95270                $o = $j * $width + $i;
95271                if ($matrix[$o - $width] > $matrix[$o - 1]) {
95272                    --$j;
95273                } else {
95274                    --$i;
95275                }
95276            }
95277        }
95278        return array_reverse($common);
95279    }
95280}
95281<?php
95282
95283declare (strict_types=1);
95284/*
95285 * This file is part of sebastian/diff.
95286 *
95287 * (c) Sebastian Bergmann <sebastian@phpunit.de>
95288 *
95289 * For the full copyright and license information, please view the LICENSE
95290 * file that was distributed with this source code.
95291 */
95292namespace PHPUnit\SebastianBergmann\Diff;
95293
95294use function array_fill;
95295use function array_merge;
95296use function array_reverse;
95297use function array_slice;
95298use function count;
95299use function in_array;
95300use function max;
95301final class MemoryEfficientLongestCommonSubsequenceCalculator implements LongestCommonSubsequenceCalculator
95302{
95303    /**
95304     * {@inheritdoc}
95305     */
95306    public function calculate(array $from, array $to) : array
95307    {
95308        $cFrom = count($from);
95309        $cTo = count($to);
95310        if ($cFrom === 0) {
95311            return [];
95312        }
95313        if ($cFrom === 1) {
95314            if (in_array($from[0], $to, \true)) {
95315                return [$from[0]];
95316            }
95317            return [];
95318        }
95319        $i = (int) ($cFrom / 2);
95320        $fromStart = array_slice($from, 0, $i);
95321        $fromEnd = array_slice($from, $i);
95322        $llB = $this->length($fromStart, $to);
95323        $llE = $this->length(array_reverse($fromEnd), array_reverse($to));
95324        $jMax = 0;
95325        $max = 0;
95326        for ($j = 0; $j <= $cTo; $j++) {
95327            $m = $llB[$j] + $llE[$cTo - $j];
95328            if ($m >= $max) {
95329                $max = $m;
95330                $jMax = $j;
95331            }
95332        }
95333        $toStart = array_slice($to, 0, $jMax);
95334        $toEnd = array_slice($to, $jMax);
95335        return array_merge($this->calculate($fromStart, $toStart), $this->calculate($fromEnd, $toEnd));
95336    }
95337    private function length(array $from, array $to) : array
95338    {
95339        $current = array_fill(0, count($to) + 1, 0);
95340        $cFrom = count($from);
95341        $cTo = count($to);
95342        for ($i = 0; $i < $cFrom; $i++) {
95343            $prev = $current;
95344            for ($j = 0; $j < $cTo; $j++) {
95345                if ($from[$i] === $to[$j]) {
95346                    $current[$j + 1] = $prev[$j] + 1;
95347                } else {
95348                    $current[$j + 1] = max($current[$j], $prev[$j + 1]);
95349                }
95350            }
95351        }
95352        return $current;
95353    }
95354}
95355<?php
95356
95357declare (strict_types=1);
95358/*
95359 * This file is part of sebastian/diff.
95360 *
95361 * (c) Sebastian Bergmann <sebastian@phpunit.de>
95362 *
95363 * For the full copyright and license information, please view the LICENSE
95364 * file that was distributed with this source code.
95365 */
95366namespace PHPUnit\SebastianBergmann\Diff;
95367
95368final class Chunk
95369{
95370    /**
95371     * @var int
95372     */
95373    private $start;
95374    /**
95375     * @var int
95376     */
95377    private $startRange;
95378    /**
95379     * @var int
95380     */
95381    private $end;
95382    /**
95383     * @var int
95384     */
95385    private $endRange;
95386    /**
95387     * @var Line[]
95388     */
95389    private $lines;
95390    public function __construct(int $start = 0, int $startRange = 1, int $end = 0, int $endRange = 1, array $lines = [])
95391    {
95392        $this->start = $start;
95393        $this->startRange = $startRange;
95394        $this->end = $end;
95395        $this->endRange = $endRange;
95396        $this->lines = $lines;
95397    }
95398    public function getStart() : int
95399    {
95400        return $this->start;
95401    }
95402    public function getStartRange() : int
95403    {
95404        return $this->startRange;
95405    }
95406    public function getEnd() : int
95407    {
95408        return $this->end;
95409    }
95410    public function getEndRange() : int
95411    {
95412        return $this->endRange;
95413    }
95414    /**
95415     * @return Line[]
95416     */
95417    public function getLines() : array
95418    {
95419        return $this->lines;
95420    }
95421    /**
95422     * @param Line[] $lines
95423     */
95424    public function setLines(array $lines) : void
95425    {
95426        foreach ($lines as $line) {
95427            if (!$line instanceof Line) {
95428                throw new InvalidArgumentException();
95429            }
95430        }
95431        $this->lines = $lines;
95432    }
95433}
95434<?php
95435
95436declare (strict_types=1);
95437/*
95438 * This file is part of sebastian/diff.
95439 *
95440 * (c) Sebastian Bergmann <sebastian@phpunit.de>
95441 *
95442 * For the full copyright and license information, please view the LICENSE
95443 * file that was distributed with this source code.
95444 */
95445namespace PHPUnit\SebastianBergmann\Diff;
95446
95447final class Diff
95448{
95449    /**
95450     * @var string
95451     */
95452    private $from;
95453    /**
95454     * @var string
95455     */
95456    private $to;
95457    /**
95458     * @var Chunk[]
95459     */
95460    private $chunks;
95461    /**
95462     * @param Chunk[] $chunks
95463     */
95464    public function __construct(string $from, string $to, array $chunks = [])
95465    {
95466        $this->from = $from;
95467        $this->to = $to;
95468        $this->chunks = $chunks;
95469    }
95470    public function getFrom() : string
95471    {
95472        return $this->from;
95473    }
95474    public function getTo() : string
95475    {
95476        return $this->to;
95477    }
95478    /**
95479     * @return Chunk[]
95480     */
95481    public function getChunks() : array
95482    {
95483        return $this->chunks;
95484    }
95485    /**
95486     * @param Chunk[] $chunks
95487     */
95488    public function setChunks(array $chunks) : void
95489    {
95490        $this->chunks = $chunks;
95491    }
95492}
95493<?php
95494
95495declare (strict_types=1);
95496/*
95497 * This file is part of sebastian/diff.
95498 *
95499 * (c) Sebastian Bergmann <sebastian@phpunit.de>
95500 *
95501 * For the full copyright and license information, please view the LICENSE
95502 * file that was distributed with this source code.
95503 */
95504namespace PHPUnit\SebastianBergmann\Diff;
95505
95506interface LongestCommonSubsequenceCalculator
95507{
95508    /**
95509     * Calculates the longest common subsequence of two arrays.
95510     */
95511    public function calculate(array $from, array $to) : array;
95512}
95513<?php
95514
95515declare (strict_types=1);
95516/*
95517 * This file is part of sebastian/diff.
95518 *
95519 * (c) Sebastian Bergmann <sebastian@phpunit.de>
95520 *
95521 * For the full copyright and license information, please view the LICENSE
95522 * file that was distributed with this source code.
95523 */
95524namespace PHPUnit\SebastianBergmann\Diff;
95525
95526use const PHP_INT_SIZE;
95527use const PREG_SPLIT_DELIM_CAPTURE;
95528use const PREG_SPLIT_NO_EMPTY;
95529use function array_shift;
95530use function array_unshift;
95531use function array_values;
95532use function count;
95533use function current;
95534use function end;
95535use function get_class;
95536use function gettype;
95537use function is_array;
95538use function is_object;
95539use function is_string;
95540use function key;
95541use function min;
95542use function preg_split;
95543use function prev;
95544use function reset;
95545use function sprintf;
95546use function substr;
95547use PHPUnit\SebastianBergmann\Diff\Output\DiffOutputBuilderInterface;
95548use PHPUnit\SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder;
95549final class Differ
95550{
95551    public const OLD = 0;
95552    public const ADDED = 1;
95553    public const REMOVED = 2;
95554    public const DIFF_LINE_END_WARNING = 3;
95555    public const NO_LINE_END_EOF_WARNING = 4;
95556    /**
95557     * @var DiffOutputBuilderInterface
95558     */
95559    private $outputBuilder;
95560    /**
95561     * @param DiffOutputBuilderInterface $outputBuilder
95562     *
95563     * @throws InvalidArgumentException
95564     */
95565    public function __construct($outputBuilder = null)
95566    {
95567        if ($outputBuilder instanceof DiffOutputBuilderInterface) {
95568            $this->outputBuilder = $outputBuilder;
95569        } elseif (null === $outputBuilder) {
95570            $this->outputBuilder = new UnifiedDiffOutputBuilder();
95571        } elseif (is_string($outputBuilder)) {
95572            // PHPUnit 6.1.4, 6.2.0, 6.2.1, 6.2.2, and 6.2.3 support
95573            // @see https://github.com/sebastianbergmann/phpunit/issues/2734#issuecomment-314514056
95574            // @deprecated
95575            $this->outputBuilder = new UnifiedDiffOutputBuilder($outputBuilder);
95576        } else {
95577            throw new InvalidArgumentException(sprintf('Expected builder to be an instance of DiffOutputBuilderInterface, <null> or a string, got %s.', is_object($outputBuilder) ? 'instance of "' . get_class($outputBuilder) . '"' : gettype($outputBuilder) . ' "' . $outputBuilder . '"'));
95578        }
95579    }
95580    /**
95581     * Returns the diff between two arrays or strings as string.
95582     *
95583     * @param array|string $from
95584     * @param array|string $to
95585     */
95586    public function diff($from, $to, LongestCommonSubsequenceCalculator $lcs = null) : string
95587    {
95588        $diff = $this->diffToArray($this->normalizeDiffInput($from), $this->normalizeDiffInput($to), $lcs);
95589        return $this->outputBuilder->getDiff($diff);
95590    }
95591    /**
95592     * Returns the diff between two arrays or strings as array.
95593     *
95594     * Each array element contains two elements:
95595     *   - [0] => mixed $token
95596     *   - [1] => 2|1|0
95597     *
95598     * - 2: REMOVED: $token was removed from $from
95599     * - 1: ADDED: $token was added to $from
95600     * - 0: OLD: $token is not changed in $to
95601     *
95602     * @param array|string                       $from
95603     * @param array|string                       $to
95604     * @param LongestCommonSubsequenceCalculator $lcs
95605     */
95606    public function diffToArray($from, $to, LongestCommonSubsequenceCalculator $lcs = null) : array
95607    {
95608        if (is_string($from)) {
95609            $from = $this->splitStringByLines($from);
95610        } elseif (!is_array($from)) {
95611            throw new InvalidArgumentException('"from" must be an array or string.');
95612        }
95613        if (is_string($to)) {
95614            $to = $this->splitStringByLines($to);
95615        } elseif (!is_array($to)) {
95616            throw new InvalidArgumentException('"to" must be an array or string.');
95617        }
95618        [$from, $to, $start, $end] = self::getArrayDiffParted($from, $to);
95619        if ($lcs === null) {
95620            $lcs = $this->selectLcsImplementation($from, $to);
95621        }
95622        $common = $lcs->calculate(array_values($from), array_values($to));
95623        $diff = [];
95624        foreach ($start as $token) {
95625            $diff[] = [$token, self::OLD];
95626        }
95627        reset($from);
95628        reset($to);
95629        foreach ($common as $token) {
95630            while (($fromToken = reset($from)) !== $token) {
95631                $diff[] = [array_shift($from), self::REMOVED];
95632            }
95633            while (($toToken = reset($to)) !== $token) {
95634                $diff[] = [array_shift($to), self::ADDED];
95635            }
95636            $diff[] = [$token, self::OLD];
95637            array_shift($from);
95638            array_shift($to);
95639        }
95640        while (($token = array_shift($from)) !== null) {
95641            $diff[] = [$token, self::REMOVED];
95642        }
95643        while (($token = array_shift($to)) !== null) {
95644            $diff[] = [$token, self::ADDED];
95645        }
95646        foreach ($end as $token) {
95647            $diff[] = [$token, self::OLD];
95648        }
95649        if ($this->detectUnmatchedLineEndings($diff)) {
95650            array_unshift($diff, ["#Warning: Strings contain different line endings!\n", self::DIFF_LINE_END_WARNING]);
95651        }
95652        return $diff;
95653    }
95654    /**
95655     * Casts variable to string if it is not a string or array.
95656     *
95657     * @return array|string
95658     */
95659    private function normalizeDiffInput($input)
95660    {
95661        if (!is_array($input) && !is_string($input)) {
95662            return (string) $input;
95663        }
95664        return $input;
95665    }
95666    /**
95667     * Checks if input is string, if so it will split it line-by-line.
95668     */
95669    private function splitStringByLines(string $input) : array
95670    {
95671        return preg_split('/(.*\\R)/', $input, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY);
95672    }
95673    private function selectLcsImplementation(array $from, array $to) : LongestCommonSubsequenceCalculator
95674    {
95675        // We do not want to use the time-efficient implementation if its memory
95676        // footprint will probably exceed this value. Note that the footprint
95677        // calculation is only an estimation for the matrix and the LCS method
95678        // will typically allocate a bit more memory than this.
95679        $memoryLimit = 100 * 1024 * 1024;
95680        if ($this->calculateEstimatedFootprint($from, $to) > $memoryLimit) {
95681            return new MemoryEfficientLongestCommonSubsequenceCalculator();
95682        }
95683        return new TimeEfficientLongestCommonSubsequenceCalculator();
95684    }
95685    /**
95686     * Calculates the estimated memory footprint for the DP-based method.
95687     *
95688     * @return float|int
95689     */
95690    private function calculateEstimatedFootprint(array $from, array $to)
95691    {
95692        $itemSize = \PHP_INT_SIZE === 4 ? 76 : 144;
95693        return $itemSize * min(count($from), count($to)) ** 2;
95694    }
95695    /**
95696     * Returns true if line ends don't match in a diff.
95697     */
95698    private function detectUnmatchedLineEndings(array $diff) : bool
95699    {
95700        $newLineBreaks = ['' => \true];
95701        $oldLineBreaks = ['' => \true];
95702        foreach ($diff as $entry) {
95703            if (self::OLD === $entry[1]) {
95704                $ln = $this->getLinebreak($entry[0]);
95705                $oldLineBreaks[$ln] = \true;
95706                $newLineBreaks[$ln] = \true;
95707            } elseif (self::ADDED === $entry[1]) {
95708                $newLineBreaks[$this->getLinebreak($entry[0])] = \true;
95709            } elseif (self::REMOVED === $entry[1]) {
95710                $oldLineBreaks[$this->getLinebreak($entry[0])] = \true;
95711            }
95712        }
95713        // if either input or output is a single line without breaks than no warning should be raised
95714        if (['' => \true] === $newLineBreaks || ['' => \true] === $oldLineBreaks) {
95715            return \false;
95716        }
95717        // two way compare
95718        foreach ($newLineBreaks as $break => $set) {
95719            if (!isset($oldLineBreaks[$break])) {
95720                return \true;
95721            }
95722        }
95723        foreach ($oldLineBreaks as $break => $set) {
95724            if (!isset($newLineBreaks[$break])) {
95725                return \true;
95726            }
95727        }
95728        return \false;
95729    }
95730    private function getLinebreak($line) : string
95731    {
95732        if (!is_string($line)) {
95733            return '';
95734        }
95735        $lc = substr($line, -1);
95736        if ("\r" === $lc) {
95737            return "\r";
95738        }
95739        if ("\n" !== $lc) {
95740            return '';
95741        }
95742        if ("\r\n" === substr($line, -2)) {
95743            return "\r\n";
95744        }
95745        return "\n";
95746    }
95747    private static function getArrayDiffParted(array &$from, array &$to) : array
95748    {
95749        $start = [];
95750        $end = [];
95751        reset($to);
95752        foreach ($from as $k => $v) {
95753            $toK = key($to);
95754            if ($toK === $k && $v === $to[$k]) {
95755                $start[$k] = $v;
95756                unset($from[$k], $to[$k]);
95757            } else {
95758                break;
95759            }
95760        }
95761        end($from);
95762        end($to);
95763        do {
95764            $fromK = key($from);
95765            $toK = key($to);
95766            if (null === $fromK || null === $toK || current($from) !== current($to)) {
95767                break;
95768            }
95769            prev($from);
95770            prev($to);
95771            $end = [$fromK => $from[$fromK]] + $end;
95772            unset($from[$fromK], $to[$toK]);
95773        } while (\true);
95774        return [$from, $to, $start, $end];
95775    }
95776}
95777<?php
95778
95779declare (strict_types=1);
95780/*
95781 * This file is part of sebastian/diff.
95782 *
95783 * (c) Sebastian Bergmann <sebastian@phpunit.de>
95784 *
95785 * For the full copyright and license information, please view the LICENSE
95786 * file that was distributed with this source code.
95787 */
95788namespace PHPUnit\SebastianBergmann\Diff;
95789
95790use function array_pop;
95791use function count;
95792use function max;
95793use function preg_match;
95794use function preg_split;
95795/**
95796 * Unified diff parser.
95797 */
95798final class Parser
95799{
95800    /**
95801     * @return Diff[]
95802     */
95803    public function parse(string $string) : array
95804    {
95805        $lines = preg_split('(\\r\\n|\\r|\\n)', $string);
95806        if (!empty($lines) && $lines[count($lines) - 1] === '') {
95807            array_pop($lines);
95808        }
95809        $lineCount = count($lines);
95810        $diffs = [];
95811        $diff = null;
95812        $collected = [];
95813        for ($i = 0; $i < $lineCount; ++$i) {
95814            if (preg_match('#^---\\h+"?(?P<file>[^\\v\\t"]+)#', $lines[$i], $fromMatch) && preg_match('#^\\+\\+\\+\\h+"?(?P<file>[^\\v\\t"]+)#', $lines[$i + 1], $toMatch)) {
95815                if ($diff !== null) {
95816                    $this->parseFileDiff($diff, $collected);
95817                    $diffs[] = $diff;
95818                    $collected = [];
95819                }
95820                $diff = new Diff($fromMatch['file'], $toMatch['file']);
95821                ++$i;
95822            } else {
95823                if (preg_match('/^(?:diff --git |index [\\da-f\\.]+|[+-]{3} [ab])/', $lines[$i])) {
95824                    continue;
95825                }
95826                $collected[] = $lines[$i];
95827            }
95828        }
95829        if ($diff !== null && count($collected)) {
95830            $this->parseFileDiff($diff, $collected);
95831            $diffs[] = $diff;
95832        }
95833        return $diffs;
95834    }
95835    private function parseFileDiff(Diff $diff, array $lines) : void
95836    {
95837        $chunks = [];
95838        $chunk = null;
95839        $diffLines = [];
95840        foreach ($lines as $line) {
95841            if (preg_match('/^@@\\s+-(?P<start>\\d+)(?:,\\s*(?P<startrange>\\d+))?\\s+\\+(?P<end>\\d+)(?:,\\s*(?P<endrange>\\d+))?\\s+@@/', $line, $match)) {
95842                $chunk = new Chunk((int) $match['start'], isset($match['startrange']) ? max(1, (int) $match['startrange']) : 1, (int) $match['end'], isset($match['endrange']) ? max(1, (int) $match['endrange']) : 1);
95843                $chunks[] = $chunk;
95844                $diffLines = [];
95845                continue;
95846            }
95847            if (preg_match('/^(?P<type>[+ -])?(?P<line>.*)/', $line, $match)) {
95848                $type = Line::UNCHANGED;
95849                if ($match['type'] === '+') {
95850                    $type = Line::ADDED;
95851                } elseif ($match['type'] === '-') {
95852                    $type = Line::REMOVED;
95853                }
95854                $diffLines[] = new Line($type, $match['line']);
95855                if (null !== $chunk) {
95856                    $chunk->setLines($diffLines);
95857                }
95858            }
95859        }
95860        $diff->setChunks($chunks);
95861    }
95862}
95863<?php
95864
95865declare (strict_types=1);
95866/*
95867 * This file is part of sebastian/diff.
95868 *
95869 * (c) Sebastian Bergmann <sebastian@phpunit.de>
95870 *
95871 * For the full copyright and license information, please view the LICENSE
95872 * file that was distributed with this source code.
95873 */
95874namespace PHPUnit\SebastianBergmann\Diff;
95875
95876final class Line
95877{
95878    public const ADDED = 1;
95879    public const REMOVED = 2;
95880    public const UNCHANGED = 3;
95881    /**
95882     * @var int
95883     */
95884    private $type;
95885    /**
95886     * @var string
95887     */
95888    private $content;
95889    public function __construct(int $type = self::UNCHANGED, string $content = '')
95890    {
95891        $this->type = $type;
95892        $this->content = $content;
95893    }
95894    public function getContent() : string
95895    {
95896        return $this->content;
95897    }
95898    public function getType() : int
95899    {
95900        return $this->type;
95901    }
95902}
95903sebastian/diff
95904
95905Copyright (c) 2002-2020, Sebastian Bergmann <sebastian@phpunit.de>.
95906All rights reserved.
95907
95908Redistribution and use in source and binary forms, with or without
95909modification, are permitted provided that the following conditions
95910are met:
95911
95912 * Redistributions of source code must retain the above copyright
95913   notice, this list of conditions and the following disclaimer.
95914
95915 * Redistributions in binary form must reproduce the above copyright
95916   notice, this list of conditions and the following disclaimer in
95917   the documentation and/or other materials provided with the
95918   distribution.
95919
95920 * Neither the name of Sebastian Bergmann nor the names of his
95921   contributors may be used to endorse or promote products derived
95922   from this software without specific prior written permission.
95923
95924THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
95925"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
95926LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
95927FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
95928COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
95929INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
95930BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
95931LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
95932CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
95933LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
95934ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
95935POSSIBILITY OF SUCH DAMAGE.
95936<?php
95937
95938declare (strict_types=1);
95939namespace PHPUnit\TheSeer\Tokenizer;
95940
95941class Token
95942{
95943    /** @var int */
95944    private $line;
95945    /** @var string */
95946    private $name;
95947    /** @var string */
95948    private $value;
95949    /**
95950     * Token constructor.
95951     */
95952    public function __construct(int $line, string $name, string $value)
95953    {
95954        $this->line = $line;
95955        $this->name = $name;
95956        $this->value = $value;
95957    }
95958    public function getLine() : int
95959    {
95960        return $this->line;
95961    }
95962    public function getName() : string
95963    {
95964        return $this->name;
95965    }
95966    public function getValue() : string
95967    {
95968        return $this->value;
95969    }
95970}
95971<?php
95972
95973declare (strict_types=1);
95974namespace PHPUnit\TheSeer\Tokenizer;
95975
95976class Tokenizer
95977{
95978    /**
95979     * Token Map for "non-tokens"
95980     *
95981     * @var array
95982     */
95983    private $map = ['(' => 'T_OPEN_BRACKET', ')' => 'T_CLOSE_BRACKET', '[' => 'T_OPEN_SQUARE', ']' => 'T_CLOSE_SQUARE', '{' => 'T_OPEN_CURLY', '}' => 'T_CLOSE_CURLY', ';' => 'T_SEMICOLON', '.' => 'T_DOT', ',' => 'T_COMMA', '=' => 'T_EQUAL', '<' => 'T_LT', '>' => 'T_GT', '+' => 'T_PLUS', '-' => 'T_MINUS', '*' => 'T_MULT', '/' => 'T_DIV', '?' => 'T_QUESTION_MARK', '!' => 'T_EXCLAMATION_MARK', ':' => 'T_COLON', '"' => 'T_DOUBLE_QUOTES', '@' => 'T_AT', '&' => 'T_AMPERSAND', '%' => 'T_PERCENT', '|' => 'T_PIPE', '$' => 'T_DOLLAR', '^' => 'T_CARET', '~' => 'T_TILDE', '`' => 'T_BACKTICK'];
95984    public function parse(string $source) : TokenCollection
95985    {
95986        $result = new TokenCollection();
95987        if ($source === '') {
95988            return $result;
95989        }
95990        $tokens = \token_get_all($source);
95991        $lastToken = new Token($tokens[0][2], 'Placeholder', '');
95992        foreach ($tokens as $pos => $tok) {
95993            if (\is_string($tok)) {
95994                $token = new Token($lastToken->getLine(), $this->map[$tok], $tok);
95995                $result->addToken($token);
95996                $lastToken = $token;
95997                continue;
95998            }
95999            $line = $tok[2];
96000            $values = \preg_split('/\\R+/Uu', $tok[1]);
96001            foreach ($values as $v) {
96002                $token = new Token($line, \token_name($tok[0]), $v);
96003                $lastToken = $token;
96004                $line++;
96005                if ($v === '') {
96006                    continue;
96007                }
96008                $result->addToken($token);
96009            }
96010        }
96011        return $this->fillBlanks($result, $lastToken->getLine());
96012    }
96013    private function fillBlanks(TokenCollection $tokens, int $maxLine) : TokenCollection
96014    {
96015        $prev = new Token(0, 'Placeholder', '');
96016        $final = new TokenCollection();
96017        foreach ($tokens as $token) {
96018            if ($prev === null) {
96019                $final->addToken($token);
96020                $prev = $token;
96021                continue;
96022            }
96023            $gap = $token->getLine() - $prev->getLine();
96024            while ($gap > 1) {
96025                $linebreak = new Token($prev->getLine() + 1, 'T_WHITESPACE', '');
96026                $final->addToken($linebreak);
96027                $prev = $linebreak;
96028                $gap--;
96029            }
96030            $final->addToken($token);
96031            $prev = $token;
96032        }
96033        $gap = $maxLine - $prev->getLine();
96034        while ($gap > 0) {
96035            $linebreak = new Token($prev->getLine() + 1, 'T_WHITESPACE', '');
96036            $final->addToken($linebreak);
96037            $prev = $linebreak;
96038            $gap--;
96039        }
96040        return $final;
96041    }
96042}
96043<?php
96044
96045declare (strict_types=1);
96046namespace PHPUnit\TheSeer\Tokenizer;
96047
96048class NamespaceUriException extends Exception
96049{
96050}
96051<?php
96052
96053declare (strict_types=1);
96054namespace PHPUnit\TheSeer\Tokenizer;
96055
96056class TokenCollectionException extends Exception
96057{
96058}
96059<?php
96060
96061declare (strict_types=1);
96062namespace PHPUnit\TheSeer\Tokenizer;
96063
96064class Exception extends \Exception
96065{
96066}
96067<?php
96068
96069declare (strict_types=1);
96070namespace PHPUnit\TheSeer\Tokenizer;
96071
96072use DOMDocument;
96073class XMLSerializer
96074{
96075    /** @var \XMLWriter */
96076    private $writer;
96077    /** @var Token */
96078    private $previousToken;
96079    /** @var NamespaceUri */
96080    private $xmlns;
96081    /**
96082     * XMLSerializer constructor.
96083     *
96084     * @param NamespaceUri $xmlns
96085     */
96086    public function __construct(NamespaceUri $xmlns = null)
96087    {
96088        if ($xmlns === null) {
96089            $xmlns = new NamespaceUri('https://github.com/theseer/tokenizer');
96090        }
96091        $this->xmlns = $xmlns;
96092    }
96093    public function toDom(TokenCollection $tokens) : DOMDocument
96094    {
96095        $dom = new DOMDocument();
96096        $dom->preserveWhiteSpace = \false;
96097        $dom->loadXML($this->toXML($tokens));
96098        return $dom;
96099    }
96100    public function toXML(TokenCollection $tokens) : string
96101    {
96102        $this->writer = new \XMLWriter();
96103        $this->writer->openMemory();
96104        $this->writer->setIndent(\true);
96105        $this->writer->startDocument();
96106        $this->writer->startElement('source');
96107        $this->writer->writeAttribute('xmlns', $this->xmlns->asString());
96108        if (\count($tokens) > 0) {
96109            $this->writer->startElement('line');
96110            $this->writer->writeAttribute('no', '1');
96111            $this->previousToken = $tokens[0];
96112            foreach ($tokens as $token) {
96113                $this->addToken($token);
96114            }
96115        }
96116        $this->writer->endElement();
96117        $this->writer->endElement();
96118        $this->writer->endDocument();
96119        return $this->writer->outputMemory();
96120    }
96121    private function addToken(Token $token) : void
96122    {
96123        if ($this->previousToken->getLine() < $token->getLine()) {
96124            $this->writer->endElement();
96125            $this->writer->startElement('line');
96126            $this->writer->writeAttribute('no', (string) $token->getLine());
96127            $this->previousToken = $token;
96128        }
96129        if ($token->getValue() !== '') {
96130            $this->writer->startElement('token');
96131            $this->writer->writeAttribute('name', $token->getName());
96132            $this->writer->writeRaw(\htmlspecialchars($token->getValue(), \ENT_NOQUOTES | \ENT_DISALLOWED | \ENT_XML1));
96133            $this->writer->endElement();
96134        }
96135    }
96136}
96137<?php
96138
96139declare (strict_types=1);
96140namespace PHPUnit\TheSeer\Tokenizer;
96141
96142class NamespaceUri
96143{
96144    /** @var string */
96145    private $value;
96146    public function __construct(string $value)
96147    {
96148        $this->ensureValidUri($value);
96149        $this->value = $value;
96150    }
96151    public function asString() : string
96152    {
96153        return $this->value;
96154    }
96155    private function ensureValidUri($value) : void
96156    {
96157        if (\strpos($value, ':') === \false) {
96158            throw new NamespaceUriException(\sprintf("Namespace URI '%s' must contain at least one colon", $value));
96159        }
96160    }
96161}
96162Tokenizer
96163
96164Copyright (c) 2017 Arne Blankerts <arne@blankerts.de> and contributors
96165All rights reserved.
96166
96167Redistribution and use in source and binary forms, with or without modification,
96168are permitted provided that the following conditions are met:
96169
96170* Redistributions of source code must retain the above copyright notice,
96171  this list of conditions and the following disclaimer.
96172
96173* Redistributions in binary form must reproduce the above copyright notice,
96174  this list of conditions and the following disclaimer in the documentation
96175  and/or other materials provided with the distribution.
96176
96177* Neither the name of Arne Blankerts nor the names of contributors
96178  may be used to endorse or promote products derived from this software
96179  without specific prior written permission.
96180
96181THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
96182AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT  * NOT LIMITED TO,
96183THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
96184PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
96185BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
96186OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
96187SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
96188INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
96189CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
96190ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
96191POSSIBILITY OF SUCH DAMAGE.
96192<?php
96193
96194declare (strict_types=1);
96195namespace PHPUnit\TheSeer\Tokenizer;
96196
96197class TokenCollection implements \ArrayAccess, \Iterator, \Countable
96198{
96199    /** @var Token[] */
96200    private $tokens = [];
96201    /** @var int */
96202    private $pos;
96203    public function addToken(Token $token) : void
96204    {
96205        $this->tokens[] = $token;
96206    }
96207    public function current() : Token
96208    {
96209        return \current($this->tokens);
96210    }
96211    public function key() : int
96212    {
96213        return \key($this->tokens);
96214    }
96215    public function next() : void
96216    {
96217        \next($this->tokens);
96218        $this->pos++;
96219    }
96220    public function valid() : bool
96221    {
96222        return $this->count() > $this->pos;
96223    }
96224    public function rewind() : void
96225    {
96226        \reset($this->tokens);
96227        $this->pos = 0;
96228    }
96229    public function count() : int
96230    {
96231        return \count($this->tokens);
96232    }
96233    public function offsetExists($offset) : bool
96234    {
96235        return isset($this->tokens[$offset]);
96236    }
96237    /**
96238     * @throws TokenCollectionException
96239     */
96240    public function offsetGet($offset) : Token
96241    {
96242        if (!$this->offsetExists($offset)) {
96243            throw new TokenCollectionException(\sprintf('No Token at offest %s', $offset));
96244        }
96245        return $this->tokens[$offset];
96246    }
96247    /**
96248     * @param Token $value
96249     *
96250     * @throws TokenCollectionException
96251     */
96252    public function offsetSet($offset, $value) : void
96253    {
96254        if (!\is_int($offset)) {
96255            $type = \gettype($offset);
96256            throw new TokenCollectionException(\sprintf('Offset must be of type integer, %s given', $type === 'object' ? \get_class($value) : $type));
96257        }
96258        if (!$value instanceof Token) {
96259            $type = \gettype($value);
96260            throw new TokenCollectionException(\sprintf('Value must be of type %s, %s given', Token::class, $type === 'object' ? \get_class($value) : $type));
96261        }
96262        $this->tokens[$offset] = $value;
96263    }
96264    public function offsetUnset($offset) : void
96265    {
96266        unset($this->tokens[$offset]);
96267    }
96268}
96269Object Enumerator
96270
96271Copyright (c) 2016-2020, Sebastian Bergmann <sebastian@phpunit.de>.
96272All rights reserved.
96273
96274Redistribution and use in source and binary forms, with or without
96275modification, are permitted provided that the following conditions
96276are met:
96277
96278 * Redistributions of source code must retain the above copyright
96279   notice, this list of conditions and the following disclaimer.
96280
96281 * Redistributions in binary form must reproduce the above copyright
96282   notice, this list of conditions and the following disclaimer in
96283   the documentation and/or other materials provided with the
96284   distribution.
96285
96286 * Neither the name of Sebastian Bergmann nor the names of his
96287   contributors may be used to endorse or promote products derived
96288   from this software without specific prior written permission.
96289
96290THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
96291"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
96292LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
96293FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
96294COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
96295INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
96296BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
96297LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
96298CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
96299LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
96300ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
96301POSSIBILITY OF SUCH DAMAGE.
96302<?php
96303
96304declare (strict_types=1);
96305/*
96306 * This file is part of sebastian/code-unit-reverse-lookup.
96307 *
96308 * (c) Sebastian Bergmann <sebastian@phpunit.de>
96309 *
96310 * For the full copyright and license information, please view the LICENSE
96311 * file that was distributed with this source code.
96312 */
96313namespace PHPUnit\SebastianBergmann\CodeUnitReverseLookup;
96314
96315use function array_merge;
96316use function assert;
96317use function get_declared_classes;
96318use function get_declared_traits;
96319use function get_defined_functions;
96320use function is_array;
96321use function range;
96322use ReflectionClass;
96323use ReflectionFunction;
96324use ReflectionFunctionAbstract;
96325use ReflectionMethod;
96326/**
96327 * @since Class available since Release 1.0.0
96328 */
96329class Wizard
96330{
96331    /**
96332     * @var array
96333     */
96334    private $lookupTable = [];
96335    /**
96336     * @var array
96337     */
96338    private $processedClasses = [];
96339    /**
96340     * @var array
96341     */
96342    private $processedFunctions = [];
96343    /**
96344     * @param string $filename
96345     * @param int    $lineNumber
96346     *
96347     * @return string
96348     */
96349    public function lookup($filename, $lineNumber)
96350    {
96351        if (!isset($this->lookupTable[$filename][$lineNumber])) {
96352            $this->updateLookupTable();
96353        }
96354        if (isset($this->lookupTable[$filename][$lineNumber])) {
96355            return $this->lookupTable[$filename][$lineNumber];
96356        }
96357        return $filename . ':' . $lineNumber;
96358    }
96359    private function updateLookupTable() : void
96360    {
96361        $this->processClassesAndTraits();
96362        $this->processFunctions();
96363    }
96364    private function processClassesAndTraits() : void
96365    {
96366        $classes = get_declared_classes();
96367        $traits = get_declared_traits();
96368        assert(is_array($classes));
96369        assert(is_array($traits));
96370        foreach (array_merge($classes, $traits) as $classOrTrait) {
96371            if (isset($this->processedClasses[$classOrTrait])) {
96372                continue;
96373            }
96374            $reflector = new ReflectionClass($classOrTrait);
96375            foreach ($reflector->getMethods() as $method) {
96376                $this->processFunctionOrMethod($method);
96377            }
96378            $this->processedClasses[$classOrTrait] = \true;
96379        }
96380    }
96381    private function processFunctions() : void
96382    {
96383        foreach (get_defined_functions()['user'] as $function) {
96384            if (isset($this->processedFunctions[$function])) {
96385                continue;
96386            }
96387            $this->processFunctionOrMethod(new ReflectionFunction($function));
96388            $this->processedFunctions[$function] = \true;
96389        }
96390    }
96391    private function processFunctionOrMethod(ReflectionFunctionAbstract $functionOrMethod) : void
96392    {
96393        if ($functionOrMethod->isInternal()) {
96394            return;
96395        }
96396        $name = $functionOrMethod->getName();
96397        if ($functionOrMethod instanceof ReflectionMethod) {
96398            $name = $functionOrMethod->getDeclaringClass()->getName() . '::' . $name;
96399        }
96400        if (!isset($this->lookupTable[$functionOrMethod->getFileName()])) {
96401            $this->lookupTable[$functionOrMethod->getFileName()] = [];
96402        }
96403        foreach (range($functionOrMethod->getStartLine(), $functionOrMethod->getEndLine()) as $line) {
96404            $this->lookupTable[$functionOrMethod->getFileName()][$line] = $name;
96405        }
96406    }
96407}
96408code-unit-reverse-lookup
96409
96410Copyright (c) 2016-2020, Sebastian Bergmann <sebastian@phpunit.de>.
96411All rights reserved.
96412
96413Redistribution and use in source and binary forms, with or without
96414modification, are permitted provided that the following conditions
96415are met:
96416
96417 * Redistributions of source code must retain the above copyright
96418   notice, this list of conditions and the following disclaimer.
96419
96420 * Redistributions in binary form must reproduce the above copyright
96421   notice, this list of conditions and the following disclaimer in
96422   the documentation and/or other materials provided with the
96423   distribution.
96424
96425 * Neither the name of Sebastian Bergmann nor the names of his
96426   contributors may be used to endorse or promote products derived
96427   from this software without specific prior written permission.
96428
96429THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
96430"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
96431LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
96432FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
96433COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
96434INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
96435BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
96436LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
96437CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
96438LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
96439ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
96440POSSIBILITY OF SUCH DAMAGE.
96441<?php
96442
96443declare (strict_types=1);
96444/*
96445 * This file is part of the Recursion Context package.
96446 *
96447 * (c) Sebastian Bergmann <sebastian@phpunit.de>
96448 *
96449 * For the full copyright and license information, please view the LICENSE
96450 * file that was distributed with this source code.
96451 */
96452namespace PHPUnit\SebastianBergmann\RecursionContext;
96453
96454use const PHP_INT_MAX;
96455use const PHP_INT_MIN;
96456use function array_pop;
96457use function array_slice;
96458use function count;
96459use function is_array;
96460use function is_object;
96461use function random_int;
96462use function spl_object_hash;
96463use SplObjectStorage;
96464/**
96465 * A context containing previously processed arrays and objects
96466 * when recursively processing a value.
96467 */
96468final class Context
96469{
96470    /**
96471     * @var array[]
96472     */
96473    private $arrays;
96474    /**
96475     * @var SplObjectStorage
96476     */
96477    private $objects;
96478    /**
96479     * Initialises the context.
96480     */
96481    public function __construct()
96482    {
96483        $this->arrays = [];
96484        $this->objects = new SplObjectStorage();
96485    }
96486    /**
96487     * @codeCoverageIgnore
96488     */
96489    public function __destruct()
96490    {
96491        foreach ($this->arrays as &$array) {
96492            if (is_array($array)) {
96493                array_pop($array);
96494                array_pop($array);
96495            }
96496        }
96497    }
96498    /**
96499     * Adds a value to the context.
96500     *
96501     * @param array|object $value the value to add
96502     *
96503     * @throws InvalidArgumentException Thrown if $value is not an array or object
96504     *
96505     * @return bool|int|string the ID of the stored value, either as a string or integer
96506     *
96507     * @psalm-template T
96508     * @psalm-param T $value
96509     * @param-out T $value
96510     */
96511    public function add(&$value)
96512    {
96513        if (is_array($value)) {
96514            return $this->addArray($value);
96515        }
96516        if (is_object($value)) {
96517            return $this->addObject($value);
96518        }
96519        throw new InvalidArgumentException('Only arrays and objects are supported');
96520    }
96521    /**
96522     * Checks if the given value exists within the context.
96523     *
96524     * @param array|object $value the value to check
96525     *
96526     * @throws InvalidArgumentException Thrown if $value is not an array or object
96527     *
96528     * @return false|int|string the string or integer ID of the stored value if it has already been seen, or false if the value is not stored
96529     *
96530     * @psalm-template T
96531     * @psalm-param T $value
96532     * @param-out T $value
96533     */
96534    public function contains(&$value)
96535    {
96536        if (is_array($value)) {
96537            return $this->containsArray($value);
96538        }
96539        if (is_object($value)) {
96540            return $this->containsObject($value);
96541        }
96542        throw new InvalidArgumentException('Only arrays and objects are supported');
96543    }
96544    /**
96545     * @return bool|int
96546     */
96547    private function addArray(array &$array)
96548    {
96549        $key = $this->containsArray($array);
96550        if ($key !== \false) {
96551            return $key;
96552        }
96553        $key = count($this->arrays);
96554        $this->arrays[] =& $array;
96555        if (!isset($array[\PHP_INT_MAX]) && !isset($array[\PHP_INT_MAX - 1])) {
96556            $array[] = $key;
96557            $array[] = $this->objects;
96558        } else {
96559            /* cover the improbable case too */
96560            do {
96561                $key = random_int(\PHP_INT_MIN, \PHP_INT_MAX);
96562            } while (isset($array[$key]));
96563            $array[$key] = $key;
96564            do {
96565                $key = random_int(\PHP_INT_MIN, \PHP_INT_MAX);
96566            } while (isset($array[$key]));
96567            $array[$key] = $this->objects;
96568        }
96569        return $key;
96570    }
96571    /**
96572     * @param object $object
96573     */
96574    private function addObject($object) : string
96575    {
96576        if (!$this->objects->contains($object)) {
96577            $this->objects->attach($object);
96578        }
96579        return spl_object_hash($object);
96580    }
96581    /**
96582     * @return false|int
96583     */
96584    private function containsArray(array &$array)
96585    {
96586        $end = array_slice($array, -2);
96587        return isset($end[1]) && $end[1] === $this->objects ? $end[0] : \false;
96588    }
96589    /**
96590     * @param object $value
96591     *
96592     * @return false|string
96593     */
96594    private function containsObject($value)
96595    {
96596        if ($this->objects->contains($value)) {
96597            return spl_object_hash($value);
96598        }
96599        return \false;
96600    }
96601}
96602<?php
96603
96604declare (strict_types=1);
96605/*
96606 * This file is part of the Recursion Context package.
96607 *
96608 * (c) Sebastian Bergmann <sebastian@phpunit.de>
96609 *
96610 * For the full copyright and license information, please view the LICENSE
96611 * file that was distributed with this source code.
96612 */
96613namespace PHPUnit\SebastianBergmann\RecursionContext;
96614
96615use Throwable;
96616interface Exception extends Throwable
96617{
96618}
96619Recursion Context
96620
96621Copyright (c) 2002-2020, Sebastian Bergmann <sebastian@phpunit.de>.
96622All rights reserved.
96623
96624Redistribution and use in source and binary forms, with or without
96625modification, are permitted provided that the following conditions
96626are met:
96627
96628 * Redistributions of source code must retain the above copyright
96629   notice, this list of conditions and the following disclaimer.
96630
96631 * Redistributions in binary form must reproduce the above copyright
96632   notice, this list of conditions and the following disclaimer in
96633   the documentation and/or other materials provided with the
96634   distribution.
96635
96636 * Neither the name of Sebastian Bergmann nor the names of his
96637   contributors may be used to endorse or promote products derived
96638   from this software without specific prior written permission.
96639
96640THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
96641"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
96642LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
96643FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
96644COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
96645INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
96646BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
96647LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
96648CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
96649LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
96650ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
96651POSSIBILITY OF SUCH DAMAGE.
96652<?php
96653
96654declare (strict_types=1);
96655/*
96656 * This file is part of the Recursion Context package.
96657 *
96658 * (c) Sebastian Bergmann <sebastian@phpunit.de>
96659 *
96660 * For the full copyright and license information, please view the LICENSE
96661 * file that was distributed with this source code.
96662 */
96663namespace PHPUnit\SebastianBergmann\RecursionContext;
96664
96665final class InvalidArgumentException extends \InvalidArgumentException implements Exception
96666{
96667}
96668^5�xB�7C�=7^H�z�SU/N��rXÙ�Z�_��P͡�-����frijqwcN�W�=�C��Ph4����GBMB