Skip to content

Commit

Permalink
Rename eventhelpers trait
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelfolaron committed Aug 24, 2024
1 parent 0c41896 commit 103c79e
Show file tree
Hide file tree
Showing 55 changed files with 110 additions and 103 deletions.
5 changes: 3 additions & 2 deletions app/Core/Bootstrap/Bootloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Contracts\Container\BindingResolutionException;
use Leantime\Core\Console\CliRequest;
use Leantime\Core\Console\ConsoleKernel;
use Leantime\Core\Events\Eventhelpers;
use Leantime\Core\Events\DispatchesEvents;
use Leantime\Core\Http\HttpKernel;
use Leantime\Core\Http\IncomingRequest;
use Psr\Container\ContainerInterface as PsrContainerContract;
Expand All @@ -19,7 +19,7 @@
*/
class Bootloader
{
use Eventhelpers;
use DispatchesEvents;

/**
* Bootloader instance
Expand Down Expand Up @@ -119,6 +119,7 @@ public function boot(): void

self::dispatch_event("beginning", ['bootloader' => $this]);


if ($this->app::hasBeenBootstrapped()) {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions app/Core/Console/ConsoleKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
use Illuminate\Support\Arr;
use Illuminate\Support\ProcessUtils;
use Illuminate\Support\Str;
use Leantime\Core\Events\Eventhelpers;
use Leantime\Core\Events\DispatchesEvents;
use Leantime\Domain\Plugins\Services\Plugins as PluginsService;
use Symfony\Component\Console\Application as ConsoleApplication;
use Symfony\Component\Console\Command\Command as SymfonyCommand;
use Symfony\Component\Process\PhpExecutableFinder;

class ConsoleKernel implements ConsoleKernelContract
{
use Eventhelpers;
use DispatchesEvents;

protected ConsoleApplication $artisan;

Expand Down
4 changes: 2 additions & 2 deletions app/Core/Controller/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Http\Exceptions\HttpResponseException;
use Illuminate\Log\Logger;
use Illuminate\Support\Facades\Log;
use Leantime\Core\Events\Eventhelpers;
use Leantime\Core\Events\DispatchesEvents;
use Leantime\Core\Http\IncomingRequest;
use Leantime\Core\Language;
use Leantime\Core\Template;
Expand All @@ -20,7 +20,7 @@
*/
abstract class Controller
{
use Eventhelpers;
use DispatchesEvents;

/**
* @var Response
Expand Down
4 changes: 2 additions & 2 deletions app/Core/Controller/Frontcontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Support\Str;
use Leantime\Core\Events\Eventhelpers;
use Leantime\Core\Events\DispatchesEvents;
use Leantime\Core\Http\HtmxRequest;
use Leantime\Core\Http\IncomingRequest;
use Symfony\Component\HttpFoundation\RedirectResponse;
Expand All @@ -18,7 +18,7 @@
*/
class Frontcontroller
{
use Eventhelpers;
use DispatchesEvents;

/**
* @var string - rootpath (is set in index.php)
Expand Down
4 changes: 2 additions & 2 deletions app/Core/Controller/HtmxController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Error;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Support\Str;
use Leantime\Core\Events\Eventhelpers;
use Leantime\Core\Events\DispatchesEvents;
use Leantime\Core\Http\IncomingRequest;
use Leantime\Core\Template;
use LogicException;
Expand All @@ -18,7 +18,7 @@
*/
abstract class HtmxController
{
use Eventhelpers;
use DispatchesEvents;

/** @var Response $response */
protected Response $response;
Expand Down
4 changes: 2 additions & 2 deletions app/Core/Db/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Leantime\Core\Configuration\Environment;
use Leantime\Core\Console\CliRequest;
use Leantime\Core\Events\Eventhelpers;
use Leantime\Core\Events\DispatchesEvents;
use Leantime\Core\Http\IncomingRequest;
use PDO;
use PDOException;
Expand All @@ -17,7 +17,7 @@
*/
class Db
{
use Eventhelpers;
use DispatchesEvents;

/**
* @var string database host default: localhost
Expand Down
4 changes: 2 additions & 2 deletions app/Core/Db/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Leantime\Core\Db;

use Illuminate\Contracts\Container\BindingResolutionException;
use Leantime\Core\Events\Eventhelpers;
use Leantime\Core\Events\DispatchesEvents;
use PDO;
use PDOStatement;
use ReflectionClass;
Expand All @@ -17,7 +17,7 @@
*/
abstract class Repository
{
use Eventhelpers;
use DispatchesEvents;

/**
* @var string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
*
*/
trait Eventhelpers
trait DispatchesEvents
{
private static string $event_context = '';

Expand Down
4 changes: 2 additions & 2 deletions app/Core/Fileupload.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use GuzzleHttp\Exception\RequestException;
use Illuminate\Http\Exceptions\HttpResponseException;
use Leantime\Core\Configuration\Environment;
use Leantime\Core\Events\Eventhelpers;
use Leantime\Core\Events\DispatchesEvents;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpFoundation\Response;

Expand All @@ -20,7 +20,7 @@
*/
class Fileupload
{
use Eventhelpers;
use DispatchesEvents;

/**
* @var string path on the server
Expand Down
4 changes: 2 additions & 2 deletions app/Core/Http/HttpKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
use Illuminate\Pipeline\Pipeline;
use Leantime\Core\Bootstrap\Application;
use Leantime\Core\Controller\Frontcontroller;
use Leantime\Core\Events\Eventhelpers;
use Leantime\Core\Events\DispatchesEvents;
use Leantime\Core\Middleware;

class HttpKernel implements HttpKernelContract
{
use Eventhelpers;
use DispatchesEvents;

/**
* The timestamp when the request started.
Expand Down
4 changes: 2 additions & 2 deletions app/Core/Language.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Str;
use Leantime\Core\Configuration\Environment;
use Leantime\Core\Events\Eventhelpers;
use Leantime\Core\Events\DispatchesEvents;
use Leantime\Core\Events\EventDispatcher;
use Leantime\Core\Http\ApiRequest;
use Symfony\Component\HttpFoundation\Cookie;
Expand All @@ -20,7 +20,7 @@
*/
class Language
{
use Eventhelpers;
use DispatchesEvents;

/**
* @var string
Expand Down
4 changes: 2 additions & 2 deletions app/Core/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Illuminate\Contracts\Container\BindingResolutionException;
use Leantime\Core\Configuration\Environment;
use Leantime\Core\Events\Eventhelpers;
use Leantime\Core\Events\DispatchesEvents;
use PHPMailer\PHPMailer\Exception;
use PHPMailer\PHPMailer\PHPMailer;

Expand All @@ -18,7 +18,7 @@
*/
class Mailer
{
use Eventhelpers;
use DispatchesEvents;

/**
* @var string
Expand Down
4 changes: 2 additions & 2 deletions app/Core/Middleware/ApiAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Closure;
use Leantime\Core\Controller\Frontcontroller;
use Leantime\Core\Events\Eventhelpers;
use Leantime\Core\Events\DispatchesEvents;
use Leantime\Core\Http\ApiRequest;
use Leantime\Core\Http\IncomingRequest;
use Leantime\Domain\Api\Services\Api as ApiService;
Expand All @@ -14,7 +14,7 @@

class ApiAuth
{
use Eventhelpers;
use DispatchesEvents;

/**
* Handle an incoming request
Expand Down
4 changes: 2 additions & 2 deletions app/Core/Middleware/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Closure;
use Leantime\Core\Controller\Frontcontroller;
use Leantime\Core\Events\Eventhelpers;
use Leantime\Core\Events\DispatchesEvents;
use Leantime\Core\Http\IncomingRequest;
use Leantime\Domain\Auth\Services\Auth as AuthService;
use Leantime\Domain\Projects\Services\Projects as ProjectsService;
Expand All @@ -13,7 +13,7 @@

class Auth
{
use Eventhelpers;
use DispatchesEvents;

/**
* Public actions
Expand Down
4 changes: 2 additions & 2 deletions app/Core/Middleware/InitialHeaders.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
namespace Leantime\Core\Middleware;

use Closure;
use Leantime\Core\Events\Eventhelpers;
use Leantime\Core\Events\DispatchesEvents;
use Leantime\Core\Http\IncomingRequest;
use Symfony\Component\HttpFoundation\Response;

class InitialHeaders
{
use Eventhelpers;
use DispatchesEvents;

/**
* Set up the initial headers
Expand Down
4 changes: 2 additions & 2 deletions app/Core/Middleware/Installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

use Closure;
use Leantime\Core\Controller\Frontcontroller;
use Leantime\Core\Events\Eventhelpers;
use Leantime\Core\Events\DispatchesEvents;
use Leantime\Core\Http\IncomingRequest;
use Leantime\Domain\Setting\Repositories\Setting as SettingRepository;
use Symfony\Component\HttpFoundation\Response;

class Installed
{
use Eventhelpers;
use DispatchesEvents;

/**
* Check if Leantime is installed
Expand Down
4 changes: 2 additions & 2 deletions app/Core/Middleware/RequestRateLimiter.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Illuminate\Contracts\Container\BindingResolutionException;
use Leantime\Core\Configuration\Environment;
use Leantime\Core\Controller\Frontcontroller;
use Leantime\Core\Events\Eventhelpers;
use Leantime\Core\Events\DispatchesEvents;
use Leantime\Core\Http\ApiRequest;
use Leantime\Core\Http\IncomingRequest;
use Leantime\Domain\Api\Services\Api;
Expand All @@ -20,7 +20,7 @@
*/
class RequestRateLimiter
{
use Eventhelpers;
use DispatchesEvents;

protected RateLimiter $limiter;
protected Environment $config;
Expand Down
4 changes: 2 additions & 2 deletions app/Core/Middleware/StartSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Date;
use Leantime\Core\Events\Eventhelpers;
use Leantime\Core\Events\DispatchesEvents;
use Leantime\Core\Http\IncomingRequest;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\HttpFoundation\Response;

class StartSession
{
use Eventhelpers;
use DispatchesEvents;

/**
* The session manager.
Expand Down
4 changes: 2 additions & 2 deletions app/Core/Middleware/TrustProxies.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Closure;
use Leantime\Core\Configuration\Environment;
use Leantime\Core\Events\Eventhelpers;
use Leantime\Core\Events\DispatchesEvents;
use Leantime\Core\Http\IncomingRequest;
use Symfony\Component\HttpFoundation\Response;

Expand All @@ -17,7 +17,7 @@
*/
class TrustProxies
{
use Eventhelpers;
use DispatchesEvents;

/**
* The trusted proxies for this application.
Expand Down
4 changes: 2 additions & 2 deletions app/Core/Middleware/Updated.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
use Closure;
use Leantime\Core\Configuration\AppSettings;
use Leantime\Core\Controller\Frontcontroller;
use Leantime\Core\Events\Eventhelpers;
use Leantime\Core\Events\DispatchesEvents;
use Leantime\Core\Http\IncomingRequest;
use Leantime\Domain\Setting\Repositories\Setting as SettingRepository;
use Symfony\Component\HttpFoundation\Response;

class Updated
{
use Eventhelpers;
use DispatchesEvents;

/**
* Check if Leantime is installed
Expand Down
4 changes: 2 additions & 2 deletions app/Core/Plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Leantime\Core;

use Leantime\Core\Events\Eventhelpers;
use Leantime\Core\Events\DispatchesEvents;

/**
* Plugins class
Expand All @@ -12,7 +12,7 @@
*/
class Plugins
{
use Eventhelpers;
use DispatchesEvents;

/**
* Enabled plugins
Expand Down
4 changes: 2 additions & 2 deletions app/Core/Providers/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
namespace Leantime\Core\Providers;

use Illuminate\Support\ServiceProvider;
use Leantime\Core\Events\Eventhelpers;
use Leantime\Core\Events\DispatchesEvents;
use Leantime\Core\Exceptions\HandleExceptions;
use Leantime\Core\Http\IncomingRequest;
use Symfony\Component\ErrorHandler\Debug;

class Environment extends ServiceProvider
{

Use Eventhelpers;
Use DispatchesEvents;

/**
* Register any application services.
Expand Down
Loading

0 comments on commit 103c79e

Please sign in to comment.