Skip to content

Commit

Permalink
Merge pull request #16 from contao-estatemanager/support/1.0
Browse files Browse the repository at this point in the history
Support/1.0
  • Loading branch information
eki89 authored Oct 27, 2022
2 parents d3dd45e + b6a158a commit 3810454
Show file tree
Hide file tree
Showing 17 changed files with 673 additions and 624 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
The project extension for Contao EstateManager allows you to display new construction projects, more extensive objects with several residential units or entire residential parks.

# License
Copyright © 2020 Contao EstateManager
Copyright © 2021 Contao EstateManager

🎫 [Get license](https://www.contao-estatemanager.com/de/erweiterungen/projekte.html) \
[License agreement](https://www.contao-estatemanager.com/de/lizenzbedingungen.html) (German)
12 changes: 9 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
}
],
"require":{
"php":">=7.1",
"contao/core-bundle":"^4.4",
"php":"^7.4 || ^8.0",
"contao/core-bundle":"^4.9",
"contao-estatemanager/core": "^1.0"
},
"require-dev": {
"contao/manager-plugin": "^2.0"
"contao/manager-plugin": "^2.0",
"contao/easy-coding-standard": "^3.4"
},
"conflict": {
"contao/core": "*",
Expand All @@ -40,5 +41,10 @@
},
"extra":{
"contao-manager-plugin": "ContaoEstateManager\\Project\\ContaoManager\\Plugin"
},
"scripts": {
"cs-fixer": [
"vendor/bin/ecs check src/ --fix --ansi"
]
}
}
34 changes: 34 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Fixer\Basic\BracesFixer;
use PhpCsFixer\Fixer\Comment\HeaderCommentFixer;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\EasyCodingStandard\ValueObject\Option;
use SlevomatCodingStandard\Sniffs\TypeHints\DisallowArrayTypeHintSyntaxSniff;

return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->import(__DIR__.'/vendor/contao/easy-coding-standard/config/set/contao.php');

$parameters = $containerConfigurator->parameters();
$parameters->set(Option::LINE_ENDING, "\n");
$parameters->set(Option::SKIP, [
DisallowArrayTypeHintSyntaxSniff::class => null,
]);

$services = $containerConfigurator->services();
$services
->set(HeaderCommentFixer::class)
->call('configure', [[
'header' => "This file is part of Contao EstateManager.\n\n@see https://www.contao-estatemanager.com/\n@source https://github.com/contao-estatemanager/project\n@copyright Copyright (c) ".date('Y')." Oveleon GbR (https://www.oveleon.de)\n@license https://www.contao-estatemanager.com/lizenzbedingungen.html",
]])
;

$services
->set(BracesFixer::class)
->call('configure', [[
'position_after_control_structures' => 'next',
]])
;
};
17 changes: 9 additions & 8 deletions src/ContaoManager/Plugin.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
<?php
/**

declare(strict_types=1);

/*
* This file is part of Contao EstateManager.
*
* @link https://www.contao-estatemanager.com/
* @source https://github.com/contao-estatemanager/project
* @copyright Copyright (c) 2019 Oveleon GbR (https://www.oveleon.de)
* @license https://www.contao-estatemanager.com/lizenzbedingungen.html
* @see https://www.contao-estatemanager.com/
* @source https://github.com/contao-estatemanager/project
* @copyright Copyright (c) 2021 Oveleon GbR (https://www.oveleon.de)
* @license https://www.contao-estatemanager.com/lizenzbedingungen.html
*/

declare(strict_types=1);

namespace ContaoEstateManager\Project\ContaoManager;

use Contao\CoreBundle\ContaoCoreBundle;
use Contao\ManagerPlugin\Bundle\BundlePluginInterface;
use Contao\ManagerPlugin\Bundle\Config\BundleConfig;
use Contao\ManagerPlugin\Bundle\Parser\ParserInterface;
use ContaoEstateManager\EstateManager\EstateManager;
use ContaoEstateManager\Project\EstateManagerProject;
use ContaoEstateManager\GoogleMaps\EstateManagerGoogleMaps;
use ContaoEstateManager\Project\EstateManagerProject;

class Plugin implements BundlePluginInterface
{
Expand Down
17 changes: 9 additions & 8 deletions src/EstateManagerProject.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<?php
/**

declare(strict_types=1);

/*
* This file is part of Contao EstateManager.
*
* @link https://www.contao-estatemanager.com/
* @source https://github.com/contao-estatemanager/project
* @copyright Copyright (c) 2019 Oveleon GbR (https://www.oveleon.de)
* @license https://www.contao-estatemanager.com/lizenzbedingungen.html
* @see https://www.contao-estatemanager.com/
* @source https://github.com/contao-estatemanager/project
* @copyright Copyright (c) 2021 Oveleon GbR (https://www.oveleon.de)
* @license https://www.contao-estatemanager.com/lizenzbedingungen.html
*/

declare(strict_types=1);

namespace ContaoEstateManager\Project;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class EstateManagerProject extends Bundle
{
}
}
48 changes: 28 additions & 20 deletions src/Resources/contao/classes/AddonManager.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<?php
/**

declare(strict_types=1);

/*
* This file is part of Contao EstateManager.
*
* @link https://www.contao-estatemanager.com/
* @source https://github.com/contao-estatemanager/project
* @copyright Copyright (c) 2019 Oveleon GbR (https://www.oveleon.de)
* @license https://www.contao-estatemanager.com/lizenzbedingungen.html
* @see https://www.contao-estatemanager.com/
* @source https://github.com/contao-estatemanager/project
* @copyright Copyright (c) 2021 Oveleon GbR (https://www.oveleon.de)
* @license https://www.contao-estatemanager.com/lizenzbedingungen.html
*/

namespace ContaoEstateManager\Project;
Expand All @@ -17,37 +20,43 @@
class AddonManager
{
/**
* Bundle name
* Bundle name.
*
* @var string
*/
public static $bundle = 'EstateManagerProject';

/**
* Package
* Package.
*
* @var string
*/
public static $package = 'contao-estatemanager/project';

/**
* Addon config key
* Addon config key.
*
* @var string
*/
public static $key = 'addon_project_license';
public static $key = 'addon_project_license';

/**
* Is initialized
* @var boolean
* Is initialized.
*
* @var bool
*/
public static $initialized = false;
public static $initialized = false;

/**
* Is valid
* @var boolean
* Is valid.
*
* @var bool
*/
public static $valid = false;
public static $valid = false;

/**
* Licenses
* Licenses.
*
* @var array
*/
private static $licenses = [
Expand Down Expand Up @@ -100,7 +109,7 @@ class AddonManager
'bfd0a675e2782ae2122248d4e7ae3b61',
'ddea2c83ca66ec610f4c677f21820993',
'71e16c05d62f94a9514bf87cb2c12ac4',
'0ca8d2e49c5cd6c553501af01c93df6a'
'0ca8d2e49c5cd6c553501af01c93df6a',
];

public static function getLicenses()
Expand All @@ -110,18 +119,17 @@ public static function getLicenses()

public static function valid()
{
if(strpos(Environment::get('requestUri'), '/contao/install') !== false)
if (false !== strpos(Environment::get('requestUri'), '/contao/install'))
{
return true;
}

if (static::$initialized === false)
if (false === static::$initialized)
{
static::$valid = EstateManager::checkLicenses(Config::get(static::$key), static::$licenses, static::$key);
static::$initialized = true;
}

return static::$valid;
}

}
Loading

0 comments on commit 3810454

Please sign in to comment.