Skip to content

Commit

Permalink
adjust license (#240)
Browse files Browse the repository at this point in the history
solverat authored Jan 8, 2025
1 parent 6ec2e26 commit 2b2eaea
Showing 13 changed files with 217 additions and 318 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/ecs-fix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Coding standard refactor
on:
schedule:
- cron: '0 0 * * SUN'
workflow_dispatch: ~

jobs:
ecs-fix:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
branch: [ 'master' ]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3

- name: Composer install
run: composer install --no-interaction --no-scripts

- name: Run ECS
run: |
vendor/bin/ecs check src --fix --config ecs.php
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: '[CS] Refactor'
author: DACHCOM Bot <bot@dachcom.ch>
title: '[CS] Refactor'
body: |
This PR has been generated automatically to fix code-styles
labels: |
Enhancement
branch: coding-standard/refactor-${{ matrix.branch }}
delete-branch: true
base: ${{ matrix.branch }}
117 changes: 0 additions & 117 deletions .github/workflows/ecs.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -40,10 +40,9 @@ atlassian-ide-plugin.xml
.project
ehthumbs.db
Thumbs.db
Vagrantfile
.vagrant
php-cgi.core
.sass-cache
/vendor/
/composer.lock

# codeception (only stage *.dist.yaml config files)
/codeception.yaml
20 changes: 14 additions & 6 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# License
Copyright (C) 2023 DACHCOM.DIGITAL
Copyright (C) DACHCOM.DIGITAL

This software is available under the GNU General Public License version 3 (GPLv3).
This software is available under two different licenses:
* GNU General Public License version 3 (GPLv3) as Pimcore Community Edition
* DACHCOM Commercial License (DCL)

### GNU General Public License version 3 (GPLv3)
If you decide to choose the GPLv3 license, you must comply with the following terms:
The default Social Data Bundle license, without a valid DACHCOM Commercial License agreement, is the Open-Source GPLv3 license.

## GNU General Public License version 3 (GPLv3)
If you decide to choose the GPLv3 license, you must comply with the following terms:

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,10 +17,14 @@ the Free Software Foundation, either version 3 of the License, or

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

[GNU General Public License](https://www.gnu.org/licenses/gpl-3.0.en.html)
## DACHCOM Commercial License (DCL)
Alternatively, commercial and supported versions of the program - also known as
Commercial Distributions - must be used in accordance with the terms and conditions
contained in a separate written agreement between you and DACHCOM.DIGITAL AG.
For more information about the Social Data Bundle Commercial License (DCL) please contact dcdi@dachcom.ch.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@

The Toolbox is a Kickstarter for your every day project. It provides some important bricks and structure basics which allow rapid and quality-oriented web development.

[![Join the chat at https://gitter.im/pimcore/pimcore](https://img.shields.io/gitter/room/pimcore/pimcore.svg?style=flat-square)](https://gitter.im/pimcore/pimcore)
[![Software License](https://img.shields.io/badge/license-GPLv3-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Software License](https://img.shields.io/badge/license-DCL-white.svg?style=flat-square&color=%23ff5c5c)](LICENSE.md)
[![Latest Release](https://img.shields.io/packagist/v/dachcom-digital/toolbox.svg?style=flat-square)](https://packagist.org/packages/dachcom-digital/toolbox)
[![Tests](https://img.shields.io/github/actions/workflow/status/dachcom-digital/pimcore-toolbox/.github/workflows/codeception.yml?branch=master&style=flat-square&logo=github&label=codeception)](https://github.com/dachcom-digital/pimcore-toolbox/actions?query=workflow%3ACodeception+branch%3Amaster)
[![PhpStan](https://img.shields.io/github/actions/workflow/status/dachcom-digital/pimcore-toolbox/.github/workflows/php-stan.yml?branch=master&style=flat-square&logo=github&label=phpstan%20level%204)](https://github.com/dachcom-digital/pimcore-toolbox/actions?query=workflow%3A"PHP+Stan"+branch%3Amaster)
@@ -15,7 +15,7 @@ The Toolbox is a Kickstarter for your every day project. It provides some import

| Release | Supported Pimcore Versions | Supported Symfony Versions | Release Date | Maintained | Branch |
|---------|-----------------------------------|----------------------------|--------------|----------------|----------|
| **5.x** | `11.0` | `6.2` | 28.09.2023 | Feature Branch | master |
| **5.x** | `11.0` | `6.4` | 28.09.2023 | Feature Branch | master |
| **4.x** | `10.5`, `10.6` | `5.4` | 01.10.2021 | Bugfixes | 4.x |
| **3.x** | `6.0` - `6.9` | `3.4`, `^4.4` | 16.07.2019 | Unsupported | 3.x |
| **2.8** | `5.4`, `5.5`, `5.6`, `5.7`, `5.8` | `3.4` | 30.06.2019 | Unsupported | 2.8 |
@@ -25,7 +25,7 @@ The Toolbox is a Kickstarter for your every day project. It provides some import

```json
"require" : {
"dachcom-digital/toolbox" : "~5.2.0"
"dachcom-digital/toolbox" : "~5.3.0"
}
```

@@ -107,12 +107,12 @@ The Toolbox provides a lot of [ready-to-use Bricks](docs/11_ElementsOverview.md)
- Fix the pimcore iframe [maskFrames](public/js/document/edit.js) bug (in some cases the iframe overlay field does not apply to the right position)
- Transforms all the brick config buttons (`pimcore_area_edit_button_*`) to more grateful ones.

## Upgrade Info
Before updating, please [check our upgrade notes!](UPGRADE.md)

## License
**DACHCOM.DIGITAL AG**, Löwenhofstrasse 15, 9424 Rheineck, Schweiz
[dachcom.com](https://www.dachcom.com), dcdi@dachcom.ch
Copyright © 2024 DACHCOM.DIGITAL. All rights reserved.
Copyright © 2025 DACHCOM.DIGITAL. All rights reserved.

For licensing details please visit [LICENSE.md](LICENSE.md)

## Upgrade Info
Before updating, please [check our upgrade notes!](UPGRADE.md)
1 change: 1 addition & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Upgrade Notes

## 5.3.0
- [LICENSE] Dual-License with GPL and Dachcom Commercial License (DCL) added
- [ENHANCEMENT] [Quill Editor Bundle](https://github.com/pimcore/quill-bundle) Support added. See [Editor Configuration Section](./docs/13_Wysiwyg_Editor.md#quill)

## 5.2.2
13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{
"name": "dachcom-digital/toolbox",
"type": "pimcore-bundle",
"license": "GPL-3.0-or-later",
"license": [
"GPL-3.0-or-later",
"proprietary"
],
"description": "Pimcore Project Kickstarter",
"keywords": ["pimcore", "toolbox"],
"homepage": "https://github.com/dachcom-digital/pimcore-toolbox",
"authors": [
{
"name": "DACHCOM.DIGITAL Stefan Hagspiel",
"email": "shagspiel@dachcom.ch",
"homepage": "http://www.dachcom.com/",
"homepage": "https://www.dachcom.com",
"role": "Developer"
}
],
@@ -37,8 +40,8 @@
"codeception/codeception": "^5.0",
"codeception/module-symfony": "^3.1",
"codeception/module-webdriver": "^4.0",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-symfony": "^1.0",
"symplify/easy-coding-standard": "^9.0"
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-symfony": "^2.0",
"symplify/easy-coding-standard": "~12.2.0"
}
}
285 changes: 128 additions & 157 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -1,162 +1,133 @@
<?php

use PhpCsFixer\Fixer;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\EasyCodingStandard\ValueObject\Option;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

return static function (ContainerConfigurator $containerConfigurator): void {

// B. full sets
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::SETS, [SetList::CLEAN_CODE, SetList::PSR_12]);

$services = $containerConfigurator->services();

$services->set(Fixer\Basic\BracesFixer::class)
->call('configure', [
[
'allow_single_line_closure' => true,
]
]);

$services->set(Fixer\PhpTag\BlankLineAfterOpeningTagFixer::class);

$services->set(Fixer\Operator\ConcatSpaceFixer::class)
->call('configure', [
[
'spacing' => 'one',
]
]);

$services->set(Fixer\Operator\NewWithBracesFixer::class);

$services->set(Fixer\Phpdoc\PhpdocAlignFixer::class)
->call('configure', [
[
'tags' => ['method', 'param', 'property', 'return', 'throws', 'type', 'var'],
]
]);

$services->set(Fixer\Operator\BinaryOperatorSpacesFixer::class)
->call('configure', [
[
'operators' => [
'=' => 'single_space',
'=>' => 'align',
]
]
]);
$services->set(Fixer\Operator\IncrementStyleFixer::class)
->call('configure', [
[
'style' => 'post',
]
]);

$services->set(Fixer\Operator\UnaryOperatorSpacesFixer::class);
$services->set(Fixer\Whitespace\BlankLineBeforeStatementFixer::class);
$services->set(Fixer\CastNotation\CastSpacesFixer::class);
$services->set(Fixer\LanguageConstruct\DeclareEqualNormalizeFixer::class);
$services->set(Fixer\FunctionNotation\FunctionTypehintSpaceFixer::class);
$services->set(Fixer\Comment\SingleLineCommentStyleFixer::class)
->call('configure', [
[
'comment_types' => ['hash'],
]
]);

$services->set(Fixer\ControlStructure\IncludeFixer::class);
$services->set(Fixer\CastNotation\LowercaseCastFixer::class);
$services->set(Fixer\ClassNotation\ClassAttributesSeparationFixer::class)
->call('configure', [
[
'elements' => [
'const' => 'none',
'method' => 'one',
'property' => 'none',
'trait_import' => 'none'
],
]
]);

$services->set(Fixer\Casing\NativeFunctionCasingFixer::class);
$services->set(Fixer\ClassNotation\NoBlankLinesAfterClassOpeningFixer::class);
$services->set(Fixer\Phpdoc\NoBlankLinesAfterPhpdocFixer::class);
$services->set(Fixer\Comment\NoEmptyCommentFixer::class);
$services->set(Fixer\Phpdoc\NoEmptyPhpdocFixer::class);
$services->set(Fixer\Phpdoc\PhpdocSeparationFixer::class);
$services->set(Fixer\Semicolon\NoEmptyStatementFixer::class);
$services->set(Fixer\Whitespace\ArrayIndentationFixer::class);
$services->set(Fixer\Whitespace\NoExtraBlankLinesFixer::class)
->call('configure', [
[
'tokens' => ['curly_brace_block', 'extra', 'parenthesis_brace_block', 'square_brace_block', 'throw', 'use'],
]
]);

$services->set(Fixer\NamespaceNotation\NoLeadingNamespaceWhitespaceFixer::class);
$services->set(Fixer\ArrayNotation\NoMultilineWhitespaceAroundDoubleArrowFixer::class);
$services->set(Fixer\CastNotation\NoShortBoolCastFixer::class);
$services->set(Fixer\Semicolon\NoSinglelineWhitespaceBeforeSemicolonsFixer::class);
$services->set(Fixer\Whitespace\NoSpacesAroundOffsetFixer::class);
$services->set(Fixer\ControlStructure\NoTrailingCommaInListCallFixer::class);
$services->set(Fixer\ControlStructure\NoUnneededControlParenthesesFixer::class);
$services->set(Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer::class);
$services->set(Fixer\Whitespace\NoWhitespaceInBlankLineFixer::class);
$services->set(Fixer\ArrayNotation\NormalizeIndexBraceFixer::class);
$services->set(Fixer\Operator\ObjectOperatorWithoutWhitespaceFixer::class);
$services->set(Fixer\Phpdoc\PhpdocAnnotationWithoutDotFixer::class);
$services->set(Fixer\Phpdoc\PhpdocIndentFixer::class);
$services->set(Fixer\Phpdoc\PhpdocInlineTagFixer::class);
$services->set(Fixer\Phpdoc\PhpdocNoAccessFixer::class);
$services->set(Fixer\Phpdoc\PhpdocNoEmptyReturnFixer::class);
$services->set(Fixer\Phpdoc\PhpdocNoPackageFixer::class);
$services->set(Fixer\Phpdoc\PhpdocNoUselessInheritdocFixer::class);
$services->set(Fixer\Phpdoc\PhpdocReturnSelfReferenceFixer::class);
$services->set(Fixer\Phpdoc\PhpdocScalarFixer::class);
$services->set(Fixer\Phpdoc\PhpdocSingleLineVarSpacingFixer::class);
$services->set(Fixer\Phpdoc\PhpdocSummaryFixer::class);
$services->set(Fixer\Phpdoc\PhpdocToCommentFixer::class);
$services->set(Fixer\Phpdoc\PhpdocTrimFixer::class);
$services->set(Fixer\Phpdoc\PhpdocTypesFixer::class);
$services->set(Fixer\Phpdoc\PhpdocVarWithoutNameFixer::class);
$services->set(Fixer\FunctionNotation\ReturnTypeDeclarationFixer::class);
$services->set(Fixer\ClassNotation\SelfAccessorFixer::class);
$services->set(Fixer\CastNotation\ShortScalarCastFixer::class);
$services->set(Fixer\StringNotation\SingleQuoteFixer::class);
$services->set(Fixer\Semicolon\SpaceAfterSemicolonFixer::class);
$services->set(Fixer\Operator\StandardizeNotEqualsFixer::class);
$services->set(Fixer\Operator\TernaryOperatorSpacesFixer::class);
$services->set(Fixer\ArrayNotation\TrimArraySpacesFixer::class);
$services->set(Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer::class);

$services->set(Fixer\ClassNotation\ClassDefinitionFixer::class)
->call('configure', [
[
'single_line' => true,
]
]);

$services->set(Fixer\Casing\MagicConstantCasingFixer::class);
$services->set(Fixer\FunctionNotation\MethodArgumentSpaceFixer::class);
$services->set(Fixer\Alias\NoMixedEchoPrintFixer::class)
->call('configure', [
[
'use' => 'echo',
]
]);

$services->set(Fixer\Import\NoLeadingImportSlashFixer::class);
$services->set(Fixer\PhpUnit\PhpUnitFqcnAnnotationFixer::class);
$services->set(Fixer\Phpdoc\PhpdocNoAliasTagFixer::class);
$services->set(Fixer\NamespaceNotation\SingleBlankLineBeforeNamespaceFixer::class);
$services->set(Fixer\ClassNotation\SingleClassElementPerStatementFixer::class);

# new since PHP-CS-Fixer 2.6
$services->set(Fixer\ClassNotation\NoUnneededFinalMethodFixer::class);
$services->set(Fixer\Semicolon\SemicolonAfterInstructionFixer::class);

# new since 2.11
$services->set(Fixer\Operator\StandardizeIncrementFixer::class);
};
$header = <<<HEADER
This source file is available under two different licenses:
- GNU General Public License version 3 (GPLv3)
- DACHCOM Commercial License (DCL)
Full copyright and license information is available in
LICENSE.md which is distributed with this source code.
@copyright Copyright (c) DACHCOM.DIGITAL AG (https://www.dachcom-digital.com)
@license GPLv3 and DCL
HEADER;

return ECSConfig::configure()
->withSets([SetList::CLEAN_CODE, SetList::PSR_12])
->withConfiguredRule(Fixer\Comment\HeaderCommentFixer::class, [
'header' => $header,
'comment_type' => 'comment'
])
->withConfiguredRule(Fixer\Basic\BracesFixer::class, [
'allow_single_line_closure' => true,
])
->withConfiguredRule(Fixer\Operator\ConcatSpaceFixer::class, [
'spacing' => 'one',
])
->withConfiguredRule(Fixer\Phpdoc\PhpdocAlignFixer::class, [
'tags' => ['method', 'param', 'property', 'return', 'throws', 'type', 'var'],
])
->withConfiguredRule(Fixer\Operator\BinaryOperatorSpacesFixer::class, [
'operators' => [
'=' => 'single_space',
'=>' => 'align',
]
])
->withConfiguredRule(Fixer\Operator\IncrementStyleFixer::class, [
'style' => 'post',
])
->withConfiguredRule(Fixer\ClassNotation\ClassAttributesSeparationFixer::class, [
'elements' => [
'const' => 'none',
'method' => 'one',
'property' => 'none',
'trait_import' => 'none'
],
])
->withConfiguredRule(Fixer\ClassNotation\ClassDefinitionFixer::class, [
'single_line' => true,
])
->withConfiguredRule(Fixer\Comment\SingleLineCommentStyleFixer::class, [
'comment_types' => ['hash'],
])
->withConfiguredRule(Fixer\Alias\NoMixedEchoPrintFixer::class, [
'use' => 'echo',
])
->withConfiguredRule(Fixer\Basic\NoTrailingCommaInSinglelineFixer::class, [
'elements' => ['array_destructuring']
])
->withConfiguredRule(Fixer\NamespaceNotation\BlankLinesBeforeNamespaceFixer::class, [
'min_line_breaks' => 2,
'max_line_breaks' => 2
])
->withConfiguredRule(Fixer\Whitespace\TypeDeclarationSpacesFixer::class, [
'elements' => ['function']
])
->withConfiguredRule(Fixer\Whitespace\NoExtraBlankLinesFixer::class, [
'tokens' => ['curly_brace_block', 'extra', 'parenthesis_brace_block', 'square_brace_block', 'throw', 'use'],
])
->withRules([
Fixer\PhpTag\BlankLineAfterOpeningTagFixer::class,
Fixer\Operator\NewWithParenthesesFixer::class,
Fixer\Operator\UnaryOperatorSpacesFixer::class,
Fixer\Operator\ObjectOperatorWithoutWhitespaceFixer::class,
Fixer\Operator\StandardizeNotEqualsFixer::class,
Fixer\Operator\TernaryOperatorSpacesFixer::class,
Fixer\Operator\StandardizeIncrementFixer::class,
Fixer\Whitespace\BlankLineBeforeStatementFixer::class,
Fixer\Whitespace\ArrayIndentationFixer::class,
Fixer\Whitespace\NoSpacesAroundOffsetFixer::class,
Fixer\Whitespace\NoWhitespaceInBlankLineFixer::class,
Fixer\CastNotation\CastSpacesFixer::class,
Fixer\CastNotation\LowercaseCastFixer::class,
Fixer\CastNotation\NoShortBoolCastFixer::class,
Fixer\CastNotation\ShortScalarCastFixer::class,
Fixer\LanguageConstruct\DeclareEqualNormalizeFixer::class,
Fixer\ControlStructure\IncludeFixer::class,
Fixer\ControlStructure\NoUnneededControlParenthesesFixer::class,
Fixer\Casing\NativeFunctionCasingFixer::class,
Fixer\Casing\MagicConstantCasingFixer::class,
Fixer\Comment\NoEmptyCommentFixer::class,
Fixer\NamespaceNotation\NoLeadingNamespaceWhitespaceFixer::class,
Fixer\Semicolon\NoEmptyStatementFixer::class,
Fixer\Semicolon\NoSinglelineWhitespaceBeforeSemicolonsFixer::class,
Fixer\Semicolon\SpaceAfterSemicolonFixer::class,
Fixer\Semicolon\SemicolonAfterInstructionFixer::class,
Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer::class,
Fixer\ArrayNotation\NormalizeIndexBraceFixer::class,
Fixer\ArrayNotation\NoMultilineWhitespaceAroundDoubleArrowFixer::class,
Fixer\ArrayNotation\TrimArraySpacesFixer::class,
Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer::class,
Fixer\Phpdoc\NoBlankLinesAfterPhpdocFixer::class,
Fixer\Phpdoc\PhpdocAnnotationWithoutDotFixer::class,
Fixer\Phpdoc\PhpdocIndentFixer::class,
Fixer\Phpdoc\PhpdocInlineTagNormalizerFixer::class,
Fixer\Phpdoc\PhpdocNoAccessFixer::class,
Fixer\Phpdoc\PhpdocNoEmptyReturnFixer::class,
Fixer\Phpdoc\PhpdocNoPackageFixer::class,
Fixer\Phpdoc\PhpdocNoUselessInheritdocFixer::class,
Fixer\Phpdoc\PhpdocReturnSelfReferenceFixer::class,
Fixer\Phpdoc\PhpdocScalarFixer::class,
Fixer\Phpdoc\PhpdocSingleLineVarSpacingFixer::class,
Fixer\Phpdoc\PhpdocSummaryFixer::class,
Fixer\Phpdoc\PhpdocToCommentFixer::class,
Fixer\Phpdoc\PhpdocTrimFixer::class,
Fixer\Phpdoc\PhpdocTypesFixer::class,
Fixer\Phpdoc\NoEmptyPhpdocFixer::class,
Fixer\Phpdoc\PhpdocSeparationFixer::class,
Fixer\Phpdoc\PhpdocVarWithoutNameFixer::class,
Fixer\Phpdoc\PhpdocNoAliasTagFixer::class,
Fixer\FunctionNotation\ReturnTypeDeclarationFixer::class,
Fixer\FunctionNotation\MethodArgumentSpaceFixer::class,
Fixer\StringNotation\SingleQuoteFixer::class,
Fixer\Import\NoUnusedImportsFixer::class,
Fixer\Import\NoLeadingImportSlashFixer::class,
Fixer\PhpUnit\PhpUnitFqcnAnnotationFixer::class,
Fixer\ClassNotation\NoBlankLinesAfterClassOpeningFixer::class,
Fixer\ClassNotation\SelfAccessorFixer::class,
Fixer\ClassNotation\SingleClassElementPerStatementFixer::class,
Fixer\ClassNotation\NoUnneededFinalMethodFixer::class
]);
4 changes: 2 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -3,8 +3,8 @@ includes:
parameters:
reportUnmatchedIgnoredErrors: false
symfony:
container_xml_path: %currentWorkingDirectory%/var/cache/test/TestKernelTestDebugContainer.xml
constant_hassers: false
containerXmlPath: %currentWorkingDirectory%/var/cache/test/TestKernelTestDebugContainer.xml
constantHassers: false
ignoreErrors:
- '#Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeParentInterface::end\(\)\.#'
# Bundle dependency calls we need to ignore:
2 changes: 1 addition & 1 deletion src/Document/Editable/ConfigParser.php
Original file line number Diff line number Diff line change
@@ -143,7 +143,7 @@ private function getSelectedValue(?Info $info, array $config, mixed $defaultConf

// force default (only if it returns false)
// checkboxes may return an empty string and are impossible to track into default mode
if (!empty($defaultConfigValue) && (method_exists($el, 'isEmpty') && $el->isEmpty() === true)) {
if (!empty($defaultConfigValue) && $el->isEmpty() === true) {
$el->setDataFromResource($defaultConfigValue);
}

4 changes: 0 additions & 4 deletions src/Model/Document/Editable/GoogleMap.php
Original file line number Diff line number Diff line change
@@ -134,10 +134,6 @@ public function getId(): ?string

protected function buildMapAttributes(): array
{
if (!is_array($this->config)) {
$this->config = [];
}

$dataAttr = [];
$dataAttr['data-locations'] = htmlspecialchars(json_encode($this->validateLocationValues($this->data)), ENT_QUOTES, 'UTF-8');
$dataAttr['data-show-info-window-on-load'] = $this->config['iwOnInit'] ?? true;
20 changes: 9 additions & 11 deletions src/Model/Document/Editable/ParallaxImage.php
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ public function getDataEditmode(): array
$this->setElements();
$return = [];

if (is_array($this->elements) && count($this->elements) > 0) {
if (count($this->elements) > 0) {
foreach ($this->elements as $index => $element) {
if ($element instanceof DataObject\Concrete) {
$return[] = [
@@ -101,7 +101,7 @@ public function frontend(): string
$this->setElements();
$return = '';

if (is_array($this->elements) && count($this->elements) > 0) {
if (count($this->elements) > 0) {
foreach ($this->elements as $element) {
$return .= Element\Service::getElementType($element['obj']) . ': ' . $element['obj']->getFullPath() . '<br />';
}
@@ -115,16 +115,14 @@ public function resolveDependencies(): array
$this->setElements();
$dependencies = [];

if (is_array($this->elements) && count($this->elements) > 0) {
if (count($this->elements) > 0) {
foreach ($this->elements as $element) {
if ($element instanceof Element\ElementInterface) {
$elementType = Element\Service::getElementType($element);
$key = $elementType . '_' . $element->getId();
$dependencies[$key] = [
'id' => $element->getId(),
'type' => $elementType
];
}
$elementType = Element\Service::getElementType($element);
$key = $elementType . '_' . $element->getId();
$dependencies[$key] = [
'id' => $element->getId(),
'type' => $elementType
];
}
}

6 changes: 1 addition & 5 deletions src/Model/Document/Editable/Vhs.php
Original file line number Diff line number Diff line change
@@ -22,10 +22,6 @@ public function getShowAsLightBox(): bool

public function getVideoParameter(): array
{
if (!is_array($this->videoParameter)) {
return [];
}

$parsedParameter = [];
foreach ($this->videoParameter as $parameter) {
$parsedParameter[$parameter['key']] = $parameter['value'];
@@ -76,7 +72,7 @@ public function setDataFromEditmode(mixed $data): static
$this->showAsLightBox = $data['showAsLightbox'];
}

if (isset($data['videoParameter'])) {
if (isset($data['videoParameter']) && is_array($data['videoParameter'])) {
$this->videoParameter = $data['videoParameter'];
}

0 comments on commit 2b2eaea

Please sign in to comment.