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
2 votes
2 answers
149 views

In PHP, trim() exists. By default the second parameter is " \n\r\t\v\x00" I wish to introduce my own version which doesn't deviate far from the core functionality: // Trim whitespace in ...
3 votes
3 answers
235 views

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
194 views

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
149 views

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
200 views

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
102 views

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
392 views

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
441 views

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
308 views

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
216 views

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
146 views

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
231 views

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
195 views

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
408 views

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
-1 votes
1 answer
250 views

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

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

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