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

feat: update ECS config and apply standards #2893

Merged
merged 1 commit into from Jan 29, 2024
Merged

feat: update ECS config and apply standards #2893

merged 1 commit into from Jan 29, 2024

Conversation

nlemoine
Copy link
Member

Bump ECS config.

Note it changed quite a lot a files and we might want to add this commit in the .git-blame-ignore-revs file.

It also removed to full namespace from the docblocks, I don't if this cause issues when generating API reference? @gchtr

@nlemoine nlemoine mentioned this pull request Jan 26, 2024
@nlemoine nlemoine added the 2.0 label Jan 26, 2024
@nlemoine nlemoine added this to the 2.0.1 milestone Jan 26, 2024
@Levdbas
Copy link
Member

Levdbas commented Jan 26, 2024

I see we are no longer prefixing the docblock return types with the full namespace. Could this have a negative impact in the symbol discovery of IDE's?

@nlemoine
Copy link
Member Author

No, since they're referenced in imports:

use Timber\CoreInterface;

I just wonder if the doc generation tool is able to compute the FQCN or is it parsing the doc block as is, example:
Capture d’écran 2024-01-26 à 12 34 09

@Levdbas
Copy link
Member

Levdbas commented Jan 26, 2024

I've just tested the doc generation in combination of your branch and the docs still seem to compile the correct paths :)

Copy link
Member

@Levdbas Levdbas left a comment

Choose a reason for hiding this comment

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

I suggested some docblock updates while at it and there is one return type issue that we might already discussed in a ticket. Just checking. Other than that, looks good to me.

src/MenuItem.php Outdated Show resolved Hide resolved
src/MenuItem.php Outdated Show resolved Hide resolved
src/MenuItem.php Outdated Show resolved Hide resolved
src/MenuItem.php Outdated Show resolved Hide resolved
@@ -67,7 +66,7 @@ trait AccessesPostsLazily
* // No additional overhead here.
* }
* ```
* @return \Timber\PostCollectionInterface The realized PostQuery.
* @return PostCollectionInterface The realized PostQuery.
Copy link
Member

Choose a reason for hiding this comment

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

This throws a static analysis error. Is this something we must take care of? Not sure if this was something that we already discussed in an issue.

Copy link
Member

Choose a reason for hiding this comment

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

@gchtr , mentioned this over here: #2668

Copy link
Member Author

Choose a reason for hiding this comment

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

Haven't figured it out yet but this shouldn't prevent us from merging the PR. We don't require PHPStan to pass (yet). :)

Co-authored-by: Erik van der Bas <erik@basedonline.nl>
@Levdbas
Copy link
Member

Levdbas commented Jan 26, 2024

@gchtr , can you take a final look at this?

@gchtr
Copy link
Member

gchtr commented Jan 29, 2024

It also removed to full namespace from the docblocks, I don't if this cause issues when generating API reference? @gchtr

It’s not a problem, because the reflections still work and generate fully qualified names, apparently.

It only doesn’t work for hook documentation. There, the types have to be generated from the DocBlock. As you can see in the following screenshot, we could have Post or Environment, but wouldn’t know whether this comes from Timber or Twig.

These hook DocBlocks are parsed by looping over the tokens in https://github.com/timber/teak/blob/a5af1504cadb8e5d2277069165caf948d1d0c012/lib/Compiler/HookReference.php#L62-L70. I guess I could somehow also derive the types from the variables that are present before a hook appears. I’ll have to check this out. I created an issue for this in timber/teak#3.

For now, I think it’s a tradeoff we can live with, because it only affects some few filters in https://timber.github.io/docs/v2/hooks/filters/.

@nlemoine nlemoine merged commit 71111e1 into 2.x Jan 29, 2024
28 of 29 checks passed
@nlemoine nlemoine deleted the 2.x-ecs-update branch January 29, 2024 08:10
@nlemoine
Copy link
Member Author

Thanks @gchtr for the details about doc generation. There should be a way to grab the FQCN, let me know if I can help.

@Levdbas Levdbas modified the milestones: 2.0.1, 2.1.0 Feb 1, 2024
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.

None yet

3 participants