Skip to main content
Software Engineering

Questions tagged [php]

Questions about PHP, a widely-used general-purpose scripting language that is especially suited for Web development.

Filter by
Sorted by
Tagged with
3 votes
3 answers
194 views

Best Practices for Implementing a Heartbeat Feature in a Laravel App to Track Offline Status

I'm trying to implement a heartbeat feature for offline tracking that just sends an offline message to the server once the web browser app (Laravel-based) is offline. Ideally it will ping the app's ...
3 votes
1 answer
173 views

How should User behaviour depending on role be design as OOP

Imagine I got user which might be either author, administrator, reviewer An author have relation on book that he wrote. An administrator have relation on banned user (we track which administrator ...
1 vote
1 answer
121 views

Best practice for integrating UI and dynamic user-specific content using a Flask app

I am building a website that uses a recommendation system. Users submit a form which is sent to the backend for the recommendation logic calculation; the recommendation response is sent back to the ...
2 votes
1 answer
170 views

Is widening parameter types in a PHP interface implementation a good practice?

I have an interface defined as follows: interface MyInterface { public function setMyMethod(int $a); public function getMyMethod(): int; } And I have a class that widens the parameter type: ...
-2 votes
1 answer
86 views

PHP secure storage for sensitive document uploads [closed]

I need help deciding how to securely store sensitive docs uploaded via a PHP script. I realize I'm not personally qualified for this task (if I was I wouldn't be asking this question) but need to know ...
0 votes
1 answer
338 views

How to share transaction across multiple repositories in DDD?

We are trying the Domain Driven Development (DDD) while working on a project. We've got a Product aggregate. We've got a ProductRepository to load/save Products. We've also got a Timeline aggregate, ...
0 votes
1 answer
344 views

DTO Interfaces naming convention in PHP

It might be that my question would sound a bit stupid but I would like to find the best way for naming my DTO interfaces. In my PHP application I have following DTO types: Simple (which contains a ...
4 votes
2 answers
285 views

Interface + Trait vs Abstract Class

While developing my application I faced an interesting situation: I have multiple DTO's which are almost identical in terms of methods, only properties are different. For example I have AccountDTO ...
1 vote
1 answer
184 views

DTOs and Single-responsibility principle

I'm developing a PHP application and trying to understand DTOs in context of single-responsibility principle. Being more specific, is it a bad practice having helper methods like toArray(), getValue(),...
-3 votes
1 answer
134 views

Mock an API for development purpose (no testing)

If I want to implement a connection from my software to an API, which is documented but not accessible yet, what is a common way to imitate the API until it is available? My first idea was to mock the ...
harrow's user avatar
  • 111
0 votes
1 answer
207 views

Our php codes base has 6 different ways to do INSERT ... ON DUPLICATE KEY UPDATE, how do I fix it?

Our php codes base has 6 different ways to do INSERT ... ON DUPLICATE KEY UPDATE. It happened over years because the php framework is evolving and my team members come and go, although I won't say we ...
2 votes
1 answer
181 views

How is $this provided in PHP?

I got a fundamental question about the $this keyword in PHP and how it is defined. Pracitcally, I know what it is and what it does. But I am interested in how it is provided / implemented? For example,...
2 votes
2 answers
395 views

Unit testing for non-stateless units - how?

Firstly let me say I have never written a unit test in my life. I am trying to get the hang of PHPUnit, and so far it's working pretty well for me so far as "stateless" functions (that ...
user avatar
user440478
-1 votes
1 answer
235 views

Best practices for organising PHP files?

I am currently writing a PHP / JavaScript application library, which I intend to use in the future for several other applications. The library includes functionality for handling a database, creating ...
user avatar
user440478
0 votes
2 answers
316 views

Should I split backend into legacy and modern app to make the rewrite feasible?

My vanilla PHP backend app needs to be rewritten due to very poor design and lot of unstructured code. The legacy app is very large and the team small, so doing full rewrite in limited time is quite ...

15 30 50 per page
1
2 3 4 5
...
138

AltStyle によって変換されたページ (->オリジナル) /