Posts by raphael • 2,131 points
59 posts
-
0
votes2
answers436
views -
4
votes3
answers5730
viewsA: When should we declare a method static?
Static method in object orientation The problem with the static method is coupling, as you are using a specific class instead of injecting it as dependency. This is why exaggeration in static code…
-
1
votes3
answers143
viewsA: $_ has any meaning in question?
The superglobal variables These variables are superglobal, and as the name says, their scope is global, meaning they can be accessed from anywhere in the code. Regarding the name starting with $_…
-
0
votes1
answer85
viewsQ: Is the PHP password_hash function a wrapper for the crypt function?
The function password_hash seems to me a wrapper that adds a high-level layer in function crypt, because it brings a default setting that could be made with crypt manually. Same with the function…
-
2
votes2
answers190
viewsQ: How to know the difference between language construction and function in PHP?
How to identify and what is the difference between a language construction and a function?
-
1
votes1
answer848
viewsA: How to calculate the percentage difference (or similarity) between two strings?
Percentage of similarity In PHP there is a function called similar_text, it serves to find the similarity between two strings. It follows the description of the language documentation about this…
-
2
votes1
answer256
viewsQ: What is Keybase Proof?
Recently I saw some gists with a content called Keybase Proof. Is that any way to prove identity? How does it work? NOTE: I know this question may not be considered a topic for the site, but it is…
-
1
votes1
answer282
viewsA: Use route controller method with Slim
The question got a little fuzzy, but I’ll try to help based on what I understand. You can create a controller with the method __invoke() and receive the objects $request and $responde in this…
-
0
votes2
answers112
viewsA: Code repetition
Method extraction Try creating a new method that contains the repeating part and pass as parameter the values that vary in Curl library calls. private function configCurl($url, $token) { $channel =…