Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Kim-the-Diamond authored and github-actions[bot] committed Oct 1, 2024
1 parent 72eafc3 commit 31dbc7b
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 54 deletions.
1 change: 1 addition & 0 deletions packages/builder/tests/ArchTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

arch()
->expect('Moox\Builder')
->toUseStrictTypes()
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/Http/Controllers/Api/ModelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ public function index()
$available_models = [];

foreach ($packages as $package) {
$namespace = str_replace(' ', '\\', $package['package']) . '\\Models\\';
$namespace = str_replace(' ', '\\', $package['package']).'\\Models\\';

foreach ($package['models'] as $model => $api) {
$fullModelName = $namespace . $model;
$fullModelName = $namespace.$model;
if (class_exists($fullModelName)) {
$available_models[] = $fullModelName;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/Http/SharedHosting/Scheduler.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public function __invoke()

return 'Scheduler run was successful';
} else {
activity()->log('Ran Scheduler with output: ' . $output);
activity()->log('Ran Scheduler with output: '.$output);

return 'Scheduler ran with output: ' . $output;
return 'Scheduler ran with output: '.$output;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Moox\Expiry\Http\Controllers\Api;

use Illuminate\Http\Request;
use Moox\Expiry\Models\Expiry;
use Illuminate\Routing\Controller;
use Moox\Expiry\Models\Expiry;

class ExpiryController extends Controller
{
Expand Down
6 changes: 3 additions & 3 deletions packages/jobs/src/Http/SharedHosting/QueueWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ public function __invoke()
$timeout = request('timeout');
}

$output = Artisan::call('queue:work --once --timeout=' . $timeout);
$output = Artisan::call('queue:work --once --timeout='.$timeout);

if ($output == 0) {
activity()->log('Queue worker ran successfully');

return 'Queue worker run was successful';
} else {
activity()->log('Ran queue worker with output: ' . $output);
activity()->log('Ran queue worker with output: '.$output);

return 'Queue worker ran with output: ' . $output;
return 'Queue worker ran with output: '.$output;
}
}
}
10 changes: 5 additions & 5 deletions packages/login-link/src/Http/Controllers/LoginLinkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
namespace Moox\LoginLink\Http\Controllers;

use App\Models\User;
use Illuminate\Support\Str;
use Illuminate\Contracts\Encryption\DecryptException;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Mail;
use Moox\LoginLink\Models\LoginLink;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Str;
use Moox\LoginLink\Mail\LoginLinkEmail;
use Illuminate\Contracts\Encryption\DecryptException;
use Moox\LoginLink\Models\LoginLink;

class LoginLinkController extends Controller
{
Expand Down Expand Up @@ -72,7 +72,7 @@ public function authenticate($userId, $token)

$loginLink->update(['used_at' => now()]);

$userModel = Config::get('login-link.user_models.' . $userType, User::class);
$userModel = Config::get('login-link.user_models.'.$userType, User::class);
$user = $userModel::findOrFail($userId);
Auth::login($user);

Expand Down
40 changes: 19 additions & 21 deletions packages/press/src/Commands/InstallWordPress.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function prepareComposer(): void
{
info('Preparing composer.json file...');

$composerSource = __DIR__ . '/../../wordpress/composer.json';
$composerSource = __DIR__.'/../../wordpress/composer.json';
$composerDestination = public_path('composer.json');

if (File::exists($composerDestination)) {
Expand Down Expand Up @@ -214,8 +214,8 @@ public function prepareWpConfig(): void
info("WordPress directory already exists at {$fullWpPath}.");
}

$wpConfigSource = __DIR__ . '/../../wordpress/wp-config.php';
$wpConfigDestination = $fullWpPath . '/wp-config.php';
$wpConfigSource = __DIR__.'/../../wordpress/wp-config.php';
$wpConfigDestination = $fullWpPath.'/wp-config.php';

if (File::exists($wpConfigDestination)) {
$overwrite = $this->ask('The wp-config.php file already exists in the WordPress directory. Do you want to overwrite it? (yes/no)', 'no');
Expand Down Expand Up @@ -283,22 +283,22 @@ public function useOrInstallWpCli(): void
$this->info('Moving wp-cli.phar to a user directory in your PATH...');

// Determine a directory that is in the user's PATH and doesn't require admin rights
$targetDir = getenv('APPDATA') . '\Composer\vendor\bin';
$targetDir = getenv('APPDATA').'\Composer\vendor\bin';
if (! file_exists($targetDir)) {
mkdir($targetDir, 0755, true);
}

$targetPath = $targetDir . '\wp.bat';
$targetPath = $targetDir.'\wp.bat';

// Create a .bat file that runs the .phar
$batContent = "@ECHO OFF\r\nphp \"%~dp0wp-cli.phar\" %*";
file_put_contents($targetPath, $batContent);

if (! @rename(base_path('wp-cli.phar'), $targetDir . '\wp-cli.phar')) {
$this->error('Failed to move wp-cli.phar to ' . $targetDir);
if (! @rename(base_path('wp-cli.phar'), $targetDir.'\wp-cli.phar')) {
$this->error('Failed to move wp-cli.phar to '.$targetDir);
exit(1);
} else {
$this->info('wp-cli installed successfully in ' . $targetDir);
$this->info('wp-cli installed successfully in '.$targetDir);
}
} else {
$this->info('Moving wp-cli.phar to /usr/local/bin/wp...');
Expand Down Expand Up @@ -327,12 +327,12 @@ public function wpInstall(): void
$env = $this->getDotenv();

$wpPath = base_path(trim($env['WP_PATH'], '/'));
if (! File::exists($wpPath . '/wp-config.php')) {
if (! File::exists($wpPath.'/wp-config.php')) {
alert('wp-config.php not found! Please ensure the file is created and configured.');
exit(1);
}

$siteUrl = $env['APP_URL'] . $env['WP_SLUG'];
$siteUrl = $env['APP_URL'].$env['WP_SLUG'];
$defaultSiteTitle = $env['APP_NAME'];
$siteTitle = $this->ask('Please enter the site title', $defaultSiteTitle);
$adminUser = 'sysadm';
Expand All @@ -346,11 +346,11 @@ public function wpInstall(): void
'wp',
'core',
'install',
'--url=' . $siteUrl,
'--title=' . $siteTitle,
'--admin_user=' . $adminUser,
'--admin_password=' . $adminPassword,
'--admin_email=' . $adminEmail,
'--url='.$siteUrl,
'--title='.$siteTitle,
'--admin_user='.$adminUser,
'--admin_password='.$adminPassword,
'--admin_email='.$adminEmail,
];

foreach ($env as $key => $value) {
Expand Down Expand Up @@ -419,10 +419,10 @@ public function pressPluginInstall(): void
$wpPath = env('WP_PATH', '/public/wp');
$fullWpPath = base_path(trim($wpPath, '/'));

$pluginsPath = $fullWpPath . '/wp-content/plugins';
$pluginsPath = $fullWpPath.'/wp-content/plugins';

$pluginSource = __DIR__ . '/../../wordpress/plugins/moox-press';
$pluginDestination = $pluginsPath . '/moox-press';
$pluginSource = __DIR__.'/../../wordpress/plugins/moox-press';
$pluginDestination = $pluginsPath.'/moox-press';

if (! File::exists($pluginSource)) {
alert('The Moox Press plugin source directory does not exist.');
Expand Down Expand Up @@ -474,7 +474,7 @@ protected function generateSecurePassword(): string
$uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
$numbers = '0123456789';
$special = '!@#$%^&*()';
$all = $lowercase . $uppercase . $numbers . $special;
$all = $lowercase.$uppercase.$numbers.$special;

$password = '';
$password .= $lowercase[random_int(0, strlen($lowercase) - 1)];
Expand All @@ -486,8 +486,6 @@ protected function generateSecurePassword(): string
$password .= $all[random_int(0, strlen($all) - 1)];
}



return str_shuffle($password);
}
}
4 changes: 2 additions & 2 deletions packages/sync/src/Http/Controllers/Api/PlatformController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace Moox\Sync\Http\Controllers\Api;

use Illuminate\Http\Request;
use Moox\Sync\Models\Platform;
use Illuminate\Routing\Controller;
use Moox\Sync\Http\Resources\SyncResource;
use Moox\Sync\Http\Resources\PlatformResource;
use Moox\Sync\Http\Resources\SyncResource;
use Moox\Sync\Models\Platform;

class PlatformController extends Controller
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Moox\Sync\Http\Controllers\Api;

use Moox\Sync\Models\Sync;
use Illuminate\Routing\Controller;
use Moox\Sync\Http\Resources\SyncResource;
use Moox\Sync\Models\Sync;

class PlatformSyncController extends Controller
{
Expand Down
2 changes: 1 addition & 1 deletion packages/sync/src/Http/Controllers/Api/SyncController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Moox\Sync\Http\Controllers\Api;

use Illuminate\Routing\Controller;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Moox\Sync\Http\Resources\SyncResource;
use Moox\Sync\Models\Sync;

Expand Down
2 changes: 1 addition & 1 deletion packages/sync/src/Http/Controllers/FileSyncController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Moox\Sync\Http\Controllers;

use Illuminate\Routing\Controller;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Validator;
use Moox\Core\Traits\LogLevel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Moox\Sync\Http\Controllers;

use Illuminate\Routing\Controller;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Moox\Core\Traits\LogLevel;
use Moox\Sync\Jobs\FileSyncJob;
use Moox\Sync\Models\Platform;
Expand Down
8 changes: 4 additions & 4 deletions packages/sync/src/Http/Controllers/SyncWebhookController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace Moox\Sync\Http\Controllers;

use Moox\Sync\Jobs\SyncJob;
use Illuminate\Http\Request;
use Moox\Core\Traits\LogLevel;
use Moox\Sync\Models\Platform;
use Moox\Sync\Jobs\FileSyncJob;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Storage;
use Moox\Core\Traits\LogLevel;
use Moox\Sync\Jobs\FileSyncJob;
use Moox\Sync\Jobs\SyncJob;
use Moox\Sync\Models\Platform;

class SyncWebhookController extends Controller
{
Expand Down
12 changes: 6 additions & 6 deletions packages/user/src/Commands/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function handle()
if ($panelsToregister != null) {
if (is_array($panelsToregister)) {
foreach ($panelsToregister as $panelprovider) {
$this->registerPlugins($providerPath . '/' . $panelprovider);
$this->registerPlugins($providerPath.'/'.$panelprovider);
}
} else {
$this->registerPlugins($panelsToregister);
Expand Down Expand Up @@ -140,7 +140,7 @@ public function customizeFilament(): void
if (isset($translations['nav']['group'])) {
$translations['nav']['group'] = 'Moox User';
$outputPath = $file->getPathname();
$content = "<?php\n\nreturn " . print_r($translations, true) . ";\n";
$content = "<?php\n\nreturn ".print_r($translations, true).";\n";
File::put($outputPath, $content);
$this->info("Updated {$file->getFilename()} in {$localePath}");
}
Expand Down Expand Up @@ -171,11 +171,11 @@ public function registerPlugins(string $providerPath): void
$newPlugins = '';

foreach ($pluginsToAdd as $plugin) {
$searchPlugin = '/' . $plugin . '/';
$searchPlugin = '/'.$plugin.'/';
if (preg_match($searchPlugin, $content)) {
warning("$plugin already registered.");
} else {
$newPlugins .= $intend . $namespace . '\\' . $plugin . $function . "\n";
$newPlugins .= $intend.$namespace.'\\'.$plugin.$function."\n";
}
}

Expand All @@ -190,7 +190,7 @@ public function registerPlugins(string $providerPath): void

$pluginsSection = " ->plugins([\n$newPlugins\n ]);";
$placeholderPattern = '/(\->authMiddleware\(\[.*?\]\))\s*\;/s';
$replacement = "$1\n" . $pluginsSection;
$replacement = "$1\n".$pluginsSection;
$newContent = preg_replace($placeholderPattern, $replacement, $content, 1);
}

Expand All @@ -217,7 +217,7 @@ public function getPanelProviderPath(): string|array
);
}
if (count($providers) == 1) {
$providerPath .= '/' . $providers[0]->getBasename();
$providerPath .= '/'.$providers[0]->getBasename();
}

return $providerPath;
Expand Down
6 changes: 3 additions & 3 deletions tests/ArchTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

arch()
->expect('App')
->not->toUse(['die', 'dd', 'dump']);
Expand All @@ -8,7 +9,6 @@
->toOnlyBeUsedIn('App')
->ignoring('App\Models\User');


arch()
->expect('App\Models')
->toBeClasses()
Expand All @@ -20,5 +20,5 @@
->expect('App\Http')
->toOnlyBeUsedIn('App\Http');

#arch()->preset()->php();
#arch()->preset()->security()->ignoring('md5');
//arch()->preset()->php();
//arch()->preset()->security()->ignoring('md5');
1 change: 0 additions & 1 deletion tests/Pest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

use Illuminate\Support\Facades\DB;
use Moox\User\Models\User;

/*
Expand Down

0 comments on commit 31dbc7b

Please sign in to comment.