Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions releases/8.0/de.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,13 @@
<div class="php8-compare__label">PHP 7</div>
<div class="php8-code phpcode">
<?php highlight_php_trimmed(
'/**
* @Route("/api/posts/{id}", methods={"GET", "HEAD"})
Copy link

Choose a reason for hiding this comment

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

a simpler fix would have been changing api/posts/{id} to api/users 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And changing User -> UsersController?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All the same we need to present method's attribute when we using Route annotation.
Controller's action is most popular example instead of separated action's action.

Copy link

Choose a reason for hiding this comment

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

actually, it can be applied to both at the same time, and this is not a real application, it's only an example to show the new syntax, and is not referring to a specific library/framework.

https://github.com/azjezz/symfony-boilerplate/blob/f4661afc5790d3a7b42925fba1de23bfa9bb3d6b/src/Controller/User/DeleteController.php#L29-L56

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image
@azjezz WDYT about this ^?

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 made in separate PR #358

*/
class User
{'
'class PostsController
{
/**
* @Route("/api/posts/{id}", methods={"GET"})
*/
public function get($id) { /* ... */ }
}'
);?>
</div>
</div>
Expand All @@ -111,9 +113,11 @@ class User
<div class="php8-compare__label php8-compare__label_new">PHP 8</div>
<div class="php8-code phpcode">
<?php highlight_php_trimmed(
'#[Route("/api/posts/{id}", methods: ["GET", "HEAD"])]
class User
{'
'class PostsController
{
#[Route("/api/posts/{id}", methods: ["GET"])]
public function get($id) { /* ... */ }
}'
);?>
</div>
</div>
Expand Down
20 changes: 12 additions & 8 deletions releases/8.0/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,13 @@
<div class="php8-compare__label">PHP 7</div>
<div class="php8-code phpcode">
<?php highlight_php_trimmed(
'/**
* @Route("/api/posts/{id}", methods={"GET", "HEAD"})
*/
class User
{'
'class PostsController
{
/**
* @Route("/api/posts/{id}", methods={"GET"})
*/
public function get($id) { /* ... */ }
}'
);?>
</div>
</div>
Expand All @@ -108,9 +110,11 @@ class User
<div class="php8-compare__label php8-compare__label_new">PHP 8</div>
<div class="php8-code phpcode">
<?php highlight_php_trimmed(
'#[Route("/api/posts/{id}", methods: ["GET", "HEAD"])]
class User
{'
'class PostsController
{
#[Route("/api/posts/{id}", methods: ["GET"])]
public function get($id) { /* ... */ }
}'
);?>
</div>
</div>
Expand Down
20 changes: 12 additions & 8 deletions releases/8.0/pt_BR.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,13 @@
<div class="php8-compare__label">PHP 7</div>
<div class="php8-code phpcode">
<?php highlight_php_trimmed(
'/**
* @Route("/api/posts/{id}", methods={"GET", "HEAD"})
*/
class User
{'
'class PostsController
{
/**
* @Route("/api/posts/{id}", methods={"GET"})
*/
public function get($id) { /* ... */ }
}'
);?>
</div>
</div>
Expand All @@ -111,9 +113,11 @@ class User
<div class="php8-compare__label php8-compare__label_new">PHP 8</div>
<div class="php8-code phpcode">
<?php highlight_php_trimmed(
'#[Route("/api/posts/{id}", methods: ["GET", "HEAD"])]
class User
{'
'class PostsController
{
#[Route("/api/posts/{id}", methods: ["GET"])]
public function get($id) { /* ... */ }
}'
);?>
</div>
</div>
Expand Down
20 changes: 12 additions & 8 deletions releases/8.0/ru.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,13 @@
<div class="php8-compare__label">PHP 7</div>
<div class="php8-code phpcode">
<?php highlight_php_trimmed(
'/**
* @Route("/api/posts/{id}", methods={"GET", "HEAD"})
*/
class User
{'
'class PostsController
{
/**
* @Route("/api/posts/{id}", methods={"GET"})
*/
public function get($id) { /* ... */ }
}'
);?>
</div>
</div>
Expand All @@ -110,9 +112,11 @@ class User
<div class="php8-compare__label php8-compare__label_new">PHP 8</div>
<div class="php8-code phpcode">
<?php highlight_php_trimmed(
'#[Route("/api/posts/{id}", methods: ["GET", "HEAD"])]
class User
{'
'class PostsController
{
#[Route("/api/posts/{id}", methods: ["GET"])]
public function get($id) { /* ... */ }
}'
);?>
</div>
</div>
Expand Down