-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dependency types are not hard-coded literals
Previously we hard-coded the list of dependency types wherever we needed to use them. In order to manage language packs within Whippet, we now need to add to the list of dependency types. So, rather than have them scattered over the code, we now have them in one place. Once we have dropped PHP 7.4 support, we should really use an enumeration here. Fixes #70
- Loading branch information
Showing
6 changed files
with
31 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
describe(\Dxw\Whippet\Dependencies\DependencyTypes::class, function () { | ||
context("getDependencyTypes()", function () { | ||
it('returns a list of dependencies as strings', function () { | ||
expect(\Dxw\Whippet\Dependencies\DependencyTypes::getDependencyTypes())->toBe(['themes', 'plugins']); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Dxw\Whippet\Dependencies; | ||
|
||
class DependencyTypes | ||
{ | ||
public const PLUGINS = 'plugins'; | ||
public const THEMES = 'themes'; | ||
|
||
|
||
public static function getDependencyTypes() | ||
{ | ||
|
||
return [DependencyTypes::THEMES, DependencyTypes::PLUGINS]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters