Git Product home page Git Product logo

dispatcher's Issues

[meta] Cut out dispatchers

The Basic dispatcher is able to dispatch a request/task on several callables: function, closure, class+method, object+method…

The idea is to extract each one of these forms as a standalone dispatcher. Then, when they will be tested, we could introduce an Aggregate dispatcher. Finally, the Basic dispatcher would be a special usage of the Aggregate dispatcher that aggregates all the existing dispatchers.

The roadmap is:

  • ensuring better performances for all dispatchers,
  • ensuring better testability for all dispatchers,
  • do not introduce BC break (not a lot at least, one is necessary, see incoming issues or PR),
  • ensuring a better modularity by choosing/aggregating dispatchers.

Progress:

  • Function (incl. Closure) dispatcher,
  • ClassMethod dispatcher,
  • ObjectMethod dispatcher,
  • Aggregate dispatcher,
  • Basic dispatcher.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Error ignoring but still raise an error

https://github.com/hoaproject/Dispatcher/blob/master/Basic.php#L83-L88
In these lines, the operator @ prevents to raise errors, but if you put an custom error handler with this code :

set_error_handler(function ($errno, $errstr, $errfile, $errline ) {
    var_dump(func_get_args());
});

There is still an triggered error.

In order to prevent this, I suggest these line as replacement

    $call       = !empty($variables['controller']) ? $variables['controller'] :
                    !empty($variables['_call']) ? $variables['_call'] : $rule[\Hoa\Router::RULE_CALL];
    $able       = !empty($variables['action']) ? $variables['action'] :
                    !empty($variables['_able']) ? $variables['_able'] : $rule[\Hoa\Router::RULE_ABLE];

Fatal Error

Hey,

I have a Fatal Error : PHP Fatal error: Cannot mix bracketed namespace declarations with unbracketed namespace declarations in C:\www\sohapi\vendor\hoa\console\Dispatcher\Kit.php on line 37
I think its come from the Core , who still have file with namespace {} and namespace ;
I try to fix it, but when we declare namespace foo; we can't return on the global namespace namespace ;

And if we force tu use namespace Hoa\Core; all function defined on root can't be access ie ( dnew => \Hoa\Core\Consistence\dnew() )... i don't have any solution for it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.