Convert PackageStructureVersions constants to enum cases
This commit is contained in:
parent
2a16b2de6b
commit
c687d0394d
2 changed files with 25 additions and 33 deletions
|
@ -108,7 +108,7 @@
|
|||
$this->temp_file = @fopen($this->temporary_path, 'wb'); // Create a temporary data file
|
||||
$this->package_file = @fopen($file_path, 'wb');
|
||||
$this->headers = [
|
||||
PackageStructure::FILE_VERSION => PackageStructureVersions::_2_0,
|
||||
PackageStructure::FILE_VERSION => PackageStructureVersions::_2_0->value,
|
||||
PackageStructure::FLAGS => [],
|
||||
PackageStructure::DIRECTORY => []
|
||||
];
|
||||
|
|
|
@ -1,44 +1,36 @@
|
|||
<?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.
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* 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;
|
||||
namespace ncc\Enums;
|
||||
|
||||
final class PackageStructureVersions
|
||||
enum PackageStructureVersions : string
|
||||
{
|
||||
/**
|
||||
* ncc 1.0.0 to 1.0.3
|
||||
*/
|
||||
public const _1_0 = '1.0';
|
||||
case _1_0 = '1.0';
|
||||
|
||||
/**
|
||||
* ncc 1.0.4 and above
|
||||
*/
|
||||
public const _2_0 = '2.0';
|
||||
|
||||
/**
|
||||
* All supported versions
|
||||
*/
|
||||
public const ALL = [
|
||||
self::_1_0,
|
||||
self::_2_0
|
||||
];
|
||||
case _2_0 = '2.0';
|
||||
}
|
Loading…
Add table
Reference in a new issue