Skip to content

Commit

Permalink
removing "will"
Browse files Browse the repository at this point in the history
  • Loading branch information
escopecz committed Apr 25, 2024
1 parent d9dce97 commit d43ed26
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/plugins/from-4-to-5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ In your PR add also PHP 8.1 and 8.2. And upgrade the Mautic version from 4.4 to
2. Autowiring

Check warning on line 13 in docs/plugins/from-4-to-5.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.HeadingPunctuation] Don't put a period at the end of a heading. Raw Output: {"message": "[Google.HeadingPunctuation] Don't put a period at the end of a heading.", "location": {"path": "docs/plugins/from-4-to-5.rst", "range": {"start": {"line": 13, "column": 1}}}, "severity": "WARNING"}
-------------

Mautic 5 comes with autowiring of PHP services which means the developer experience is way better and the code will shrink substantially.
Mautic 5 comes with autowiring of PHP services which means the developer experience is way better and the code size gets reduced.

There is a great doc already written on this topic so get that setup and come back: https://devdocs.mautic.org/en/5.x/plugins/autowiring.html

Expand Down Expand Up @@ -49,7 +49,7 @@ In the controllers, you'll also have to update the view paths like this:
- $this->renderView('MauticCoreBundle:Notification:flash_messages.html.php');
+ $this->renderView('@MauticCore/Notification/flash_messages.html.twig');
This command will save you some time as it validates the Twig syntax:
Running this command is faster than refreshing all the views in the browser. It validates the Twig syntax and can guide you through the process:

``bin/console lint:twig plugins/MyBundle``

Expand All @@ -58,7 +58,7 @@ This command will save you some time as it validates the Twig syntax:
5. The Integration Class

Check warning on line 58 in docs/plugins/from-4-to-5.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.Headings] '5. The Integration Class' should use sentence-style capitalization. Raw Output: {"message": "[Google.Headings] '5. The Integration Class' should use sentence-style capitalization.", "location": {"path": "docs/plugins/from-4-to-5.rst", "range": {"start": {"line": 58, "column": 1}}}, "severity": "WARNING"}

Check warning on line 58 in docs/plugins/from-4-to-5.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.HeadingPunctuation] Don't put a period at the end of a heading. Raw Output: {"message": "[Google.HeadingPunctuation] Don't put a period at the end of a heading.", "location": {"path": "docs/plugins/from-4-to-5.rst", "range": {"start": {"line": 58, "column": 1}}}, "severity": "WARNING"}
------------------------

If you went ahead and deleted all services from config.php with a smile on your face, you may find yourself in a pickle if you are using Mautic's Integration classes and interfaces. The inner workings of the IntegrationsBundle expects that your integration has a service key in a specific format. I bet this will be improved for Mautic 6, but for now add an alias to services.php:
If you went ahead and deleted all services from config.php with a smile on your face, you may find yourself in a pickle if you are using Mautic's Integration classes and interfaces. The inner workings of the IntegrationsBundle expects that your integration has a service key in a specific format. This should be improved for Mautic 6, but for now add an alias to services.php:

Check failure on line 61 in docs/plugins/from-4-to-5.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'PHP' instead of 'php'. Raw Output: {"message": "[Vale.Terms] Use 'PHP' instead of 'php'.", "location": {"path": "docs/plugins/from-4-to-5.rst", "range": {"start": {"line": 61, "column": 56}}}, "severity": "ERROR"}

Check failure on line 61 in docs/plugins/from-4-to-5.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'PHP' instead of 'php'. Raw Output: {"message": "[Vale.Terms] Use 'PHP' instead of 'php'.", "location": {"path": "docs/plugins/from-4-to-5.rst", "range": {"start": {"line": 61, "column": 373}}}, "severity": "ERROR"}

.. code:: php
$services->alias('mautic.integration.[MY_INTEGRAION]', \MauticPlugin\[MY_INTEGRAION]Bundle\Integration\[MY_INTEGRAION]Integration::class);

Check failure on line 64 in docs/plugins/from-4-to-5.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'Mautic' instead of 'mautic'. Raw Output: {"message": "[Vale.Terms] Use 'Mautic' instead of 'mautic'.", "location": {"path": "docs/plugins/from-4-to-5.rst", "range": {"start": {"line": 64, "column": 22}}}, "severity": "ERROR"}
Expand All @@ -78,7 +78,7 @@ If you plugin uses a compliler pass, you may have to double-check that it works
7. Getting container in tests
-----------------------------

This one will be a quick find and replace:
This one is a quick find and replace:

.. code:: diff
Expand All @@ -90,7 +90,7 @@ Notice you can also use FQCN instead of string service keys which is more conven
8. Automated refactoring
------------------------

Your plugin should be working on Mautic 5 by now. But let's go further as Mautic 5 uses PHP 8+ we can take advantage of the syntax. And Rector will help you to upgrade for you.
Your plugin should be working on Mautic 5 by now. But let's go further as Mautic 5 uses PHP 8+ we can take advantage of the syntax. And Rector upgrade the code for you.

Run ``bin/rector process plugins/MyBundle`` and review the changes.

Expand All @@ -106,11 +106,11 @@ Another great way how to improve your plugin code base quality is to run the CS
10. Static analysis
-------------------

PHPSTAN is another amazing tool that will find bugs for you. It's better to run it on the whole codebase including core Mautic so it's aware of all classes.
PHPSTAN is another amazing tool that detects bugs for you. It's better to run it on the whole codebase including core Mautic so it's aware of all classes.

Run ``composer phpstan``

If your plugin has way too many PHPSTAN errors than you can handle right now, consider using [PHPSTAN baseline](https://phpstan.org/user-guide/baseline). It allows you to store your tech debt to a file and it will force you to write better code from now on. And you can reduce the baseline by small chunks every month to get to 0.
If your plugin has way too many PHPSTAN errors than you can handle right now, consider using [PHPSTAN baseline](https://phpstan.org/user-guide/baseline). It allows you to store your tech debt to a single file and it forces you to write better code from now on. And you can reduce the baseline by small chunks every month to get to 0.

Conclusion
----------
Expand Down

0 comments on commit d43ed26

Please sign in to comment.