Slide 1

Slide 1 text

THE BIG UPGRADE All the way up to Symfony 7 and PHP 8.3

Slide 2

Slide 2 text

I have been a software developer for more than 30 years. In the development space I have done everything: I have done games, e-commerce, APIs, backend, frontend, Android, SRE, DevOps... And I have worked with multiple languages and technologies: C++, PHP, Java, JavaScript, SQL, MongoDB, Docker… Carlos Granados PHP 100% Symfony 100%

Slide 3

Slide 3 text

https://fastdebug.io Looking for beta users!

Slide 4

Slide 4 text

https://github.com/php-static-analysis/attributes PHP STATIC ANALYSIS ATTRIBUTES

Slide 5

Slide 5 text

TABLE OF CONTENTS 01 Current status 02 Preparation 03 Execution 04 Conclusions

Slide 6

Slide 6 text

CURRENT STATUS 01

Slide 7

Slide 7 text

WizAI was founded in 2001 and its focus is on digital signage and intelligent information systems. They provide the right display hardware for their customers and their CMS software wizperZone and enable users to display their digital content in an appealing way. THE COMPANY Started working there in July 2023

Slide 8

Slide 8 text

● Symfony 3.4 CURRENT STATUS ● PHP 7.2 ● REST API with an Angular NG frontend ● Approx. 1K PHP files and 100K LOC ● Almost no tests ● No CI setup ● No containers ● No static analysis tools ● No common coding standard ● Very heterogeneous code base

Slide 9

Slide 9 text

PREPARATION 02

Slide 10

Slide 10 text

90% DEDICATION 1 TESTS, 1 TOOLS HUMAN RESOURCES 4 MONTHS 2 DEVELOPERS

Slide 11

Slide 11 text

01 – DOCKERISE

Slide 12

Slide 12 text

02 – ADD PHPUNIT

Slide 13

Slide 13 text

03 – CREATE CI PIPELINE

Slide 14

Slide 14 text

04 – ADD MIGRATIONS BUNDLE

Slide 15

Slide 15 text

05 – ADD FIXTURES BUNDLE

Slide 16

Slide 16 text

06 – ADD BEHAT

Slide 17

Slide 17 text

06 – ADD BEHAT

Slide 18

Slide 18 text

06 – ADD BEHAT

Slide 19

Slide 19 text

06 – ADD BEHAT - Very good integration with Symfony - Allows you to cover a lot of code with very few tests - Does not create real HTTP requests, it simulates them by directly calling the Symfony kernel - It is very fast

Slide 20

Slide 20 text

07 – CODE COVERAGE

Slide 21

Slide 21 text

08 – PHPSTAN

Slide 22

Slide 22 text

09 – CODING STANDARD

Slide 23

Slide 23 text

10 – RECTOR

Slide 24

Slide 24 text

SMALL PRS SINGLE PURPOSE MODUS OPERANDI WORK IN PARALLEL LITTLE STEPS

Slide 25

Slide 25 text

END RESULT - Database setup with migrations and fixtures - Good test code coverage with Behat and PHPUnit - CI pipeline in place - Static Analysis - PSR-12 compliant code base - Code fully updated to Symfony 3.4 and PHP 7.4 - Rector refactoring tool available

Slide 26

Slide 26 text

EXECUTION 03

Slide 27

Slide 27 text

90% DEDICATION 4 MONTHS HUMAN RESOURCES 1 DEVELOPER

Slide 28

Slide 28 text

https://github.com/symfony/symfony/blob/5.0/UPGRADE-5.0.md https://symfonycasts.com/screencast/symfony6-upgrade/upgrade-symfony6 DOC RESOURCES https://symfony.com/doc/current/setup/upgrade_major.html

Slide 29

Slide 29 text

01 – DEPRECATIONS

Slide 30

Slide 30 text

01 – DEPRECATIONS

Slide 31

Slide 31 text

01 – DEPRECATIONS

Slide 32

Slide 32 text

02 – UPDATE VERSION

Slide 33

Slide 33 text

02 – UPDATE VERSION

Slide 34

Slide 34 text

03 – DEPENDENCY HELL

Slide 35

Slide 35 text

03 – DEPENDENCY HELL

Slide 36

Slide 36 text

03 – DEPENDENCY HELL

Slide 37

Slide 37 text

03 – DEPENDENCY HELL

Slide 38

Slide 38 text

04 – UPDATE YOUR CODE

Slide 39

Slide 39 text

05 – SF4 - FOLDERS

Slide 40

Slide 40 text

06 – SF4 - FLEX https://symfony.com/doc/current/setup/flex.html composer recipes:update

Slide 41

Slide 41 text

07 – SF4 - PARAMETERS

Slide 42

Slide 42 text

08 – SF4 - BEHAT

Slide 43

Slide 43 text

09 – SF5 - MAILER

Slide 44

Slide 44 text

10 – SF5 – PHP8

Slide 45

Slide 45 text

11 – SF6 – ATTRIBUTES

Slide 46

Slide 46 text

SMALL PRS SINGLE PURPOSE MODUS OPERANDI WORK IN PARALLEL LITTLE STEPS

Slide 47

Slide 47 text

CURRENT MAIN/PROD NEXT STAGING MODUS OPERANDI NEXT+ BRANCH THREE VERSIONS

Slide 48

Slide 48 text

CONCLUSIONS 04

Slide 49

Slide 49 text

END RESULT - Well tested, modern and homogeneous code base - Faster code base - Safer code base - Allows us to use all the latest Symfony capabilities - Allows us to use the latest PHP constructs - Matches latest documentation - Matches current presentations

Slide 50

Slide 50 text

THANKS! [email protected] carlos-granados @carlos_granados