Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
[ci skip] [skip ci]
  • Loading branch information
fntneves authored and StyleCIBot committed Apr 15, 2020
1 parent 4ce77d7 commit a14ee05
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Neves/Events/EventServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function register()
$eventDispatcher = $this->app->make(EventDispatcher::class);
$this->app->extend('events', function () use ($eventDispatcher) {
$dispatcher = new TransactionalDispatcher($eventDispatcher);
$dispatcher->listen(TransactionalClosureEvent::class, function(TransactionalClosureEvent $event) {
$dispatcher->listen(TransactionalClosureEvent::class, function (TransactionalClosureEvent $event) {
($event->getClosure())();
});
$dispatcher->setTransactionalEvents($this->app['config']->get('transactional-events.transactional'));
Expand Down
7 changes: 3 additions & 4 deletions src/Neves/Events/TransactionalClosureEvent.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?php


namespace Neves\Events;


use Closure;
use Neves\Events\Contracts\TransactionalEvent;

Expand All @@ -16,7 +14,8 @@ public function __construct(Closure $closure)
$this->closure = $closure;
}

public function getClosure(): Closure {
public function getClosure(): Closure
{
return $this->closure;
}
}
}
2 changes: 1 addition & 1 deletion src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ function transactional(Closure $callable)

$dispatcher->dispatch(new TransactionalClosureEvent($callable));
}
}
}
4 changes: 2 additions & 2 deletions tests/TransactionalDispatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public function it_immediately_dispatches_specific_events_excluded_on_a_pattern(
public function it_provides_transactional_behavior_of_custom_closures()
{
DB::transaction(function () {
$this->dispatcher->dispatch(new TransactionalClosureEvent(function() {
$this->dispatcher->dispatch(new TransactionalClosureEvent(function () {
$_SERVER['__events'] = 'bar';
}));

Expand All @@ -287,7 +287,7 @@ public function it_provides_transactional_behavior_of_custom_closures()
public function it_provides_transactional_behavior_of_custom_closures_using_transactional_helper()
{
DB::transaction(function () {
transactional(function() {
transactional(function () {
$_SERVER['__events'] = 'bar';
});

Expand Down

0 comments on commit a14ee05

Please sign in to comment.