Modify

Ticket #37 (closed defect: fixed)

Opened 6 years ago

Last modified 3 years ago

PHPUnit2Util::getDefinedClasses

Reported by: elias@… Owned by: mrook
Priority: low Milestone: 2.2.0
Component: Version: 2.2.0RC2
Keywords: Cc:

Description

PHPUnit2Util::getDefinedClasses issues a notice:

[PHP Error] Undefined index: ... [line 111 of /usr/share/pear/phing/tasks/ext/phpunit2/PHPUnit2Util.php]

Line 111 should be replaced with:

$declaredClasses = array_merge(get_declared_interfaces(), get_declared_classes());

Attachments

Change History

comment:1 Changed 6 years ago by mrook

  • Owner set to mrook
  • Status changed from new to assigned

I agree with your bugreport, but not with your proposed solution. The method getDefinedClasses() does not (and should not) care about interfaces.

A better solution (one which I would commit) would be:

if (is_array(self::$definedClasses[$filename]))
{
  return self::$definedClasses[$filename];
}
else
{
  return array();
}

comment:2 Changed 6 years ago by mrook

The "is_array" in the previous comment should obviously be "isset".

comment:3 Changed 6 years ago by elias

i din't thougt much about the context, i just wanted the error go away. :) your solution is fine too.

comment:4 Changed 6 years ago by mrook

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixed in r68, thanks!

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.