View on GitHub

RefactoringPHP

A PHP version of the refactors from Refactoring: Improving the Design of Existing Code (Second Edition) by Martin Fowler

Change Value to Reference (256)

Inverse of Change Reference to Value (252)

Old Code

<?php
$customer = new Customer($customerData);

New Code

<?php
$customer = $customerRepository->get($customerData->id);