🧪 Tests ok
continuous-integration/drone/push Build is passing Details

clean_web
Antoine PEREDERII 1 year ago
parent 19f37061e0
commit a13036b9de

546
Sources/composer.lock generated

File diff suppressed because it is too large Load Diff

@ -2,7 +2,7 @@
require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../config/config.php';
echo "hello";
use App\AppCreator;
use App\Router\Middleware\LoggingMiddleware;
use App\Router\Request\RequestFactory;
@ -49,10 +49,6 @@ $appFactory->registerService(INotificationRepository::class, NotificationReposit
$appFactory->registerService(IUserRepository::class, UserRepository::class);
echo "hallo";
$appFactory->registerService(\Twig\Loader\LoaderInterface::class, function() {
return new FilesystemLoader(__DIR__ . '/../src/app/views/Templates');
});
@ -64,10 +60,8 @@ $appFactory->registerService(\Twig\Environment::class,\Twig\Environment::class);
$appFactory->AddControllers();
echo "holla";
$app = $appFactory->create();
if (!is_null($app)){
echo "va bien te faire ...";
// Ajout des Middleware
/*$app->use(new LoggingMiddleware());*/
$app->use(new AuthMiddleware($appFactory->getDicontainer()->get(IAuthService::class) ));
@ -75,5 +69,3 @@ if (!is_null($app)){
$app->run(RequestFactory::createFromGlobals());
}
echo "meerde";

@ -1,5 +1,4 @@
<?php
use Shared\Log;
class AltoRouter {
@ -101,8 +100,6 @@ class AltoRouter {
public function generate($routeName, array $params = array()) {
// Check if named route exists
if(!isset($this->namedRoutes[$routeName])) {
throw new \Exception("Route '{$routeName}' does not exist.");
}

@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit1887e85fc3cfddacf8d7e17588dae6f1::getLoader();
return ComposerAutoloaderInit4c2287070574f70d470b239b224aef76::getLoader();

@ -70,7 +70,6 @@ return array(
'PHPUnit\\Event\\Telemetry\\SystemStopWatchWithOffset' => $vendorDir . '/phpunit/phpunit/src/Event/Value/Telemetry/SystemStopWatchWithOffset.php',
'PHPUnit\\Event\\TestData\\DataFromDataProvider' => $vendorDir . '/phpunit/phpunit/src/Event/Value/Test/TestData/DataFromDataProvider.php',
'PHPUnit\\Event\\TestData\\DataFromTestDependency' => $vendorDir . '/phpunit/phpunit/src/Event/Value/Test/TestData/DataFromTestDependency.php',
'PHPUnit\\Event\\TestData\\MoreThanOneDataSetFromDataProviderException' => $vendorDir . '/phpunit/phpunit/src/Event/Exception/MoreThanOneDataSetFromDataProviderException.php',
'PHPUnit\\Event\\TestData\\NoDataSetFromDataProviderException' => $vendorDir . '/phpunit/phpunit/src/Event/Exception/NoDataSetFromDataProviderException.php',
'PHPUnit\\Event\\TestData\\TestData' => $vendorDir . '/phpunit/phpunit/src/Event/Value/Test/TestData/TestData.php',
'PHPUnit\\Event\\TestData\\TestDataCollection' => $vendorDir . '/phpunit/phpunit/src/Event/Value/Test/TestData/TestDataCollection.php',
@ -130,10 +129,6 @@ return array(
'PHPUnit\\Event\\Test\\AfterTestMethodCalledSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodCalledSubscriber.php',
'PHPUnit\\Event\\Test\\AfterTestMethodFinished' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodFinished.php',
'PHPUnit\\Event\\Test\\AfterTestMethodFinishedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodFinishedSubscriber.php',
'PHPUnit\\Event\\Test\\AssertionFailed' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionFailed.php',
'PHPUnit\\Event\\Test\\AssertionFailedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionFailedSubscriber.php',
'PHPUnit\\Event\\Test\\AssertionSucceeded' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionSucceeded.php',
'PHPUnit\\Event\\Test\\AssertionSucceededSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionSucceededSubscriber.php',
'PHPUnit\\Event\\Test\\BeforeFirstTestMethodCalled' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodCalled.php',
'PHPUnit\\Event\\Test\\BeforeFirstTestMethodCalledSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodCalledSubscriber.php',
'PHPUnit\\Event\\Test\\BeforeFirstTestMethodErrored' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodErrored.php',
@ -235,7 +230,6 @@ return array(
'PHPUnit\\Framework\\Attributes\\BackupStaticProperties' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/BackupStaticProperties.php',
'PHPUnit\\Framework\\Attributes\\Before' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/Before.php',
'PHPUnit\\Framework\\Attributes\\BeforeClass' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/BeforeClass.php',
'PHPUnit\\Framework\\Attributes\\CodeCoverageIgnore' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/CodeCoverageIgnore.php',
'PHPUnit\\Framework\\Attributes\\CoversClass' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/CoversClass.php',
'PHPUnit\\Framework\\Attributes\\CoversFunction' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/CoversFunction.php',
'PHPUnit\\Framework\\Attributes\\CoversNothing' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/CoversNothing.php',
@ -254,10 +248,8 @@ return array(
'PHPUnit\\Framework\\Attributes\\ExcludeGlobalVariableFromBackup' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/ExcludeGlobalVariableFromBackup.php',
'PHPUnit\\Framework\\Attributes\\ExcludeStaticPropertyFromBackup' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/ExcludeStaticPropertyFromBackup.php',
'PHPUnit\\Framework\\Attributes\\Group' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/Group.php',
'PHPUnit\\Framework\\Attributes\\IgnoreClassForCodeCoverage' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/IgnoreClassForCodeCoverage.php',
'PHPUnit\\Framework\\Attributes\\IgnoreDeprecations' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/IgnoreDeprecations.php',
'PHPUnit\\Framework\\Attributes\\IgnoreFunctionForCodeCoverage' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/IgnoreFunctionForCodeCoverage.php',
'PHPUnit\\Framework\\Attributes\\IgnoreMethodForCodeCoverage' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/IgnoreMethodForCodeCoverage.php',
'PHPUnit\\Framework\\Attributes\\IgnorePhpunitDeprecations' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/IgnorePhpunitDeprecations.php',
'PHPUnit\\Framework\\Attributes\\Large' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/Large.php',
'PHPUnit\\Framework\\Attributes\\Medium' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/Medium.php',
'PHPUnit\\Framework\\Attributes\\PostCondition' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/PostCondition.php',
@ -365,6 +357,8 @@ return array(
'PHPUnit\\Framework\\MockObject\\ConfigurableMethod' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/ConfigurableMethod.php',
'PHPUnit\\Framework\\MockObject\\DoubledCloneMethod' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Api/DoubledCloneMethod.php',
'PHPUnit\\Framework\\MockObject\\Exception' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/Exception.php',
'PHPUnit\\Framework\\MockObject\\GeneratedAsMockObject' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Api/GeneratedAsMockObject.php',
'PHPUnit\\Framework\\MockObject\\GeneratedAsTestStub' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Api/GeneratedAsTestStub.php',
'PHPUnit\\Framework\\MockObject\\Generator\\ClassAlreadyExistsException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ClassAlreadyExistsException.php',
'PHPUnit\\Framework\\MockObject\\Generator\\ClassIsEnumerationException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ClassIsEnumerationException.php',
'PHPUnit\\Framework\\MockObject\\Generator\\ClassIsFinalException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ClassIsFinalException.php',
@ -507,6 +501,15 @@ return array(
'PHPUnit\\Logging\\TestDox\\TestResultCollectionIterator' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/TestResultCollectionIterator.php',
'PHPUnit\\Logging\\TestDox\\TestResultCollector' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/TestResultCollector.php',
'PHPUnit\\Logging\\TestDox\\TestSkippedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestSkippedSubscriber.php',
'PHPUnit\\Logging\\TestDox\\TestTriggeredDeprecationSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredDeprecationSubscriber.php',
'PHPUnit\\Logging\\TestDox\\TestTriggeredNoticeSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredNoticeSubscriber.php',
'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpDeprecationSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpDeprecationSubscriber.php',
'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpNoticeSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpNoticeSubscriber.php',
'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpWarningSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpWarningSubscriber.php',
'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpunitDeprecationSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpunitDeprecationSubscriber.php',
'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpunitErrorSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpunitErrorSubscriber.php',
'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpunitWarningSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpunitWarningSubscriber.php',
'PHPUnit\\Logging\\TestDox\\TestTriggeredWarningSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredWarningSubscriber.php',
'PHPUnit\\Metadata\\After' => $vendorDir . '/phpunit/phpunit/src/Metadata/After.php',
'PHPUnit\\Metadata\\AfterClass' => $vendorDir . '/phpunit/phpunit/src/Metadata/AfterClass.php',
'PHPUnit\\Metadata\\Annotation\\Parser\\DocBlock' => $vendorDir . '/phpunit/phpunit/src/Metadata/Parser/Annotation/DocBlock.php',
@ -535,10 +538,8 @@ return array(
'PHPUnit\\Metadata\\ExcludeGlobalVariableFromBackup' => $vendorDir . '/phpunit/phpunit/src/Metadata/ExcludeGlobalVariableFromBackup.php',
'PHPUnit\\Metadata\\ExcludeStaticPropertyFromBackup' => $vendorDir . '/phpunit/phpunit/src/Metadata/ExcludeStaticPropertyFromBackup.php',
'PHPUnit\\Metadata\\Group' => $vendorDir . '/phpunit/phpunit/src/Metadata/Group.php',
'PHPUnit\\Metadata\\IgnoreClassForCodeCoverage' => $vendorDir . '/phpunit/phpunit/src/Metadata/IgnoreClassForCodeCoverage.php',
'PHPUnit\\Metadata\\IgnoreDeprecations' => $vendorDir . '/phpunit/phpunit/src/Metadata/IgnoreDeprecations.php',
'PHPUnit\\Metadata\\IgnoreFunctionForCodeCoverage' => $vendorDir . '/phpunit/phpunit/src/Metadata/IgnoreFunctionForCodeCoverage.php',
'PHPUnit\\Metadata\\IgnoreMethodForCodeCoverage' => $vendorDir . '/phpunit/phpunit/src/Metadata/IgnoreMethodForCodeCoverage.php',
'PHPUnit\\Metadata\\IgnorePhpunitDeprecations' => $vendorDir . '/phpunit/phpunit/src/Metadata/IgnorePhpunitDeprecations.php',
'PHPUnit\\Metadata\\InvalidVersionRequirementException' => $vendorDir . '/phpunit/phpunit/src/Metadata/Exception/InvalidVersionRequirementException.php',
'PHPUnit\\Metadata\\Metadata' => $vendorDir . '/phpunit/phpunit/src/Metadata/Metadata.php',
'PHPUnit\\Metadata\\MetadataCollection' => $vendorDir . '/phpunit/phpunit/src/Metadata/MetadataCollection.php',
@ -595,6 +596,11 @@ return array(
'PHPUnit\\Runner\\ClassDoesNotExtendTestCaseException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/ClassDoesNotExtendTestCaseException.php',
'PHPUnit\\Runner\\ClassIsAbstractException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/ClassIsAbstractException.php',
'PHPUnit\\Runner\\CodeCoverage' => $vendorDir . '/phpunit/phpunit/src/Runner/CodeCoverage.php',
'PHPUnit\\Runner\\DeprecationCollector\\Collector' => $vendorDir . '/phpunit/phpunit/src/Runner/DeprecationCollector/Collector.php',
'PHPUnit\\Runner\\DeprecationCollector\\Facade' => $vendorDir . '/phpunit/phpunit/src/Runner/DeprecationCollector/Facade.php',
'PHPUnit\\Runner\\DeprecationCollector\\Subscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/DeprecationCollector/Subscriber/Subscriber.php',
'PHPUnit\\Runner\\DeprecationCollector\\TestPreparedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/DeprecationCollector/Subscriber/TestPreparedSubscriber.php',
'PHPUnit\\Runner\\DeprecationCollector\\TestTriggeredDeprecationSubscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/DeprecationCollector/Subscriber/TestTriggeredDeprecationSubscriber.php',
'PHPUnit\\Runner\\DirectoryCannotBeCreatedException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/DirectoryCannotBeCreatedException.php',
'PHPUnit\\Runner\\ErrorException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/ErrorException.php',
'PHPUnit\\Runner\\ErrorHandler' => $vendorDir . '/phpunit/phpunit/src/Runner/ErrorHandler.php',
@ -606,9 +612,11 @@ return array(
'PHPUnit\\Runner\\Extension\\PharLoader' => $vendorDir . '/phpunit/phpunit/src/Runner/Extension/PharLoader.php',
'PHPUnit\\Runner\\FileDoesNotExistException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/FileDoesNotExistException.php',
'PHPUnit\\Runner\\Filter\\ExcludeGroupFilterIterator' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/ExcludeGroupFilterIterator.php',
'PHPUnit\\Runner\\Filter\\ExcludeNameFilterIterator' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/ExcludeNameFilterIterator.php',
'PHPUnit\\Runner\\Filter\\Factory' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/Factory.php',
'PHPUnit\\Runner\\Filter\\GroupFilterIterator' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php',
'PHPUnit\\Runner\\Filter\\IncludeGroupFilterIterator' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/IncludeGroupFilterIterator.php',
'PHPUnit\\Runner\\Filter\\IncludeNameFilterIterator' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/IncludeNameFilterIterator.php',
'PHPUnit\\Runner\\Filter\\NameFilterIterator' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php',
'PHPUnit\\Runner\\Filter\\TestIdFilterIterator' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/TestIdFilterIterator.php',
'PHPUnit\\Runner\\GarbageCollection\\ExecutionFinishedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/GarbageCollection/Subscriber/ExecutionFinishedSubscriber.php',
@ -680,6 +688,7 @@ return array(
'PHPUnit\\TextUI\\Command\\Command' => $vendorDir . '/phpunit/phpunit/src/TextUI/Command/Command.php',
'PHPUnit\\TextUI\\Command\\GenerateConfigurationCommand' => $vendorDir . '/phpunit/phpunit/src/TextUI/Command/Commands/GenerateConfigurationCommand.php',
'PHPUnit\\TextUI\\Command\\ListGroupsCommand' => $vendorDir . '/phpunit/phpunit/src/TextUI/Command/Commands/ListGroupsCommand.php',
'PHPUnit\\TextUI\\Command\\ListTestFilesCommand' => $vendorDir . '/phpunit/phpunit/src/TextUI/Command/Commands/ListTestFilesCommand.php',
'PHPUnit\\TextUI\\Command\\ListTestSuitesCommand' => $vendorDir . '/phpunit/phpunit/src/TextUI/Command/Commands/ListTestSuitesCommand.php',
'PHPUnit\\TextUI\\Command\\ListTestsAsTextCommand' => $vendorDir . '/phpunit/phpunit/src/TextUI/Command/Commands/ListTestsAsTextCommand.php',
'PHPUnit\\TextUI\\Command\\ListTestsAsXmlCommand' => $vendorDir . '/phpunit/phpunit/src/TextUI/Command/Commands/ListTestsAsXmlCommand.php',
@ -844,6 +853,7 @@ return array(
'PHPUnit\\TextUI\\XmlConfiguration\\RemoveLoggingElements' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveLoggingElements.php',
'PHPUnit\\TextUI\\XmlConfiguration\\RemoveNoInteractionAttribute' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveNoInteractionAttribute.php',
'PHPUnit\\TextUI\\XmlConfiguration\\RemovePrinterAttributes' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemovePrinterAttributes.php',
'PHPUnit\\TextUI\\XmlConfiguration\\RemoveRegisterMockObjectsFromTestArgumentsRecursivelyAttribute' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveRegisterMockObjectsFromTestArgumentsRecursivelyAttribute.php',
'PHPUnit\\TextUI\\XmlConfiguration\\RemoveTestDoxGroupsElement' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveTestDoxGroupsElement.php',
'PHPUnit\\TextUI\\XmlConfiguration\\RemoveTestSuiteLoaderAttributes' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveTestSuiteLoaderAttributes.php',
'PHPUnit\\TextUI\\XmlConfiguration\\RemoveVerboseAttribute' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveVerboseAttribute.php',
@ -863,7 +873,6 @@ return array(
'PHPUnit\\Util\\Color' => $vendorDir . '/phpunit/phpunit/src/Util/Color.php',
'PHPUnit\\Util\\Exception' => $vendorDir . '/phpunit/phpunit/src/Util/Exception/Exception.php',
'PHPUnit\\Util\\ExcludeList' => $vendorDir . '/phpunit/phpunit/src/Util/ExcludeList.php',
'PHPUnit\\Util\\Exporter' => $vendorDir . '/phpunit/phpunit/src/Util/Exporter.php',
'PHPUnit\\Util\\Filesystem' => $vendorDir . '/phpunit/phpunit/src/Util/Filesystem.php',
'PHPUnit\\Util\\Filter' => $vendorDir . '/phpunit/phpunit/src/Util/Filter.php',
'PHPUnit\\Util\\GlobalState' => $vendorDir . '/phpunit/phpunit/src/Util/GlobalState.php',
@ -923,6 +932,7 @@ return array(
'PharIo\\Manifest\\ManifestLoader' => $vendorDir . '/phar-io/manifest/src/ManifestLoader.php',
'PharIo\\Manifest\\ManifestLoaderException' => $vendorDir . '/phar-io/manifest/src/exceptions/ManifestLoaderException.php',
'PharIo\\Manifest\\ManifestSerializer' => $vendorDir . '/phar-io/manifest/src/ManifestSerializer.php',
'PharIo\\Manifest\\NoEmailAddressException' => $vendorDir . '/phar-io/manifest/src/exceptions/NoEmailAddressException.php',
'PharIo\\Manifest\\PhpElement' => $vendorDir . '/phar-io/manifest/src/xml/PhpElement.php',
'PharIo\\Manifest\\PhpExtensionRequirement' => $vendorDir . '/phar-io/manifest/src/values/PhpExtensionRequirement.php',
'PharIo\\Manifest\\PhpVersionRequirement' => $vendorDir . '/phar-io/manifest/src/values/PhpVersionRequirement.php',

@ -22,7 +22,6 @@ return array(
'Network\\' => array($baseDir . '/src/data/core/network'),
'Model\\' => array($baseDir . '/src/data/model'),
'Manager\\' => array($baseDir . '/src/data/model/manager'),
'Json\\' => array($baseDir . '/src/data/core/json'),
'Hearttrack\\' => array($baseDir . '/src'),
'GrahamCampbell\\ResultType\\' => array($vendorDir . '/graham-campbell/result-type/src'),
'Dotenv\\' => array($vendorDir . '/vlucas/phpdotenv/src'),

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit1887e85fc3cfddacf8d7e17588dae6f1
class ComposerAutoloaderInit4c2287070574f70d470b239b224aef76
{
private static $loader;
@ -24,16 +24,16 @@ class ComposerAutoloaderInit1887e85fc3cfddacf8d7e17588dae6f1
require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInit1887e85fc3cfddacf8d7e17588dae6f1', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit4c2287070574f70d470b239b224aef76', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit1887e85fc3cfddacf8d7e17588dae6f1', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit4c2287070574f70d470b239b224aef76', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit4c2287070574f70d470b239b224aef76::getInitializer($loader));
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit4c2287070574f70d470b239b224aef76::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1
class ComposerStaticInit4c2287070574f70d470b239b224aef76
{
public static $files = array (
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
@ -52,10 +52,6 @@ class ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1
'Model\\' => 6,
'Manager\\' => 8,
),
'J' =>
array (
'Json\\' => 5,
),
'H' =>
array (
'Hearttrack\\' => 11,
@ -155,10 +151,6 @@ class ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1
array (
0 => __DIR__ . '/../..' . '/src/data/model/manager',
),
'Json\\' =>
array (
0 => __DIR__ . '/../..' . '/src/data/core/json',
),
'Hearttrack\\' =>
array (
0 => __DIR__ . '/../..' . '/src',
@ -286,7 +278,6 @@ class ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1
'PHPUnit\\Event\\Telemetry\\SystemStopWatchWithOffset' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/Telemetry/SystemStopWatchWithOffset.php',
'PHPUnit\\Event\\TestData\\DataFromDataProvider' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/Test/TestData/DataFromDataProvider.php',
'PHPUnit\\Event\\TestData\\DataFromTestDependency' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/Test/TestData/DataFromTestDependency.php',
'PHPUnit\\Event\\TestData\\MoreThanOneDataSetFromDataProviderException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Exception/MoreThanOneDataSetFromDataProviderException.php',
'PHPUnit\\Event\\TestData\\NoDataSetFromDataProviderException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Exception/NoDataSetFromDataProviderException.php',
'PHPUnit\\Event\\TestData\\TestData' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/Test/TestData/TestData.php',
'PHPUnit\\Event\\TestData\\TestDataCollection' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/Test/TestData/TestDataCollection.php',
@ -346,10 +337,6 @@ class ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1
'PHPUnit\\Event\\Test\\AfterTestMethodCalledSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodCalledSubscriber.php',
'PHPUnit\\Event\\Test\\AfterTestMethodFinished' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodFinished.php',
'PHPUnit\\Event\\Test\\AfterTestMethodFinishedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodFinishedSubscriber.php',
'PHPUnit\\Event\\Test\\AssertionFailed' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionFailed.php',
'PHPUnit\\Event\\Test\\AssertionFailedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionFailedSubscriber.php',
'PHPUnit\\Event\\Test\\AssertionSucceeded' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionSucceeded.php',
'PHPUnit\\Event\\Test\\AssertionSucceededSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionSucceededSubscriber.php',
'PHPUnit\\Event\\Test\\BeforeFirstTestMethodCalled' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodCalled.php',
'PHPUnit\\Event\\Test\\BeforeFirstTestMethodCalledSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodCalledSubscriber.php',
'PHPUnit\\Event\\Test\\BeforeFirstTestMethodErrored' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodErrored.php',
@ -451,7 +438,6 @@ class ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1
'PHPUnit\\Framework\\Attributes\\BackupStaticProperties' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/BackupStaticProperties.php',
'PHPUnit\\Framework\\Attributes\\Before' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/Before.php',
'PHPUnit\\Framework\\Attributes\\BeforeClass' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/BeforeClass.php',
'PHPUnit\\Framework\\Attributes\\CodeCoverageIgnore' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/CodeCoverageIgnore.php',
'PHPUnit\\Framework\\Attributes\\CoversClass' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/CoversClass.php',
'PHPUnit\\Framework\\Attributes\\CoversFunction' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/CoversFunction.php',
'PHPUnit\\Framework\\Attributes\\CoversNothing' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/CoversNothing.php',
@ -470,10 +456,8 @@ class ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1
'PHPUnit\\Framework\\Attributes\\ExcludeGlobalVariableFromBackup' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/ExcludeGlobalVariableFromBackup.php',
'PHPUnit\\Framework\\Attributes\\ExcludeStaticPropertyFromBackup' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/ExcludeStaticPropertyFromBackup.php',
'PHPUnit\\Framework\\Attributes\\Group' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/Group.php',
'PHPUnit\\Framework\\Attributes\\IgnoreClassForCodeCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/IgnoreClassForCodeCoverage.php',
'PHPUnit\\Framework\\Attributes\\IgnoreDeprecations' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/IgnoreDeprecations.php',
'PHPUnit\\Framework\\Attributes\\IgnoreFunctionForCodeCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/IgnoreFunctionForCodeCoverage.php',
'PHPUnit\\Framework\\Attributes\\IgnoreMethodForCodeCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/IgnoreMethodForCodeCoverage.php',
'PHPUnit\\Framework\\Attributes\\IgnorePhpunitDeprecations' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/IgnorePhpunitDeprecations.php',
'PHPUnit\\Framework\\Attributes\\Large' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/Large.php',
'PHPUnit\\Framework\\Attributes\\Medium' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/Medium.php',
'PHPUnit\\Framework\\Attributes\\PostCondition' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/PostCondition.php',
@ -581,6 +565,8 @@ class ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1
'PHPUnit\\Framework\\MockObject\\ConfigurableMethod' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/ConfigurableMethod.php',
'PHPUnit\\Framework\\MockObject\\DoubledCloneMethod' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Api/DoubledCloneMethod.php',
'PHPUnit\\Framework\\MockObject\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/Exception.php',
'PHPUnit\\Framework\\MockObject\\GeneratedAsMockObject' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Api/GeneratedAsMockObject.php',
'PHPUnit\\Framework\\MockObject\\GeneratedAsTestStub' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Api/GeneratedAsTestStub.php',
'PHPUnit\\Framework\\MockObject\\Generator\\ClassAlreadyExistsException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ClassAlreadyExistsException.php',
'PHPUnit\\Framework\\MockObject\\Generator\\ClassIsEnumerationException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ClassIsEnumerationException.php',
'PHPUnit\\Framework\\MockObject\\Generator\\ClassIsFinalException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ClassIsFinalException.php',
@ -723,6 +709,15 @@ class ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1
'PHPUnit\\Logging\\TestDox\\TestResultCollectionIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/TestResultCollectionIterator.php',
'PHPUnit\\Logging\\TestDox\\TestResultCollector' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/TestResultCollector.php',
'PHPUnit\\Logging\\TestDox\\TestSkippedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestSkippedSubscriber.php',
'PHPUnit\\Logging\\TestDox\\TestTriggeredDeprecationSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredDeprecationSubscriber.php',
'PHPUnit\\Logging\\TestDox\\TestTriggeredNoticeSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredNoticeSubscriber.php',
'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpDeprecationSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpDeprecationSubscriber.php',
'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpNoticeSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpNoticeSubscriber.php',
'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpWarningSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpWarningSubscriber.php',
'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpunitDeprecationSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpunitDeprecationSubscriber.php',
'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpunitErrorSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpunitErrorSubscriber.php',
'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpunitWarningSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpunitWarningSubscriber.php',
'PHPUnit\\Logging\\TestDox\\TestTriggeredWarningSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredWarningSubscriber.php',
'PHPUnit\\Metadata\\After' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/After.php',
'PHPUnit\\Metadata\\AfterClass' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/AfterClass.php',
'PHPUnit\\Metadata\\Annotation\\Parser\\DocBlock' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/Parser/Annotation/DocBlock.php',
@ -751,10 +746,8 @@ class ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1
'PHPUnit\\Metadata\\ExcludeGlobalVariableFromBackup' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/ExcludeGlobalVariableFromBackup.php',
'PHPUnit\\Metadata\\ExcludeStaticPropertyFromBackup' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/ExcludeStaticPropertyFromBackup.php',
'PHPUnit\\Metadata\\Group' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/Group.php',
'PHPUnit\\Metadata\\IgnoreClassForCodeCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/IgnoreClassForCodeCoverage.php',
'PHPUnit\\Metadata\\IgnoreDeprecations' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/IgnoreDeprecations.php',
'PHPUnit\\Metadata\\IgnoreFunctionForCodeCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/IgnoreFunctionForCodeCoverage.php',
'PHPUnit\\Metadata\\IgnoreMethodForCodeCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/IgnoreMethodForCodeCoverage.php',
'PHPUnit\\Metadata\\IgnorePhpunitDeprecations' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/IgnorePhpunitDeprecations.php',
'PHPUnit\\Metadata\\InvalidVersionRequirementException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/Exception/InvalidVersionRequirementException.php',
'PHPUnit\\Metadata\\Metadata' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/Metadata.php',
'PHPUnit\\Metadata\\MetadataCollection' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/MetadataCollection.php',
@ -811,6 +804,11 @@ class ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1
'PHPUnit\\Runner\\ClassDoesNotExtendTestCaseException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/ClassDoesNotExtendTestCaseException.php',
'PHPUnit\\Runner\\ClassIsAbstractException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/ClassIsAbstractException.php',
'PHPUnit\\Runner\\CodeCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/CodeCoverage.php',
'PHPUnit\\Runner\\DeprecationCollector\\Collector' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/DeprecationCollector/Collector.php',
'PHPUnit\\Runner\\DeprecationCollector\\Facade' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/DeprecationCollector/Facade.php',
'PHPUnit\\Runner\\DeprecationCollector\\Subscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/DeprecationCollector/Subscriber/Subscriber.php',
'PHPUnit\\Runner\\DeprecationCollector\\TestPreparedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/DeprecationCollector/Subscriber/TestPreparedSubscriber.php',
'PHPUnit\\Runner\\DeprecationCollector\\TestTriggeredDeprecationSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/DeprecationCollector/Subscriber/TestTriggeredDeprecationSubscriber.php',
'PHPUnit\\Runner\\DirectoryCannotBeCreatedException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/DirectoryCannotBeCreatedException.php',
'PHPUnit\\Runner\\ErrorException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/ErrorException.php',
'PHPUnit\\Runner\\ErrorHandler' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/ErrorHandler.php',
@ -822,9 +820,11 @@ class ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1
'PHPUnit\\Runner\\Extension\\PharLoader' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Extension/PharLoader.php',
'PHPUnit\\Runner\\FileDoesNotExistException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/FileDoesNotExistException.php',
'PHPUnit\\Runner\\Filter\\ExcludeGroupFilterIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/ExcludeGroupFilterIterator.php',
'PHPUnit\\Runner\\Filter\\ExcludeNameFilterIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/ExcludeNameFilterIterator.php',
'PHPUnit\\Runner\\Filter\\Factory' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/Factory.php',
'PHPUnit\\Runner\\Filter\\GroupFilterIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php',
'PHPUnit\\Runner\\Filter\\IncludeGroupFilterIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/IncludeGroupFilterIterator.php',
'PHPUnit\\Runner\\Filter\\IncludeNameFilterIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/IncludeNameFilterIterator.php',
'PHPUnit\\Runner\\Filter\\NameFilterIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php',
'PHPUnit\\Runner\\Filter\\TestIdFilterIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/TestIdFilterIterator.php',
'PHPUnit\\Runner\\GarbageCollection\\ExecutionFinishedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/GarbageCollection/Subscriber/ExecutionFinishedSubscriber.php',
@ -896,6 +896,7 @@ class ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1
'PHPUnit\\TextUI\\Command\\Command' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Command/Command.php',
'PHPUnit\\TextUI\\Command\\GenerateConfigurationCommand' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Command/Commands/GenerateConfigurationCommand.php',
'PHPUnit\\TextUI\\Command\\ListGroupsCommand' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Command/Commands/ListGroupsCommand.php',
'PHPUnit\\TextUI\\Command\\ListTestFilesCommand' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Command/Commands/ListTestFilesCommand.php',
'PHPUnit\\TextUI\\Command\\ListTestSuitesCommand' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Command/Commands/ListTestSuitesCommand.php',
'PHPUnit\\TextUI\\Command\\ListTestsAsTextCommand' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Command/Commands/ListTestsAsTextCommand.php',
'PHPUnit\\TextUI\\Command\\ListTestsAsXmlCommand' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Command/Commands/ListTestsAsXmlCommand.php',
@ -1060,6 +1061,7 @@ class ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1
'PHPUnit\\TextUI\\XmlConfiguration\\RemoveLoggingElements' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveLoggingElements.php',
'PHPUnit\\TextUI\\XmlConfiguration\\RemoveNoInteractionAttribute' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveNoInteractionAttribute.php',
'PHPUnit\\TextUI\\XmlConfiguration\\RemovePrinterAttributes' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemovePrinterAttributes.php',
'PHPUnit\\TextUI\\XmlConfiguration\\RemoveRegisterMockObjectsFromTestArgumentsRecursivelyAttribute' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveRegisterMockObjectsFromTestArgumentsRecursivelyAttribute.php',
'PHPUnit\\TextUI\\XmlConfiguration\\RemoveTestDoxGroupsElement' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveTestDoxGroupsElement.php',
'PHPUnit\\TextUI\\XmlConfiguration\\RemoveTestSuiteLoaderAttributes' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveTestSuiteLoaderAttributes.php',
'PHPUnit\\TextUI\\XmlConfiguration\\RemoveVerboseAttribute' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveVerboseAttribute.php',
@ -1079,7 +1081,6 @@ class ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1
'PHPUnit\\Util\\Color' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Color.php',
'PHPUnit\\Util\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Exception/Exception.php',
'PHPUnit\\Util\\ExcludeList' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/ExcludeList.php',
'PHPUnit\\Util\\Exporter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Exporter.php',
'PHPUnit\\Util\\Filesystem' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Filesystem.php',
'PHPUnit\\Util\\Filter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Filter.php',
'PHPUnit\\Util\\GlobalState' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/GlobalState.php',
@ -1139,6 +1140,7 @@ class ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1
'PharIo\\Manifest\\ManifestLoader' => __DIR__ . '/..' . '/phar-io/manifest/src/ManifestLoader.php',
'PharIo\\Manifest\\ManifestLoaderException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/ManifestLoaderException.php',
'PharIo\\Manifest\\ManifestSerializer' => __DIR__ . '/..' . '/phar-io/manifest/src/ManifestSerializer.php',
'PharIo\\Manifest\\NoEmailAddressException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/NoEmailAddressException.php',
'PharIo\\Manifest\\PhpElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/PhpElement.php',
'PharIo\\Manifest\\PhpExtensionRequirement' => __DIR__ . '/..' . '/phar-io/manifest/src/values/PhpExtensionRequirement.php',
'PharIo\\Manifest\\PhpVersionRequirement' => __DIR__ . '/..' . '/phar-io/manifest/src/values/PhpVersionRequirement.php',
@ -1389,9 +1391,9 @@ class ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit1887e85fc3cfddacf8d7e17588dae6f1::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit4c2287070574f70d470b239b224aef76::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit4c2287070574f70d470b239b224aef76::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit4c2287070574f70d470b239b224aef76::$classMap;
}, null, ClassLoader::class);
}

File diff suppressed because it is too large Load Diff

@ -3,7 +3,7 @@
'name' => 'hearttrack/package',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'e86b3f7b002e2852b5084d5448b98251eec6e846',
'reference' => '19f37061e0fd9cc55f51b54a788cb4e7949be3d1',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@ -40,7 +40,7 @@
'hearttrack/package' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'e86b3f7b002e2852b5084d5448b98251eec6e846',
'reference' => '19f37061e0fd9cc55f51b54a788cb4e7949be3d1',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@ -56,18 +56,18 @@
'dev_requirement' => true,
),
'nikic/php-parser' => array(
'pretty_version' => 'v5.0.0',
'version' => '5.0.0.0',
'reference' => '4a21235f7e56e713259a6f76bf4b5ea08502b9dc',
'pretty_version' => 'v5.0.2',
'version' => '5.0.2.0',
'reference' => '139676794dc1e9231bf7bcd123cfc0c99182cb13',
'type' => 'library',
'install_path' => __DIR__ . '/../nikic/php-parser',
'aliases' => array(),
'dev_requirement' => true,
),
'phar-io/manifest' => array(
'pretty_version' => '2.0.3',
'version' => '2.0.3.0',
'reference' => '97803eca37d319dfa7826cc2437fc020857acb53',
'pretty_version' => '2.0.4',
'version' => '2.0.4.0',
'reference' => '54750ef60c58e43759730615a392c31c80e23176',
'type' => 'library',
'install_path' => __DIR__ . '/../phar-io/manifest',
'aliases' => array(),
@ -92,54 +92,54 @@
'dev_requirement' => false,
),
'phpunit/php-code-coverage' => array(
'pretty_version' => '10.1.11',
'version' => '10.1.11.0',
'reference' => '78c3b7625965c2513ee96569a4dbb62601784145',
'pretty_version' => '11.0.3',
'version' => '11.0.3.0',
'reference' => '7e35a2cbcabac0e6865fd373742ea432a3c34f92',
'type' => 'library',
'install_path' => __DIR__ . '/../phpunit/php-code-coverage',
'aliases' => array(),
'dev_requirement' => true,
),
'phpunit/php-file-iterator' => array(
'pretty_version' => '4.1.0',
'version' => '4.1.0.0',
'reference' => 'a95037b6d9e608ba092da1b23931e537cadc3c3c',
'pretty_version' => '5.0.0',
'version' => '5.0.0.0',
'reference' => '99e95c94ad9500daca992354fa09d7b99abe2210',
'type' => 'library',
'install_path' => __DIR__ . '/../phpunit/php-file-iterator',
'aliases' => array(),
'dev_requirement' => true,
),
'phpunit/php-invoker' => array(
'pretty_version' => '4.0.0',
'version' => '4.0.0.0',
'reference' => 'f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7',
'pretty_version' => '5.0.0',
'version' => '5.0.0.0',
'reference' => '5d8d9355a16d8cc5a1305b0a85342cfa420612be',
'type' => 'library',
'install_path' => __DIR__ . '/../phpunit/php-invoker',
'aliases' => array(),
'dev_requirement' => true,
),
'phpunit/php-text-template' => array(
'pretty_version' => '3.0.1',
'version' => '3.0.1.0',
'reference' => '0c7b06ff49e3d5072f057eb1fa59258bf287a748',
'pretty_version' => '4.0.0',
'version' => '4.0.0.0',
'reference' => 'd38f6cbff1cdb6f40b03c9811421561668cc133e',
'type' => 'library',
'install_path' => __DIR__ . '/../phpunit/php-text-template',
'aliases' => array(),
'dev_requirement' => true,
),
'phpunit/php-timer' => array(
'pretty_version' => '6.0.0',
'version' => '6.0.0.0',
'reference' => 'e2a2d67966e740530f4a3343fe2e030ffdc1161d',
'pretty_version' => '7.0.0',
'version' => '7.0.0.0',
'reference' => '8a59d9e25720482ee7fcdf296595e08795b84dc5',
'type' => 'library',
'install_path' => __DIR__ . '/../phpunit/php-timer',
'aliases' => array(),
'dev_requirement' => true,
),
'phpunit/phpunit' => array(
'pretty_version' => '10.5.5',
'version' => '10.5.5.0',
'reference' => 'ed21115d505b4b4f7dc7b5651464e19a2c7f7856',
'pretty_version' => '11.0.8',
'version' => '11.0.8.0',
'reference' => '48ea58408879a9aad630022186398364051482fc',
'type' => 'library',
'install_path' => __DIR__ . '/../phpunit/phpunit',
'aliases' => array(),
@ -155,171 +155,171 @@
'dev_requirement' => false,
),
'sebastian/cli-parser' => array(
'pretty_version' => '2.0.0',
'version' => '2.0.0.0',
'reference' => 'efdc130dbbbb8ef0b545a994fd811725c5282cae',
'pretty_version' => '3.0.1',
'version' => '3.0.1.0',
'reference' => '00a74d5568694711f0222e54fb281e1d15fdf04a',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/cli-parser',
'aliases' => array(),
'dev_requirement' => true,
),
'sebastian/code-unit' => array(
'pretty_version' => '2.0.0',
'version' => '2.0.0.0',
'reference' => 'a81fee9eef0b7a76af11d121767abc44c104e503',
'pretty_version' => '3.0.0',
'version' => '3.0.0.0',
'reference' => '6634549cb8d702282a04a774e36a7477d2bd9015',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/code-unit',
'aliases' => array(),
'dev_requirement' => true,
),
'sebastian/code-unit-reverse-lookup' => array(
'pretty_version' => '3.0.0',
'version' => '3.0.0.0',
'reference' => '5e3a687f7d8ae33fb362c5c0743794bbb2420a1d',
'pretty_version' => '4.0.0',
'version' => '4.0.0.0',
'reference' => 'df80c875d3e459b45c6039e4d9b71d4fbccae25d',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/code-unit-reverse-lookup',
'aliases' => array(),
'dev_requirement' => true,
),
'sebastian/comparator' => array(
'pretty_version' => '5.0.1',
'version' => '5.0.1.0',
'reference' => '2db5010a484d53ebf536087a70b4a5423c102372',
'pretty_version' => '6.0.0',
'version' => '6.0.0.0',
'reference' => 'bd0f2fa5b9257c69903537b266ccb80fcf940db8',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/comparator',
'aliases' => array(),
'dev_requirement' => true,
),
'sebastian/complexity' => array(
'pretty_version' => '3.2.0',
'version' => '3.2.0.0',
'reference' => '68ff824baeae169ec9f2137158ee529584553799',
'pretty_version' => '4.0.0',
'version' => '4.0.0.0',
'reference' => '88a434ad86150e11a606ac4866b09130712671f0',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/complexity',
'aliases' => array(),
'dev_requirement' => true,
),
'sebastian/diff' => array(
'pretty_version' => '5.1.0',
'version' => '5.1.0.0',
'reference' => 'fbf413a49e54f6b9b17e12d900ac7f6101591b7f',
'pretty_version' => '6.0.1',
'version' => '6.0.1.0',
'reference' => 'ab83243ecc233de5655b76f577711de9f842e712',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/diff',
'aliases' => array(),
'dev_requirement' => true,
),
'sebastian/environment' => array(
'pretty_version' => '6.0.1',
'version' => '6.0.1.0',
'reference' => '43c751b41d74f96cbbd4e07b7aec9675651e2951',
'pretty_version' => '7.1.0',
'version' => '7.1.0.0',
'reference' => '4eb3a442574d0e9d141aab209cd4aaf25701b09a',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/environment',
'aliases' => array(),
'dev_requirement' => true,
),
'sebastian/exporter' => array(
'pretty_version' => '5.1.1',
'version' => '5.1.1.0',
'reference' => '64f51654862e0f5e318db7e9dcc2292c63cdbddc',
'pretty_version' => '6.0.1',
'version' => '6.0.1.0',
'reference' => 'f291e5a317c321c0381fa9ecc796fa2d21b186da',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/exporter',
'aliases' => array(),
'dev_requirement' => true,
),
'sebastian/global-state' => array(
'pretty_version' => '6.0.1',
'version' => '6.0.1.0',
'reference' => '7ea9ead78f6d380d2a667864c132c2f7b83055e4',
'pretty_version' => '7.0.1',
'version' => '7.0.1.0',
'reference' => 'c3a307e832f2e69c7ef869e31fc644fde0e7cb3e',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/global-state',
'aliases' => array(),
'dev_requirement' => true,
),
'sebastian/lines-of-code' => array(
'pretty_version' => '2.0.2',
'version' => '2.0.2.0',
'reference' => '856e7f6a75a84e339195d48c556f23be2ebf75d0',
'pretty_version' => '3.0.0',
'version' => '3.0.0.0',
'reference' => '376c5b3f6b43c78fdc049740bca76a7c846706c0',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/lines-of-code',
'aliases' => array(),
'dev_requirement' => true,
),
'sebastian/object-enumerator' => array(
'pretty_version' => '5.0.0',
'version' => '5.0.0.0',
'reference' => '202d0e344a580d7f7d04b3fafce6933e59dae906',
'pretty_version' => '6.0.0',
'version' => '6.0.0.0',
'reference' => 'f75f6c460da0bbd9668f43a3dde0ec0ba7faa678',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/object-enumerator',
'aliases' => array(),
'dev_requirement' => true,
),
'sebastian/object-reflector' => array(
'pretty_version' => '3.0.0',
'version' => '3.0.0.0',
'reference' => '24ed13d98130f0e7122df55d06c5c4942a577957',
'pretty_version' => '4.0.0',
'version' => '4.0.0.0',
'reference' => 'bb2a6255d30853425fd38f032eb64ced9f7f132d',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/object-reflector',
'aliases' => array(),
'dev_requirement' => true,
),
'sebastian/recursion-context' => array(
'pretty_version' => '5.0.0',
'version' => '5.0.0.0',
'reference' => '05909fb5bc7df4c52992396d0116aed689f93712',
'pretty_version' => '6.0.0',
'version' => '6.0.0.0',
'reference' => 'b75224967b5a466925c6d54e68edd0edf8dd4ed4',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/recursion-context',
'aliases' => array(),
'dev_requirement' => true,
),
'sebastian/type' => array(
'pretty_version' => '4.0.0',
'version' => '4.0.0.0',
'reference' => '462699a16464c3944eefc02ebdd77882bd3925bf',
'pretty_version' => '5.0.0',
'version' => '5.0.0.0',
'reference' => 'b8502785eb3523ca0dd4afe9ca62235590020f3f',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/type',
'aliases' => array(),
'dev_requirement' => true,
),
'sebastian/version' => array(
'pretty_version' => '4.0.1',
'version' => '4.0.1.0',
'reference' => 'c51fa83a5d8f43f1402e3f32a005e6262244ef17',
'pretty_version' => '5.0.0',
'version' => '5.0.0.0',
'reference' => '13999475d2cb1ab33cb73403ba356a814fdbb001',
'type' => 'library',
'install_path' => __DIR__ . '/../sebastian/version',
'aliases' => array(),
'dev_requirement' => true,
),
'symfony/polyfill-ctype' => array(
'pretty_version' => 'v1.28.0',
'version' => '1.28.0.0',
'reference' => 'ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb',
'pretty_version' => 'v1.29.0',
'version' => '1.29.0.0',
'reference' => 'ef4d7e442ca910c4764bce785146269b30cb5fc4',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/polyfill-mbstring' => array(
'pretty_version' => 'v1.28.0',
'version' => '1.28.0.0',
'reference' => '42292d99c55abe617799667f454222c54c60e229',
'pretty_version' => 'v1.29.0',
'version' => '1.29.0.0',
'reference' => '9773676c8a1bb1f8d4340a62efe641cf76eda7ec',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/polyfill-php80' => array(
'pretty_version' => 'v1.28.0',
'version' => '1.28.0.0',
'reference' => '6caa57379c4aec19c0a12a38b59b26487dcfe4b5',
'pretty_version' => 'v1.29.0',
'version' => '1.29.0.0',
'reference' => '87b68208d5c1188808dd7839ee1e6c8ec3b02f1b',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-php80',
'aliases' => array(),
'dev_requirement' => false,
),
'theseer/tokenizer' => array(
'pretty_version' => '1.2.2',
'version' => '1.2.2.0',
'reference' => 'b2ad5003ca10d4ee50a12da31de12a5774ba6b96',
'pretty_version' => '1.2.3',
'version' => '1.2.3.0',
'reference' => '737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2',
'type' => 'library',
'install_path' => __DIR__ . '/../theseer/tokenizer',
'aliases' => array(),

@ -1,31 +0,0 @@
<?php
$finder = PhpCsFixer\Finder::create()
->exclude('PhpParser/Parser')
->in(__DIR__ . '/lib')
->in(__DIR__ . '/test')
->in(__DIR__ . '/grammar')
;
$config = new PhpCsFixer\Config();
return $config->setRiskyAllowed(true)
->setRules([
'@PSR12' => true,
// We use PSR12 with consistent brace placement.
'curly_braces_position' => [
'functions_opening_brace' => 'same_line',
'classes_opening_brace' => 'same_line',
],
// declare(strict_types=1) on the same line as <?php.
'blank_line_after_opening_tag' => false,
'declare_strict_types' => true,
// Keep argument formatting for now.
'method_argument_space' => ['on_multiline' => 'ignore'],
'phpdoc_align' => ['align' => 'left'],
'phpdoc_trim' => true,
'no_empty_phpdoc' => true,
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
'no_extra_blank_lines' => true,
])
->setFinder($finder)
;

@ -1,10 +0,0 @@
.PHONY: phpstan php-cs-fixer
tools/vendor:
composer install -d tools
phpstan: tools/vendor
tools/vendor/bin/phpstan
php-cs-fixer: tools/vendor
tools/vendor/bin/php-cs-fixer fix

@ -251,7 +251,7 @@ class TokenStream {
private function calcIndentMap(): array {
$indentMap = [];
$indent = 0;
foreach ($this->tokens as $token) {
foreach ($this->tokens as $i => $token) {
$indentMap[] = $indent;
if ($token->id === \T_WHITESPACE) {
@ -259,6 +259,10 @@ class TokenStream {
$newlinePos = \strrpos($content, "\n");
if (false !== $newlinePos) {
$indent = \strlen($content) - $newlinePos - 1;
} elseif ($i === 1 && $this->tokens[0]->id === \T_OPEN_TAG &&
$this->tokens[0]->text[\strlen($this->tokens[0]->text) - 1] === "\n") {
// Special case: Newline at the end of opening tag followed by whitespace.
$indent = \strlen($content);
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -318,7 +318,7 @@ abstract class ParserAbstract implements Parser {
try {
$callback = $this->reduceCallbacks[$rule];
if ($callback !== null) {
$callback($stackPos);
$callback($this, $stackPos);
} elseif ($ruleLength > 0) {
$this->semValue = $this->semStack[$stackPos - $ruleLength + 1];
}

@ -43,7 +43,7 @@ class PhpVersion {
* if it is still under development.
*/
public static function getNewestSupported(): self {
return self::fromComponents(8, 2);
return self::fromComponents(8, 3);
}
/**

@ -26,6 +26,13 @@ if (!\function_exists('PhpParser\defineCompatibilityTokens')) {
foreach ($compatTokens as $token) {
if (\defined($token)) {
$tokenId = \constant($token);
if (!\is_int($tokenId)) {
throw new \Error(sprintf(
'Token %s has ID of type %s, should be int. ' .
'You may be using a library with broken token emulation',
$token, \gettype($tokenId)
));
}
$clashingToken = $usedTokenIds[$tokenId] ?? null;
if ($clashingToken !== null) {
throw new \Error(sprintf(

@ -1,236 +0,0 @@
parameters:
ignoreErrors:
-
message: "#^Method PhpParser\\\\Builder\\\\ClassConst\\:\\:__construct\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#"
count: 1
path: lib/PhpParser/Builder/ClassConst.php
-
message: "#^Method PhpParser\\\\Builder\\\\ClassConst\\:\\:addConst\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#"
count: 1
path: lib/PhpParser/Builder/ClassConst.php
-
message: "#^Method PhpParser\\\\BuilderFactory\\:\\:args\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#"
count: 1
path: lib/PhpParser/BuilderFactory.php
-
message: "#^Method PhpParser\\\\BuilderFactory\\:\\:attribute\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#"
count: 1
path: lib/PhpParser/BuilderFactory.php
-
message: "#^Method PhpParser\\\\BuilderFactory\\:\\:classConst\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#"
count: 1
path: lib/PhpParser/BuilderFactory.php
-
message: "#^Method PhpParser\\\\BuilderFactory\\:\\:funcCall\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#"
count: 1
path: lib/PhpParser/BuilderFactory.php
-
message: "#^Method PhpParser\\\\BuilderFactory\\:\\:methodCall\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#"
count: 1
path: lib/PhpParser/BuilderFactory.php
-
message: "#^Method PhpParser\\\\BuilderFactory\\:\\:new\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#"
count: 1
path: lib/PhpParser/BuilderFactory.php
-
message: "#^Method PhpParser\\\\BuilderFactory\\:\\:staticCall\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#"
count: 1
path: lib/PhpParser/BuilderFactory.php
-
message: "#^Method PhpParser\\\\BuilderFactory\\:\\:val\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#"
count: 1
path: lib/PhpParser/BuilderFactory.php
-
message: "#^Method PhpParser\\\\BuilderHelpers\\:\\:normalizeValue\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#"
count: 1
path: lib/PhpParser/BuilderHelpers.php
-
message: "#^Method PhpParser\\\\ConstExprEvaluator\\:\\:evaluateArray\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: lib/PhpParser/ConstExprEvaluator.php
-
message: "#^Unary operation \"~\" on mixed results in an error\\.$#"
count: 1
path: lib/PhpParser/ConstExprEvaluator.php
-
message: "#^Method PhpParser\\\\JsonDecoder\\:\\:decodeArray\\(\\) has parameter \\$array with no value type specified in iterable type array\\.$#"
count: 1
path: lib/PhpParser/JsonDecoder.php
-
message: "#^Method PhpParser\\\\JsonDecoder\\:\\:decodeArray\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: lib/PhpParser/JsonDecoder.php
-
message: "#^Method PhpParser\\\\JsonDecoder\\:\\:decodeComment\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#"
count: 1
path: lib/PhpParser/JsonDecoder.php
-
message: "#^Method PhpParser\\\\JsonDecoder\\:\\:decodeNode\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#"
count: 1
path: lib/PhpParser/JsonDecoder.php
-
message: "#^Call to function assert\\(\\) with false will always evaluate to false\\.$#"
count: 1
path: lib/PhpParser/Lexer/Emulative.php
-
message: "#^Method PhpParser\\\\NodeDumper\\:\\:__construct\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
count: 1
path: lib/PhpParser/NodeDumper.php
-
message: "#^Method PhpParser\\\\NodeDumper\\:\\:dump\\(\\) has parameter \\$node with no value type specified in iterable type array\\.$#"
count: 1
path: lib/PhpParser/NodeDumper.php
-
message: "#^Method PhpParser\\\\NodeTraverser\\:\\:traverseArray\\(\\) has parameter \\$nodes with no value type specified in iterable type array\\.$#"
count: 1
path: lib/PhpParser/NodeTraverser.php
-
message: "#^Method PhpParser\\\\NodeTraverser\\:\\:traverseArray\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: lib/PhpParser/NodeTraverser.php
-
message: "#^Access to an undefined property PhpParser\\\\Node\\:\\:\\$attrGroups\\.$#"
count: 1
path: lib/PhpParser/NodeVisitor/NameResolver.php
-
message: "#^Access to an undefined property PhpParser\\\\Node\\:\\:\\$name\\.$#"
count: 1
path: lib/PhpParser/NodeVisitor/NameResolver.php
-
message: "#^Access to an undefined property PhpParser\\\\Node\\:\\:\\$namespacedName\\.$#"
count: 1
path: lib/PhpParser/NodeVisitor/NameResolver.php
-
message: "#^Method PhpParser\\\\NodeVisitor\\\\NodeConnectingVisitor\\:\\:beforeTraverse\\(\\) should return array\\<PhpParser\\\\Node\\>\\|null but return statement is missing\\.$#"
count: 1
path: lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php
-
message: "#^Method PhpParser\\\\NodeVisitor\\\\NodeConnectingVisitor\\:\\:enterNode\\(\\) should return array\\<PhpParser\\\\Node\\>\\|int\\|PhpParser\\\\Node\\|null but return statement is missing\\.$#"
count: 1
path: lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php
-
message: "#^Method PhpParser\\\\NodeVisitor\\\\NodeConnectingVisitor\\:\\:leaveNode\\(\\) should return array\\<PhpParser\\\\Node\\>\\|int\\|PhpParser\\\\Node\\|null but return statement is missing\\.$#"
count: 1
path: lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php
-
message: "#^Method PhpParser\\\\NodeVisitor\\\\ParentConnectingVisitor\\:\\:beforeTraverse\\(\\) should return array\\<PhpParser\\\\Node\\>\\|null but return statement is missing\\.$#"
count: 1
path: lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php
-
message: "#^Method PhpParser\\\\NodeVisitor\\\\ParentConnectingVisitor\\:\\:enterNode\\(\\) should return array\\<PhpParser\\\\Node\\>\\|int\\|PhpParser\\\\Node\\|null but return statement is missing\\.$#"
count: 1
path: lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php
-
message: "#^Method PhpParser\\\\NodeVisitor\\\\ParentConnectingVisitor\\:\\:leaveNode\\(\\) should return array\\<PhpParser\\\\Node\\>\\|int\\|PhpParser\\\\Node\\|null but return statement is missing\\.$#"
count: 1
path: lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php
-
message: "#^Access to undefined constant static\\(PhpParser\\\\ParserAbstract\\)\\:\\:T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG\\.$#"
count: 1
path: lib/PhpParser/ParserAbstract.php
-
message: "#^Access to undefined constant static\\(PhpParser\\\\ParserAbstract\\)\\:\\:T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG\\.$#"
count: 1
path: lib/PhpParser/ParserAbstract.php
-
message: "#^Access to undefined constant static\\(PhpParser\\\\ParserAbstract\\)\\:\\:T_ATTRIBUTE\\.$#"
count: 1
path: lib/PhpParser/ParserAbstract.php
-
message: "#^Access to undefined constant static\\(PhpParser\\\\ParserAbstract\\)\\:\\:T_COALESCE_EQUAL\\.$#"
count: 1
path: lib/PhpParser/ParserAbstract.php
-
message: "#^Access to undefined constant static\\(PhpParser\\\\ParserAbstract\\)\\:\\:T_ECHO\\.$#"
count: 1
path: lib/PhpParser/ParserAbstract.php
-
message: "#^Access to undefined constant static\\(PhpParser\\\\ParserAbstract\\)\\:\\:T_ENUM\\.$#"
count: 1
path: lib/PhpParser/ParserAbstract.php
-
message: "#^Access to undefined constant static\\(PhpParser\\\\ParserAbstract\\)\\:\\:T_FN\\.$#"
count: 1
path: lib/PhpParser/ParserAbstract.php
-
message: "#^Access to undefined constant static\\(PhpParser\\\\ParserAbstract\\)\\:\\:T_MATCH\\.$#"
count: 1
path: lib/PhpParser/ParserAbstract.php
-
message: "#^Access to undefined constant static\\(PhpParser\\\\ParserAbstract\\)\\:\\:T_NAME_FULLY_QUALIFIED\\.$#"
count: 1
path: lib/PhpParser/ParserAbstract.php
-
message: "#^Access to undefined constant static\\(PhpParser\\\\ParserAbstract\\)\\:\\:T_NAME_QUALIFIED\\.$#"
count: 1
path: lib/PhpParser/ParserAbstract.php
-
message: "#^Access to undefined constant static\\(PhpParser\\\\ParserAbstract\\)\\:\\:T_NAME_RELATIVE\\.$#"
count: 1
path: lib/PhpParser/ParserAbstract.php
-
message: "#^Access to undefined constant static\\(PhpParser\\\\ParserAbstract\\)\\:\\:T_NULLSAFE_OBJECT_OPERATOR\\.$#"
count: 1
path: lib/PhpParser/ParserAbstract.php
-
message: "#^Access to undefined constant static\\(PhpParser\\\\ParserAbstract\\)\\:\\:T_PAAMAYIM_NEKUDOTAYIM\\.$#"
count: 1
path: lib/PhpParser/ParserAbstract.php
-
message: "#^Access to undefined constant static\\(PhpParser\\\\ParserAbstract\\)\\:\\:T_READONLY\\.$#"
count: 1
path: lib/PhpParser/ParserAbstract.php
-
message: "#^Unary operation \"\\+\" on string results in an error\\.$#"
count: 1
path: lib/PhpParser/ParserAbstract.php
-
message: "#^Variable \\$action might not be defined\\.$#"
count: 1
path: lib/PhpParser/ParserAbstract.php

@ -1,8 +0,0 @@
includes:
- phpstan-baseline.neon
parameters:
level: 6
paths:
- lib
treatPhpDocTypesAsCertain: false

@ -2,6 +2,14 @@
All notable changes to phar-io/manifest are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
## [2.0.4] - 03-03-2024
### Changed
- Make `EMail` an optional attribute for author
- Stick with PHP 7.2 compatibilty
- Do not use implict nullable type (thanks @sebastianbergmann), this should make things work on PHP 8.4
## [2.0.3] - 20.07.2021
- Fixed PHP 7.2 / PHP 7.3 incompatibility introduced in previous release
@ -26,7 +34,8 @@ This release now requires PHP 7.2+
### Unreleased
[Unreleased]: https://github.com/phar-io/manifest/compare/2.0.3...HEAD
[Unreleased]: https://github.com/phar-io/manifest/compare/2.1.0...HEAD
[2.1.0]: https://github.com/phar-io/manifest/compare/2.0.3...2.1.0
[2.0.3]: https://github.com/phar-io/manifest/compare/2.0.2...2.0.3
[2.0.2]: https://github.com/phar-io/manifest/compare/2.0.1...2.0.2
[2.0.1]: https://github.com/phar-io/manifest/compare/2.0.0...2.0.1

@ -2,10 +2,6 @@
Component for reading [phar.io](https://phar.io/) manifest information from a [PHP Archive (PHAR)](http://php.net/phar).
[![Build Status](https://travis-ci.org/phar-io/manifest.svg?branch=master)](https://travis-ci.org/phar-io/manifest)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/phar-io/manifest/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/phar-io/manifest/?branch=master)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/d8cc6035-69ad-477d-bd1a-ccc605480fd7/mini.png)](https://insight.sensiolabs.com/projects/d8cc6035-69ad-477d-bd1a-ccc605480fd7)
## Installation
You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/):
@ -16,8 +12,9 @@ If you only need this library during development, for instance to run your proje
composer require --dev phar-io/manifest
## Usage
## Usage Examples
### Read from `manifest.xml`
```php
use PharIo\Manifest\ManifestLoader;
use PharIo\Manifest\ManifestSerializer;
@ -28,3 +25,154 @@ var_dump($manifest);
echo (new ManifestSerializer)->serializeToString($manifest);
```
<details>
<summary>Output</summary>
```shell
object(PharIo\Manifest\Manifest)#14 (6) {
["name":"PharIo\Manifest\Manifest":private]=>
object(PharIo\Manifest\ApplicationName)#10 (1) {
["name":"PharIo\Manifest\ApplicationName":private]=>
string(12) "some/library"
}
["version":"PharIo\Manifest\Manifest":private]=>
object(PharIo\Version\Version)#12 (5) {
["originalVersionString":"PharIo\Version\Version":private]=>
string(5) "1.0.0"
["major":"PharIo\Version\Version":private]=>
object(PharIo\Version\VersionNumber)#13 (1) {
["value":"PharIo\Version\VersionNumber":private]=>
int(1)
}
["minor":"PharIo\Version\Version":private]=>
object(PharIo\Version\VersionNumber)#23 (1) {
["value":"PharIo\Version\VersionNumber":private]=>
int(0)
}
["patch":"PharIo\Version\Version":private]=>
object(PharIo\Version\VersionNumber)#22 (1) {
["value":"PharIo\Version\VersionNumber":private]=>
int(0)
}
["preReleaseSuffix":"PharIo\Version\Version":private]=>
NULL
}
["type":"PharIo\Manifest\Manifest":private]=>
object(PharIo\Manifest\Library)#6 (0) {
}
["copyrightInformation":"PharIo\Manifest\Manifest":private]=>
object(PharIo\Manifest\CopyrightInformation)#19 (2) {
["authors":"PharIo\Manifest\CopyrightInformation":private]=>
object(PharIo\Manifest\AuthorCollection)#9 (1) {
["authors":"PharIo\Manifest\AuthorCollection":private]=>
array(1) {
[0]=>
object(PharIo\Manifest\Author)#15 (2) {
["name":"PharIo\Manifest\Author":private]=>
string(13) "Reiner Zufall"
["email":"PharIo\Manifest\Author":private]=>
object(PharIo\Manifest\Email)#16 (1) {
["email":"PharIo\Manifest\Email":private]=>
string(16) "reiner@zufall.de"
}
}
}
}
["license":"PharIo\Manifest\CopyrightInformation":private]=>
object(PharIo\Manifest\License)#11 (2) {
["name":"PharIo\Manifest\License":private]=>
string(12) "BSD-3-Clause"
["url":"PharIo\Manifest\License":private]=>
object(PharIo\Manifest\Url)#18 (1) {
["url":"PharIo\Manifest\Url":private]=>
string(26) "https://domain.tld/LICENSE"
}
}
}
["requirements":"PharIo\Manifest\Manifest":private]=>
object(PharIo\Manifest\RequirementCollection)#17 (1) {
["requirements":"PharIo\Manifest\RequirementCollection":private]=>
array(1) {
[0]=>
object(PharIo\Manifest\PhpVersionRequirement)#20 (1) {
["versionConstraint":"PharIo\Manifest\PhpVersionRequirement":private]=>
object(PharIo\Version\SpecificMajorAndMinorVersionConstraint)#24 (3) {
["originalValue":"PharIo\Version\AbstractVersionConstraint":private]=>
string(3) "7.0"
["major":"PharIo\Version\SpecificMajorAndMinorVersionConstraint":private]=>
int(7)
["minor":"PharIo\Version\SpecificMajorAndMinorVersionConstraint":private]=>
int(0)
}
}
}
}
["bundledComponents":"PharIo\Manifest\Manifest":private]=>
object(PharIo\Manifest\BundledComponentCollection)#8 (1) {
["bundledComponents":"PharIo\Manifest\BundledComponentCollection":private]=>
array(0) {
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<phar xmlns="https://phar.io/xml/manifest/1.0">
<contains name="some/library" version="1.0.0" type="library"/>
<copyright>
<author name="Reiner Zufall" email="reiner@zufall.de"/>
<license type="BSD-3-Clause" url="https://domain.tld/LICENSE"/>
</copyright>
<requires>
<php version="7.0"/>
</requires>
</phar>
```
</details>
### Create via API
```php
$bundled = new \PharIo\Manifest\BundledComponentCollection();
$bundled->add(
new \PharIo\Manifest\BundledComponent('vendor/packageA', new \PharIo\Version\Version('1.2.3-dev')
)
);
$manifest = new PharIo\Manifest\Manifest(
new \PharIo\Manifest\ApplicationName('vendor/package'),
new \PharIo\Version\Version('1.0.0'),
new \PharIo\Manifest\Library(),
new \PharIo\Manifest\CopyrightInformation(
new \PharIo\Manifest\AuthorCollection(),
new \PharIo\Manifest\License(
'BSD-3-Clause',
new \PharIo\Manifest\Url('https://spdx.org/licenses/BSD-3-Clause.html')
)
),
new \PharIo\Manifest\RequirementCollection(),
$bundled
);
echo (new ManifestSerializer)->serializeToString($manifest);
```
<details>
<summary>Output</summary>
```xml
<?xml version="1.0" encoding="UTF-8"?>
<phar xmlns="https://phar.io/xml/manifest/1.0">
<contains name="vendor/package" version="1.0.0" type="library"/>
<copyright>
<license type="BSD-3-Clause" url="https://spdx.org/licenses/BSD-3-Clause.html"/>
</copyright>
<requires>
<php version="*"/>
</requires>
<bundles>
<component name="vendor/packageA" version="1.2.3-dev"/>
</bundles>
</phar>
```
</details>

@ -26,6 +26,7 @@
"php": "^7.2 || ^8.0",
"ext-dom": "*",
"ext-phar": "*",
"ext-libxml": "*",
"ext-xmlwriter": "*",
"phar-io/version": "^3.0.1"
},

@ -4,24 +4,24 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "f2ac4614ce4f7273fd54a64b65fd047a",
"content-hash": "279b3c4fe44357abd924fdcc0cfa5664",
"packages": [
{
"name": "phar-io/version",
"version": "3.0.1",
"version": "3.2.1",
"source": {
"type": "git",
"url": "https://github.com/phar-io/version.git",
"reference": "d06a5000ac1a258a7d035295f0bd4ae7c859bc4f"
"reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phar-io/version/zipball/d06a5000ac1a258a7d035295f0bd4ae7c859bc4f",
"reference": "d06a5000ac1a258a7d035295f0bd4ae7c859bc4f",
"url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
"reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
"shasum": ""
},
"require": {
"php": "^7.2"
"php": "^7.2 || ^8.0"
},
"type": "library",
"autoload": {
@ -51,7 +51,11 @@
}
],
"description": "Library for handling version information and constraints",
"time": "2020-05-09T21:27:55+00:00"
"support": {
"issues": "https://github.com/phar-io/version/issues",
"source": "https://github.com/phar-io/version/tree/3.2.1"
},
"time": "2022-02-21T01:04:05+00:00"
}
],
"packages-dev": [],
@ -61,10 +65,12 @@
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": "^7.2",
"php": "^7.2 || ^8.0",
"ext-dom": "*",
"ext-phar": "*",
"ext-libxml": "*",
"ext-xmlwriter": "*"
},
"platform-dev": []
"platform-dev": [],
"plugin-api-version": "2.3.0"
}

@ -2,16 +2,19 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
use PharIo\Version\Exception as VersionException;
use PharIo\Version\Version;
use PharIo\Version\VersionConstraintParser;
use Throwable;
use function sprintf;
class ManifestDocumentMapper {
public function map(ManifestDocument $document): Manifest {
@ -30,9 +33,7 @@ class ManifestDocumentMapper {
$requirements,
$bundledComponents
);
} catch (VersionException $e) {
throw new ManifestDocumentMapperException($e->getMessage(), (int)$e->getCode(), $e);
} catch (Exception $e) {
} catch (Throwable $e) {
throw new ManifestDocumentMapperException($e->getMessage(), (int)$e->getCode(), $e);
}
}
@ -48,7 +49,7 @@ class ManifestDocumentMapper {
}
throw new ManifestDocumentMapperException(
\sprintf('Unsupported type %s', $contains->getType())
sprintf('Unsupported type %s', $contains->getType())
);
}
@ -59,7 +60,7 @@ class ManifestDocumentMapper {
$authors->add(
new Author(
$authorElement->getName(),
new Email($authorElement->getEmail())
$authorElement->hasEMail() ? new Email($authorElement->getEmail()) : null
)
);
}
@ -85,7 +86,7 @@ class ManifestDocumentMapper {
$versionConstraint = $parser->parse($phpElement->getVersion());
} catch (VersionException $e) {
throw new ManifestDocumentMapperException(
\sprintf('Unsupported version constraint - %s', $e->getMessage()),
sprintf('Unsupported version constraint - %s', $e->getMessage()),
(int)$e->getCode(),
$e
);
@ -141,7 +142,7 @@ class ManifestDocumentMapper {
);
} catch (VersionException $e) {
throw new ManifestDocumentMapperException(
\sprintf('Unsupported version constraint - %s', $e->getMessage()),
sprintf('Unsupported version constraint - %s', $e->getMessage()),
(int)$e->getCode(),
$e
);

@ -2,13 +2,16 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
use function sprintf;
class ManifestLoader {
public static function fromFile(string $filename): Manifest {
try {
@ -17,7 +20,7 @@ class ManifestLoader {
);
} catch (Exception $e) {
throw new ManifestLoaderException(
\sprintf('Loading %s failed.', $filename),
sprintf('Loading %s failed.', $filename),
(int)$e->getCode(),
$e
);

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
@ -13,6 +14,9 @@ use PharIo\Version\AnyVersionConstraint;
use PharIo\Version\Version;
use PharIo\Version\VersionConstraint;
use XMLWriter;
use function count;
use function file_put_contents;
use function str_repeat;
/** @psalm-suppress MissingConstructor */
class ManifestSerializer {
@ -20,7 +24,7 @@ class ManifestSerializer {
private $xmlWriter;
public function serializeToFile(Manifest $manifest, string $filename): void {
\file_put_contents(
file_put_contents(
$filename,
$this->serializeToString($manifest)
);
@ -41,7 +45,7 @@ class ManifestSerializer {
$xmlWriter = new XMLWriter();
$xmlWriter->openMemory();
$xmlWriter->setIndent(true);
$xmlWriter->setIndentString(\str_repeat(' ', 4));
$xmlWriter->setIndentString(str_repeat(' ', 4));
$xmlWriter->startDocument('1.0', 'UTF-8');
$xmlWriter->startElement('phar');
$xmlWriter->writeAttribute('xmlns', 'https://phar.io/xml/manifest/1.0');
@ -144,7 +148,7 @@ class ManifestSerializer {
}
private function addBundles(BundledComponentCollection $bundledComponentCollection): void {
if (\count($bundledComponentCollection) === 0) {
if (count($bundledComponentCollection) === 0) {
return;
}
$this->xmlWriter->startElement('bundles');

@ -2,12 +2,15 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
class ElementCollectionException extends \InvalidArgumentException implements Exception {
use InvalidArgumentException;
class ElementCollectionException extends InvalidArgumentException implements Exception {
}

@ -2,12 +2,15 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
interface Exception extends \Throwable {
use Throwable;
interface Exception extends Throwable {
}

@ -2,13 +2,16 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
class InvalidApplicationNameException extends \InvalidArgumentException implements Exception {
use InvalidArgumentException;
class InvalidApplicationNameException extends InvalidArgumentException implements Exception {
public const InvalidFormat = 2;
}

@ -2,12 +2,15 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
class InvalidEmailException extends \InvalidArgumentException implements Exception {
use InvalidArgumentException;
class InvalidEmailException extends InvalidArgumentException implements Exception {
}

@ -2,12 +2,15 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
class InvalidUrlException extends \InvalidArgumentException implements Exception {
use InvalidArgumentException;
class InvalidUrlException extends InvalidArgumentException implements Exception {
}

@ -1,5 +1,16 @@
<?php declare(strict_types = 1);
/*
* This file is part of PharIo\Manifest.
*
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
class ManifestDocumentException extends \RuntimeException implements Exception {
use RuntimeException;
class ManifestDocumentException extends RuntimeException implements Exception {
}

@ -2,14 +2,16 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
use LibXMLError;
use function sprintf;
class ManifestDocumentLoadingException extends \Exception implements Exception {
/** @var LibXMLError[] */
@ -25,7 +27,7 @@ class ManifestDocumentLoadingException extends \Exception implements Exception {
$first = $this->libxmlErrors[0];
parent::__construct(
\sprintf(
sprintf(
'%s (Line: %d / Column: %d / File: %s)',
$first->message,
$first->line,

@ -1,5 +1,16 @@
<?php declare(strict_types = 1);
/*
* This file is part of PharIo\Manifest.
*
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
class ManifestDocumentMapperException extends \RuntimeException implements Exception {
use RuntimeException;
class ManifestDocumentMapperException extends RuntimeException implements Exception {
}

@ -1,5 +1,16 @@
<?php declare(strict_types = 1);
/*
* This file is part of PharIo\Manifest.
*
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
class ManifestElementException extends \RuntimeException implements Exception {
use RuntimeException;
class ManifestElementException extends RuntimeException implements Exception {
}

@ -1,4 +1,13 @@
<?php declare(strict_types = 1);
/*
* This file is part of PharIo\Manifest.
*
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
class ManifestLoaderException extends \Exception implements Exception {

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;

@ -2,13 +2,17 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
use function preg_match;
use function sprintf;
class ApplicationName {
/** @var string */
private $name;
@ -27,9 +31,9 @@ class ApplicationName {
}
private function ensureValidFormat(string $name): void {
if (!\preg_match('#\w/\w#', $name)) {
if (!preg_match('#\w/\w#', $name)) {
throw new InvalidApplicationNameException(
\sprintf('Format of name "%s" is not valid - expected: vendor/packagename', $name),
sprintf('Format of name "%s" is not valid - expected: vendor/packagename', $name),
InvalidApplicationNameException::InvalidFormat
);
}

@ -2,27 +2,34 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
use function sprintf;
class Author {
/** @var string */
private $name;
/** @var Email */
/** @var null|Email */
private $email;
public function __construct(string $name, Email $email) {
public function __construct(string $name, ?Email $email = null) {
$this->name = $name;
$this->email = $email;
}
public function asString(): string {
return \sprintf(
if (!$this->hasEmail()) {
return $this->name;
}
return sprintf(
'%s <%s>',
$this->name,
$this->email->asString()
@ -33,7 +40,18 @@ class Author {
return $this->name;
}
/**
* @psalm-assert-if-true Email $this->email
*/
public function hasEmail(): bool {
return $this->email !== null;
}
public function getEmail(): Email {
if (!$this->hasEmail()) {
throw new NoEmailAddressException();
}
return $this->email;
}
}

@ -2,14 +2,20 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
class AuthorCollection implements \Countable, \IteratorAggregate {
use Countable;
use IteratorAggregate;
use function count;
/** @template-implements IteratorAggregate<int,Author> */
class AuthorCollection implements Countable, IteratorAggregate {
/** @var Author[] */
private $authors = [];
@ -25,7 +31,7 @@ class AuthorCollection implements \Countable, \IteratorAggregate {
}
public function count(): int {
return \count($this->authors);
return count($this->authors);
}
public function getIterator(): AuthorCollectionIterator {

@ -2,14 +2,19 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
class AuthorCollectionIterator implements \Iterator {
use Iterator;
use function count;
/** @template-implements Iterator<int,Author> */
class AuthorCollectionIterator implements Iterator {
/** @var Author[] */
private $authors;
@ -25,7 +30,7 @@ class AuthorCollectionIterator implements \Iterator {
}
public function valid(): bool {
return $this->position < \count($this->authors);
return $this->position < count($this->authors);
}
public function key(): int {

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;

@ -2,14 +2,20 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
class BundledComponentCollection implements \Countable, \IteratorAggregate {
use Countable;
use IteratorAggregate;
use function count;
/** @template-implements IteratorAggregate<int,BundledComponent> */
class BundledComponentCollection implements Countable, IteratorAggregate {
/** @var BundledComponent[] */
private $bundledComponents = [];
@ -25,7 +31,7 @@ class BundledComponentCollection implements \Countable, \IteratorAggregate {
}
public function count(): int {
return \count($this->bundledComponents);
return count($this->bundledComponents);
}
public function getIterator(): BundledComponentCollectionIterator {

@ -2,14 +2,19 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
class BundledComponentCollectionIterator implements \Iterator {
use Iterator;
use function count;
/** @template-implements Iterator<int,BundledComponent> */
class BundledComponentCollectionIterator implements Iterator {
/** @var BundledComponent[] */
private $bundledComponents;
@ -25,7 +30,7 @@ class BundledComponentCollectionIterator implements \Iterator {
}
public function valid(): bool {
return $this->position < \count($this->bundledComponents);
return $this->position < count($this->bundledComponents);
}
public function key(): int {

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;

@ -2,13 +2,17 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
use const FILTER_VALIDATE_EMAIL;
use function filter_var;
class Email {
/** @var string */
private $email;
@ -24,7 +28,7 @@ class Email {
}
private function ensureEmailIsValid(string $url): void {
if (\filter_var($url, \FILTER_VALIDATE_EMAIL) === false) {
if (filter_var($url, FILTER_VALIDATE_EMAIL) === false) {
throw new InvalidEmailException;
}
}

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
@ -75,7 +76,7 @@ class Manifest {
return $this->type->isExtension();
}
public function isExtensionFor(ApplicationName $application, Version $version = null): bool {
public function isExtensionFor(ApplicationName $application, ?Version $version = null): bool {
if (!$this->isExtension()) {
return false;
}

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;

@ -2,14 +2,20 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
class RequirementCollection implements \Countable, \IteratorAggregate {
use Countable;
use IteratorAggregate;
use function count;
/** @template-implements IteratorAggregate<int,Requirement> */
class RequirementCollection implements Countable, IteratorAggregate {
/** @var Requirement[] */
private $requirements = [];
@ -25,7 +31,7 @@ class RequirementCollection implements \Countable, \IteratorAggregate {
}
public function count(): int {
return \count($this->requirements);
return count($this->requirements);
}
public function getIterator(): RequirementCollectionIterator {

@ -2,14 +2,19 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
class RequirementCollectionIterator implements \Iterator {
use Iterator;
use function count;
/** @template-implements Iterator<int,Requirement> */
class RequirementCollectionIterator implements Iterator {
/** @var Requirement[] */
private $requirements;
@ -25,7 +30,7 @@ class RequirementCollectionIterator implements \Iterator {
}
public function valid(): bool {
return $this->position < \count($this->requirements);
return $this->position < count($this->requirements);
}
public function key(): int {

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;

@ -2,13 +2,17 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
use const FILTER_VALIDATE_URL;
use function filter_var;
class Url {
/** @var string */
private $url;
@ -24,12 +28,10 @@ class Url {
}
/**
* @param string $url
*
* @throws InvalidUrlException
*/
private function ensureUrlIsValid($url): void {
if (\filter_var($url, \FILTER_VALIDATE_URL) === false) {
private function ensureUrlIsValid(string $url): void {
if (filter_var($url, FILTER_VALIDATE_URL) === false) {
throw new InvalidUrlException;
}
}

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
@ -17,4 +18,8 @@ class AuthorElement extends ManifestElement {
public function getEmail(): string {
return $this->getAttributeValue('email');
}
public function hasEMail(): bool {
return $this->hasAttribute('email');
}
}

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;

@ -2,17 +2,24 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
use DOMElement;
use DOMNodeList;
use Iterator;
use ReturnTypeWillChange;
use function count;
use function get_class;
use function sprintf;
abstract class ElementCollection implements \Iterator {
/** @template-implements Iterator<int,DOMElement> */
abstract class ElementCollection implements Iterator {
/** @var DOMElement[] */
private $nodes = [];
@ -24,7 +31,7 @@ abstract class ElementCollection implements \Iterator {
$this->importNodes($nodeList);
}
#[\ReturnTypeWillChange]
#[ReturnTypeWillChange]
abstract public function current();
public function next(): void {
@ -36,7 +43,7 @@ abstract class ElementCollection implements \Iterator {
}
public function valid(): bool {
return $this->position < \count($this->nodes);
return $this->position < count($this->nodes);
}
public function rewind(): void {
@ -51,7 +58,7 @@ abstract class ElementCollection implements \Iterator {
foreach ($nodeList as $node) {
if (!$node instanceof DOMElement) {
throw new ElementCollectionException(
\sprintf('\DOMElement expected, got \%s', \get_class($node))
sprintf('\DOMElement expected, got \%s', get_class($node))
);
}

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;

@ -2,15 +2,24 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
use DOMDocument;
use DOMElement;
use Throwable;
use function count;
use function file_get_contents;
use function is_file;
use function libxml_clear_errors;
use function libxml_get_errors;
use function libxml_use_internal_errors;
use function sprintf;
class ManifestDocument {
public const XMLNS = 'https://phar.io/xml/manifest/1.0';
@ -19,28 +28,31 @@ class ManifestDocument {
private $dom;
public static function fromFile(string $filename): ManifestDocument {
if (!\file_exists($filename)) {
if (!is_file($filename)) {
throw new ManifestDocumentException(
\sprintf('File "%s" not found', $filename)
sprintf('File "%s" not found', $filename)
);
}
return self::fromString(
\file_get_contents($filename)
file_get_contents($filename)
);
}
public static function fromString(string $xmlString): ManifestDocument {
$prev = \libxml_use_internal_errors(true);
\libxml_clear_errors();
$prev = libxml_use_internal_errors(true);
libxml_clear_errors();
try {
$dom = new DOMDocument();
$dom->loadXML($xmlString);
$errors = libxml_get_errors();
libxml_use_internal_errors($prev);
} catch (Throwable $t) {
throw new ManifestDocumentException($t->getMessage(), 0, $t);
}
$errors = \libxml_get_errors();
\libxml_use_internal_errors($prev);
if (\count($errors) !== 0) {
if (count($errors) !== 0) {
throw new ManifestDocumentLoadingException($errors);
}
@ -94,7 +106,7 @@ class ManifestDocument {
if (!$element instanceof DOMElement) {
throw new ManifestDocumentException(
\sprintf('Element %s missing', $elementName)
sprintf('Element %s missing', $elementName)
);
}

@ -2,15 +2,17 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;
use DOMElement;
use DOMNodeList;
use function sprintf;
class ManifestElement {
public const XMLNS = 'https://phar.io/xml/manifest/1.0';
@ -25,7 +27,7 @@ class ManifestElement {
protected function getAttributeValue(string $name): string {
if (!$this->element->hasAttribute($name)) {
throw new ManifestElementException(
\sprintf(
sprintf(
'Attribute %s not set on element %s',
$name,
$this->element->localName
@ -36,12 +38,16 @@ class ManifestElement {
return $this->element->getAttribute($name);
}
protected function hasAttribute(string $name): bool {
return $this->element->hasAttribute($name);
}
protected function getChildByName(string $elementName): DOMElement {
$element = $this->element->getElementsByTagNameNS(self::XMLNS, $elementName)->item(0);
if (!$element instanceof DOMElement) {
throw new ManifestElementException(
\sprintf('Element %s missing', $elementName)
sprintf('Element %s missing', $elementName)
);
}
@ -53,7 +59,7 @@ class ManifestElement {
if ($elementList->length === 0) {
throw new ManifestElementException(
\sprintf('Element(s) %s missing', $elementName)
sprintf('Element(s) %s missing', $elementName)
);
}

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;

@ -2,10 +2,11 @@
/*
* This file is part of PharIo\Manifest.
*
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/
namespace PharIo\Manifest;

@ -1,97 +0,0 @@
# ChangeLog
All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
## [10.1.11] - 2023-12-21
### Changed
* This component is now compatible with `nikic/php-parser` 5.0
## [10.1.10] - 2023-12-11
### Fixed
* [#1023](https://github.com/sebastianbergmann/php-code-coverage/issues/1023): Branch Coverage and Path Coverage are not correctly reported for traits
## [10.1.9] - 2023-11-23
### Fixed
* [#1020](https://github.com/sebastianbergmann/php-code-coverage/issues/1020): Single line method is ignored
## [10.1.8] - 2023-11-15
### Fixed
* [#1018](https://github.com/sebastianbergmann/php-code-coverage/issues/1018): Interface methods are not ignored when their signature is split over multiple lines
## [10.1.7] - 2023-10-04
### Fixed
* [#1014](https://github.com/sebastianbergmann/php-code-coverage/issues/1014): Incorrect statement count in coverage report for constructor property promotion
## [10.1.6] - 2023-09-19
### Fixed
* [#1012](https://github.com/sebastianbergmann/php-code-coverage/issues/1012): Cobertura report pulls functions from report scope, not the individual element
## [10.1.5] - 2023-09-12
### Changed
* [#1011](https://github.com/sebastianbergmann/php-code-coverage/pull/1011): Avoid serialization of cache data in PHP report
## [10.1.4] - 2023-08-31
### Fixed
* Exceptions of type `SebastianBergmann\Template\Exception` are now properly handled
## [10.1.3] - 2023-07-26
### Changed
* The result of `CodeCoverage::getReport()` is now cached
### Fixed
* Static analysis cache keys do not include configuration settings that affect source code parsing
* The Clover, Cobertura, Crap4j, and PHP report writers no longer create a `php:` directory when they should write to `php://stdout`, for instance
## [10.1.2] - 2023-05-22
### Fixed
* [#998](https://github.com/sebastianbergmann/php-code-coverage/pull/998): Group Use Declarations are not handled properly
## [10.1.1] - 2023-04-17
### Fixed
* [#994](https://github.com/sebastianbergmann/php-code-coverage/issues/994): Argument `$linesToBeIgnored` of `CodeCoverage::stop()` has no effect for files that are not executed at all
## [10.1.0] - 2023-04-13
### Added
* [#982](https://github.com/sebastianbergmann/php-code-coverage/issues/982): Add option to ignore lines from code coverage
### Deprecated
* The `SebastianBergmann\CodeCoverage\Filter::includeDirectory()`, `SebastianBergmann\CodeCoverage\Filter::excludeDirectory()`, and `SebastianBergmann\CodeCoverage\Filter::excludeFile()` methods are now deprecated
[10.1.11]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.10...10.1.11
[10.1.10]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.9...10.1.10
[10.1.9]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.8...10.1.9
[10.1.8]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.7...10.1.8
[10.1.7]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.6...10.1.7
[10.1.6]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.5...10.1.6
[10.1.5]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.4...10.1.5
[10.1.4]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.3...10.1.4
[10.1.3]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.2...10.1.3
[10.1.2]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.1...10.1.2
[10.1.1]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.0...10.1.1
[10.1.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.0.2...10.1.0

@ -1,6 +1,6 @@
BSD 3-Clause License
Copyright (c) 2009-2023, Sebastian Bergmann
Copyright (c) 2009-2024, Sebastian Bergmann
All rights reserved.
Redistribution and use in source and binary forms, with or without

@ -22,29 +22,29 @@
},
"config": {
"platform": {
"php": "8.1.0"
"php": "8.2.0"
},
"optimize-autoloader": true,
"sort-packages": true
},
"prefer-stable": true,
"require": {
"php": ">=8.1",
"php": ">=8.2",
"ext-dom": "*",
"ext-libxml": "*",
"ext-xmlwriter": "*",
"nikic/php-parser": "^4.18 || ^5.0",
"phpunit/php-file-iterator": "^4.0",
"phpunit/php-text-template": "^3.0",
"sebastian/code-unit-reverse-lookup": "^3.0",
"sebastian/complexity": "^3.0",
"sebastian/environment": "^6.0",
"sebastian/lines-of-code": "^2.0",
"sebastian/version": "^4.0",
"nikic/php-parser": "^5.0",
"phpunit/php-file-iterator": "^5.0",
"phpunit/php-text-template": "^4.0",
"sebastian/code-unit-reverse-lookup": "^4.0",
"sebastian/complexity": "^4.0",
"sebastian/environment": "^7.0",
"sebastian/lines-of-code": "^3.0",
"sebastian/version": "^5.0",
"theseer/tokenizer": "^1.2.0"
},
"require-dev": {
"phpunit/phpunit": "^10.1"
"phpunit/phpunit": "^11.0"
},
"suggest": {
"ext-pcov": "PHP extension that provides line coverage",
@ -63,7 +63,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "10.1-dev"
"dev-main": "11.0-dev"
}
}
}

@ -160,7 +160,7 @@ final class CodeCoverage
$this->tests = $tests;
}
public function start(string $id, TestSize $size = null, bool $clear = false): void
public function start(string $id, ?TestSize $size = null, bool $clear = false): void
{
if ($clear) {
$this->clear();
@ -177,13 +177,13 @@ final class CodeCoverage
/**
* @psalm-param array<string,list<int>> $linesToBeIgnored
*/
public function stop(bool $append = true, TestStatus $status = null, array|false $linesToBeCovered = [], array $linesToBeUsed = [], array $linesToBeIgnored = []): RawCodeCoverageData
public function stop(bool $append = true, ?TestStatus $status = null, array|false $linesToBeCovered = [], array $linesToBeUsed = [], array $linesToBeIgnored = []): RawCodeCoverageData
{
$data = $this->driver->stop();
$this->linesToBeIgnored = array_merge_recursive(
$this->linesToBeIgnored,
$linesToBeIgnored
$linesToBeIgnored,
);
$this->append($data, null, $append, $status, $linesToBeCovered, $linesToBeUsed, $linesToBeIgnored);
@ -202,7 +202,7 @@ final class CodeCoverage
* @throws TestIdMissingException
* @throws UnintentionallyCoveredCodeException
*/
public function append(RawCodeCoverageData $rawData, string $id = null, bool $append = true, TestStatus $status = null, array|false $linesToBeCovered = [], array $linesToBeUsed = [], array $linesToBeIgnored = []): void
public function append(RawCodeCoverageData $rawData, ?string $id = null, bool $append = true, ?TestStatus $status = null, array|false $linesToBeCovered = [], array $linesToBeUsed = [], array $linesToBeIgnored = []): void
{
if ($id === null) {
$id = $this->currentId;
@ -246,7 +246,7 @@ final class CodeCoverage
$rawData,
$linesToBeCovered,
$linesToBeUsed,
$size
$size,
);
if (empty($rawData->lineCoverage())) {
@ -267,7 +267,7 @@ final class CodeCoverage
public function merge(self $that): void
{
$this->filter->includeFiles(
$that->filter()->files()
$that->filter()->files(),
);
$this->data->merge($that->data);
@ -342,7 +342,7 @@ final class CodeCoverage
{
if (!$this->cachesStaticAnalysis()) {
throw new StaticAnalysisCacheNotConfiguredException(
'The static analysis cache is not configured'
'The static analysis cache is not configured',
);
}
@ -436,12 +436,12 @@ final class CodeCoverage
$data->keepLineCoverageDataOnlyForLines(
$filename,
array_keys($linesToBranchMap)
array_keys($linesToBranchMap),
);
$data->markExecutableLineByBranch(
$filename,
$linesToBranchMap
$linesToBranchMap,
);
}
}
@ -459,13 +459,13 @@ final class CodeCoverage
if (isset($linesToBeIgnored[$filename])) {
$data->removeCoverageDataForLines(
$filename,
$linesToBeIgnored[$filename]
$linesToBeIgnored[$filename],
);
}
$data->removeCoverageDataForLines(
$filename,
$this->analyser()->ignoredLinesFor($filename)
$this->analyser()->ignoredLinesFor($filename),
);
}
}
@ -477,7 +477,7 @@ final class CodeCoverage
{
$uncoveredFiles = array_diff(
$this->filter->files(),
$this->data->coveredFiles()
$this->data->coveredFiles(),
);
foreach ($uncoveredFiles as $uncoveredFile) {
@ -485,10 +485,10 @@ final class CodeCoverage
$this->append(
RawCodeCoverageData::fromUncoveredFile(
$uncoveredFile,
$this->analyser()
$this->analyser(),
),
self::UNCOVERED_FILES,
linesToBeIgnored: $this->linesToBeIgnored
linesToBeIgnored: $this->linesToBeIgnored,
);
}
}
@ -502,7 +502,7 @@ final class CodeCoverage
{
$allowedLines = $this->getAllowedLines(
$linesToBeCovered,
$linesToBeUsed
$linesToBeUsed,
);
$unintentionallyCoveredUnits = [];
@ -519,7 +519,7 @@ final class CodeCoverage
if (!empty($unintentionallyCoveredUnits)) {
throw new UnintentionallyCoveredCodeException(
$unintentionallyCoveredUnits
$unintentionallyCoveredUnits,
);
}
}
@ -535,7 +535,7 @@ final class CodeCoverage
$allowedLines[$file] = array_merge(
$allowedLines[$file],
$linesToBeCovered[$file]
$linesToBeCovered[$file],
);
}
@ -546,13 +546,13 @@ final class CodeCoverage
$allowedLines[$file] = array_merge(
$allowedLines[$file],
$linesToBeUsed[$file]
$linesToBeUsed[$file],
);
}
foreach (array_keys($allowedLines) as $file) {
$allowedLines[$file] = array_flip(
array_unique($allowedLines[$file])
array_unique($allowedLines[$file]),
);
}
@ -592,7 +592,7 @@ final class CodeCoverage
throw new ReflectionException(
$e->getMessage(),
$e->getCode(),
$e
$e,
);
}
@ -614,7 +614,7 @@ final class CodeCoverage
$this->analyser = new ParsingFileAnalyser(
$this->useAnnotationsForIgnoringCode,
$this->ignoreDeprecatedCode
$this->ignoreDeprecatedCode,
);
if ($this->cachesStaticAnalysis()) {
@ -622,7 +622,7 @@ final class CodeCoverage
$this->cacheDirectory,
$this->analyser,
$this->useAnnotationsForIgnoringCode,
$this->ignoreDeprecatedCode
$this->ignoreDeprecatedCode,
);
}

@ -164,8 +164,8 @@ final class ProcessedCodeCoverageData
$compareLineNumbers = array_unique(
array_merge(
array_keys($this->lineCoverage[$file]),
array_keys($newData->lineCoverage[$file])
)
array_keys($newData->lineCoverage[$file]),
),
);
foreach ($compareLineNumbers as $line) {
@ -176,7 +176,7 @@ final class ProcessedCodeCoverageData
$this->lineCoverage[$file][$line] = $newData->lineCoverage[$file][$line];
} elseif ($thatPriority === $thisPriority && is_array($this->lineCoverage[$file][$line])) {
$this->lineCoverage[$file][$line] = array_unique(
array_merge($this->lineCoverage[$file][$line], $newData->lineCoverage[$file][$line])
array_merge($this->lineCoverage[$file][$line], $newData->lineCoverage[$file][$line]),
);
}
}

@ -144,7 +144,7 @@ final class RawCodeCoverageData
$this->lineCoverage[$filename] = array_intersect_key(
$this->lineCoverage[$filename],
array_flip($lines)
array_flip($lines),
);
}
@ -223,7 +223,7 @@ final class RawCodeCoverageData
$this->lineCoverage[$filename] = array_diff_key(
$this->lineCoverage[$filename],
array_flip($lines)
array_flip($lines),
);
if (isset($this->functionCoverage[$filename])) {

@ -75,8 +75,8 @@ abstract class Driver
throw new BranchAndPathCoverageNotSupportedException(
sprintf(
'%s does not support branch and path coverage',
$this->nameAndVersion()
)
$this->nameAndVersion(),
),
);
}
@ -107,8 +107,8 @@ abstract class Driver
throw new DeadCodeDetectionNotSupportedException(
sprintf(
'%s does not support dead code detection',
$this->nameAndVersion()
)
$this->nameAndVersion(),
),
);
}

@ -75,7 +75,7 @@ final class XdebugDriver extends Driver
xdebug_set_filter(
XDEBUG_FILTER_CODE_COVERAGE,
XDEBUG_PATH_INCLUDE,
$filter->files()
$filter->files(),
);
}
}

@ -14,7 +14,6 @@ use function is_file;
use function realpath;
use function str_contains;
use function str_starts_with;
use SebastianBergmann\FileIterator\Facade as FileIteratorFacade;
final class Filter
{
@ -28,16 +27,6 @@ final class Filter
*/
private array $isFileCache = [];
/**
* @deprecated
*/
public function includeDirectory(string $directory, string $suffix = '.php', string $prefix = ''): void
{
foreach ((new FileIteratorFacade)->getFilesAsArray($directory, $suffix, $prefix) as $file) {
$this->includeFile($file);
}
}
/**
* @psalm-param list<string> $files
*/
@ -59,30 +48,6 @@ final class Filter
$this->files[$filename] = true;
}
/**
* @deprecated
*/
public function excludeDirectory(string $directory, string $suffix = '.php', string $prefix = ''): void
{
foreach ((new FileIteratorFacade)->getFilesAsArray($directory, $suffix, $prefix) as $file) {
$this->excludeFile($file);
}
}
/**
* @deprecated
*/
public function excludeFile(string $filename): void
{
$filename = realpath($filename);
if (!$filename || !isset($this->files[$filename])) {
return;
}
unset($this->files[$filename]);
}
public function isFile(string $filename): bool
{
if (isset($this->isFileCache[$filename])) {

@ -33,7 +33,7 @@ abstract class AbstractNode implements Countable
private readonly ?AbstractNode $parent;
private string $id;
public function __construct(string $name, self $parent = null)
public function __construct(string $name, ?self $parent = null)
{
if (str_ends_with($name, DIRECTORY_SEPARATOR)) {
$name = substr($name, 0, -1);
@ -131,7 +131,7 @@ abstract class AbstractNode implements Countable
{
return Percentage::fromFractionAndTotal(
$this->numberOfExecutedBranches(),
$this->numberOfExecutableBranches()
$this->numberOfExecutableBranches(),
);
}
@ -139,7 +139,7 @@ abstract class AbstractNode implements Countable
{
return Percentage::fromFractionAndTotal(
$this->numberOfExecutedPaths(),
$this->numberOfExecutablePaths()
$this->numberOfExecutablePaths(),
);
}

@ -45,13 +45,13 @@ final class Builder
$commonPath = $this->reducePaths($data);
$root = new Directory(
$commonPath,
null
null,
);
$this->addItems(
$root,
$this->buildDirectoryStructure($data),
$coverage->getTests()
$coverage->getTests(),
);
return $root;
@ -80,8 +80,8 @@ final class Builder
$this->analyser->classesIn($filename),
$this->analyser->traitsIn($filename),
$this->analyser->functionsIn($filename),
$this->analyser->linesOfCodeFor($filename)
)
$this->analyser->linesOfCodeFor($filename),
),
);
}
} else {

@ -37,7 +37,7 @@ final class CrapIndex
return sprintf(
'%01.2F',
$this->cyclomaticComplexity ** 2 * (1 - $this->codeCoverage / 100) ** 3 + $this->cyclomaticComplexity
$this->cyclomaticComplexity ** 2 * (1 - $this->codeCoverage / 100) ** 3 + $this->cyclomaticComplexity,
);
}
}

@ -76,7 +76,7 @@ final class Directory extends AbstractNode implements IteratorAggregate
{
return new RecursiveIteratorIterator(
new Iterator($this),
RecursiveIteratorIterator::SELF_FIRST
RecursiveIteratorIterator::SELF_FIRST,
);
}
@ -122,7 +122,7 @@ final class Directory extends AbstractNode implements IteratorAggregate
foreach ($this->children as $child) {
$this->classes = array_merge(
$this->classes,
$child->classes()
$child->classes(),
);
}
}
@ -138,7 +138,7 @@ final class Directory extends AbstractNode implements IteratorAggregate
foreach ($this->children as $child) {
$this->traits = array_merge(
$this->traits,
$child->traits()
$child->traits(),
);
}
}
@ -154,7 +154,7 @@ final class Directory extends AbstractNode implements IteratorAggregate
foreach ($this->children as $child) {
$this->functions = array_merge(
$this->functions,
$child->functions()
$child->functions(),
);
}
}

@ -587,7 +587,7 @@ final class File extends AbstractNode
if (isset($this->functionCoverageData[$functionName]['branches'])) {
$this->functions[$functionName]['executableBranches'] = count(
$this->functionCoverageData[$functionName]['branches']
$this->functionCoverageData[$functionName]['branches'],
);
$this->functions[$functionName]['executedBranches'] = count(
@ -596,14 +596,14 @@ final class File extends AbstractNode
static function (array $branch)
{
return (bool) $branch['hit'];
}
)
},
),
);
}
if (isset($this->functionCoverageData[$functionName]['paths'])) {
$this->functions[$functionName]['executablePaths'] = count(
$this->functionCoverageData[$functionName]['paths']
$this->functionCoverageData[$functionName]['paths'],
);
$this->functions[$functionName]['executedPaths'] = count(
@ -612,8 +612,8 @@ final class File extends AbstractNode
static function (array $path)
{
return (bool) $path['hit'];
}
)
},
),
);
}
@ -653,7 +653,7 @@ final class File extends AbstractNode
if (isset($this->functionCoverageData[$key]['branches'])) {
$methodData['executableBranches'] = count(
$this->functionCoverageData[$key]['branches']
$this->functionCoverageData[$key]['branches'],
);
$methodData['executedBranches'] = count(
@ -662,14 +662,14 @@ final class File extends AbstractNode
static function (array $branch)
{
return (bool) $branch['hit'];
}
)
},
),
);
}
if (isset($this->functionCoverageData[$key]['paths'])) {
$methodData['executablePaths'] = count(
$this->functionCoverageData[$key]['paths']
$this->functionCoverageData[$key]['paths'],
);
$methodData['executedPaths'] = count(
@ -678,8 +678,8 @@ final class File extends AbstractNode
static function (array $path)
{
return (bool) $path['hit'];
}
)
},
),
);
}

@ -16,7 +16,7 @@ use function is_string;
use function ksort;
use function max;
use function range;
use function strpos;
use function str_contains;
use function time;
use DOMDocument;
use SebastianBergmann\CodeCoverage\CodeCoverage;
@ -115,28 +115,28 @@ final class Clover
if (!empty($class['package']['fullPackage'])) {
$xmlClass->setAttribute(
'fullPackage',
$class['package']['fullPackage']
$class['package']['fullPackage'],
);
}
if (!empty($class['package']['category'])) {
$xmlClass->setAttribute(
'category',
$class['package']['category']
$class['package']['category'],
);
}
if (!empty($class['package']['package'])) {
$xmlClass->setAttribute(
'package',
$class['package']['package']
$class['package']['package'],
);
}
if (!empty($class['package']['subpackage'])) {
$xmlClass->setAttribute(
'subpackage',
$class['package']['subpackage']
$class['package']['subpackage'],
);
}
@ -213,7 +213,7 @@ final class Clover
} else {
if (!isset($packages[$namespace])) {
$packages[$namespace] = $xmlDocument->createElement(
'package'
'package',
);
$packages[$namespace]->setAttribute('name', $namespace);
@ -244,7 +244,7 @@ final class Clover
$buffer = $xmlDocument->saveXML();
if ($target !== null) {
if (!strpos($target, '://') !== false) {
if (!str_contains($target, '://')) {
Filesystem::createDirectory(dirname($target));
}

@ -15,8 +15,8 @@ use function dirname;
use function file_put_contents;
use function preg_match;
use function range;
use function str_contains;
use function str_replace;
use function strpos;
use function time;
use DOMImplementation;
use SebastianBergmann\CodeCoverage\CodeCoverage;
@ -40,7 +40,7 @@ final class Cobertura
$documentType = $implementation->createDocumentType(
'coverage',
'',
'http://cobertura.sourceforge.net/xml/coverage-04.dtd'
'http://cobertura.sourceforge.net/xml/coverage-04.dtd',
);
$document = $implementation->createDocument('', '', $documentType);
@ -295,7 +295,7 @@ final class Cobertura
$buffer = $document->saveXML();
if ($target !== null) {
if (!strpos($target, '://') !== false) {
if (!str_contains($target, '://')) {
Filesystem::createDirectory(dirname($target));
}

@ -15,7 +15,7 @@ use function file_put_contents;
use function htmlspecialchars;
use function is_string;
use function round;
use function strpos;
use function str_contains;
use DOMDocument;
use SebastianBergmann\CodeCoverage\CodeCoverage;
use SebastianBergmann\CodeCoverage\Driver\WriteOperationFailedException;
@ -122,7 +122,7 @@ final class Crap4j
$buffer = $document->saveXML();
if ($target !== null) {
if (!strpos($target, '://') !== false) {
if (!str_contains($target, '://')) {
Filesystem::createDirectory(dirname($target));
}

@ -31,7 +31,7 @@ final class CustomCssFile
{
if (!is_file($path)) {
throw new InvalidArgumentException(
'$path does not exist'
'$path does not exist',
);
}

@ -50,7 +50,7 @@ final class Facade
$this->generator,
$date,
$this->thresholds,
$coverage->collectsBranchAndPathCoverage()
$coverage->collectsBranchAndPathCoverage(),
);
$directory = new Directory(
@ -58,7 +58,7 @@ final class Facade
$this->generator,
$date,
$this->thresholds,
$coverage->collectsBranchAndPathCoverage()
$coverage->collectsBranchAndPathCoverage(),
);
$file = new File(
@ -66,7 +66,7 @@ final class Facade
$this->generator,
$date,
$this->thresholds,
$coverage->collectsBranchAndPathCoverage()
$coverage->collectsBranchAndPathCoverage(),
);
$directory->render($report, $target . 'index.html');
@ -126,7 +126,7 @@ final class Facade
'success-high' => $this->colors->successHigh(),
'warning' => $this->colors->warning(),
'danger' => $this->colors->danger(),
]
],
);
try {
@ -135,7 +135,7 @@ final class Facade
throw new FileCouldNotBeWrittenException(
$e->getMessage(),
$e->getCode(),
$e
$e,
);
}
}

@ -55,7 +55,7 @@ abstract class Renderer
$data['numClasses'];
$classesBar = $this->coverageBar(
$data['testedClassesPercent']
$data['testedClassesPercent'],
);
} else {
$classesLevel = '';
@ -71,7 +71,7 @@ abstract class Renderer
$data['numMethods'];
$methodsBar = $this->coverageBar(
$data['testedMethodsPercent']
$data['testedMethodsPercent'],
);
} else {
$methodsLevel = '';
@ -87,7 +87,7 @@ abstract class Renderer
$data['numExecutableLines'];
$linesBar = $this->coverageBar(
$data['linesExecutedPercent']
$data['linesExecutedPercent'],
);
} else {
$linesLevel = '';
@ -103,7 +103,7 @@ abstract class Renderer
$data['numExecutablePaths'];
$pathsBar = $this->coverageBar(
$data['pathsExecutedPercent']
$data['pathsExecutedPercent'],
);
} else {
$pathsLevel = '';
@ -119,7 +119,7 @@ abstract class Renderer
$data['numExecutableBranches'];
$branchesBar = $this->coverageBar(
$data['branchesExecutedPercent']
$data['branchesExecutedPercent'],
);
} else {
$branchesLevel = '';
@ -153,7 +153,7 @@ abstract class Renderer
'classes_tested_percent' => $data['testedClassesPercentAsString'] ?? '',
'classes_level' => $classesLevel,
'classes_number' => $classesNumber,
]
],
);
return $template->render();
@ -173,7 +173,7 @@ abstract class Renderer
'generator' => $this->generator,
'low_upper_bound' => $this->thresholds->lowUpperBound(),
'high_lower_bound' => $this->thresholds->highLowerBound(),
]
],
);
}
@ -196,7 +196,7 @@ abstract class Renderer
if ($step !== $node) {
$breadcrumbs .= $this->inactiveBreadcrumb(
$step,
array_pop($pathToRoot)
array_pop($pathToRoot),
);
} else {
$breadcrumbs .= $this->activeBreadcrumb($step);
@ -210,7 +210,7 @@ abstract class Renderer
{
$buffer = sprintf(
' <li class="breadcrumb-item active">%s</li>' . "\n",
$node->name()
$node->name(),
);
if ($node instanceof DirectoryNode) {
@ -225,7 +225,7 @@ abstract class Renderer
return sprintf(
' <li class="breadcrumb-item"><a href="%sindex.html">%s</a></li>' . "\n",
$pathToRoot,
$node->name()
$node->name(),
);
}
@ -250,7 +250,7 @@ abstract class Renderer
$template = new Template(
$templateName,
'{{',
'}}'
'}}',
);
$template->setVar(['level' => $level, 'percent' => sprintf('%.2F', $percent)]);
@ -280,7 +280,7 @@ abstract class Renderer
'<a href="%s" target="_top">%s %s</a>',
$runtime->getVendorUrl(),
$runtime->getName(),
$runtime->getVersion()
$runtime->getVersion(),
);
}
}

@ -36,7 +36,7 @@ final class Dashboard extends Renderer
$template = new Template(
$templateName,
'{{',
'}}'
'}}',
);
$this->setCommonTemplateVariables($template, $node);
@ -57,7 +57,7 @@ final class Dashboard extends Renderer
'complexity_method' => $complexity['method'],
'class_coverage_distribution' => $coverageDistribution['class'],
'method_coverage_distribution' => $coverageDistribution['method'],
]
],
);
try {
@ -66,7 +66,7 @@ final class Dashboard extends Renderer
throw new FileCouldNotBeWrittenException(
$e->getMessage(),
$e->getCode(),
$e
$e,
);
}
}
@ -76,7 +76,7 @@ final class Dashboard extends Renderer
return sprintf(
' <li class="breadcrumb-item"><a href="index.html">%s</a></li>' . "\n" .
' <li class="breadcrumb-item active">(Dashboard)</li>' . "\n",
$node->name()
$node->name(),
);
}
@ -99,7 +99,7 @@ final class Dashboard extends Renderer
sprintf(
'<a href="%s">%s</a>',
str_replace($baseLink, '', $method['link']),
$methodName
$methodName,
),
];
}
@ -110,7 +110,7 @@ final class Dashboard extends Renderer
sprintf(
'<a href="%s">%s</a>',
str_replace($baseLink, '', $class['link']),
$className
$className,
),
];
}
@ -222,7 +222,7 @@ final class Dashboard extends Renderer
' <tr><td><a href="%s">%s</a></td><td class="text-right">%d%%</td></tr>' . "\n",
str_replace($baseLink, '', $classes[$className]['link']),
$className,
$coverage
$coverage,
);
}
@ -234,7 +234,7 @@ final class Dashboard extends Renderer
str_replace($baseLink, '', $classes[$class]['methods'][$method]['link']),
$methodName,
$method,
$coverage
$coverage,
);
}
@ -277,7 +277,7 @@ final class Dashboard extends Renderer
' <tr><td><a href="%s">%s</a></td><td class="text-right">%d</td></tr>' . "\n",
str_replace($baseLink, '', $classes[$className]['link']),
$className,
$crap
$crap,
);
}
@ -289,7 +289,7 @@ final class Dashboard extends Renderer
str_replace($baseLink, '', $classes[$class]['methods'][$method]['link']),
$methodName,
$method,
$crap
$crap,
);
}

@ -44,7 +44,7 @@ final class Directory extends Renderer
[
'id' => $node->id(),
'items' => $items,
]
],
);
try {
@ -53,7 +53,7 @@ final class Directory extends Renderer
throw new FileCouldNotBeWrittenException(
$e->getMessage(),
$e->getCode(),
$e
$e,
);
}
}
@ -93,7 +93,7 @@ final class Directory extends Renderer
$data['name'] = sprintf(
'<a href="%s/index.html">%s</a>',
$node->name(),
$node->name()
$node->name(),
);
$data['icon'] = sprintf('<img src="%s_icons/file-directory.svg" class="octicon" />', $up);
} elseif ($this->hasBranchCoverage) {
@ -102,13 +102,13 @@ final class Directory extends Renderer
$node->name(),
$node->name(),
$node->name(),
$node->name()
$node->name(),
);
} else {
$data['name'] = sprintf(
'<a href="%s.html">%s</a>',
$node->name(),
$node->name()
$node->name(),
);
}
}
@ -117,7 +117,7 @@ final class Directory extends Renderer
return $this->renderItemTemplate(
new Template($templateName, '{{', '}}'),
$data
$data,
);
}
}

@ -196,7 +196,7 @@ final class File extends Renderer
'lines' => $this->renderSourceWithLineCoverage($node),
'legend' => '<p><span class="legend covered-by-small-tests">Covered by small (and larger) tests</span><span class="legend covered-by-medium-tests">Covered by medium (and large) tests</span><span class="legend covered-by-large-tests">Covered by large tests (and tests of unknown size)</span><span class="legend not-covered">Not covered</span><span class="legend not-coverable">Not coverable</span></p>',
'structure' => '',
]
],
);
try {
@ -205,7 +205,7 @@ final class File extends Renderer
throw new FileCouldNotBeWrittenException(
$e->getMessage(),
$e->getCode(),
$e
$e,
);
}
@ -216,7 +216,7 @@ final class File extends Renderer
'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),
]
],
);
try {
@ -225,7 +225,7 @@ final class File extends Renderer
throw new FileCouldNotBeWrittenException(
$e->getMessage(),
$e->getCode(),
$e
$e,
);
}
@ -235,7 +235,7 @@ final class File extends Renderer
'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),
]
],
);
try {
@ -244,7 +244,7 @@ final class File extends Renderer
throw new FileCouldNotBeWrittenException(
$e->getMessage(),
$e->getCode(),
$e
$e,
);
}
}
@ -259,7 +259,7 @@ final class File extends Renderer
$methodItemTemplate = new Template(
$methodTemplateName,
'{{',
'}}'
'}}',
);
$items = $this->renderItemTemplate(
@ -287,24 +287,24 @@ final class File extends Renderer
'testedClassesPercent' => $node->percentageOfTestedClassesAndTraits()->asFloat(),
'testedClassesPercentAsString' => $node->percentageOfTestedClassesAndTraits()->asString(),
'crap' => '<abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr>',
]
],
);
$items .= $this->renderFunctionItems(
$node->functions(),
$methodItemTemplate
$methodItemTemplate,
);
$items .= $this->renderTraitOrClassItems(
$node->traits(),
$template,
$methodItemTemplate
$methodItemTemplate,
);
$items .= $this->renderTraitOrClassItems(
$node->classes(),
$template,
$methodItemTemplate
$methodItemTemplate,
);
return $items;
@ -337,15 +337,15 @@ final class File extends Renderer
$numTestedClasses = $numTestedMethods === $numMethods ? 1 : 0;
$linesExecutedPercentAsString = Percentage::fromFractionAndTotal(
$item['executedLines'],
$item['executableLines']
$item['executableLines'],
)->asString();
$branchesExecutedPercentAsString = Percentage::fromFractionAndTotal(
$item['executedBranches'],
$item['executableBranches']
$item['executableBranches'],
)->asString();
$pathsExecutedPercentAsString = Percentage::fromFractionAndTotal(
$item['executedPaths'],
$item['executablePaths']
$item['executablePaths'],
)->asString();
} else {
$numClasses = 0;
@ -357,12 +357,12 @@ final class File extends Renderer
$testedMethodsPercentage = Percentage::fromFractionAndTotal(
$numTestedMethods,
$numMethods
$numMethods,
);
$testedClassesPercentage = Percentage::fromFractionAndTotal(
$numTestedMethods === $numMethods ? 1 : 0,
1
1,
);
$buffer .= $this->renderItemTemplate(
@ -389,7 +389,7 @@ final class File extends Renderer
'numExecutableBranches' => $item['executableBranches'],
'pathsExecutedPercent' => Percentage::fromFractionAndTotal(
$item['executedPaths'],
$item['executablePaths']
$item['executablePaths'],
)->asFloat(),
'pathsExecutedPercentAsString' => $pathsExecutedPercentAsString,
'numExecutedPaths' => $item['executedPaths'],
@ -399,14 +399,14 @@ final class File extends Renderer
'testedClassesPercent' => $testedClassesPercentage->asFloat(),
'testedClassesPercentAsString' => $testedClassesPercentage->asString(),
'crap' => $item['crap'],
]
],
);
foreach ($item['methods'] as $method) {
$buffer .= $this->renderFunctionOrMethodItem(
$methodItemTemplate,
$method,
'&nbsp;'
'&nbsp;',
);
}
}
@ -425,7 +425,7 @@ final class File extends Renderer
foreach ($functions as $function) {
$buffer .= $this->renderFunctionOrMethodItem(
$template,
$function
$function,
);
}
@ -447,22 +447,22 @@ final class File extends Renderer
$executedLinesPercentage = Percentage::fromFractionAndTotal(
$item['executedLines'],
$item['executableLines']
$item['executableLines'],
);
$executedBranchesPercentage = Percentage::fromFractionAndTotal(
$item['executedBranches'],
$item['executableBranches']
$item['executableBranches'],
);
$executedPathsPercentage = Percentage::fromFractionAndTotal(
$item['executedPaths'],
$item['executablePaths']
$item['executablePaths'],
);
$testedMethodsPercentage = Percentage::fromFractionAndTotal(
$numTestedMethods,
1
1,
);
return $this->renderItemTemplate(
@ -473,7 +473,7 @@ final class File extends Renderer
$indent,
$item['startLine'],
htmlspecialchars($item['signature'], $this->htmlSpecialCharsFlags),
$item['functionName'] ?? $item['methodName']
$item['functionName'] ?? $item['methodName'],
),
'numMethods' => $numMethods,
'numTestedMethods' => $numTestedMethods,
@ -492,7 +492,7 @@ final class File extends Renderer
'testedMethodsPercent' => $testedMethodsPercentage->asFloat(),
'testedMethodsPercentAsString' => $testedMethodsPercentage->asString(),
'crap' => $item['crap'],
]
],
);
}
@ -550,7 +550,7 @@ final class File extends Renderer
$popover = sprintf(
' data-title="%s" data-content="%s" data-placement="top" data-html="true"',
$popoverTitle,
htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags)
htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags),
);
}
@ -637,7 +637,7 @@ final class File extends Renderer
$popover = sprintf(
' data-title="%s" data-content="%s" data-placement="top" data-html="true"',
$popoverTitle,
htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags)
htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags),
);
}
@ -727,7 +727,7 @@ final class File extends Renderer
$popover = sprintf(
' data-title="%s" data-content="%s" data-placement="top" data-html="true"',
$popoverTitle,
htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags)
htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags),
);
}
@ -825,7 +825,7 @@ final class File extends Renderer
$popover = sprintf(
' data-title="%s" data-content="%s" data-placement="top" data-html="true"',
$popoverTitle,
htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags)
htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags),
);
}
@ -940,7 +940,7 @@ final class File extends Renderer
$popover = sprintf(
' data-title="%s" data-content="%s" data-placement="top" data-html="true"',
$popoverTitle,
htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags)
htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags),
);
}
@ -965,7 +965,7 @@ final class File extends Renderer
'lineContent' => $lineContent,
'class' => $class,
'popover' => $popover,
]
],
);
return $template->render();
@ -991,14 +991,14 @@ final class File extends Renderer
if ($token === '"' && $tokens[$j - 1] !== '\\') {
$result[$i] .= sprintf(
'<span class="string">%s</span>',
htmlspecialchars($token, $this->htmlSpecialCharsFlags)
htmlspecialchars($token, $this->htmlSpecialCharsFlags),
);
$stringFlag = !$stringFlag;
} else {
$result[$i] .= sprintf(
'<span class="keyword">%s</span>',
htmlspecialchars($token, $this->htmlSpecialCharsFlags)
htmlspecialchars($token, $this->htmlSpecialCharsFlags),
);
}
@ -1010,7 +1010,7 @@ final class File extends Renderer
$value = str_replace(
["\t", ' '],
['&nbsp;&nbsp;&nbsp;&nbsp;', '&nbsp;'],
htmlspecialchars($value, $this->htmlSpecialCharsFlags)
htmlspecialchars($value, $this->htmlSpecialCharsFlags),
);
if ($value === "\n") {
@ -1039,7 +1039,7 @@ final class File extends Renderer
$result[$i] .= sprintf(
'<span class="%s">%s</span>',
$colour,
$line
$line,
);
}
@ -1067,7 +1067,7 @@ final class File extends Renderer
$className = sprintf(
'<abbr title="%s">%s</abbr>',
$className,
array_pop($tmp)
array_pop($tmp),
);
}
@ -1109,7 +1109,7 @@ final class File extends Renderer
return sprintf(
'<li%s>%s</li>',
$testCSS,
htmlspecialchars($test, $this->htmlSpecialCharsFlags)
htmlspecialchars($test, $this->htmlSpecialCharsFlags),
);
}

@ -12,7 +12,7 @@ namespace SebastianBergmann\CodeCoverage\Report;
use function dirname;
use function file_put_contents;
use function serialize;
use function strpos;
use function str_contains;
use SebastianBergmann\CodeCoverage\CodeCoverage;
use SebastianBergmann\CodeCoverage\Driver\WriteOperationFailedException;
use SebastianBergmann\CodeCoverage\Util\Filesystem;
@ -27,7 +27,7 @@ final class PHP
return \unserialize(<<<'END_OF_COVERAGE_SERIALIZATION'" . PHP_EOL . serialize($coverage) . PHP_EOL . 'END_OF_COVERAGE_SERIALIZATION' . PHP_EOL . ');';
if ($target !== null) {
if (!strpos($target, '://') !== false) {
if (!str_contains($target, '://')) {
Filesystem::createDirectory(dirname($target));
}

@ -78,27 +78,27 @@ final class Text
if ($showColors) {
$colors['classes'] = $this->coverageColor(
$report->numberOfTestedClassesAndTraits(),
$report->numberOfClassesAndTraits()
$report->numberOfClassesAndTraits(),
);
$colors['methods'] = $this->coverageColor(
$report->numberOfTestedMethods(),
$report->numberOfMethods()
$report->numberOfMethods(),
);
$colors['lines'] = $this->coverageColor(
$report->numberOfExecutedLines(),
$report->numberOfExecutableLines()
$report->numberOfExecutableLines(),
);
$colors['branches'] = $this->coverageColor(
$report->numberOfExecutedBranches(),
$report->numberOfExecutableBranches()
$report->numberOfExecutableBranches(),
);
$colors['paths'] = $this->coverageColor(
$report->numberOfExecutedPaths(),
$report->numberOfExecutablePaths()
$report->numberOfExecutablePaths(),
);
$colors['reset'] = self::COLOR_RESET;
@ -109,10 +109,10 @@ final class Text
' Classes: %6s (%d/%d)',
Percentage::fromFractionAndTotal(
$report->numberOfTestedClassesAndTraits(),
$report->numberOfClassesAndTraits()
$report->numberOfClassesAndTraits(),
)->asString(),
$report->numberOfTestedClassesAndTraits(),
$report->numberOfClassesAndTraits()
$report->numberOfClassesAndTraits(),
);
$methods = sprintf(
@ -122,7 +122,7 @@ final class Text
$report->numberOfMethods(),
)->asString(),
$report->numberOfTestedMethods(),
$report->numberOfMethods()
$report->numberOfMethods(),
);
$paths = '';
@ -136,7 +136,7 @@ final class Text
$report->numberOfExecutablePaths(),
)->asString(),
$report->numberOfExecutedPaths(),
$report->numberOfExecutablePaths()
$report->numberOfExecutablePaths(),
);
$branches = sprintf(
@ -146,7 +146,7 @@ final class Text
$report->numberOfExecutableBranches(),
)->asString(),
$report->numberOfExecutedBranches(),
$report->numberOfExecutableBranches()
$report->numberOfExecutableBranches(),
);
}
@ -157,7 +157,7 @@ final class Text
$report->numberOfExecutableLines(),
)->asString(),
$report->numberOfExecutedLines(),
$report->numberOfExecutableLines()
$report->numberOfExecutableLines(),
);
$padding = max(array_map('strlen', [$classes, $methods, $lines]));
@ -278,7 +278,7 @@ final class Text
{
$coverage = Percentage::fromFractionAndTotal(
$numberOfCoveredElements,
$totalNumberOfElements
$totalNumberOfElements,
);
if ($coverage->asFloat() >= $this->thresholds->highLowerBound()) {
@ -298,16 +298,18 @@ final class Text
return Percentage::fromFractionAndTotal(
$numberOfCoveredElements,
$totalNumberOfElements
$totalNumberOfElements,
)->asFixedWidthString() .
' (' . sprintf($format, $numberOfCoveredElements) . '/' .
sprintf($format, $totalNumberOfElements) . ')';
}
private function format(string $color, int $padding, string|false $string): string
private function format(string $color, int $padding, false|string $string): string
{
$reset = $color ? self::COLOR_RESET : '';
if ($color === '') {
return (string) $string . PHP_EOL;
}
return $color . str_pad((string) $string, $padding) . $reset . PHP_EOL;
return $color . str_pad((string) $string, $padding) . self::COLOR_RESET . PHP_EOL;
}
}

@ -31,7 +31,7 @@ final class Thresholds
{
if ($lowUpperBound > $highLowerBound) {
throw new InvalidArgumentException(
'$lowUpperBound must not be larger than $highLowerBound'
'$lowUpperBound must not be larger than $highLowerBound',
);
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save