Skip to content

Commit

Permalink
Added objects for source types
Browse files Browse the repository at this point in the history
  • Loading branch information
jaxwilko committed Dec 6, 2024
1 parent ac5733c commit b22d11b
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 3 deletions.
3 changes: 1 addition & 2 deletions modules/cms/classes/ThemeManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

namespace Cms\Classes;

use Cms\Classes\Theme;
use System\Classes\Extensions\ExtensionManager;
use System\Classes\Extensions\ExtensionSource;
use System\Classes\Extensions\Source\ExtensionSource;
use System\Classes\Extensions\WinterExtension;
use System\Models\Parameter;
use Winter\Storm\Exception\ApplicationException;
Expand Down
1 change: 1 addition & 0 deletions modules/system/classes/extensions/ExtensionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace System\Classes\Extensions;

use System\Classes\Extensions\Source\ExtensionSource;
use Winter\Storm\Exception\ApplicationException;

interface ExtensionManager
Expand Down
1 change: 1 addition & 0 deletions modules/system/classes/extensions/PluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
use System\Classes\ComposerManager;
use System\Classes\Extensions\Source\ExtensionSource;
use System\Classes\SettingsManager;
use System\Classes\UpdateManager;
use System\Classes\VersionManager;
Expand Down
20 changes: 20 additions & 0 deletions modules/system/classes/extensions/source/ComposerSource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace System\Classes\Extensions\Source;

use Winter\Storm\Exception\ApplicationException;

class ComposerSource extends ExtensionSource
{
/**
* @throws ApplicationException
*/
public function __construct(
string $type,
?string $code = null,
?string $composerPackage = null,
?string $path = null
) {
parent::__construct(static::SOURCE_COMPOSER, $type, $code, $composerPackage, $path);
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<?php

namespace System\Classes\Extensions;
namespace System\Classes\Extensions\Source;

use Cms\Classes\ThemeManager;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\File;
use System\Classes\Extensions\ExtensionManager;
use System\Classes\Extensions\WinterExtension;
use System\Classes\Packager\Composer;
use Winter\Packager\Exceptions\CommandException;
use Winter\Storm\Exception\ApplicationException;
Expand Down
20 changes: 20 additions & 0 deletions modules/system/classes/extensions/source/LocalSource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace System\Classes\Extensions\Source;

use Winter\Storm\Exception\ApplicationException;

class LocalSource extends ExtensionSource
{
/**
* @throws ApplicationException
*/
public function __construct(
string $type,
?string $code = null,
?string $composerPackage = null,
?string $path = null
) {
parent::__construct(static::SOURCE_LOCAL, $type, $code, $composerPackage, $path);
}
}
20 changes: 20 additions & 0 deletions modules/system/classes/extensions/source/MarketSource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace System\Classes\Extensions\Source;

use Winter\Storm\Exception\ApplicationException;

class MarketSource extends ExtensionSource
{
/**
* @throws ApplicationException
*/
public function __construct(
string $type,
?string $code = null,
?string $composerPackage = null,
?string $path = null
) {
parent::__construct(static::SOURCE_MARKET, $type, $code, $composerPackage, $path);
}
}

0 comments on commit b22d11b

Please sign in to comment.