A
A
Andrey Abramov2018-01-14 17:11:15
PHP
Andrey Abramov, 2018-01-14 17:11:15

Inverted question marks appeared in Text Wrangler, how to remove them?

However, not in all documents, but in some Wordpress template files. How to remove and where did they come from?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Daria Motorina, 2019-10-31
@TheRikipm

1. link - do not save on autoloader, it's not rational if you have already started using it :)
2. link - it's better to collect such strings in advance into a variable and then pass them as an argument, it's inconvenient to support them "inside brackets", and saving on one variable is nothing will not give
3. link The structure of the response is not described in any way; you can’t understand anything until you look at the vk dock or test it with your hands. You need to either encapsulate the response in a class, or give it some kind of predictable array structure.
4. link To make "$key - 1" more clear not by description in phpdoc, but by refactoring into the most obvious code.
5. linkThere is no guarantee that the out method can be applied to the $messages[0] element, it must be somehow prevented.
6. link constructor got lost among the many methods, it would be nice to move it to the beginning :)
7. link It is considered good practice to put any numbers, even obvious ones, into constants (60).
UPD.
1. General note - you also need to write typehints for the input parameters of methods.
2. A lot of comments on the code - this is a sign that there are a lot of non-obvious steps, which means they need to be split up, encapsulated into methods, maybe even taken out into separate classes so as not to overload the current one.

M
Moris Haos, 2018-01-15
@morihaos

Hello,
Interrogative and other bugs appear when the editor was unable to open a file in an encoding that matches the encoding of the file itself. Reopen the file specifying the file encoding (there is such a function in the open dialog) and they will be removed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question