Skip to content

Commit 19b93a1

Browse files
alexz707mcop1vmalykmattamon
authored
Remove deprecations (#957)
* [Task] Remove deprecations (#935) * Removed deprecations, added upgrade notes * Improvements to readability * Apply php-cs-fixer changes * Code format * Removed config related to merge operator * Added field type for table query type definition. (#883) * Update 01_Upgrade_Notes.md (#936) * [Bug] Introduce numeric-prefix for table (#937) * Introduce numeric-prefix for table * Apply php-cs-fixer changes * [Improvement]: Add timezone indication for outputted date/datetime values (#938) * Added timezone indication * Apply php-cs-fixer changes * Added specific client safe exception * Apply php-cs-fixer changes * Added check for pimcore version in format function * Apply php-cs-fixer changes * Removed unnecessary checks * Apply php-cs-fixer changes * Removed unnecessary checks * Apply php-cs-fixer changes * Removed unnecessary method * Apply php-cs-fixer changes * Added creationDate/modificationDate for data objects, assets and asset folder * Apply php-cs-fixer changes * Added datetime resolve for metadata in assets * Apply php-cs-fixer changes * Update upgrade notes, added resolver for object folder and document folder types * Apply php-cs-fixer changes * Update upgrade notes * Fix automatic tests * Apply php-cs-fixer changes * Fix automatic tests * Added date resolver for translation type * Apply php-cs-fixer changes * Removed typo * Update src/GraphQL/DataObjectQueryFieldConfigGenerator/Date.php Co-authored-by: Matthias Schuhmayer <38959016+mattamon@users.noreply.github.com> * Update src/GraphQL/Exception/InvalidFieldDefinitionException.php Co-authored-by: Matthias Schuhmayer <38959016+mattamon@users.noreply.github.com> * Apply php-cs-fixer changes --------- Co-authored-by: Matthias Schuhmayer <38959016+mattamon@users.noreply.github.com> * Remove deprecated config setting enable_authenticator_manager * Adding return types to symfony extension methods * Adding return types to compiler pass methods * Change to attributes * Add return types --------- Co-authored-by: mcop1 <89011527+mcop1@users.noreply.github.com> Co-authored-by: Vladimir Malik <vladimir@pearlconvert.no> Co-authored-by: Matthias Schuhmayer <38959016+mattamon@users.noreply.github.com> Co-authored-by: mattamon <matthias.schuhmayer@pimcore.com>
1 parent c8bd3d3 commit 19b93a1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+378
-1024
lines changed

.github/ci/files/config/packages/security.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
security:
2-
enable_authenticator_manager: true
3-
42
providers:
53
pimcore_admin:
64
id: Pimcore\Security\User\UserProvider

.github/ci/files/security.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
security:
2-
enable_authenticator_manager: true
3-
42
providers:
53
pimcore_admin:
64
id: Pimcore\Security\User\UserProvider

doc/01_Installation_and_Upgrade/01_Upgrade_Notes.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Upgrade Notes
22

3+
## 2.0.0
4+
5+
- [General] Added timezone indication for date and datetime fields in the GraphQL schema, including creation and modification date.
6+
Therefore, the type of both date fields in the GraphQL schema have changed from `int` (timestamp) to `string`.
7+
- [Operator] Removed merge operator
8+
- [Command] Removed RebuildDefinitionsCommand (`datahub:graphql:rebuild-definitions`), use RebuildWorkspacesCommand (`datahub:graphql:rebuild-workspaces`) instead.
9+
- [Config] Removed DatahubConfigLocator class
10+
- [Config] Removed support for legacy config file (`datahub-configurations.php`)
11+
- [Config] Removed `getConfigModificationDate` from config dao.
12+
- [Config] Removed sql query config field
13+
- [QueryType] `args['path']` will no longer be supported, use `args['fullpath']` instead.
14+
- [DataType] Generated type names now include the type itself, see https://github.com/pimcore/data-hub/issues/879
15+
316
## 1.8.0
417
- [General] Dropped support of `pimcore/pimcore` v10. Bumped minimum requirement of `pimcore/pimcore` to `^11.2`
518
- [General] Replaced Request::get() with explicit input sources.

doc/10_GraphQL/08_Operators/Query/Merge.md

-3
This file was deleted.

doc/10_GraphQL/10_Events.md

-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ class GraphQlSubscriber implements EventSubscriberInterface
180180

181181
#### Example 4: Add custom query conditions to object listing
182182

183-
- For global SQL conditions also [General Settings](https://github.com/pimcore/data-hub/blob/master/doc/graphl/General.md#general-settings)
184183
- For simple filter conditions also see [Filtering](https://github.com/pimcore/data-hub/blob/master/doc/graphl/Filtering.md#request)
185184

186185
```php

phpstan-baseline.neon

-5
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,6 @@ parameters:
180180
count: 1
181181
path: src/GraphQL/DataObjectType/LocalizedType.php
182182

183-
-
184-
message: "#^If condition is always true\\.$#"
185-
count: 1
186-
path: src/GraphQL/DataObjectType/MergeType.php
187-
188183
-
189184
message: "#^Constructor of class Pimcore\\\\Bundle\\\\DataHubBundle\\\\GraphQL\\\\DataObjectType\\\\ObjectFolderType has an unused parameter \\$config\\.$#"
190185
count: 1

src/Command/Configuration/MigrateLegacyConfig.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
class MigrateLegacyConfig extends AbstractCommand
2525
{
26-
protected function configure()
26+
protected function configure(): void
2727
{
2828
$this
2929
->setName('datahub:configuration:migrate-legacy-config')

src/Command/Configuration/RebuildWorkspacesCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
class RebuildWorkspacesCommand extends AbstractCommand
2727
{
28-
protected function configure()
28+
protected function configure(): void
2929
{
3030
$this
3131
->setName('datahub:configuration:rebuild-workspaces')

src/Command/GraphQL/RebuildDefinitionsCommand.php

-86
This file was deleted.

src/Configuration.php

+3-12
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,6 @@ public function setGroup(?string $group): void
189189
$this->group = $group;
190190
}
191191

192-
/**
193-
* @deprecated property sqlObjectCondition will be removed in the next major release
194-
*/
195-
public function getSqlObjectCondition(): ?string
196-
{
197-
return $this->configuration && $this->configuration['general'] ? $this->configuration['general']['sqlObjectCondition'] ?? null : null;
198-
}
199-
200192
/**
201193
* @return string|bool
202194
*/
@@ -310,7 +302,7 @@ public static function getList()
310302
{
311303
$config = new self(null, null);
312304

313-
return $config->getDao()->loadList();
305+
return $config->getDao()->getList();
314306
}
315307

316308
/**
@@ -321,7 +313,7 @@ public static function getByName($name): ?self
321313
{
322314
try {
323315
$config = new self(null, null);
324-
$config->getDao()->loadByName($name);
316+
$config->getDao()->getByName($name);
325317

326318
return $config;
327319
} catch (\Pimcore\Model\Exception\NotFoundException $e) {
@@ -341,9 +333,8 @@ public function getQueryEntities(): array
341333
public function getSpecialEntities(): array
342334
{
343335
$schema = $this->configuration['schema'] ?? null;
344-
$entities = $schema ? $schema['specialEntities'] : [];
345336

346-
return $entities;
337+
return $schema ? $schema['specialEntities'] : [];
347338
}
348339

349340
public function getMutationEntities(): array

src/Configuration/Dao.php

+8-86
Original file line numberDiff line numberDiff line change
@@ -41,43 +41,17 @@ class Dao extends Model\Dao\PimcoreLocationAwareConfigDao
4141
*/
4242
private static $_config = null;
4343

44-
/**
45-
* @deprecated Will be removed in Pimcore 11
46-
*/
47-
private const LEGACY_FILE = 'datahub-configurations.php';
48-
49-
/**
50-
* @deprecated Will be removed as soon as Pimcore 10.6 isn´t supported anymore.
51-
*/
52-
public const CONFIG_PATH = PIMCORE_CONFIGURATION_DIRECTORY . '/data_hub';
53-
5444
public function configure(): void
5545
{
5646
$config = \Pimcore::getContainer()->getParameter('pimcore_data_hub');
5747

58-
if (\Pimcore\Version::getMajorVersion() >= 11) {
59-
$storageConfig = $config['config_location']['data_hub'];
48+
$storageConfig = $config['config_location']['data_hub'];
49+
parent::configure([
50+
'containerConfig' => $config['configurations'] ?? [],
51+
'settingsStoreScope' => 'pimcore_data_hub',
52+
'storageConfig' => $storageConfig,
53+
]);
6054

61-
parent::configure([
62-
'containerConfig' => $config['configurations'] ?? [],
63-
'settingsStoreScope' => 'pimcore_data_hub',
64-
'storageConfig' => $storageConfig,
65-
]);
66-
} else {
67-
$storageConfig = Config\LocationAwareConfigRepository::getStorageConfigurationCompatibilityLayer(
68-
$config,
69-
'data_hub',
70-
'PIMCORE_CONFIG_STORAGE_DIR_DATA_HUB',
71-
'PIMCORE_WRITE_TARGET_DATA_HUB'
72-
);
73-
74-
parent::configure([
75-
'containerConfig' => $config['configurations'] ?? [],
76-
'settingsStoreScope' => 'pimcore_data_hub',
77-
'storageDirectory' => $storageConfig,
78-
'legacyConfigFile' => self::LEGACY_FILE,
79-
]);
80-
}
8155
}
8256

8357
/**
@@ -131,7 +105,7 @@ public function setVariables($data)
131105
* @param string $name
132106
*
133107
*/
134-
public function loadByName($name)
108+
public function getByName($name)
135109
{
136110
$data = $this->getDataByName($name);
137111

@@ -146,42 +120,6 @@ public function loadByName($name)
146120
}
147121
}
148122

149-
/**
150-
* @deprecated Will be removed in Pimcore 11
151-
*
152-
* get a configuration by name.
153-
*
154-
* TODO: remove this static function and rename "loadByName" to "getByName"
155-
*
156-
* @param string $name
157-
*
158-
*/
159-
public static function getByName($name)
160-
{
161-
try {
162-
$config = new Configuration(null, null);
163-
$config->getDao()->loadByName($name);
164-
165-
return $config;
166-
} catch (\Pimcore\Model\Exception\NotFoundException $e) {
167-
return null;
168-
}
169-
}
170-
171-
/**
172-
*
173-
* @return int
174-
*
175-
*@deprecated will be removed with pimcore 11
176-
*
177-
* get latest modification date of configuration file.
178-
*
179-
*/
180-
public static function getConfigModificationDate()
181-
{
182-
return 0;
183-
}
184-
185123
/**
186124
* get the whole configuration file content.
187125
*
@@ -220,7 +158,7 @@ private function &getConfig()
220158
* get the list of configurations.
221159
*
222160
*/
223-
public function loadList(): array
161+
public function getList(): array
224162
{
225163
$list = [];
226164

@@ -234,22 +172,6 @@ public function loadList(): array
234172
return $list;
235173
}
236174

237-
/**
238-
* @deprecated Will be removed in Pimcore 11
239-
*
240-
* get the list of configurations.
241-
*
242-
* TODO: remove this static function and rename "loadList" to "getList"
243-
*
244-
*
245-
*/
246-
public static function getList(): array
247-
{
248-
$configuration = new Configuration(null, null);
249-
250-
return $configuration->getDao()->loadList();
251-
}
252-
253175
/**
254176
* @param mixed $data
255177
*

0 commit comments

Comments
 (0)