diff --git a/code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Type.php b/code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Type.php index 5b34101a47..2219c9ae36 100644 --- a/code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Type.php +++ b/code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Type.php @@ -32,7 +32,7 @@ public function getSettingsSchema(): array public function mapFieldValueForm(FormInterface $fieldForm, FieldData $data): void { - $definition = $data->fieldDefinition; + $definition = $data->getFieldDefinition(); $fieldForm->add('value', Point2DType::class, [ 'required' => $definition->isRequired, 'label' => $definition->getName(), diff --git a/code_samples/field_types/2dpoint_ft/steps/step_3/Type.php b/code_samples/field_types/2dpoint_ft/steps/step_3/Type.php index 3619c4e028..9e0bbc346d 100644 --- a/code_samples/field_types/2dpoint_ft/steps/step_3/Type.php +++ b/code_samples/field_types/2dpoint_ft/steps/step_3/Type.php @@ -18,7 +18,7 @@ public function getFieldTypeIdentifier(): string public function mapFieldValueForm(FormInterface $fieldForm, FieldData $data): void { - $definition = $data->fieldDefinition; + $definition = $data->getFieldDefinition(); $fieldForm->add('value', Point2DType::class, [ 'required' => $definition->isRequired, 'label' => $definition->getName(), diff --git a/code_samples/field_types/2dpoint_ft/steps/step_6/Type.php b/code_samples/field_types/2dpoint_ft/steps/step_6/Type.php index 7019b0876c..617411f67e 100644 --- a/code_samples/field_types/2dpoint_ft/steps/step_6/Type.php +++ b/code_samples/field_types/2dpoint_ft/steps/step_6/Type.php @@ -28,7 +28,7 @@ public function getSettingsSchema(): array public function mapFieldValueForm(FormInterface $fieldForm, FieldData $data): void { - $definition = $data->fieldDefinition; + $definition = $data->getFieldDefinition(); $fieldForm->add('value', Point2DType::class, [ 'required' => $definition->isRequired, 'label' => $definition->getName(), diff --git a/code_samples/field_types/generic_ft/src/FieldType/HelloWorld/Type.php b/code_samples/field_types/generic_ft/src/FieldType/HelloWorld/Type.php index 09db13dd83..62e5e121ae 100644 --- a/code_samples/field_types/generic_ft/src/FieldType/HelloWorld/Type.php +++ b/code_samples/field_types/generic_ft/src/FieldType/HelloWorld/Type.php @@ -17,7 +17,7 @@ public function getFieldTypeIdentifier(): string public function mapFieldValueForm(FormInterface $fieldForm, FieldData $data): void { - $definition = $data->fieldDefinition; + $definition = $data->getFieldDefinition(); $fieldForm->add('value', HelloWorldType::class, [ 'required' => $definition->isRequired, diff --git a/code_samples/search/custom/src/Query/Criterion/Solr/CameraManufacturerVisitor.php b/code_samples/search/custom/src/Query/Criterion/Solr/CameraManufacturerVisitor.php index 97f404aa15..c4cf00e598 100644 --- a/code_samples/search/custom/src/Query/Criterion/Solr/CameraManufacturerVisitor.php +++ b/code_samples/search/custom/src/Query/Criterion/Solr/CameraManufacturerVisitor.php @@ -10,7 +10,7 @@ final class CameraManufacturerVisitor extends CriterionVisitor { - public function canVisit(CriterionInterface $criterion) + public function canVisit(CriterionInterface $criterion): bool { return $criterion instanceof CameraManufacturerCriterion; } @@ -18,7 +18,7 @@ public function canVisit(CriterionInterface $criterion) /** * @param \App\Query\Criterion\CameraManufacturerCriterion $criterion */ - public function visit(CriterionInterface $criterion, CriterionVisitor $subVisitor = null) + public function visit(CriterionInterface $criterion, ?CriterionVisitor $subVisitor = null): string { $expressions = array_map( fn ($value): string => 'exif_camera_manufacturer_id:"' . $this->escapeQuote((string) $value) . '"', diff --git a/code_samples/search/custom/src/Search/FieldMapper/WebinarEventTitleFulltextFieldMapper.php b/code_samples/search/custom/src/Search/FieldMapper/WebinarEventTitleFulltextFieldMapper.php index 67a209dc4d..b3e07061eb 100644 --- a/code_samples/search/custom/src/Search/FieldMapper/WebinarEventTitleFulltextFieldMapper.php +++ b/code_samples/search/custom/src/Search/FieldMapper/WebinarEventTitleFulltextFieldMapper.php @@ -14,13 +14,13 @@ public function __construct(protected ContentHandler $contentHandler, protected { } - public function accept(Content $content) + public function accept(Content $content): bool { // ContentType with ID 42 is webinar event return $content->versionInfo->contentInfo->contentTypeId == 42; } - public function mapFields(Content $content) + public function mapFields(Content $content): array { $mainLocationId = $content->versionInfo->contentInfo->mainLocationId; $location = $this->locationHandler->load($mainLocationId); diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 9359f1762c..94b21757c7 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -606,30 +606,12 @@ parameters: count: 1 path: code_samples/search/custom/src/Query/Aggregation/Solr/PriorityRangeAggregationResultExtractor.php - - - message: '#^Method App\\Query\\Aggregation\\Solr\\PriorityRangeAggregationResultExtractor\:\:canVisit\(\) has parameter \$languageFilter with no value type specified in iterable type array\.$#' - identifier: missingType.iterableValue - count: 1 - path: code_samples/search/custom/src/Query/Aggregation/Solr/PriorityRangeAggregationResultExtractor.php - - - - message: '#^Method App\\Query\\Aggregation\\Solr\\PriorityRangeAggregationResultExtractor\:\:extract\(\) has parameter \$languageFilter with no value type specified in iterable type array\.$#' - identifier: missingType.iterableValue - count: 1 - path: code_samples/search/custom/src/Query/Aggregation/Solr/PriorityRangeAggregationResultExtractor.php - - message: '#^Method App\\Query\\Aggregation\\Solr\\PriorityRangeAggregationVisitor\:\:formatRangeValue\(\) has parameter \$value with no type specified\.$#' identifier: missingType.parameter count: 1 path: code_samples/search/custom/src/Query/Aggregation/Solr/PriorityRangeAggregationVisitor.php - - - message: '#^Method App\\Query\\Aggregation\\Solr\\PriorityRangeAggregationVisitor\:\:visit\(\) should return array\ but returns array\\>\|string\>\.$#' - identifier: return.type - count: 1 - path: code_samples/search/custom/src/Query/Aggregation/Solr/PriorityRangeAggregationVisitor.php - - message: '#^Method App\\Query\\Criterion\\Elasticsearch\\CameraManufacturerVisitor\:\:visit\(\) return type has no value type specified in iterable type array\.$#' identifier: missingType.iterableValue