-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Got rid of Ocramius Package Version package as it has only PHP 7.4 su…
…pport for Composer 2
- Loading branch information
1 parent
3b8cb7d
commit 6fd2394
Showing
4 changed files
with
38 additions
and
34 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
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,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Contains the DetectsEnumVersion trait. | ||
* | ||
* @copyright Copyright (c) 2020 Attila Fulop | ||
* @author Attila Fulop | ||
* @license MIT | ||
* @since 2020-11-04 | ||
* | ||
*/ | ||
|
||
namespace Konekt\Enum\Eloquent\Tests; | ||
|
||
use Konekt\Enum\Enum; | ||
|
||
trait DetectsEnumVersion | ||
{ | ||
private function getEnumVersion(): string | ||
{ | ||
return defined(Enum::class. '::__DEFAULT') ? '3.0.0' : '2.3.0'; | ||
} | ||
|
||
private function getEnumVersionMajor(): int | ||
{ | ||
$parts = explode('.', $this->getEnumVersion()); | ||
|
||
return (int) $parts[0]; | ||
} | ||
} |
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