PHP: Is it possible to reduce the code by grades (interfees or tracks) very much, but it's always a little different
-
There's a passer who downloads a lot of archives from the site, and then, everybody processs and stores data from it. The tables are not linked, each archive may have its data problems, for example, one needs to be transferred from one coding, the other one from another. For a table, a checklist should be added to the table, depending on the availability or absence of information in the archival bd. In short, you have to make a long roast of functions that are very similar but a little different. It looks like:
Archives.
function 1 (for the first archive table).
function 2 (for rolling into Table 2)
many functions
Cod, unfortunately, I can't bring... If it was possible to re-establish this through objective-oriented programming, I was wondering how. I'd only understand the principle, because then I'll know what to find... The objective-oriented programming is very weak. ♪
-
You can and should. I want you to meet these articles, https://habr.com/ru/company/vk/blog/336788/ I'm just describing your problem in the paragraph: Remove the duplicate code
And you can read more. https://github.com/peter-gribanov/clean-code-php#%D0%90%D1%80%D0%B3%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D1%8B-%D1%84%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D0%B9-%D0%B2-%D0%B8%D0%B4%D0%B5%D0%B0%D0%BB%D0%B5-%D0%B4%D0%B2%D0%B0-%D0%B8%D0%BB%D0%B8-%D0%BC%D0%B5%D0%BD%D1%8C%D1%88%D0%B5