Skip to content

πŸ‘· Replacement strategy of messy code because of the global

License

Notifications You must be signed in to change notification settings

javanile/php-global-var

Folders and files

NameName
Last commit message
Last commit date

Latest commit

503e6eb Β· Jul 9, 2021

History

6 Commits
May 9, 2020
May 9, 2020
May 9, 2020
Jul 9, 2021
May 9, 2020
May 9, 2020

Repository files navigation

PHP Global Var

This project supports replacement into old PHP code written with abuse of global directive, and give a strategy to step by step remove and refacoty code in a modern way.

Installation

composer require javanile/php-global-var

Usage

<?php

function getNewEntity() 
{
   // Replace the following line
   global $entityManager;
   // With `get_global_var` call
   $entityManager = get_global_var('entityManager');
   
   .
   .
   .
}