WEBVTT

NOTE Created by CaptionSync from Automatic Sync Technologies www.automaticsync.com

00:00:00.056 --> 00:00:07.506 align:middle
What could be better than
eating ice cream at the beach?

00:00:08.446 --> 00:00:11.836 align:middle
Only one thing I can think of:
eating ice cream at the beach...

00:00:12.216 --> 00:00:12.786 align:middle
wait for it...

00:00:13.116 --> 00:00:16.056 align:middle
while contributing to Symfony!

00:00:17.116 --> 00:00:23.476 align:middle
Seriously, I am super, duper,
double-duper, excited about this tutorial!

00:00:24.406 --> 00:00:28.166 align:middle
If you're like me, you probably
use Symfony almost every day.

00:00:28.876 --> 00:00:33.056 align:middle
And that means, we're taking
advantage of countless hours

00:00:33.056 --> 00:00:36.176 align:middle
of volunteer work from thousands of people!

00:00:37.156 --> 00:00:42.726 align:middle
Contributing to Symfony is a great way to give
back and become part of that amazing effort.

00:00:43.506 --> 00:00:46.706 align:middle
But, I also have a few other motivations.

00:00:47.376 --> 00:00:54.396 align:middle
Like, if you want to truly become an expert
on one part of Symfony, there is no better way

00:00:54.486 --> 00:00:57.216 align:middle
than reviewing a pull request or fixing a bug.

00:00:57.926 --> 00:00:58.746 align:middle
Seriously.

00:00:59.486 --> 00:01:04.866 align:middle
Or, have you ever been annoyed by part
of Symfony and wanted to improve it?

00:01:06.006 --> 00:01:11.166 align:middle
How about this: have you ever been
confused, finally figured something out,

00:01:11.566 --> 00:01:14.366 align:middle
and then realized a small change

00:01:14.366 --> 00:01:18.296 align:middle
to the documentation could have
saved you hours of frustration?

00:01:19.286 --> 00:01:23.176 align:middle
These are the things that get me
excited to contribute back to Symfony!

00:01:24.236 --> 00:01:31.346 align:middle
How cool is it that you could save other people
hundreds of hours by improving the documentation

00:01:31.626 --> 00:01:35.916 align:middle
with extra information that the core
team didn't realize was missing?

00:01:37.006 --> 00:01:39.806 align:middle
Symfony is truly community-driven.

00:01:40.626 --> 00:01:45.456 align:middle
There's actually no official roadmap:
if you want to add something, do it!

00:01:46.506 --> 00:01:51.576 align:middle
Excited? There's just one
small problem: contributing...

00:01:51.836 --> 00:01:52.566 align:middle
ain't easy!

00:01:53.046 --> 00:01:54.456 align:middle
At least, not at first.

00:01:55.116 --> 00:01:58.026 align:middle
Symfony is a huge and complex project.

00:01:58.516 --> 00:02:01.966 align:middle
But, you will not regret
learning how to give back.

00:02:02.596 --> 00:02:05.386 align:middle
It's fun and will make you
an even better developer.

00:02:06.516 --> 00:02:07.286 align:middle
Let's jump in!

00:02:08.076 --> 00:02:13.196 align:middle
The main repository for Symfony lives
at https://github.com/symfony/symfony.

00:02:14.136 --> 00:02:17.186 align:middle
This holds almost all of the Symfony libraries.

00:02:17.726 --> 00:02:22.546 align:middle
There are a few others that live in other
places - but we'll talk about those later.

00:02:23.196 --> 00:02:30.486 align:middle
And, woh! 749 issues and 181 pull requests!

00:02:30.946 --> 00:02:33.666 align:middle
That's, ah, a lot!

00:02:33.666 --> 00:02:38.336 align:middle
And this leads me to the first, most important

00:02:38.666 --> 00:02:43.166 align:middle
and least celebrated way
of contributing: triaging!

00:02:44.076 --> 00:02:50.676 align:middle
Here's the truth: there are too many issues and
too many pull requests for the Symfony core team

00:02:50.896 --> 00:02:53.626 align:middle
to be able to reply &amp; review everything.

00:02:54.856 --> 00:03:00.906 align:middle
The first way to contribute is to "triage":
find an issue and help push it forward.

00:03:01.916 --> 00:03:07.116 align:middle
If it's a feature idea, you can give your
feedback or offer alternate solutions.

00:03:07.856 --> 00:03:10.986 align:middle
If it's a bug, see if you
can replicate that bug.

00:03:11.956 --> 00:03:13.176 align:middle
We're going to do this.

00:03:14.106 --> 00:03:22.776 align:middle
You can also triage pull requests: find one,
review its code, give your opinion on whether

00:03:22.776 --> 00:03:28.566 align:middle
or not you think it's a good idea, and even
test it in a real project to make sure it works.

00:03:29.476 --> 00:03:30.236 align:middle
We'll do that too!

00:03:31.006 --> 00:03:36.226 align:middle
Oh, and I recommend focusing on newer
issues and pull requests, at least at first.

00:03:36.846 --> 00:03:41.186 align:middle
If a PR or issue is old, it's
probably pretty complicated.

00:03:42.456 --> 00:03:46.186 align:middle
If reviewing code or giving
your opinion in a big repository

00:03:46.186 --> 00:03:48.826 align:middle
like Symfony sounds scary, don't worry!

00:03:49.346 --> 00:03:55.056 align:middle
Symfony is a friendly place: everyone has the
same goal: to help move the project forward.

00:03:56.256 --> 00:04:00.796 align:middle
Sure, it is possible that you'll say
something that's not completely correct.

00:04:01.376 --> 00:04:03.046 align:middle
I do that all the time!

00:04:03.426 --> 00:04:05.046 align:middle
I think I'm kinda famous for it!

00:04:05.786 --> 00:04:07.946 align:middle
It's really no big deal.

00:04:08.616 --> 00:04:14.666 align:middle
Honestly, the time that you took to review
that pull request or issue has a high value.

00:04:15.406 --> 00:04:20.276 align:middle
And if you say something that isn't totally
right, someone else will nicely correct you,

00:04:20.686 --> 00:04:24.126 align:middle
you'll learn something, and the
whole project will move forward.

00:04:25.126 --> 00:04:30.146 align:middle
Be nice, don't be afraid to be wrong, and
use any feedback as a way to learn more.

00:04:31.226 --> 00:04:33.456 align:middle
So, let's start contributing!

00:04:34.246 --> 00:04:39.916 align:middle
Let's triage a pull request that
I found: - it's number 28069.

00:04:40.996 --> 00:04:47.096 align:middle
This PR is from my friend Colin, who's
proposing a new MultipleOf validation constraint

00:04:47.486 --> 00:04:51.256 align:middle
that checks whether a submitted
value is divisible by another number.

00:04:52.116 --> 00:04:56.176 align:middle
I like this idea, but this PR
hasn't gotten any attention yet.

00:04:56.916 --> 00:05:00.926 align:middle
This is a perfect opportunity
for us to help push it forward!

00:05:02.176 --> 00:05:04.106 align:middle
First, let's review the code.

00:05:04.886 --> 00:05:09.216 align:middle
As a new contributor, you might not really
know what to look for when reviewing.

00:05:09.936 --> 00:05:15.406 align:middle
No problem: just see if the code makes sense
and look for potential bugs or other issues.

00:05:16.366 --> 00:05:18.996 align:middle
You don't have to be perfect:
every little bit helps.

00:05:20.546 --> 00:05:23.286 align:middle
To create a validator, you need two classes.

00:05:23.906 --> 00:05:28.296 align:middle
The first represents the annotation: MultipleOf.

00:05:29.426 --> 00:05:35.006 align:middle
The second - MultipleOfValidator - is the
class that actually does the validation work.

00:05:36.116 --> 00:05:40.926 align:middle
The annotation has an option message:
The value should be a multiple

00:05:40.926 --> 00:05:43.986 align:middle
of {{ compared_value }} That's
a pretty good message.

00:05:44.896 --> 00:05:48.776 align:middle
In the validator, Colin uses
`fmod` to compare the values,

00:05:49.336 --> 00:05:54.796 align:middle
which means the user can compare
decimals - like 1 is a multiple of .5.

00:05:55.996 --> 00:05:57.936 align:middle
Yea, this all looks pretty good to me!

00:05:59.176 --> 00:06:05.036 align:middle
The second thing to look for is if the
PR has a test: most features need some.

00:06:05.506 --> 00:06:12.596 align:middle
And, no surprise, Colin did a great job here
too: he's testing valid and invalid comparisons.

00:06:13.866 --> 00:06:17.416 align:middle
This test uses a special base
class to hook this all together.

00:06:18.366 --> 00:06:22.246 align:middle
So... I have no comments to
add to this pull request!

00:06:22.696 --> 00:06:25.076 align:middle
And even that is valuable!

00:06:25.976 --> 00:06:30.296 align:middle
We'll be able to post that we reviewed
the code and it looks good to us.

00:06:31.326 --> 00:06:35.846 align:middle
But, there is still one important
question: does this...

00:06:35.956 --> 00:06:37.246 align:middle
actually work?

00:06:37.936 --> 00:06:44.056 align:middle
It's one thing to look at the code, but it helps
so much if someone in the community says: Hey!

00:06:44.576 --> 00:06:48.786 align:middle
I actually tried this in a real
project and it works great!

00:06:49.716 --> 00:06:52.426 align:middle
Let's be that wonderful person next!

