Refactor long methods to method classes

Classes with a lot of lines of code are generally bad. Too many responsibilities, low cohesion, or both. However, sometimes it is not possible to make functions smaller. Reasons could be various. What can be done in this circumstance?

Category: Development
Subcategories: Tutorials
07/01/2020
4896 times
Refactor long methods to method classes
Related posts
Design patterns in PHP: Strategy

This tutorial describes a TDD approach to refactor code to Strategy pattern. Starting from working code and some test, refactoring steps are applied to obtain cleaner code

PHP/Laravel Library for Tado API

I released on GitHub a PHP library for querying and editing data on the Tado Thermostat System. It is integrated in Laravel 5.x for quick setup in this excellent framework.

Create a custom validation rule with string alias

In this tutorial I will show how to define a Laravel validation rule providing a custom alias string to use in custom validation classes.

Shibboleth IDP: Saving audit log to database

Learn how to write Shibboleth IDP logs to a database instead of simple text file