Skip to content

Anbu::disable() does not work  #27

@gabarba

Description

@gabarba

I had a need to disable the Anbu for a particular request while testing and I was presented with the following error

Undefined index: disable
…/­vendor/­daylerees/­anbu/­src/­Profiler.php:338

I figured it was an issue in the Facade class itself so I was able to fix it with the following.

<?php

namespace Anbu\Facades;

use App;

class Anbu
{
    /**
     * Proxy static method calls to module instances.
     *
     * @param  string $method
     * @param  mixed  $args
     * @return mixed
     */
    public static function __callStatic($method, $args)
    {
        // Resolve profiler from container.
        $profiler = App::make('Anbu\\Profiler');

       if($method == 'disable')
        {
           return $profiler->disable();
        }

        if($method == 'hide')
        {
           return $profiler->hide();
        }


        // Return the module instance by method name.
        return $profiler->getModule($method);
    }
}

Im sure that you may have a better solution to this issue than this one but I just wanted to give you a heads up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions