Skip to content

Commit 93beb70

Browse files
committed
Refactor the service removing Hm_ namespace usage
1 parent 318da41 commit 93beb70

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+248
-248
lines changed

console

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Symfony\Component\Console\Application;
77
use Symfony\Component\DependencyInjection\ContainerInterface;
88

9-
list($containerBuilder, $config) = require __DIR__ . '/services/Hm_bootstrap.php';
9+
list($containerBuilder, $config) = require __DIR__ . '/services/Hbootstrap.php';
1010

1111
$application = new Application('Cypht Console', '1.0');
1212

services/Commands/Hm_CheckMailCommand.php renamed to services/Commands/CheckMailCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
namespace Services\Commands;
44

5-
use Services\Jobs\Hm_ProcessNewEmail;
6-
use Services\Core\Commands\Hm_BaseCommand;
7-
use Services\Notifications\Hm_NewMailNotification;
5+
use Services\Jobs\ProcessNewEmail;
6+
use Services\Core\Commands\BaseCommand;
7+
use Services\Notifications\NewMailNotification;
88
use Symfony\Component\Console\Command\Command;
99
use Symfony\Component\Console\Input\InputInterface;
1010
use Symfony\Component\Console\Output\OutputInterface;
1111

12-
class Hm_CheckMailCommand extends Hm_BaseCommand
12+
class CheckMailCommand extends BaseCommand
1313
{
1414
/**
1515
* The name of the command.
@@ -37,7 +37,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
3737

3838
// $notification = new Hm_NewMailNotification($message);
3939
// $notification->sendNow();
40-
Hm_NewMailNotification::dispatch($message);
40+
NewMailNotification::dispatch($message);
4141
// Hm_ProcessNewEmail::dispatch(email: '[email protected]');
4242
return Command::SUCCESS;
4343
}

services/Contracts/Hm_Job.php renamed to services/Contracts/Job.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Services\Contracts;
44

5-
interface Hm_Job
5+
interface Job
66
{
77
public function handle(): void;
88
public function failed(): void;

services/Contracts/Notifications/Hm_Dispatcher.php renamed to services/Contracts/Notifications/Dispatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Services\Contracts\Notifications;
44

5-
interface Hm_Dispatcher
5+
interface Dispatcher
66
{
77
/**
88
* Send the given notification to the given notifiable entities.

services/Contracts/Notifications/Hm_Factory.php renamed to services/Contracts/Notifications/Factory.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace Services\Contracts\Notifications;
44

5-
use Services\Core\Notifications\Hm_Notification;
5+
use Services\Core\Notifications\Notification;
66

7-
interface Hm_Factory
7+
interface Factory
88
{
99
/**
1010
* Get a channel instance by name.
@@ -20,13 +20,13 @@ static public function channel(string $name);
2020
* @param mixed $notification
2121
* @return void
2222
*/
23-
static public function send(Hm_Notification $notification): void;
23+
static public function send(Notification $notification): void;
2424

2525
/**
2626
* Send the given notification immediately.
2727
*
2828
* @param mixed $notification
2929
* @return void
3030
*/
31-
static public function sendNow(Hm_Notification $notification): void;
31+
static public function sendNow(Notification $notification): void;
3232
}

services/Contracts/Queue/Hm_Queueable.php

Lines changed: 0 additions & 10 deletions
This file was deleted.

services/Contracts/Queue/Hm_ShouldQueue.php

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace Services\Contracts\Queue;
4+
5+
use Services\Core\Jobs\BaseJob;
6+
7+
interface Queueable
8+
{
9+
public function process(BaseJob $job): void;
10+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
namespace Services\Contracts\Queue;
4+
5+
use Services\Core\Queue\Queueable;
6+
7+
interface ShouldQueue
8+
{
9+
public function push(Queueable $queueable): void;
10+
public function pop(): ?Queueable;
11+
public function release(Queueable $queueable, int $delay = 0): void;
12+
}

services/Core/Commands/Hm_BaseCommand.php renamed to services/Core/Commands/BaseCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/**
1212
* BaseCommand provides common functionality for all console commands.
1313
*/
14-
abstract class Hm_BaseCommand extends Command
14+
abstract class BaseCommand extends Command
1515
{
1616

1717
/**

0 commit comments

Comments
 (0)