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

[develop] Serializers #47

Merged
merged 1 commit into from
May 11, 2014

Conversation

jasonlewis
Copy link
Contributor

Same as #45 except now targeting the develop branch.

Got some rogue commits. Not sure why. 😦

@jasonlewis
Copy link
Contributor Author

Okay fixed rogue commits. You may want to look over it again and make sure everything is where it should be (gotta love Git sometimes). 😁

@@ -102,7 +102,8 @@ public function testProcessEmbeddedResourcesInvalidAvailableEmbed()
$manager = new Manager;
$manager->parseIncludes('book');

$scope = new Scope($manager, m::mock('League\Fractal\Resource\ResourceInterface'));
$scope = new Scope($manager, m::mock('League\Fractal\Resource\ResourceAbstract'));
$transformer->setManager($manager);
Copy link
Member

Choose a reason for hiding this comment

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

This should fail. If it doesnt then its a merge problem. Transformers no longer have direct access to the manager, as they do that via the "setCurrentScope()" method, which then has access to the manager. Scopes have manager passed in their constructor, so this seemed like a reasonably useful way to cut down dependencies.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good pick up, flying under the radar since it's throwing a BadMethodCallException as well. Bloody thing.

Copy link
Member

Choose a reason for hiding this comment

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

This looks perfect so far. I’m gonna play locally with some sample code instead of just relying on unit tests.

TDD is great and all BUT ITS SCARY AND I DONT TRUST IT.
-- 
Phil Sturgeon

On May 11, 2014 at 11:55:27 AM, Jason Lewis (notifications@github.com) wrote:

In tests/TransformerAbstractTest.php:

@@ -102,7 +102,8 @@ public function testProcessEmbeddedResourcesInvalidAvailableEmbed()
$manager = new Manager;
$manager->parseIncludes('book');

  •    $scope = new Scope($manager, m::mock('League\Fractal\Resource\ResourceInterface'));
    
  •    $scope = new Scope($manager, m::mock('League\Fractal\Resource\ResourceAbstract'));
    
  •    $transformer->setManager($manager);
    
    Good pick up, flying under the radar since it's throwing a BadMethodCallException as well. Bloody thing.


Reply to this email directly or view it on GitHub.

Signed-off-by: Jason Lewis <jason.lewis1991@gmail.com>
@jasonlewis
Copy link
Contributor Author

Okay all fixed, hopefully. Regarding you outdated diff comment: no worries. I think I'll add a basic HAL serializer soon and push that up.

Also there's no meta yet even though the Collection resource references some. So will add that in as well.

@philsturgeon philsturgeon merged commit c608090 into thephpleague:develop May 11, 2014
@philsturgeon
Copy link
Member

This is now merged to develop, but does have an outstanding issue relating to allow Serializers to sideload or embed their relationships. Add that as a new PR and we'll be good to go.

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