Skip to content
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

Move internal configuration to PHP #6284

Merged
merged 1 commit into from
Sep 3, 2020

Conversation

franmomu
Copy link
Member

@franmomu franmomu commented Aug 13, 2020

Ref: symfony/symfony#37186

I decided to do this because when I tried to upgrade to Symfony 5.1, there were a lot of warnings coming from xml configuration files because <deprecation> tag uses some attributes (package and version) and I have no idea if that could be doable using XML. So based on symfony/symfony#37186 and using https://github.com/migrify/config-transformer I tried to do this.

I did it quickly without checking too much, I'd like to check better and also format the arguments, so this is just to see if we are fine with this change, I'll keep going.

@franmomu franmomu force-pushed the move_config_php branch 2 times, most recently from 1dfdf3b to b5c8124 Compare August 14, 2020 06:35
@franmomu
Copy link
Member Author

I think it's ready to review. Should we keep the xml files? I left them because someone might be using them (I don't think so, but just in case).

@franmomu franmomu requested a review from a team August 14, 2020 06:51
@greg0ire
Copy link
Contributor

I think the xml files can be removed safely.

@jordisala1991
Copy link
Member

This will be a pain to merge to master, but I guess it is better to do on 3.x?

@franmomu
Copy link
Member Author

This will be a pain to merge to master, but I guess it is better to do on 3.x?

Probably... I could (not now, also on holidays so I probably won't be able to have a proper internet connection) compare the xml files from 3.x to master and try to update the php files.

@core23
Copy link
Member

core23 commented Aug 19, 2020

Please have a look at https://github.com/sonata-project/SonataAdminBundle/compare/3.x...core23:fix-php-compiler?expand=1

There may be a type error, when defining admin services in php configs.

@SonataCI
Copy link
Collaborator

Could you please rebase your PR and fix merge conflicts?

@codecov-commenter
Copy link

codecov-commenter commented Aug 31, 2020

Codecov Report

Merging #6284 into 3.x will increase coverage by 1.12%.
The diff coverage is 97.68%.

Impacted file tree graph

@@             Coverage Diff              @@
##                3.x    #6284      +/-   ##
============================================
+ Coverage     77.52%   78.65%   +1.12%     
- Complexity     2603     2604       +1     
============================================
  Files           142      156      +14     
  Lines          7776     8239     +463     
============================================
+ Hits           6028     6480     +452     
- Misses         1748     1759      +11     
Impacted Files Coverage Δ Complexity Δ
src/Resources/config/makers.php 0.00% <0.00%> (ø) 0.00 <0.00> (?)
src/DependencyInjection/SonataAdminExtension.php 86.06% <93.75%> (ø) 27.00 <2.00> (ø)
src/Export/Exporter.php 44.44% <100.00%> (ø) 1.00 <0.00> (ø)
src/Resources/config/actions.php 100.00% <100.00%> (ø) 0.00 <0.00> (?)
src/Resources/config/block.php 100.00% <100.00%> (ø) 0.00 <0.00> (?)
src/Resources/config/commands.php 100.00% <100.00%> (ø) 0.00 <0.00> (?)
src/Resources/config/core.php 100.00% <100.00%> (ø) 0.00 <0.00> (?)
src/Resources/config/event_listener.php 100.00% <100.00%> (ø) 0.00 <0.00> (?)
src/Resources/config/exporter.php 100.00% <100.00%> (ø) 0.00 <0.00> (?)
src/Resources/config/form_types.php 100.00% <100.00%> (ø) 0.00 <0.00> (?)
... and 23 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b65b5c6...4cd0dd2. Read the comment docs.

@franmomu franmomu force-pushed the move_config_php branch 4 times, most recently from ea9d3a3 to 4cd0dd2 Compare September 1, 2020 06:02
@franmomu franmomu requested a review from a team September 1, 2020 06:05
@franmomu franmomu force-pushed the move_config_php branch 2 times, most recently from 65bc0b7 to 9470cd1 Compare September 1, 2020 09:12
jordisala1991
jordisala1991 previously approved these changes Sep 2, 2020
@jordisala1991
Copy link
Member

jordisala1991 commented Sep 2, 2020

To me it looks good!, You will have to merge master for this one, please, to fix the possible changes that appear
(Also it would be nice to apply this for each bundle we have)

@franmomu
Copy link
Member Author

franmomu commented Sep 2, 2020

To me it looks good!, You will have to merge master for this one, please, to fix the possible changes that appear
(Also it would be nice to apply this for each bundle we have)

Sure! I was going to.

@jordisala1991 jordisala1991 merged commit 3ad3910 into sonata-project:3.x Sep 3, 2020
@jordisala1991
Copy link
Member

Thank you @franmomu

@franmomu franmomu deleted the move_config_php branch September 3, 2020 06:15
peter-gribanov added a commit to peter-gribanov/SonataAdminBundle that referenced this pull request Sep 4, 2020
allow use data_transformer in SetObjectFieldValueAction

create BooleanToStringTransformer for allows to use non-strings

update SetObjectFieldValueActionTest

use yoda conditions

fix errors in HelperControllerTest

test BooleanToStringTransformer

allow override transformers for 'date', 'boolean' and 'choice' field types

mark BooleanToStringTransformer and BooleanToStringTransformer classes as final

add example of using the data_transformer option in docs

add full docs about Symfony Data Transformers

optimize resolve Data Transformer

fix docs

create DataTransformerResolver service

add type hint for BooleanToStringTransformer::$trueValue

allow add a custom global transformers

field type should be a string

correct default value for $globalCustomTransformers

correct test DataTransformerResolverTest::testAddCustomGlobalTransformer()

add BC support usage of DataTransformerResolver

Update tests/Action/SetObjectFieldValueActionTest.php

Update tests/Form/DataTransformer/BooleanToStringTransformerTest.php

Update tests/Form/DataTransformerResolverTest.php

Update src/Action/SetObjectFieldValueAction.php

change "entity" word to "model" in documentations

change deprecated error message

add datetime in editable date form types

correct test transform datetime and date form types

test DateTime object in assertSame()

fix typo

restore getTemplate() return value in SetObjectFieldValueActionTest

use Yoda conditions

lazy-load predefined data transformers

add DataTransformerResolverInterface

use constants for determinate a field type

test laze-load data transformers

test usage DataTransformerResolver::addCustomGlobalTransformer()

create simple function in DataTransformerResolverTest

Process deprecation of FieldDescriptionInterface::getTargetEntity()

Use FieldDescriptionInterface::getTargetModel if exists sonata-project#6208

change usage getTargetEntity() -> getTargetModel() in DataTransformerResolverTest

merge changes from PR sonata-project#6167

register BooleanToStringTransformer as a service

merge changes from PR sonata-project#6144

Move internal configuration to PHP sonata-project#6284
peter-gribanov added a commit to peter-gribanov/SonataAdminBundle that referenced this pull request Sep 4, 2020
allow use data_transformer in SetObjectFieldValueAction

create BooleanToStringTransformer for allows to use non-strings

update SetObjectFieldValueActionTest

use yoda conditions

fix errors in HelperControllerTest

test BooleanToStringTransformer

allow override transformers for 'date', 'boolean' and 'choice' field types

mark BooleanToStringTransformer and BooleanToStringTransformer classes as final

add example of using the data_transformer option in docs

add full docs about Symfony Data Transformers

optimize resolve Data Transformer

fix docs

create DataTransformerResolver service

add type hint for BooleanToStringTransformer::$trueValue

allow add a custom global transformers

field type should be a string

correct default value for $globalCustomTransformers

correct test DataTransformerResolverTest::testAddCustomGlobalTransformer()

add BC support usage of DataTransformerResolver

Update tests/Action/SetObjectFieldValueActionTest.php

Update tests/Form/DataTransformer/BooleanToStringTransformerTest.php

Update tests/Form/DataTransformerResolverTest.php

Update src/Action/SetObjectFieldValueAction.php

change "entity" word to "model" in documentations

change deprecated error message

add datetime in editable date form types

correct test transform datetime and date form types

test DateTime object in assertSame()

fix typo

restore getTemplate() return value in SetObjectFieldValueActionTest

use Yoda conditions

lazy-load predefined data transformers

add DataTransformerResolverInterface

use constants for determinate a field type

test laze-load data transformers

test usage DataTransformerResolver::addCustomGlobalTransformer()

create simple function in DataTransformerResolverTest

Process deprecation of FieldDescriptionInterface::getTargetEntity()

Use FieldDescriptionInterface::getTargetModel if exists sonata-project#6208

change usage getTargetEntity() -> getTargetModel() in DataTransformerResolverTest

merge changes from PR sonata-project#6167

register BooleanToStringTransformer as a service

merge changes from PR sonata-project#6144

Move internal configuration to PHP sonata-project#6284
peter-gribanov added a commit to peter-gribanov/SonataAdminBundle that referenced this pull request Sep 7, 2020
allow use data_transformer in SetObjectFieldValueAction

create BooleanToStringTransformer for allows to use non-strings

update SetObjectFieldValueActionTest

use yoda conditions

fix errors in HelperControllerTest

test BooleanToStringTransformer

allow override transformers for 'date', 'boolean' and 'choice' field types

mark BooleanToStringTransformer and BooleanToStringTransformer classes as final

add example of using the data_transformer option in docs

add full docs about Symfony Data Transformers

optimize resolve Data Transformer

fix docs

create DataTransformerResolver service

add type hint for BooleanToStringTransformer::$trueValue

allow add a custom global transformers

field type should be a string

correct default value for $globalCustomTransformers

correct test DataTransformerResolverTest::testAddCustomGlobalTransformer()

add BC support usage of DataTransformerResolver

Update tests/Action/SetObjectFieldValueActionTest.php

Update tests/Form/DataTransformer/BooleanToStringTransformerTest.php

Update tests/Form/DataTransformerResolverTest.php

Update src/Action/SetObjectFieldValueAction.php

change "entity" word to "model" in documentations

change deprecated error message

add datetime in editable date form types

correct test transform datetime and date form types

test DateTime object in assertSame()

fix typo

restore getTemplate() return value in SetObjectFieldValueActionTest

use Yoda conditions

lazy-load predefined data transformers

add DataTransformerResolverInterface

use constants for determinate a field type

test laze-load data transformers

test usage DataTransformerResolver::addCustomGlobalTransformer()

create simple function in DataTransformerResolverTest

Process deprecation of FieldDescriptionInterface::getTargetEntity()

Use FieldDescriptionInterface::getTargetModel if exists sonata-project#6208

change usage getTargetEntity() -> getTargetModel() in DataTransformerResolverTest

merge changes from PR sonata-project#6167

register BooleanToStringTransformer as a service

merge changes from PR sonata-project#6144

merge changes from PR sonata-project#6284

compare date with time in DataTransformerResolverTest
VincentLanglet pushed a commit that referenced this pull request Sep 13, 2020
allow use data_transformer in SetObjectFieldValueAction

create BooleanToStringTransformer for allows to use non-strings

update SetObjectFieldValueActionTest

use yoda conditions

fix errors in HelperControllerTest

test BooleanToStringTransformer

allow override transformers for 'date', 'boolean' and 'choice' field types

mark BooleanToStringTransformer and BooleanToStringTransformer classes as final

add example of using the data_transformer option in docs

add full docs about Symfony Data Transformers

optimize resolve Data Transformer

fix docs

create DataTransformerResolver service

add type hint for BooleanToStringTransformer::$trueValue

allow add a custom global transformers

field type should be a string

correct default value for $globalCustomTransformers

correct test DataTransformerResolverTest::testAddCustomGlobalTransformer()

add BC support usage of DataTransformerResolver

Update tests/Action/SetObjectFieldValueActionTest.php

Update tests/Form/DataTransformer/BooleanToStringTransformerTest.php

Update tests/Form/DataTransformerResolverTest.php

Update src/Action/SetObjectFieldValueAction.php

change "entity" word to "model" in documentations

change deprecated error message

add datetime in editable date form types

correct test transform datetime and date form types

test DateTime object in assertSame()

fix typo

restore getTemplate() return value in SetObjectFieldValueActionTest

use Yoda conditions

lazy-load predefined data transformers

add DataTransformerResolverInterface

use constants for determinate a field type

test laze-load data transformers

test usage DataTransformerResolver::addCustomGlobalTransformer()

create simple function in DataTransformerResolverTest

Process deprecation of FieldDescriptionInterface::getTargetEntity()

Use FieldDescriptionInterface::getTargetModel if exists #6208

change usage getTargetEntity() -> getTargetModel() in DataTransformerResolverTest

merge changes from PR #6167

register BooleanToStringTransformer as a service

merge changes from PR #6144

merge changes from PR #6284

compare date with time in DataTransformerResolverTest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants