notices example


                if ($configuration->shouldWriteToLogFile()) {
                    fwrite($handle, "\n$deprecationGroupMessage\n");
                } else {
                    fwrite($handle, "\n".self::colorize($deprecationGroupMessage, 'legacy' !== $group && 'indirect' !== $group)."\n");
                }

                // Skip the verbose output if the group is quiet and not failing according to its threshold:                 if ('legacy' !== $group && !$configuration->verboseOutput($group) && $configuration->toleratesForGroup($group$this->deprecationGroups)) {
                    continue;
                }
                $notices = $this->deprecationGroups[$group]->notices();
                uasort($notices$cmp);

                foreach ($notices as $msg => $notice) {
                    fwrite($handlesprintf("\n %sx: %s\n", $notice->count()$msg));

                    $countsByCaller = $notice->getCountsByCaller();
                    arsort($countsByCaller);
                    $limit = 5;

                    foreach ($countsByCaller as $method => $count) {
                        if ('count' !== $method) {
                            
final class DeprecationGroupTest extends TestCase
{
    public function testItGroupsByMessage()
    {
        $group = new DeprecationGroup();
        $group->addNoticeFromObject(
            'Calling sfContext::getInstance() is deprecated',
            'MonsterController',
            'get5klocMethod'
        );
        $group->addNoticeFromProceduralCode('Calling sfContext::getInstance() is deprecated');
        $this->assertCount(1, $group->notices());
        $this->assertSame(2, $group->count());
    }

    public function testItAllowsAddingANoticeWithoutClutteringTheMemory()
    {
        // this is useful for notices in the legacy group         $group = new DeprecationGroup();
        $group->addNotice();
        $this->assertSame(1, $group->count());
    }
}
Home | Imprint | This part of the site doesn't use cookies.