From c9782d72726abfd419b51a64c6bb19b539f8b245 Mon Sep 17 00:00:00 2001 From: Nicolas Morand <48729-NicolasGraph@users.noreply.drupalcode.org> Date: Tue, 5 Nov 2024 17:00:07 +0000 Subject: [PATCH] Issue #3479145 by nicolasgraph, jrockowitz: Adds Physical support --- composer.json | 1 + composer.libraries.json | 1 + docs/DECISIONS.md | 1 + docs/MODULES.md | 4 +- .../schemadotorg_office_hours.install | 4 +- .../SchemaDotOrgOfficeHoursInstallTest.php | 2 +- modules/schemadotorg_physical/README.md | 27 ++++ .../schemadotorg_physical.info.yml | 9 ++ .../schemadotorg_physical.install | 76 ++++++++++++ .../schemadotorg_physical.module | 38 ++++++ .../SchemaDotOrgPhysicalJsonLdKernelTest.php | 115 ++++++++++++++++++ .../Kernel/SchemaDotOrgPhysicalKernelTest.php | 114 +++++++++++++++++ .../icon/individual_product.png | Bin 0 -> 1218 bytes phpstan.neon | 6 +- 14 files changed, 393 insertions(+), 5 deletions(-) create mode 100644 modules/schemadotorg_physical/README.md create mode 100644 modules/schemadotorg_physical/schemadotorg_physical.info.yml create mode 100644 modules/schemadotorg_physical/schemadotorg_physical.install create mode 100644 modules/schemadotorg_physical/schemadotorg_physical.module create mode 100644 modules/schemadotorg_physical/tests/src/Kernel/SchemaDotOrgPhysicalJsonLdKernelTest.php create mode 100644 modules/schemadotorg_physical/tests/src/Kernel/SchemaDotOrgPhysicalKernelTest.php create mode 100644 modules/schemadotorg_type_tray/images/schemadotorg_type_tray/icon/individual_product.png diff --git a/composer.json b/composer.json index 3cd39f4e5..bd59792da 100644 --- a/composer.json +++ b/composer.json @@ -50,6 +50,7 @@ "drupal/office_hours": "^1.0", "drupal/paragraphs": "^1.0", "drupal/pathauto": "^1.0", + "drupal/physical": "^1.4", "drupal/range": "^1.0", "drupal/rdf": "^2.0", "drupal/scheduler": "^2.0", diff --git a/composer.libraries.json b/composer.libraries.json index 5a8bb4077..4c09b0083 100644 --- a/composer.libraries.json +++ b/composer.libraries.json @@ -46,6 +46,7 @@ "drupal/office_hours": "^1.0", "drupal/paragraphs": "^1.0", "drupal/pathauto": "^1.0", + "drupal/physical": "^1.0", "drupal/scheduler": "^2.0", "drupal/simple_sitemap": "^4.0", "drupal/smart_date": "^4.1", diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md index d722f88ec..b89567b59 100644 --- a/docs/DECISIONS.md +++ b/docs/DECISIONS.md @@ -272,6 +272,7 @@ for managing optional dependencies and patches. - [Geolocation Field](https://www.drupal.org/project/geolocation) â for https://schema.org/GeoCoordinates. - [Geofield](https://www.drupal.org/project/geofield) an alternative for https://schema.org/GeoCoordinates. No integration is being provided. - [Office Hours](https://www.drupal.org/project/office_hours) â for https://schema.org/OpeningHoursSpecification +- [Physical Fields](https://www.drupal.org/project/physical) â for https://schema.org/QuantitativeValue - [Range](https://www.drupal.org/project/range) â for https://schema.org/MonetaryAmount - [SmartDate](https://www.drupal.org/project/smart_date) â for https://schema.org/Date and https://schema.org/Schedule - [Time Field](https://www.drupal.org/project/time_field) for https://schema.org/Time diff --git a/docs/MODULES.md b/docs/MODULES.md index 9c84af794..202a627ca 100644 --- a/docs/MODULES.md +++ b/docs/MODULES.md @@ -102,6 +102,9 @@ and field configuration settings. - **[Schema.org Blueprints Options](https://git.drupalcode.org/project/schemadotorg/-/tree/1.0.x/modules/schemadotorg_options)** Set allowed values for list (options) fields. +- **[Schema.org Blueprints Physical Fields](https://git.drupalcode.org/project/schemadotorg/-/tree/1.0.x/modules/schemadotorg_physical)** + Allows an Physical fields to be used to create a http://schema.org/QuantitativeValue. + - **[Schema.org Blueprints Smart Date](https://git.drupalcode.org/project/schemadotorg/-/tree/1.0.x/modules/schemadotorg_smart_date)** Allows a Smart date field to be used to create date ranges and event schedules included in a site's Schema.org JSON-LD. @@ -222,4 +225,3 @@ The below API related modules creates APIs based on Schema.org types - **[Schema.org Blueprints Demo](https://git.drupalcode.org/project/schemadotorg_demo/-/tree/1.0.x/README.md)** Provides an opinionated demo of the Schema.org Blueprints built on top of Drupal's standard profile with default content and translations. - diff --git a/modules/schemadotorg_office_hours/schemadotorg_office_hours.install b/modules/schemadotorg_office_hours/schemadotorg_office_hours.install index 78422511c..ad6fee8bc 100644 --- a/modules/schemadotorg_office_hours/schemadotorg_office_hours.install +++ b/modules/schemadotorg_office_hours/schemadotorg_office_hours.install @@ -19,7 +19,7 @@ function schemadotorg_office_hours_install(bool $is_syncing): void { $schema_config_manager = \Drupal::service('schemadotorg.config_manager'); // Add openingHoursSpecification to Place's default properties. - $schema_config_manager->setSchemaTypeDefaultProperties('Place', 'openingHoursSpecification'); + $schema_config_manager->setSchemaTypeDefaultProperties('Place', ['openingHoursSpecification', 'specialOpeningHoursSpecification']); $config = \Drupal::configFactory()->getEditable('schemadotorg.settings'); @@ -52,7 +52,7 @@ function schemadotorg_office_hours_uninstall(bool $is_syncing): void { $schema_config_manager = \Drupal::service('schemadotorg.config_manager'); // Remove openingHoursSpecification to Place's default properties. - $schema_config_manager->unsetSchemaTypeDefaultProperties('Place', 'openingHoursSpecification'); + $schema_config_manager->unsetSchemaTypeDefaultProperties('Place', ['openingHoursSpecification', 'specialOpeningHoursSpecification']); $config = \Drupal::configFactory()->getEditable('schemadotorg.settings'); diff --git a/modules/schemadotorg_office_hours/tests/src/Kernel/SchemaDotOrgOfficeHoursInstallTest.php b/modules/schemadotorg_office_hours/tests/src/Kernel/SchemaDotOrgOfficeHoursInstallTest.php index d929138f4..16df7a847 100644 --- a/modules/schemadotorg_office_hours/tests/src/Kernel/SchemaDotOrgOfficeHoursInstallTest.php +++ b/modules/schemadotorg_office_hours/tests/src/Kernel/SchemaDotOrgOfficeHoursInstallTest.php @@ -55,7 +55,7 @@ class SchemaDotOrgOfficeHoursInstallTest extends TokenKernelTestBase { // Check adding openingHoursSpecification to Place's default properties. $this->assertEquals( - ['address', 'description', 'image', 'latitude', 'longitude', 'name', 'openingHoursSpecification', 'telephone'], + ['address', 'description', 'image', 'latitude', 'longitude', 'name', 'openingHoursSpecification', 'specialOpeningHoursSpecification', 'telephone'], \Drupal::config('schemadotorg.settings')->get('schema_types.default_properties.Place') ); diff --git a/modules/schemadotorg_physical/README.md b/modules/schemadotorg_physical/README.md new file mode 100644 index 000000000..6522a340c --- /dev/null +++ b/modules/schemadotorg_physical/README.md @@ -0,0 +1,27 @@ +Table of contents +----------------- + +* Introduction +* Features +* Requirements + + +Introduction +------------ + +The **Schema.org Blueprints Physical module** allows an physical fields to be +used to create a https://schema.org/QuantitativeValue. + + +Features +-------- + +- Support physical measurement and dimensions field type. +- Defaults https://schema.org/QuantitativeValue to use the physical fields. + + +Requirements +------------ + +- **[Physical](https://www.drupal.org/project/physical)** + Provides an API for storing and manipulating physical measurements. diff --git a/modules/schemadotorg_physical/schemadotorg_physical.info.yml b/modules/schemadotorg_physical/schemadotorg_physical.info.yml new file mode 100644 index 000000000..86d908a27 --- /dev/null +++ b/modules/schemadotorg_physical/schemadotorg_physical.info.yml @@ -0,0 +1,9 @@ +name: 'Schema.org Blueprints Physical' +type: module +description: 'Allows an physical fields to be used to create a https://schema.org/QuantitativeValue.' +package: 'Schema.org Blueprints Fields' +core_version_requirement: ^10.3 || ^11 +schemadotorg_production: true +dependencies: + - 'schemadotorg:schemadotorg' + - 'physical:physical' diff --git a/modules/schemadotorg_physical/schemadotorg_physical.install b/modules/schemadotorg_physical/schemadotorg_physical.install new file mode 100644 index 000000000..f138de0be --- /dev/null +++ b/modules/schemadotorg_physical/schemadotorg_physical.install @@ -0,0 +1,76 @@ +<?php + +/** + * @file + * Installation hooks for the Schema.org Blueprints Physical module. + */ + +declare(strict_types=1); + +/** + * Implements hook_install(). + */ +function schemadotorg_physical_install(bool $is_syncing): void { + if ($is_syncing) { + return; + } + + /** @var \Drupal\schemadotorg\SchemaDotOrgConfigManagerInterface $schema_config_manager */ + $schema_config_manager = \Drupal::service('schemadotorg.config_manager'); + + // Add width, height and weight to Person's default properties. + $schema_config_manager->setSchemaTypeDefaultProperties('IndividualProduct', ['depth', 'height', 'width']); + + // Add physical_dimensions and physical_measurement field to QuantitativeValue field types. + $config = \Drupal::configFactory()->getEditable('schemadotorg.settings'); + $quantitative_value_config_key = 'schema_types.default_field_types.QuantitativeValue'; + $config->set($quantitative_value_config_key, array_merge( + ['physical_dimensions', 'physical_measurement'], + $config->get($quantitative_value_config_key) ?: [] + )); + + // Default to physical_measurement field type for depth, height, weight and width properties. + $config->set('schema_properties.default_fields.depth.type', 'field_ui:physical_measurement:length'); + $config->set('schema_properties.default_fields.height.type', 'field_ui:physical_measurement:length'); + $config->set('schema_properties.default_fields.weight.type', 'field_ui:physical_measurement:weight'); + $config->set('schema_properties.default_fields.width.type', 'field_ui:physical_measurement:length'); + + // Add length field to Distance field types. + $config->set('schema_types.default_field_types.Distance', ['field_ui:physical_measurement:length']); + + $config->save(); +} + +/** + * Implements hook_uninstall(). + */ +function schemadotorg_physical_uninstall(bool $is_syncing): void { + if ($is_syncing) { + return; + } + + /** @var \Drupal\schemadotorg\SchemaDotOrgConfigManagerInterface $schema_config_manager */ + $schema_config_manager = \Drupal::service('schemadotorg.config_manager'); + + // Remove width, height and weight to Person's default properties. + $schema_config_manager->unsetSchemaTypeDefaultProperties('IndividualProduct', ['depth', 'height', 'width']); + + // Remove physical_dimensions and physical_measurement field from QuantitativeValue field types. + $config = \Drupal::configFactory()->getEditable('schemadotorg.settings'); + $quantitative_value_config_key = 'schema_types.default_field_types.QuantitativeValue'; + $config->set($quantitative_value_config_key, array_values(array_diff( + $config->get($quantitative_value_config_key) ?: [], + ['physical_dimensions', 'physical_measurement'] + ))); + + // Restore field type for depth, height, weight and width properties. + $config->set('schema_properties.default_fields.depth.type', NULL); + $config->set('schema_properties.default_fields.height.type', 'string'); + $config->set('schema_properties.default_fields.weight.type', NULL); + $config->set('schema_properties.default_fields.width.type', 'string'); + + // Remove length field from Distance field types. + $config->clear('schema_types.default_field_types.Distance'); + + $config->save(); +} diff --git a/modules/schemadotorg_physical/schemadotorg_physical.module b/modules/schemadotorg_physical/schemadotorg_physical.module new file mode 100644 index 000000000..66e31c331 --- /dev/null +++ b/modules/schemadotorg_physical/schemadotorg_physical.module @@ -0,0 +1,38 @@ +<?php + +/** + * @file + * Allows Physical fields to be used to create a http://schema.org/QuantitativeValue. + */ + +declare(strict_types=1); + +use Drupal\Core\Field\FieldItemInterface; +use Drupal\Core\Render\BubbleableMetadata; +use Drupal\physical\Plugin\Field\FieldType\DimensionsItem; +use Drupal\physical\Plugin\Field\FieldType\MeasurementItem; + +/** + * Implements hook_schemadotorg_jsonld_schema_property_alter(). + */ +function schemadotorg_physical_schemadotorg_jsonld_schema_property_alter(mixed &$value, FieldItemInterface $item, BubbleableMetadata $bubbleable_metadata): void { + if ($item instanceof MeasurementItem) { + $value = [ + '@type' => 'QuantitativeValue', + 'value' => $item->number, + 'unitText' => $item->unit, + ]; + } + elseif ($item instanceof DimensionsItem) { + $value = []; + $dimension_properties = ['length', 'height', 'width']; + foreach ($dimension_properties as $dimension_property) { + $value[] = [ + '@type' => 'QuantitativeValue', + 'name' => $dimension_property, + 'value' => $item->{$dimension_property}, + 'unitText' => $item->unit, + ]; + } + } +} diff --git a/modules/schemadotorg_physical/tests/src/Kernel/SchemaDotOrgPhysicalJsonLdKernelTest.php b/modules/schemadotorg_physical/tests/src/Kernel/SchemaDotOrgPhysicalJsonLdKernelTest.php new file mode 100644 index 000000000..91b41443e --- /dev/null +++ b/modules/schemadotorg_physical/tests/src/Kernel/SchemaDotOrgPhysicalJsonLdKernelTest.php @@ -0,0 +1,115 @@ +<?php + +declare(strict_types=1); + +namespace Drupal\Tests\schemadotorg_physical\Kernel; + +use Drupal\Tests\schemadotorg_jsonld\Kernel\SchemaDotOrgJsonLdKernelTestBase; +use Drupal\node\Entity\Node; +use Drupal\physical\LengthUnit; +use Drupal\schemadotorg_jsonld\SchemaDotOrgJsonLdBuilderInterface; + +/** + * Tests the functionality of the Schema.org Physical module JSON-LD integration. + * + * @covers schemadotorg_physical_schemadotorg_jsonld_schema_property_alter(() + * @group schemadotorg + */ +class SchemaDotOrgPhysicalJsonLdKernelTest extends SchemaDotOrgJsonLdKernelTestBase { + + /** + * {@inheritdoc} + */ + protected static $modules = [ + 'physical', + 'schemadotorg_physical', + ]; + + /** + * Schema.org JSON-LD builder. + */ + protected SchemaDotOrgJsonLdBuilderInterface $builder; + + /** + * {@inheritdoc} + */ + protected function setUp(): void { + parent::setUp(); + + \Drupal::moduleHandler()->loadInclude('schemadotorg_physical', 'install'); + schemadotorg_physical_install(FALSE); + } + + /** + * Test Schema.org Physical JSON-LD. + */ + public function testJsonLdPhysical(): void { + \Drupal::currentUser()->setAccount($this->createUser(['access content'])); + + $this->config('schemadotorg.settings') + ->set('schema_properties.default_fields.size.type', 'physical_dimensions') + ->save(); + $this->appendSchemaTypeDefaultProperties('IndividualProduct', ['size']); + $this->createSchemaEntity('node', 'IndividualProduct'); + + // Create a product node. + $product_node = Node::create([ + 'type' => 'individual_product', + 'title' => 'Individual product', + 'schema_depth' => [['number' => '100', 'unit' => LengthUnit::MILLIMETER]], + 'schema_height' => [['number' => '200', 'unit' => LengthUnit::MILLIMETER]], + 'schema_width' => [['number' => '300', 'unit' => LengthUnit::MILLIMETER]], + 'schema_size' => [['length' => '10', 'height' => '10', 'width' => '10', 'unit' => LengthUnit::MILLIMETER]], + ]); + $product_node->save(); + $product_jsonld = $this->builder->buildEntity($product_node); + + // Check depth JSON-LD. + $expected_depth = [ + '@type' => 'QuantitativeValue', + 'unitText' => LengthUnit::MILLIMETER, + 'value' => '100', + ]; + $this->assertEquals($expected_depth, $product_jsonld['depth']); + + // Check height JSON-LD. + $expected_height = [ + '@type' => 'QuantitativeValue', + 'unitText' => LengthUnit::MILLIMETER, + 'value' => '200', + ]; + $this->assertEquals($expected_height, $product_jsonld['height']); + + // Check width JSON-LD. + $expected_width = [ + '@type' => 'QuantitativeValue', + 'unitText' => LengthUnit::MILLIMETER, + 'value' => '300', + ]; + $this->assertEquals($expected_width, $product_jsonld['width']); + + // Check size JSON-LD. + $expected_size = [ + [ + '@type' => 'QuantitativeValue', + 'value' => '10', + 'unitText' => 'mm', + 'name' => 'length', + ], + [ + '@type' => 'QuantitativeValue', + 'value' => '10', + 'unitText' => 'mm', + 'name' => 'height', + ], + [ + '@type' => 'QuantitativeValue', + 'value' => '10', + 'unitText' => 'mm', + 'name' => 'width', + ], + ]; + $this->assertEquals($expected_size, $product_jsonld['size']); + } + +} diff --git a/modules/schemadotorg_physical/tests/src/Kernel/SchemaDotOrgPhysicalKernelTest.php b/modules/schemadotorg_physical/tests/src/Kernel/SchemaDotOrgPhysicalKernelTest.php new file mode 100644 index 000000000..795a2340a --- /dev/null +++ b/modules/schemadotorg_physical/tests/src/Kernel/SchemaDotOrgPhysicalKernelTest.php @@ -0,0 +1,114 @@ +<?php + +declare(strict_types=1); + +namespace Drupal\Tests\schemadotorg_physical\Kernel; + +use Drupal\Tests\schemadotorg\Kernel\SchemaDotOrgEntityKernelTestBase; + +/** + * Tests the functionality of the Schema.org Physical module. + * + * @covers schemadotorg_physical_install() + * @covers schemadotorg_physical_uninstall() + * @group schemadotorg + */ +class SchemaDotOrgPhysicalKernelTest extends SchemaDotOrgEntityKernelTestBase { + + /** + * {@inheritdoc} + */ + protected static $modules = [ + 'physical', + 'schemadotorg_physical', + ]; + + /** + * {@inheritdoc} + */ + protected function setUp(): void { + parent::setUp(); + $this->installConfig(['schemadotorg_physical']); + } + + /** + * Test Schema.org Blueprints Physical installation. + */ + public function testInstall(): void { + \Drupal::moduleHandler()->loadInclude('schemadotorg_physical', 'install'); + + $config = \Drupal::config('schemadotorg.settings'); + + // Check IndividualProduct's default properties. + $this->assertEquals(NULL, \Drupal::config('schemadotorg.settings')->get('schema_types.default_properties.IndividualProduct')); + + // Check QuantitativeValue default field types is 'number'. + $default_field_types = [ + 'integer', + 'decimal', + 'float', + 'range_integer', + 'range_decimal', + 'range_float', + ]; + $this->assertEquals($default_field_types, $config->get('schema_types.default_field_types.QuantitativeValue')); + + // Check some properties initial default field types. + $this->assertEquals(NULL, $config->get('schema_properties.default_fields.depth.type')); + $this->assertEquals('string', $config->get('schema_properties.default_fields.height.type')); + $this->assertEquals(NULL, $config->get('schema_properties.default_fields.weight.type')); + $this->assertEquals('string', $config->get('schema_properties.default_fields.width.type')); + + // Install the Schema.org Blueprints Physical module. + schemadotorg_physical_install(FALSE); + + // Check adding width, height and weight to IndividualProduct's default properties. + $new_default_properties = [ + 'depth', + 'height', + 'width', + ]; + $this->assertEquals($new_default_properties, \Drupal::config('schemadotorg.settings')->get('schema_types.default_properties.IndividualProduct')); + + // Check QuantitativeValue default field types has now also Physical field types. + $new_default_field_types = [ + 'physical_dimensions', + 'physical_measurement', + 'integer', + 'decimal', + 'float', + 'range_integer', + 'range_decimal', + 'range_float', + ]; + $this->assertEquals($new_default_field_types, $config->get('schema_types.default_field_types.QuantitativeValue')); + + // Check some properties altered default field types. + $this->assertEquals('field_ui:physical_measurement:length', $config->get('schema_properties.default_fields.depth.type')); + $this->assertEquals('field_ui:physical_measurement:length', $config->get('schema_properties.default_fields.height.type')); + $this->assertEquals('field_ui:physical_measurement:weight', $config->get('schema_properties.default_fields.weight.type')); + $this->assertEquals('field_ui:physical_measurement:length', $config->get('schema_properties.default_fields.width.type')); + + // Check length field used for Distance. + $this->assertEquals(['field_ui:physical_measurement:length'], $config->get('schema_types.default_field_types.Distance')); + + // Uninstall the Schema.org Blueprints Physical module. + schemadotorg_physical_uninstall(FALSE); + + // Check QuantitativeValue default field types is 'string_long'. + $this->assertEquals($default_field_types, $config->get('schema_types.default_field_types.QuantitativeValue')); + + // Check some properties initial default field types. + $this->assertEquals('string', $config->get('schema_properties.default_fields.height.type')); + $this->assertEquals(NULL, $config->get('schema_properties.default_fields.weight.type')); + $this->assertEquals('string', $config->get('schema_properties.default_fields.width.type')); + + // Check removing width, height and weight to IndividualProduct's default properties. + $this->assertEquals([], \Drupal::config('schemadotorg.settings')->get('schema_types.default_properties.IndividualProduct')); + + // Check remove length field used for Distance. + $this->assertEquals(NULL, $config->get('schema_types.default_field_types.Distance')); + + } + +} diff --git a/modules/schemadotorg_type_tray/images/schemadotorg_type_tray/icon/individual_product.png b/modules/schemadotorg_type_tray/images/schemadotorg_type_tray/icon/individual_product.png new file mode 100644 index 0000000000000000000000000000000000000000..4195cbd81993b58f839e2080d84478d9e12ed44c GIT binary patch literal 1218 zcmV;z1U>tSP)<h;3K|Lk000e1NJLTq003kF003kN1^@s6aN?Cz00001b5ch_0Itp) z=>Px(d`Uz>RCr$PoN;#BAPmMsF4p!AO|H}SI&to>>|$Xf&(8C**dRckq*(c9Z?$Z& zetZ&OAnXkOj>qG7jPWZ|^~*2}AJ$$kSgY{iaQL;`?cPi39YXjyolf5+wpwgV0r~v= zd=DWcAjQ977)-sRsmj&>i7|eh&*w`qL19A&A`IZMcn9J@>OJ5gtKN4kcRCOjx7I(@ zfz<ns<xU5};@0|yI*@wbvE1oESlmi`Xo8UL*zfnZe+%ZY9t*g{7=Pw})I3mBHx5Y? zhn0?}k>2g@pfmwe1Eg>Um+JIV`x_h$V8nq4gZK}a^bD~WkeUQt+T45CNr4doqD>Vm z0O6qw4#W_QJ13-Cpg=6bn5dvWbisgV&l$PAgHj0uh;<m_xCrv)5dws=Fd^4cg|5R^ zu&@Jhb<mm+I}q#YKrfPD1!7$tXc$RLtUxTQLjnc@NTfwj9oAAXSb_8mS7{7zy<RUh zv$6B<DKW;k+%i;27_2~gge$JW*usnftZTa#2iS5*2O#VY8ddxiLinv^Q8p)#ru-ot zI;66hRv_%^kaBpgTnCc#5cs-EAY92D?Axm1R08?iHT95Hg>&Vm!{N}B)VHb<PK6Zj z1zg~|NtLhx>GZi4zQ~|=q@X@eJCNypHUowYNb+QB9$5-y(^}n{xh-moMccCi=@hos zd~(}et7REz4|vvrJo-T80%{5<Rv@V&0F^AguSxZ=17XZ1l!ljVO>_((Km=8?s2;5y z0|*e|(3Mk?D&@d{C<<Mxs*&zWLxGG?TBlTUExzfx^c)%-hy^H;9RLv^MxdktCuD*3 zT+(7dlqdSTkI+y=fuy&dR(|BxOEo2i#+#8)#DPq{(hlb3c2H3osYW=c-j^DMECJI5 z2NAl|1DS)G!AXBEIx3c;%$zMkC8mHp!b$%RA*2J9VQ{!rViw3_YeuPuTO}_81gRd* z9@k3(Sy4}y(8j5fO#taV)^Q-Y?ho<0=DjPMQpm)u#}`blJhDk3J!YF72r(?>%v)9B zKyn@?UT@7K4ut6NoVf$Zc?fvD#~%8ZSI8LC-w^9`Th+n2!%Iak>zRYN24Ahod=xU< zW+G7_g`wk;Huk5ZHCm!tI;y<lnDVDZa?bdQ0V#yh!hr2wuKaQPoWNG=l?Pjf!I?iq zfEb6tzE%sW5bH3w)d5w=3&3Dk2NXz$zQ07eo0rMf)twgt30ba=^0ov4(rGYO{#KnW zxdy4vstExyet&2>`=qmviyw!C0nH&6Rf2{A1(FKWv@A3y5eXP@Ad?d`t3?XL<QrHH zdDbGefsuwGrjSQClA$a?NcDO7V`6hL`q}mA6l(4T)Y>4x2Zl9prcS^=m91FmJ~@B- zo+7;uJ?9J29FnWtLTF3-+>3vlACrnJK`?Y61ZN>k9SFk9gfbim!C44X2ZHc2p$rE? za2CSUfgrq0D8qpeoP{uTAP6rL$}j~ay%+UxW*-<5T0@N~afTSOFrnr>mhLg9kWnSs gV*)iyrPqM^17PA0lJ{&74*&oF07*qoM6N<$f>oO)!vFvP literal 0 HcmV?d00001 diff --git a/phpstan.neon b/phpstan.neon index 8df6aa986..6facc5cde 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -93,6 +93,10 @@ parameters: count: 1 path: modules/schemadotorg_smart_date/src/SchemaDotOrgSmartDateJsonLdManager.php + - message: "#^Access to an undefined property Drupal\\\\physical\\\\Plugin\\\\Field\\\\FieldType\\\\(Measurement|Dimensions)Item\\:\\:\\$(number|unit|height|width|length)\\.$#" + count: 6 + path: modules/schemadotorg_physical/schemadotorg_physical.module + ########################################################################## # Fields. ########################################################################## @@ -100,7 +104,7 @@ parameters: - message: "#^Parameter \\#1 \\$item of method Drupal\\\\schemadotorg_jsonld\\\\SchemaDotOrgJsonLdManagerInterface\\:\\:getSchemaPropertyValue\\(\\) expects Drupal\\\\Core\\\\Field\\\\FieldItemInterface, Drupal\\\\Core\\\\TypedData\\\\TypedDataInterface\\|null given\\.$#" count: 5 path: modules/schemadotorg_jsonld/tests/src/Kernel/SchemaDotOrgJsonLdManagerKernelTest.php - + - message: "#^Parameter \\#2 \\$times of function str_repeat expects int, Drupal\\\\Core\\\\Field\\\\FieldItemListInterface given.$#" count: 1 path: src/Plugin/EntityReferenceSelection/SchemaDotOrgTermReferenceSelection.php -- GitLab