Skip to content

cleaning filename returned wrongly due to an XDebug bug #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions PHP/CodeCoverage.php
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,13 @@ protected function applyListsFilter(&$data)
protected function initializeFilesThatAreSeenTheFirstTime($data)
{
foreach ($data as $file => $lines) {
// Patch for XDebug bug:
// http://bugs.xdebug.org/bug_view_page.php?bug_id=0000331
preg_match('/.*\.php/', $file, $matches);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That only works for filenames that end in .php.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the intention. Anyway, if you are use to ending the PHP files with another extension, can be added, or even not filtering by any extension.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code should make no assumption on the suffix.

if(isset($matches[0])) {
$file = $matches[0];
}

if ($this->filter->isFile($file) && !isset($this->data[$file])) {
$this->data[$file] = array();

Expand Down