Skip to content

Commit 73e63e2

Browse files
authored
Merge pull request #225 from mautic/fix-build-errors
Fix build errors
2 parents 01f8e46 + 7df91da commit 73e63e2

File tree

4 files changed

+24
-20
lines changed

4 files changed

+24
-20
lines changed

docs/components/cache.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ All you need to do now is to clear all tagged items:
4343
.. code-block:: php
4444
4545
$cache->invalidateTags(['firstTag']);
46+
4647
Pools clearing
4748
==============
4849

@@ -54,6 +55,7 @@ Cache Pools include methods to delete a cache item, some of them, or all of them
5455
.. code-block:: php
5556
5657
$isDeleted = $cache->deleteItem('user_'.$userId);
58+
5759
Use the ``Psr\\Cache\\CacheItemPoolInterface::deleteItems`` method to delete several cache items simultaneously - it returns true only if all the items have been deleted, even when any or some of them don't exist.
5860

5961
Configuration
@@ -68,6 +70,7 @@ These are the default settings:
6870
'cache_adapter' => 'mautic.cache.adapter.filesystem',
6971
'cache_prefix' => 'app',
7072
'cache_lifetime' => 86400
73+
7174
They can be overridden in ``local.php`` like this:
7275

7376
.. code-block:: php
@@ -84,6 +87,7 @@ Delivered adapters
8487
- ``mautic.cache.adapter.memcached``
8588

8689
.. code-block:: php
90+
8791
'memcached' => [
8892
'servers' => ['memcached://localhost'],
8993
'options' => [

docs/design/retriving_system_information.rst renamed to docs/design/retrieving_system_information.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Retrieving Mautic settings in Twig
2-
=============================================
2+
##################################
33

44
Mautic allows you to access configuration settings directly in Twig templates using the ``configGetParameter`` function. This feature is particularly useful for creating display conditions or showing existing data in your templates.
55

66
Basic usage
7-
-----------
7+
***********
88

99
To retrieve a setting, use the ``configGetParameter`` function with the parameter name as its argument:
1010

@@ -13,7 +13,7 @@ To retrieve a setting, use the ``configGetParameter`` function with the paramete
1313
{{ configGetParameter('parameter_name') }}
1414
1515
Display conditions
16-
------------------
16+
==================
1717

1818
Use ``configGetParameter`` in conditional statements to control the display of content based on configuration settings:
1919

@@ -24,7 +24,7 @@ Use ``configGetParameter`` in conditional statements to control the display of c
2424
{% endif %}
2525
2626
Displaying configuration values
27-
-------------------------------
27+
===============================
2828

2929
To directly display a configuration value in your template, use the following syntax:
3030

@@ -45,12 +45,12 @@ For example, to display the API OAuth2 access token lifetime:
4545
API OAuth2 Access Token Lifetime: {{ configGetParameter('api_oauth2_access_token_lifetime') }}
4646
4747
Finding available parameters
48-
----------------------------
48+
============================
4949

5050
The ``/config/local.php`` file contains available configuration parameters, once you save the global configuration form for the first time. This file contains the complete list of settings that are accessible using ``configGetParameter``.
5151

5252
Identifying parameter names
53-
---------------------------
53+
===========================
5454

5555
To find the correct parameter name for a specific setting:
5656

@@ -67,7 +67,7 @@ For example, if you see:
6767
The corresponding parameter name would be ``api_oauth2_access_token_lifetime``.
6868

6969
Additional information
70-
----------------------
70+
**********************
7171

7272
- Be cautious when displaying sensitive configuration data in templates.
7373
- Always consider providing default values when using configuration parameters to handle cases where the setting aren't defined.

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ There are several ways to support Mautic other than contributing with code.
5656
:caption: Design and UX
5757
:hidden:
5858

59-
design/retrieving_system_settings
59+
design/retrieving_system_information
6060

6161
.. toctree::
6262
:maxdepth: 2

docs/plugins/from-4-to-5.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
Update Plugins for Mautic 5
2-
=======================================
2+
###########################
33

44
Here is a list of steps that most of the Plugins may need to take to upgrade from Mautic 4 to Mautic 5. You should be able to get through each step, make a commit, move to the next one and once you are at finished you have upgraded your Plugin.
55

66
Continuous Integration
7-
-------------------------
7+
**********************
88

99
If you don't have CI configured, this is the time to do it. This is an optional step but it makes sense to do it at the beginning rather than later. Here's how to get it done: :doc:`/plugins/continuous-integration`.
1010

1111
In your PR add also support for PHP 8.1 and 8.2, and upgrade the Mautic version from 4.4 to 5.1. One more thing is that Mautic 5 have ``local.php`` in ``config/local.php`` instead of ``app/config/local.php`` so update that as well.
1212

1313
Autowiring
14-
-------------
14+
**********
1515

1616
Mautic 5 comes with autowiring of PHP services which means the developer experience is much improved, and the code size is reduced.
1717

@@ -24,7 +24,7 @@ To quickly verify that the wiring of services is complete and configured correct
2424
.. note:: Ideally, you should be able to delete the whole ``services`` section from your ``config.php`` file, but do that as a cherry on top once you are sure everything is working as the later steps in this process may yet cause you difficulties.
2525

2626
``config.php`` - controllers
27-
---------------------------
27+
****************************
2828

2929
``config.php`` should be much lighter now when all services are gone after autowiring is configured. There is one more thing to verify. The controllers are now defined with a different syntax. Here is an example:
3030

@@ -36,7 +36,7 @@ To quickly verify that the wiring of services is complete and configured correct
3636
Symfony 5 is much more explicit. That's a good thing even if it's longer. You don't have to guess what the syntax is. It's basically just standard FQCN (Fully Qualified Class Name) with the full method name behind the 2 colons. You don't even need to call the controller method `*Action` any more.
3737

3838
Rendering views
39-
------------------
39+
***************
4040

4141
As Symfony 5 removed the PHP templating engine, Mautic had to switch to Twig. Your Plugin must also update the any views from PHP to Twig. Here is a helpful resource on how to migrate the ``*.html.php`` files to ``*.html.twig`` files:
4242

@@ -58,7 +58,7 @@ Running this command is faster than refreshing all the views in the browser. It
5858
.. vale off
5959
6060
The Integration class
61-
------------------------
61+
*********************
6262

6363
.. vale on
6464
@@ -72,7 +72,7 @@ If you went ahead and deleted all services from ``config.php``, you may experien
7272
.. note:: Replace `[MY_INTEGRATION]` with your Plugin name.
7373

7474
Compiler passes
75-
------------------
75+
***************
7676

7777
If your Plugin uses a compiler pass, you may have to verify that it works correctly. In many cases you may have to change the service alias with FQCN like so:
7878

@@ -82,7 +82,7 @@ If your Plugin uses a compiler pass, you may have to verify that it works correc
8282
+ ->setDecoratedService(EmailType::class, 'mautic.form.type.email.inner')
8383
8484
Getting container in tests
85-
-----------------------------
85+
**************************
8686

8787
This one is a quick find and replace:
8888

@@ -94,7 +94,7 @@ This one is a quick find and replace:
9494
Notice you can also use FQCN instead of string service keys which is more convenient.
9595

9696
Automated refactoring
97-
------------------------
97+
**********************
9898

9999
Your Plugin should be working on Mautic 5 by now. Wouldn't it be great to shorten the code a little more? Mautic 5 uses PHP 8.0+ so can take advantage of the syntax. Rector can upgrade the code for you.
100100

@@ -103,14 +103,14 @@ Run ``bin/rector process plugins/MyBundle`` and review the changes.
103103
.. note:: Update MyBundle with your bundle name.
104104

105105
Automated code style
106-
-----------------------
106+
********************
107107

108108
Another great way how to improve your Plugin code base quality is to run the CS Fixer: ``bin/php-cs-fixer fix plugins/MyBundle``.
109109

110110
.. note:: Update MyBundle with your bundle name.
111111

112112
Static analysis
113-
-------------------
113+
***************
114114

115115
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.
116116

@@ -119,6 +119,6 @@ Run ``composer phpstan``
119119
If your Plugin has more PHPSTAN errors than you can handle right now, consider using :xref:`PHPSTAN 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.
120120

121121
Conclusion
122-
----------
122+
**********
123123

124124
This list of steps is compiled by Mautic Plugin developers for the Mautic Plugin developers. If you find that some common problem isn't addressed here, please add it.

0 commit comments

Comments
 (0)