Skip to content

Conversation

mnocon
Copy link
Contributor

@mnocon mnocon commented May 19, 2025

Target: 5.0 only!

See the failing build on v5:
https://github.com/ibexa/documentation-developer/actions/runs/15046924482/job/42291716387?pr=2739

There are two types of errors:

Commands

   Line   recent_activity/src/Command/MonitorRecentContentCreationCommand.php   
 ------ ---------------------------------------------------------------------- 
  19     Property                                                              
         App\Command\MonitorRecentContentCreationCommand::$defaultName has no  
         type specified.                                                       
         🪪 missingType.property                                               
  21     Property                                                              
         App\Command\MonitorRecentContentCreationCommand::$defaultDescription  
         has no type specified.                                                
         🪪 missingType.property   

I've switched to registering the Commands using the AsCommand attribute: https://symfony.com/doc/current/console.html#registering-the-command

Normalizers and denormalizers

   Line   field_types/2dpoint_ft/src/Serializer/Point2D/ValueNormalizer.php                      
 ------ --------------------------------------------------------------------------------------- 
  9      Non-abstract class App\Serializer\Point2D\ValueNormalizer contains                     
         abstract method getSupportedTypes() from interface                                     
         Symfony\Component\Serializer\Normalizer\NormalizerInterface.                           
  11     Return type mixed of method                                                            
         App\Serializer\Point2D\ValueNormalizer::normalize() is not covariant                   
         with return type array|ArrayObject|bool|float|int|string|null of                       
         method                                                                                 
         Symfony\Component\Serializer\Normalizer\NormalizerInterface::normalize().              
  19     Method                                                                                 
         App\Serializer\Point2D\ValueNormalizer::supportsNormalization()                        
         overrides method                                                                       
         Symfony\Component\Serializer\Normalizer\NormalizerInterface::supportsNormalization()   
         but misses parameter #3 $context.                                                      
  19     Return type mixed of method                                                            
         App\Serializer\Point2D\ValueNormalizer::supportsNormalization() is                     
         not covariant with return type bool of method                                          
         Symfony\Component\Serializer\Normalizer\NormalizerInterface::supportsNormalization().  

The interfaces have changed, see:

@mnocon mnocon requested a review from a team May 21, 2025 09:26
@ezrobot ezrobot requested review from adriendupuis, dabrt and julitafalcondusza and removed request for a team May 21, 2025 09:27
Comment on lines 74 to 75
$context = $payment->getContext();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$context seems not used between this set and its override at line 97 (below // Create a new payment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, it doesn't make a lot of sense in the context of the Command - I've included it to improve the doc a bit:

Please compare:
https://ez-systems-developer-documentation--2748.com.readthedocs.build/en/2748/commerce/payment/extend_payment/#attach-custom-data-to-payments
and
https://doc.ibexa.co/en/latest/commerce/payment/extend_payment/#attach-custom-data-to-payments

I could add the getContext line somewhere else and then "glue" 2 includes together, I just prefered having it in one include as I think it's easier to maintain

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's tricky!
I didn't see that extend_payment.md uses it in reverse order…
Maybe a comment in the cut-out line to explain why it's there?

Suggested change
$context = $payment->getContext();
$context = $payment->getContext();
// Will be overridden later but used to illustrate `getContext()`

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 79c5c1a - I'll wait for the "check code samples" job to make sure I did it right

@adriendupuis adriendupuis self-requested a review May 21, 2025 13:07
Copy link

code_samples/ change report

Report's diff is too long to be displayed in a comment.

Download colorized diff

@mnocon mnocon merged commit aa9d43e into 5.0 May 21, 2025
7 checks passed
@mnocon mnocon deleted the adjust-code-samples branch May 21, 2025 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants