Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: namespace in the publish command #16

Merged
merged 1 commit into from
Dec 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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