Skip to content

Commit cc5dfba

Browse files
authored
Merge pull request #119 from pimcore/add_version_resolver
[Task] Add `lib\Version` resolver
2 parents 03be7ca + a933e4c commit cc5dfba

File tree

4 files changed

+107
-0
lines changed

4 files changed

+107
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
/**
5+
* This source file is available under the terms of the
6+
* Pimcore Open Core License (POCL)
7+
* Full copyright and license information is available in
8+
* LICENSE.md which is distributed with this source code.
9+
*
10+
* @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com)
11+
* @license Pimcore Open Core License (POCL)
12+
*/
13+
14+
namespace Pimcore\Bundle\StaticResolverBundle\Contract\Lib;
15+
16+
use Pimcore\Version;
17+
18+
class VersionResolverContract implements VersionResolverContractInterface
19+
{
20+
public function getMajorVersion(): int
21+
{
22+
return Version::getMajorVersion();
23+
}
24+
25+
public function getVersion(): string
26+
{
27+
return Version::getVersion();
28+
}
29+
30+
public function getRevision(): string
31+
{
32+
return Version::getRevision();
33+
}
34+
35+
public function getPlatformVersion(): ?string
36+
{
37+
return Version::getPlatformVersion();
38+
}
39+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
/**
5+
* This source file is available under the terms of the
6+
* Pimcore Open Core License (POCL)
7+
* Full copyright and license information is available in
8+
* LICENSE.md which is distributed with this source code.
9+
*
10+
* @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com)
11+
* @license Pimcore Open Core License (POCL)
12+
*/
13+
14+
namespace Pimcore\Bundle\StaticResolverBundle\Contract\Lib;
15+
16+
interface VersionResolverContractInterface
17+
{
18+
public function getMajorVersion(): int;
19+
public function getVersion(): string;
20+
public function getRevision(): string;
21+
public function getPlatformVersion(): ?string;
22+
}

src/Lib/VersionResolver.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
/**
5+
* This source file is available under the terms of the
6+
* Pimcore Open Core License (POCL)
7+
* Full copyright and license information is available in
8+
* LICENSE.md which is distributed with this source code.
9+
*
10+
* @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com)
11+
* @license Pimcore Open Core License (POCL)
12+
*/
13+
14+
namespace Pimcore\Bundle\StaticResolverBundle\Lib\Tools;
15+
16+
use Pimcore\Bundle\StaticResolverBundle\Contract\Lib\VersionResolverContract;
17+
18+
/**
19+
* @internal
20+
*/
21+
final class VersionResolver extends VersionResolverContract implements VersionResolverInterface
22+
{
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
/**
5+
* This source file is available under the terms of the
6+
* Pimcore Open Core License (POCL)
7+
* Full copyright and license information is available in
8+
* LICENSE.md which is distributed with this source code.
9+
*
10+
* @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com)
11+
* @license Pimcore Open Core License (POCL)
12+
*/
13+
14+
namespace Pimcore\Bundle\StaticResolverBundle\Lib\Tools;
15+
16+
use Pimcore\Bundle\StaticResolverBundle\Contract\Lib\VersionResolverContractInterface;
17+
18+
/**
19+
* @internal
20+
*/
21+
interface VersionResolverInterface extends VersionResolverContractInterface
22+
{
23+
}

0 commit comments

Comments
 (0)