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

Added JsonLd CreativeWork #1735

Merged
merged 12 commits into from
Dec 27, 2017
Merged

Added JsonLd CreativeWork #1735

merged 12 commits into from
Dec 27, 2017

Conversation

JohnnyMcWeed
Copy link
Contributor

What are you changing/introducing

Added JsonLd CreativeWork (Interface, Trait and Class)

@coveralls
Copy link

Coverage Status

Coverage decreased (-10.9%) to 40.747% when pulling e7c4998 on JohnnyMcWeed:JsonLd into 2f53cb5 on luyadev:master.

@nadar nadar added this to the 1.0.1 milestone Dec 20, 2017
@nadar
Copy link
Contributor

nadar commented Dec 20, 2017

Looks good to me! Could you please add a change log entry (Add new section Added).

And also think there should be a better description of CreativeWork. We should people tell what they should cover with this CreativeWork like

Its for

  • Images
  • Blog
    idk.

In the description of the class.

This would people help. I think we should maybe also extend the existing jsonld classes with such descriptions as well.


/**
* JsonLd - Creative Work
*
Copy link
Contributor

Choose a reason for hiding this comment

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

Better description for people, what this can cover. like blog .. .etc.

@coveralls
Copy link

Coverage Status

Coverage decreased (-11.8%) to 39.874% when pulling 4d47928 on JohnnyMcWeed:JsonLd into 2f53cb5 on luyadev:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-11.9%) to 39.836% when pulling 738fd2b on JohnnyMcWeed:JsonLd into 2f53cb5 on luyadev:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-12.2%) to 39.513% when pulling bf70f8f on JohnnyMcWeed:JsonLd into 2f53cb5 on luyadev:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-12.2%) to 39.464% when pulling 5d8d738 on JohnnyMcWeed:JsonLd into 2f53cb5 on luyadev:master.

Copy link
Contributor

@nadar nadar left a comment

Choose a reason for hiding this comment

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

Looks good. just stumbled upon a few small things to change. thank you anyhow

}

/**
* Articles may belong to one or more 'sections' in a magazine or newspaper, such as Sports, Lifestyle, etc.
Copy link
Contributor

Choose a reason for hiding this comment

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

@JohnnyMcWeed The private will not be shown anywhere (not in IDE nor on luya.io/api) so the information should be stored on the getter method. You can even fully remove any phpdoc for the private var. (for example: https://github.com/luyadev/luya/blob/master/core/tag/BaseTag.php)

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. I'll change that for all classes in the next few days.

*
* @return \luya\web\jsonld\Article
*/
public static function article(array $config = [])
Copy link
Contributor

@nadar nadar Dec 21, 2017

Choose a reason for hiding this comment

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

Missing @ since 1.0.1 tag

* @param array $config Optional config array to provided blog posting data via setter methods.
*
* @return \luya\web\jsonld\BlogPosting
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing @SInCE 1.0.1 tag

Copy link
Contributor

@nadar nadar Dec 21, 2017

Choose a reason for hiding this comment

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

(github just marked the user @ since :-) but i think you know what i mean)

*
* @param array $config Optional config array to provided person data via setter methods.
* @param array $config Optional config array to provided creative work data via setter methods.
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing @SInCE 1.0.1 tag

* Register new Live Blog Posting.
*
* @param array $config Optional config array to provided live blog posting data via setter methods.
*
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing @SInCE 1.0.1 tag

/**
* Register new Social Media Posting.
*
* @param array $config Optional config array to provided social media posting data via setter methods.
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing @SInCE 1.0.1 tag

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll walk through and add it in the next few days


/**
* @param string $articleSection
* @return Article|ArticleTrait
Copy link
Contributor

Choose a reason for hiding this comment

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

The phpdoc return except an object of type. So we could typehint this for $articleSection like Article $articleSection - what do you think? or are there any other optiosn available?

Copy link
Contributor Author

@JohnnyMcWeed JohnnyMcWeed Dec 21, 2017

Choose a reason for hiding this comment

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

I think the hinting right now makes more sense, as return "Article $articleSection" could confuse in case of what is returned. The return is the article (or any object when the trait is used). Or what do you think?

@nadar
Copy link
Contributor

nadar commented Dec 21, 2017

@JohnnyMcWeed i almost forgot something very important. we would need to have a very small unit test for the new classes. sorry

@JohnnyMcWeed
Copy link
Contributor Author

I already did some tests but not yet pushed. Could you make a "complete" test for Thing? Like that I have a class I can check what it needs to test all methods, as I can't see the result.

@nadar
Copy link
Contributor

nadar commented Dec 21, 2017

@JohnnyMcWeed sure i can provide such an option. But to keep it simple just add something like this: https://github.com/luyadev/luya/blob/master/tests/core/web/JsonLdTest.php#L42-L52

@JohnnyMcWeed
Copy link
Contributor Author

Already did these but not yet pushed ;)

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.5%) to 49.238% when pulling d209e82 on JohnnyMcWeed:JsonLd into 2f53cb5 on luyadev:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.5%) to 49.238% when pulling 74fa6af on JohnnyMcWeed:JsonLd into 2f53cb5 on luyadev:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.5%) to 49.238% when pulling 95516e1 on JohnnyMcWeed:JsonLd into 2f53cb5 on luyadev:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.5%) to 49.238% when pulling c149378 on JohnnyMcWeed:JsonLd into 2f53cb5 on luyadev:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.0%) to 49.744% when pulling b2e3ae1 on JohnnyMcWeed:JsonLd into 2f53cb5 on luyadev:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.0%) to 49.744% when pulling effbc54 on JohnnyMcWeed:JsonLd into 2f53cb5 on luyadev:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.0%) to 49.744% when pulling fa1e106 on JohnnyMcWeed:JsonLd into 2f53cb5 on luyadev:master.

@nadar nadar merged commit a61d5f0 into luyadev:master Dec 27, 2017
nadar added a commit that referenced this pull request Dec 27, 2017
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