diff --git a/Documentation/CodingGuidelines/CodingBestPractices/Index.rst b/Documentation/CodingGuidelines/CodingBestPractices/Index.rst deleted file mode 100644 index 36f8429522..0000000000 --- a/Documentation/CodingGuidelines/CodingBestPractices/Index.rst +++ /dev/null @@ -1,20 +0,0 @@ -:navigation-title: PHP Best Practice -.. include:: /Includes.rst.txt - -.. _cgl-best-practices: - -================== -PHP best practices -================== - -This section documents some best practices when developing for TYPO3. -Most areas are documented in more detail at different places, this -part is just an overview of common pitfalls and generic tips. - - -.. toctree:: - :maxdepth: 1 - :titlesonly: - - NamedArguments - Singletons diff --git a/Documentation/CodingGuidelines/Index.rst b/Documentation/CodingGuidelines/Index.rst index e3ec682d9c..eab1241f92 100644 --- a/Documentation/CodingGuidelines/Index.rst +++ b/Documentation/CodingGuidelines/Index.rst @@ -32,9 +32,7 @@ should be sufficient. :titlesonly: Introduction - PhpArchitecture/Index CglPhp/Index - CodingBestPractices/Index CglJavaScript/Index CglTypeScript/Index CglTypoScript/Index diff --git a/Documentation/CodingGuidelines/PhpArchitecture/Index.rst b/Documentation/CodingGuidelines/PhpArchitecture/Index.rst deleted file mode 100644 index b5b8560db9..0000000000 --- a/Documentation/CodingGuidelines/PhpArchitecture/Index.rst +++ /dev/null @@ -1,34 +0,0 @@ -.. include:: /Includes.rst.txt - -.. _cgl-modeling-cross-cutting-concerns: -.. _cgl-php-architecture: - -================ -PHP architecture -================ - -This chapter aims to give developers some ideas and practices at hand -when PHP architectural decisions have to be taken. Result should be a -understanding of some thoughts behind and a harmonization of solutions -found in the TYPO3 Core and maybe in third-party extensions. It -should help reviewers to evaluate solutions and how they stick to the -main code separation principles the Core tries to follow. The document -should help developers to train their architectural skills and to rate -easier which pattern matches a given problem to improve code quality -and exchangeability. - -These following sections also address cross-cutting concerns, which are -problems that have to be solved at multiple, distinct places within the -system that have no further connection to each other. It is a cross-class -hierarchy and maybe cross-extension problem that can and should not -be solved with class abstractions. - - -.. toctree:: - :maxdepth: 1 - :titlesonly: - - Services - StaticMethods - Traits - WorkingWithExceptions diff --git a/Documentation/Index.rst b/Documentation/Index.rst index 8f69188997..b26d6cf7cc 100644 --- a/Documentation/Index.rst +++ b/Documentation/Index.rst @@ -40,6 +40,11 @@ TYPO3 Explained Learn how to write site packages and other custom extension with or without Extbase. + .. card:: :ref:`PHP architecture ` + + General PHP architectural strategies in TYPO3 core development and best + practices for extension developers. + .. card:: :ref:`Security guidelines ` This chapter describes some typical risks and advises how to protect a @@ -60,6 +65,7 @@ TYPO3 Explained Configuration/Index CodingGuidelines/Index ExtensionArchitecture/Index + PhpArchitecture/Index Security/Index Testing/Index diff --git a/Documentation/PhpArchitecture/Index.rst b/Documentation/PhpArchitecture/Index.rst new file mode 100644 index 0000000000..5f299fd3ce --- /dev/null +++ b/Documentation/PhpArchitecture/Index.rst @@ -0,0 +1,29 @@ +.. include:: /Includes.rst.txt + +.. _cgl-modeling-cross-cutting-concerns: +.. _cgl-php-architecture: +.. _cgl-best-practices: + +================ +PHP architecture +================ + +Writing excellent PHP code within the TYPO3 framework involves more than just correctly +utilizing the framework's API: It also requires making sound decisions regarding general +PHP architecture. + +This chapter addresses general PHP architectural considerations and best +practices, with a focus on TYPO3. It covers both overarching principles of +good PHP architecture relevant to TYPO3 Core developers and best practices +specifically for extension developers. + +.. toctree:: + :maxdepth: 1 + :titlesonly: + + NamedArguments + Services + StaticMethods + Traits + WorkingWithExceptions + Singletons diff --git a/Documentation/CodingGuidelines/CodingBestPractices/NamedArguments.rst b/Documentation/PhpArchitecture/NamedArguments.rst similarity index 100% rename from Documentation/CodingGuidelines/CodingBestPractices/NamedArguments.rst rename to Documentation/PhpArchitecture/NamedArguments.rst diff --git a/Documentation/CodingGuidelines/PhpArchitecture/Services.rst b/Documentation/PhpArchitecture/Services.rst similarity index 100% rename from Documentation/CodingGuidelines/PhpArchitecture/Services.rst rename to Documentation/PhpArchitecture/Services.rst diff --git a/Documentation/CodingGuidelines/CodingBestPractices/Singletons.rst b/Documentation/PhpArchitecture/Singletons.rst similarity index 100% rename from Documentation/CodingGuidelines/CodingBestPractices/Singletons.rst rename to Documentation/PhpArchitecture/Singletons.rst diff --git a/Documentation/CodingGuidelines/PhpArchitecture/StaticMethods.rst b/Documentation/PhpArchitecture/StaticMethods.rst similarity index 100% rename from Documentation/CodingGuidelines/PhpArchitecture/StaticMethods.rst rename to Documentation/PhpArchitecture/StaticMethods.rst diff --git a/Documentation/CodingGuidelines/PhpArchitecture/Traits.rst b/Documentation/PhpArchitecture/Traits.rst similarity index 100% rename from Documentation/CodingGuidelines/PhpArchitecture/Traits.rst rename to Documentation/PhpArchitecture/Traits.rst diff --git a/Documentation/CodingGuidelines/PhpArchitecture/WorkingWithExceptions.rst b/Documentation/PhpArchitecture/WorkingWithExceptions.rst similarity index 100% rename from Documentation/CodingGuidelines/PhpArchitecture/WorkingWithExceptions.rst rename to Documentation/PhpArchitecture/WorkingWithExceptions.rst