{"action":"opened","issue":{"url":"https://api.github.com/repos/sebastianbergmann/phpunit/issues/2288","repository_url":"https://api.github.com/repos/sebastianbergmann/phpunit","labels_url":"https://api.github.com/repos/sebastianbergmann/phpunit/issues/2288/labels{/name}","comments_url":"https://api.github.com/repos/sebastianbergmann/phpunit/issues/2288/comments","events_url":"https://api.github.com/repos/sebastianbergmann/phpunit/issues/2288/events","html_url":"https://github.com/sebastianbergmann/phpunit/issues/2288","id":174893653,"number":2288,"title":"Missing extension dependencies in composer.json","user":{"login":"vbashkirtsev","id":16136510,"avatar_url":"https://avatars.githubusercontent.com/u/16136510?v=3","gravatar_id":"","url":"https://api.github.com/users/vbashkirtsev","html_url":"https://github.com/vbashkirtsev","followers_url":"https://api.github.com/users/vbashkirtsev/followers","following_url":"https://api.github.com/users/vbashkirtsev/following{/other_user}","gists_url":"https://api.github.com/users/vbashkirtsev/gists{/gist_id}","starred_url":"https://api.github.com/users/vbashkirtsev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vbashkirtsev/subscriptions","organizations_url":"https://api.github.com/users/vbashkirtsev/orgs","repos_url":"https://api.github.com/users/vbashkirtsev/repos","events_url":"https://api.github.com/users/vbashkirtsev/events{/privacy}","received_events_url":"https://api.github.com/users/vbashkirtsev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-03T12:02:49Z","updated_at":"2016-09-03T12:02:49Z","closed_at":null,"body":"Recently I have created the tools which checks list of extensions in composer.json against actually used extensions in code. This tool is available on packagist.org as **logics/extcheck** . I have run it against PHPUnit and it gave me the following:\r\n\r\n```\r\nFollowing extensions are missing in require section of composer.json:\r\n\r\n  ext-SPL\r\n    Used RuntimeException in /home/mega/PHPUnit/phpunit/src/Runner/Exception.php:14\r\n    Used SplObjectStorage in /home/mega/PHPUnit/phpunit/tests/_files/DataProviderDebugTest.php:33\r\n\r\n  ext-date\r\n    Used time in /home/mega/PHPUnit/phpunit/src/Util/PHP.php:328\r\n    Used DateTime in /home/mega/PHPUnit/phpunit/tests/Framework/ConstraintTest.php:813\r\n    Used DateTimeZone in /home/mega/PHPUnit/phpunit/tests/Framework/ConstraintTest.php:813\r\n    Used DateTime in /home/mega/PHPUnit/phpunit/tests/Framework/ConstraintTest.php:814\r\n    Used DateTimeZone in /home/mega/PHPUnit/phpunit/tests/Framework/ConstraintTest.php:814\r\n\r\n  ext-Reflection\r\n    Used ReflectionClass in /home/mega/PHPUnit/phpunit/src/TextUI/TestRunner.php:91\r\n    Used ReflectionClass in /home/mega/PHPUnit/phpunit/src/TextUI/TestRunner.php:129\r\n    Used ReflectionClass in /home/mega/PHPUnit/phpunit/src/TextUI/TestRunner.php:136\r\n    Used ReflectionClass in /home/mega/PHPUnit/phpunit/src/TextUI/TestRunner.php:143\r\n    Used ReflectionClass in /home/mega/PHPUnit/phpunit/src/TextUI/TestRunner.php:246\r\n    Used ReflectionClass in /home/mega/PHPUnit/phpunit/src/TextUI/TestRunner.php:889\r\n\r\n  ext-mbstring\r\n    Used mb_convert_encoding in /home/mega/PHPUnit/phpunit/src/Util/String.php:29\r\n\r\n  ext-xml\r\n    Used utf8_encode in /home/mega/PHPUnit/phpunit/src/Util/String.php:31\r\n\r\n  ext-tidy\r\n    Used tidy_repair_file in /home/mega/PHPUnit/phpunit/src/Util/Printer.php:91\r\n\r\n  ext-libxml\r\n    Used libxml_use_internal_errors in /home/mega/PHPUnit/phpunit/src/Util/XML.php:65\r\n    Used libxml_get_errors in /home/mega/PHPUnit/phpunit/src/Util/XML.php:84\r\n    Used libxml_use_internal_errors in /home/mega/PHPUnit/phpunit/src/Util/XML.php:88\r\n\r\n  ext-Phar\r\n    Used Phar in /home/mega/PHPUnit/phpunit/src/TextUI/Command.php:972\r\n\r\nFollowing extensions are missing in require-dev section of composer.json:\r\n\r\n  ext-PDO\r\n    Used PDO in /home/mega/PHPUnit/phpunit/tests/Regression/GitHub/1351/Issue1351Test.php:44\r\n    Used PDO in /home/mega/PHPUnit/phpunit/tests/Regression/GitHub/1351/Issue1351Test.php:45\r\n    Used PDO in /home/mega/PHPUnit/phpunit/tests/Regression/GitHub/1351/Issue1351Test.php:45\r\n\r\n  ext-xdebug\r\n    Used xdebug_disable in /home/mega/PHPUnit/phpunit/tests/_files/FatalTest.php:8\r\n\r\n```\r\n\r\next-SPL and ext-Reflection are in current composer.json but in lowercase which is strictly speaking not correct. The rest is clearly missing.\r\n\r\nI have checked the code pointed out by **extcheck** and it appears that:\r\n**ext-date** must be in **require**\r\nEither **ext-mbstring** or **ext-xml** must be in **require** (**ext-mbstring** preferred according to the code)\r\n**ext-tidy** should be is **suggest**\r\n**ext-xml** must be in **require**\r\n**ext-Phar** must be in **require**\r\n**ext-PDO** must be in **require-dev**\r\n**ext-xdebug** should be in **suggest**\r\n\r\nIt is easy to fix it and make a new PR. But before I do so I'd like your opinion on should we have extcheck in .travis.yml so it would check extensions on each build and fail the build if new contribution make use of just another previously not mentioned extension or just add missing extensions to composer.json? What is your view on this?\r\n\r\nPS: Amazingly pretty much all packages I tested with extcheck have some extensions missing! That's quite spread problem...\r\n"}}
{"actor":{"display_login":"vbashkirtsev"}}