Remove ComponentFileExtensions enum
This commit is contained in:
parent
b2d2a1ea15
commit
3aedd2d94d
2 changed files with 1 additions and 39 deletions
|
@ -1,34 +0,0 @@
|
||||||
<?php
|
|
||||||
/*
|
|
||||||
* Copyright (c) Nosial 2022-2023, all rights reserved.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
||||||
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
|
|
||||||
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
||||||
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
|
|
||||||
* conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
|
|
||||||
* of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
||||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
||||||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
||||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
||||||
* DEALINGS IN THE SOFTWARE.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace ncc\Enums;
|
|
||||||
|
|
||||||
final class ComponentFileExtensions
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* The file extensions that the PHP compiler extension will accept as components.
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
// TODO: Cannot convert this to enum, try another way
|
|
||||||
public const PHP = ['*.php', '*.php3', '*.php4', '*.php5', '*.phtml'];
|
|
||||||
}
|
|
|
@ -252,16 +252,12 @@
|
||||||
* Returns an array of file extensions for the components that are part of this project
|
* Returns an array of file extensions for the components that are part of this project
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
* @throws NotSupportedException
|
|
||||||
*/
|
*/
|
||||||
public function getComponentFileExtensions(): array
|
public function getComponentFileExtensions(): array
|
||||||
{
|
{
|
||||||
return match ($this->getProjectConfiguration()->getProject()->getCompiler()->getExtension())
|
return match ($this->getProjectConfiguration()->getProject()->getCompiler()->getExtension())
|
||||||
{
|
{
|
||||||
CompilerExtensions::PHP->value => ComponentFileExtensions::PHP,
|
CompilerExtensions::PHP => ['*.php', '*.php3', '*.php4', '*.php5', '*.phtml']
|
||||||
default => throw new NotSupportedException(
|
|
||||||
sprintf('The compiler extension \'%s\' is not supported', $this->getProjectConfiguration()->getProject()->getCompiler()->getExtension())
|
|
||||||
),
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue