javanile/php-global-var

Replacement strategy of messy code because of the global

Maintainers

Package info

github.com/javanile/php-global-var

pkg:composer/javanile/php-global-var

Statistics

Installs: 17

Dependents: 1

Suggesters: 0

Stars: 1

Open Issues: 0

0.0.1 2020-05-09 01:30 UTC

This package is auto-updated.

Last update: 2026-03-09 20:52:55 UTC


README

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');
   
   .
   .
   .
}