Skip to content

Commit

Permalink
Merge pull request #16 from michalsn/fix-namespace
Browse files Browse the repository at this point in the history
fix: namespace in the publish command
  • Loading branch information
michalsn committed Dec 17, 2023
2 parents b0c8165 + 6b6ce6c commit 30d7b60
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Commands/QueuePublish.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class QueuePublish extends BaseCommand
*/
public function run(array $params)
{
$source = service('autoloader')->getNamespace('Michalsn\\CodeIgniterQueue')[0];
$source = service('autoloader')->getNamespace('CodeIgniter\\Queue')[0];

$publisher = new Publisher($source, APPPATH);

Expand All @@ -34,8 +34,8 @@ public function run(array $params)

foreach ($publisher->getPublished() as $file) {
$contents = file_get_contents($file);
$contents = str_replace('namespace Michalsn\\CodeIgniterQueue\\Config', 'namespace Config', $contents);
$contents = str_replace('use CodeIgniter\\Config\\BaseConfig', 'use Michalsn\\CodeIgniterQueue\\Config\\Queue as BaseQueue', $contents);
$contents = str_replace('namespace CodeIgniter\\Queue\\Config', 'namespace Config', $contents);
$contents = str_replace('use CodeIgniter\\Config\\BaseConfig', 'use CodeIgniter\\Queue\\Config\\Queue as BaseQueue', $contents);
$contents = str_replace('class Queue extends BaseConfig', 'class Queue extends BaseQueue', $contents);
$method = <<<'EOT'
Expand All @@ -50,6 +50,8 @@ public function __construct()
/**
* Resolve job class name.
*
* @return class-string<JobInterface>
*/
public function resolveJobClass(string $name): string
{
Expand Down

0 comments on commit 30d7b60

Please sign in to comment.