'Provides handlers for all phases.'

def __getattr__(self, item):

    for (phase, method) in plugin.phase_methods.items():
        if ((item == method) and (phase not in [u'accept', u'reject', u'fail', u'input'])):
            break
    else:
        raise AttributeError(item)
    def handle_phase(task, config):
        entry_actions = {u'accept': Entry.accept, u'reject': Entry.reject, u'fail': Entry.fail}
        for item in config:
            (requirement, action) = list(item.items())[0]
            passed_entries = (e for e in task.entries if self.check_condition(requirement, e))
            if isinstance(action, str):
                if (not (phase == u'filter')):
                    continue
                for entry in passed_entries:
                    entry_actions[action](entry, (u'Matched    requirement:    %s' % requirement))
            else:
                fake_task = Task(task.manager, task.name, config=action, options=task.options)
                fake_task.session = task.session
                fake_task.all_entries[:] = passed_entries
                methods = {}
                for (plugin_name, plugin_config) in action.items():
                    p = plugin.get_plugin_by_name(plugin_name)
                    method = p.phase_handlers.get(phase)
                    if method:
                        methods[method] = (fake_task, plugin_config)
                for method in sorted(methods, reverse=True):
                    method(*methods[method])
    handle_phase.priority = 80
    return handle_phase
