Coder Social home page Coder Social logo

laravel-tactician's People

Contributors

jcrowe206 avatar jeffagostinho avatar joselfonseca avatar kpicaza avatar lloy0076 avatar ralbear avatar timbroder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

laravel-tactician's Issues

Publishes command isn't working

Hey,

Your service provider hasn't the publishes method. It requires this method in order to run php artisan vendor:publish without problems.

{
  "error": {
    "type": "Symfony\\Component\\Debug\\Exception\\FatalErrorException",
    "message": "Call to undefined method Joselfonseca\\LaravelTactician\\Providers\\LaravelTacticianServiceProvider::publishes()",
    "file": "/project/vendor/joselfonseca/laravel-tactician/src/Providers/LaravelTacticianServiceProvider.php",
    "line": 63
  }
}

Profile:
Laravel 4
joselfonseca/laravel-tactician 0.3.2

make:tactician file generation issue

php artisan make:tactician /src/Commands/CommandName

creates the files in /app/CommandBus whereas I have clearly specified a root path.

Current Behavior

/app/CommandBus/Commands/CommandNameCommand
/app/CommandBus/Handlers/CommandNameHandler

Expected behavior

at leaset

/src/Commands/Commands/CommandNameCommand
/src/Commands/Handlers/CommandNameHandler

OR

/src/Commands/CommandNameCommand
/src/Commands/CommandNameHandler

Also, It would be nicer if there were a flag like --bare to skip creating Commands and 'Handlers' folders.

Bug Undefined index in getHandlerForCommand( TestCommand )

Following test fails in PHP 8.0.2 but passes in PHP 7.2.8

It throws exception when locator from laravel container is not found

for both LaravelLocator and LaravelLazyLocator with next error:

Failed asserting that exception of type "ErrorException" matches expected exception "League\Tactician\Exception\MissingHandlerException". Message was: "Undefined index: TestCommand"

I am working on a patch

Versions issue

$ vendor/bin/phpunit -v
PHPUnit 4.8.36 by Sebastian Bergmann and contributors.

Runtime:        PHP 5.6.33 with Xdebug 2.5.5
Configuration:  C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\phpunit.xml

......EEEEEEE.............

Time: 55.66 seconds, Memory: 11.25MB

There were 7 errors:

1) Joselfonseca\LaravelTactician\Tests\Generators\TestGenerators::test_it_creates_command
ErrorException: The Symfony\Component\Process\ProcessUtils::escapeArgument() method is deprecated since Symfony 3.3 and will be removed in 4.0. Use a command line array or give env vars to the Process::start/run() method instead.

C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\vendor\symfony\process\ProcessUtils.php:43
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\vendor\laravel\framework\src\Illuminate\Queue\Listener.php:87
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\vendor\laravel\framework\src\Illuminate\Queue\Listener.php:75
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\vendor\laravel\framework\src\Illuminate\Queue\Listener.php:63
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\vendor\laravel\framework\src\Illuminate\Queue\QueueServiceProvider.php:185
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\vendor\laravel\framework\src\Illuminate\Container\Container.php:726
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\vendor\laravel\framework\src\Illuminate\Container\Container.php:608
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\vendor\laravel\framework\src\Illuminate\Container\Container.php:575
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\vendor\laravel\framework\src\Illuminate\Foundation\Application.php:728
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\vendor\laravel\framework\src\Illuminate\Container\Container.php:1172
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\vendor\laravel\framework\src\Illuminate\Foundation\Providers\ArtisanServiceProvider.php:596
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\vendor\laravel\framework\src\Illuminate\Container\Container.php:726
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\vendor\laravel\framework\src\Illuminate\Container\Container.php:608
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\vendor\laravel\framework\src\Illuminate\Container\Container.php:575
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\vendor\laravel\framework\src\Illuminate\Foundation\Application.php:728
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\vendor\laravel\framework\src\Illuminate\Console\Application.php:192
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\vendor\laravel\framework\src\Illuminate\Console\Application.php:206
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\vendor\laravel\framework\src\Illuminate\Support\ServiceProvider.php:232
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\vendor\laravel\framework\src\Illuminate\Console\Application.php:111
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\vendor\laravel\framework\src\Illuminate\Console\Application.php:58
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php:284
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php:220
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:221
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\tests\Generators\TestGenerators.php:56
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\tests\Generators\TestGenerators.php:56
C:\Users\Usuario\GitHub\jagarsoft\laravel-tactician\tests\Generators\TestGenerators.php:88

Command Handler bindings in ServiceProvider

I kind of assumed it would make sense to create a new ServiceProvider for having all the Command / Handler bindings in one place in the app. I'm using the ::register()-method to set this up.

I saw that the LocatorInterface has an ::addHandlers(array $commandClassToHandlerMap)-method, so in the ::register()-method of the service provider, I type hint for the LocatorInterface, so I can call the ::addHandlers-method.

Excerpt:

/**
     * Bootstrap the application services. Boot happens after all providers have
     * registered. So all bindings have been made and can be used.
     *
     * @return void
     */
    public function boot(LocatorInterface $handlerLocator)
    {
        $handlerLocator->addHandlers([
            GeneratePlayerCommand::class => GeneratePlayerHandler::class,
        ]);
    }

However this does not work. This does not work because for each resolve the IoC container does, it returns a new instance. I.e. the LaravelTacticianServiceProvider::register() method uses $this->app->bind() and not $this->app->singleton(). For the LocatorInterface, MethodNameInflector, CommandNameExtractor and CommandBusInterface I think it makes sense to use the singleton() method, since the same instance should be able to be reused during the request.

Or maybe I am missing a reason why that should not be the case? If I am not missing anything, I could make a PR for this?

What about Undo feature?

Hi folks
What do you think about implementing Undo feature?

Comments will be welcomed!

I have started working on 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.