Skip to content

Test and fix embedded PHP snippets#3166

Draft
mnocon wants to merge 5 commits intotest-yamlsfrom
test-php-snippets
Draft

Test and fix embedded PHP snippets#3166
mnocon wants to merge 5 commits intotest-yamlsfrom
test-php-snippets

Conversation

@mnocon
Copy link
Copy Markdown
Contributor

@mnocon mnocon commented Apr 24, 2026

No description provided.

mnocon and others added 5 commits April 23, 2026 20:46
- Add `return` to array expressions in bundles.php snippets
- Add use statements for classes used in snippets
- Add @var PHPDoc annotations for undefined variables
- Fix method return types (void, typed returns)
- Fix interface imports for form mapper interfaces
- Fix wrong class paths (Float\Type\Value → Float\Value)
- Fix TaxonomyEntry constructor usage
- Fix Author FieldType to use new Author\Value()
- Fix FilterResponseEvent → ResponseEvent in cache subscriber
- Fix TranslatorInterface namespace (Component vs Contracts)
- Fix payment criteria to use setQuery() instead of property access
- Fix payment LogicalAnd/LogicalOr to use variadic args, not array
- Fix PaymentQuery/PaymentMethodQuery initialization
- Fix CartCreateStruct and EntryAddStruct constructor arguments
- Add @phpstan-ignore for intentional pattern issues
- Fix Novactive Solr class and add missing return in searchAction
- Fix storefront controller to extend AbstractController

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add correct use statements for all field type Value classes
- Fix class aliases: use namespace imports (X\Namespace as Alias)
  instead of class imports (X\Namespace\Value as Alias) so
  Alias\Value resolves correctly
- Add @var annotations for undefined variables
- Fix incorrect property names: $values (Keyword), $destinationContentIds (RelationList)
- Fix incorrect method: loadContentTypeByIdentifier() instead of loadContentType()
- Fix incorrect constant: Type::DEFAULT_EMPTY instead of DateAndTime::DEFAULT_EMPTY
- Add return statements to expression-only snippets (countryfield, type_and_value)
- Fix variable names: $checkboxValue->bool instead of $value->bool
- Fix use statements: EmailAddress\Value instead of Type, then new Value()
- Add @phpstan-ignore-next-line for conceptual read-only property assignments

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add missing use statements (Query, LocationQuery, ProductQuery, Aggregation,
  Range, URLQuery, Criterion, ShoppingListQuery) to all code blocks
- Fix ObjectStateTermAggregation: remove incorrect Location\ namespace prefix
- Fix product_attribute_aggregations: use correct class names
  (AttributeSelectionTermAggregation, AttributeIntegerRangeAggregation)
- Fix Range type errors: use Range::ofInt(), Range::ofFloat(),
  Range::ofDateTime() factory methods for proper generic typing
- Fix TimeRangeAggregation: use integer seconds instead of DateTime objects
- Fix ProductQuery snippets: use setAggregations() instead of direct
  property access (aggregations is private on ProductQuery)
- Fix taxonomyentryid ProductQuery snippet accordingly
- Fix SectionId URL criterion: use int[] instead of string[]
- Add \@var annotations for undefined $query, $currency, $customerGroup

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add return types to methods (void, array, typed returns)
- Fix missing use statements (Bundle, ContainerBuilder, Request, Language, etc.)
- Replace invalid `self $this` annotations with proper service @var annotations
- Replace `$this->service` patterns with standalone $service variables in snippets
- Fix NotificationHandlerInterface to TranslatableNotificationHandlerInterface
- Fix MVCEvents::INTERACTIVE_LOGIN to SecurityEvents::INTERACTIVE_LOGIN
- Fix InteractiveLoginEvent to Symfony's version
- Fix HEADER_X_FORWARDED_ALL (removed in Symfony) with individual constants
- Fix user_id() undefined function with $userId variable
- Fix ContentTagInterface missing use statements
- Fix X-Location-Id header int→string cast
- Fix IbexaSetList use statement, suppress SensiolabsSetList
- Add @phpstan-ignore for unavoidable null-access patterns
- Add return statement to array expression in update_from_4.6.md
- Fix RectorConfig use statement

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mnocon mnocon changed the base branch from 5.0 to test-yamls April 24, 2026 07:13
@github-actions
Copy link
Copy Markdown

Preview of modified files: Too many files modified in a single PR, preview link list is skipped. (267 files > 100)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant