Skip to content

Upgrade api-platform #6211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
Draft

Upgrade api-platform #6211

wants to merge 12 commits into from

Conversation

AngelFQC
Copy link
Member

@AngelFQC AngelFQC commented Apr 8, 2025

No description provided.

@ywarnier
Copy link
Member

When I issue a composer install in this branch, I get:

Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 1
!!  
!!  In ArrayNode.php line 327:
!!                                                                                 
!!    Unrecognized option "metadata_backward_compatibility_layer" under "api_plat  
!!    form". Available options are "asset_package", "collection", "defaults", "de  
!!    scription", "docs_formats", "doctrine", "doctrine_mongodb_odm", "eager_load  
!!    ing", "elasticsearch", "enable_docs", "enable_entrypoint", "enable_link_sec  
!!    urity", "enable_profiler", "enable_re_doc", "enable_swagger", "enable_swagg  
!!    er_ui", "error_formats", "event_listeners_backward_compatibility_layer", "e  
!!    xception_to_status", "formats", "graphql", "handle_symfony_errors", "http_c  
!!    ache", "inflector", "jsonschema_formats", "keep_legacy_inflector", "maker",  
!!     "mapping", "mercure", "messenger", "name_converter", "oauth", "openapi", "  
!!    patch_formats", "path_segment_name_generator", "resource_class_directories"  
!!    , "serializer", "show_webby", "swagger", "title", "use_deprecated_json_sche  
!!    ma_type_factory", "use_symfony_listeners", "validator", "version".           
!!                                                                                 
!!  
!!  2025-04-21T10:05:22+00:00 [info] User Deprecated: Method "Symfony\Component\HttpKernel\Bundle\Bundle::build()" might add "void" as a native return type declaration in the future. Do the same in child class "Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle" now to avoid errors or add an explicit @return annotation to suppress this message.
!!  
Script @auto-scripts was called via post-install-cmd

(just in case you have something different)

@AngelFQC AngelFQC force-pushed the upgrade-api branch 2 times, most recently from dc6b40d to 23d32c5 Compare April 22, 2025 22:34
@@ -26,7 +26,22 @@
use Symfony\Component\Uid\Uuid;
use Symfony\Component\Validator\Constraints as Assert;

#[ApiResource(operations: [new Get(security: 'is_granted(\'VIEW\', object)'), new Put(security: 'is_granted(\'EDIT\', object)'), new Delete(security: 'is_granted(\'DELETE\', object)'), new GetCollection(security: 'is_granted(\'ROLE_USER\')'), new Post(securityPostDenormalize: 'is_granted(\'CREATE\', object)')], security: 'is_granted(\'ROLE_ADMIN\') or is_granted(\'ROLE_CURRENT_COURSE_TEACHER\')', denormalizationContext: ['groups' => ['c_tool_intro:write']], normalizationContext: ['groups' => ['c_tool_intro:read']])]
#[ApiResource(
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.

@AngelFQC AngelFQC force-pushed the upgrade-api branch 3 times, most recently from 4a30071 to 311defd Compare April 23, 2025 21:22
AngelFQC added 12 commits April 23, 2025 17:14
Replaced the deprecated ApiPlatform namespace with the updated one. This change ensures compatibility with the latest version of the ApiPlatform library and removes potential warnings.
Replaced all Symfony Doctrine ORM annotations with PHP 8 attributes to modernize the codebase and improve readability. Additionally, updated type hints and property declarations to enforce strict typing and better align with PHP 8 standards.
Copy link

codeclimate bot commented Apr 23, 2025

Code Climate has analyzed commit 15b4e9e and detected 2 issues on this pull request.

Here's the issue category breakdown:

Category Count
Duplication 2

View more on Code Climate.

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.

2 participants