Skip to main content

Questions tagged [php7]

PHP 7 is the successor to PHP 5.6, it was released on December 3, 2015. Use this tag for issues relating to development using PHP 7

Filter by
Sorted by
Tagged with
2 votes
2 answers
535 views

Address class in PHP 7.4 with types

About this exercise I found out there is a form of strict types in PHP 7.4, so I freshened up my PHP coding with this simple Address class. I did not use PHP since ...
3 votes
1 answer
321 views

Applying the Strategy pattern for payment methods

The strategy pattern is applied in the code below in the payment separation solution. Please evaluate if it is well done according to standards. I would be very grateful for suggestions. ...
2 votes
1 answer
511 views

PHP Class to render HTML div styled tables v1

This class aims to render an HTML compliant div styled table. I added a help() method that provides usage and styling in a more user-friendly way. Besides the ...
0 votes
1 answer
99 views

PHP Class to render HTML div styled tables v2 [reviewed by me]

After my previous question I made several changes and came up with this. Remember: I wrote this for PHP 7.0.33. I'm aware I should upgrade, save the advice :) ...
2 votes
1 answer
104 views

HTML form Class

After my previous question I revised the code to the code below. I am using PHP 7.0.33 and tried to accomplish PSR-12 as much as I could. In "condensed usage" in the docblock you can find a ...
3 votes
2 answers
690 views

PHP HTML form Class - so far so good?

I am writing this class to render HTML forms. It is working as expected, so far. There are many things to be done yet (including testing). Is it ok to keep this way? ...
2 votes
1 answer
101 views

PHP Pagination class (Clase para paginar resultados)

This is my first question in Code Review. I apologize in advance for using Spanish (my native language). I thought there was a spanish version of Code Review. This class is meant for pagination. It ...
3 votes
1 answer
550 views

Adjusting variables on change of status attribute of my Order Laravel model on the updated event in observer

I have an order model and a client model. A client has many orders, an order belongs to a single client. In the client model I keep track of how much money a client paid (...
6 votes
2 answers
495 views

Usage of Factory pattern for maintaing bookshelf having books, magazine and notes

I have tried to achieve the following task using Factory Pattern with PHP version 7.0. Define the classes and their methods (including parameters and return types) for a system that consist of a ...
1 vote
1 answer
61 views

Building a pre-loader for performance gains in Wordpress

As the title states, I am building a pre-loader for Wordpress running on PHP 7.3.5+ that will deliver performance boosts in loading, as well as metrics such as Google Page Speed. This is something ...
2 votes
0 answers
59 views

Magic Class Invoker for procedural script

I have inherited a project in bad conditions that contains the following class and I need your help to improve it, the truth is I don't know if it is correctly optimized or if it has security problems ...
3 votes
2 answers
358 views

Archiving / Moving Data from one database server to another database server

I am working on an SMS marketing project based on Yii2 Framework (PHP 7.3 & MariaDb (innodb engine)) where we have to move the logs from different tables to the archive db, which is total a ...
-1 votes
1 answer
37 views

Find qualifications that are expiring [closed]

I have the following function that returns StaffQualifications where either the qualification is expiring or the qualification type is expiring, but this section doesn't seem to sit well with me as it ...
3 votes
2 answers
411 views

To-do app API made with Slim 3

I have put together the back-end (API) with the Slim framework (v3) and MySQL. In index.php I have: ...
2 votes
1 answer
130 views

Scrape multiple twitch IRC chats

I've always struggled to create and sustainable, organizated, clean code. I tried to use a Factory method and it's working better now that I created another class. I know I should write documentation,...
4 votes
2 answers
5k views

PHP loop to generate an HTML form for the days in the coming week

There are two arrays, $states and $weekdays. I want to loop through them to create a form, an HTML table, or possibly some other ...
0 votes
1 answer
73 views

Automated Tweet of new inbound Enquiries in PHP7 (Laravel 5.2)

Background. A User can submit an enquiry via a form hosted on a clients website, these are pushed onto a queue, and then taken off the queue for processing, to process several different parts of the ...