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

Remove SnapshotPageProxy hard coded dependancy #552

Closed
wants to merge 3 commits into from

Conversation

FabienD
Copy link
Contributor

@FabienD FabienD commented Oct 23, 2015

According what I've explained in the issue #551, I've built this PR in order to make SnapshotPageProxy customisable in an easy way (I think).

@@ -33,6 +32,8 @@ class Transformer implements TransformerInterface

protected $blockManager;

protected $snapshotPageProxyClass;
Copy link
Member

Choose a reason for hiding this comment

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

phpdoc missing

@FabienD FabienD force-pushed the snproxy branch 2 times, most recently from 2bc8d16 to 2f19a19 Compare October 24, 2015 08:44
{
$this->snapshotManager = $snapshotManager;
$this->transformer = $transformer;
$this->snapshotPageProxyClass = $snapshotPageProxyClass;
Copy link
Member

Choose a reason for hiding this comment

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

Is this should be mandatory?

In this case, you should throw a deprecated error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is. A default value is provided in the constructor.

@soullivaneuh
Copy link
Member

I've built this PR in order to make SnapshotPageProxy customisable in an easy way (I think).

Could you please elaborate? Do you have some concrete cases where this class should be extended / overridden?

@FabienD
Copy link
Contributor Author

FabienD commented Oct 24, 2015

Hi,

I've made this PR, just because, it's the only way I found to add a new property on the Page entity (cf. #551). I want to have the possibility to set a specific css class by page.

Thx.

@soullivaneuh
Copy link
Member

@rande what do you think?

@FabienD FabienD force-pushed the snproxy branch 2 times, most recently from d5aac2d to fad0074 Compare November 13, 2015 13:16
@FabienD
Copy link
Contributor Author

FabienD commented Nov 13, 2015

No feedback ?
Thx.

@rande
Copy link
Member

rande commented Nov 16, 2015

I will prefer a factory to avoid injecting class name.

@FabienD
Copy link
Contributor Author

FabienD commented Nov 16, 2015

Ok, I'll try to do that. Thank you.

@FabienD FabienD force-pushed the snproxy branch 2 times, most recently from 902eace to e632fea Compare November 22, 2015 20:52
@FabienD
Copy link
Contributor Author

FabienD commented Nov 22, 2015

Hi,

I've refactored the PR in order to use a factory to instantiate the SnapshotProxy class. Now, the SnapshotManager takes a 4th argument, the SnapshotProxyFactory. I'm not confortable with "tests", I've updated the SnapshotManagerTest but I don't know how to fix the failed test in CmsSnapshotManagerTest. I need help to fix the failed tests.

In addition, I've removed the getPageByName method from the SnapshotManager, this method seems not to be used, the snapshotProxy is instantiated with only 2 args, the class needs 3.

What do you think about this refactoring ?

Thx.

*/
public function __construct($class, ManagerRegistry $registry, $templates = array())
public function __construct($class, ManagerRegistry $registry, $templates = array(), SnapshotPageProxyFactory $snapshotPageProxyFactory)
Copy link
Member

Choose a reason for hiding this comment

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

This is a BC break

@soullivaneuh
Copy link
Member

According to the new Sonata version management and next major release plan, this project has been refactored regarding branching and versioning.

If you see this message, your PR concerns a patch or a minor release and is not targeting the right branch.

So I'm closing this one, but don't see it as a refusal. If you think your work is still relevant and want to continue, feel free to reopen it on the right branch (e.g. the default one).

Regards.

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.

5 participants