php / doc-en

English PHP documentation
509 stars 740 forks source link

abstract.xml Fix the error in the last example and CS #4149

Closed mmalferov closed 2 days ago

mmalferov commented 4 days ago

The only thing I'm not sure about is whether one empty line is required between the hooks that contain the implementation. With an empty string, readability seems to be better.

If we imagine that hooks are the same as methods, then, perhaps, it is better to leave one empty string between the "methods" :)

In this case, it might be better to add one empty line between hooks without implementation

mmalferov commented 2 days ago

Was the error only s/arguments/parameters?

No, it's not the s, it's the terms. It is impossible to define arguments in the method signature, arguments are the actual values that come to the method from the outside. Only parameters are allowed to be defined in the method body.

I will allow myself one quote there:

The two terms are used interchangeably in conversation, but they mean different things. You pass arguments when calling a method. And you use parameters within the method body.

As most if not all programming languages are copy-by-value, the two are equivalent, only differing in the context. The two terms exist to distinguish whether you are talking about a method definition or a method call. When you're calling a method, you pass in arguments. When you're actually in the method body, you are using parameters. Arguments get copied-by-value to parameters

Try to think of arguments as actually non-named values that are sent to the method, and of parameters as an integral part of a function or method, and you will no longer be able to say that "optional arguments have been defined in the method" :)

kamil-tekiela commented 2 days ago

Was the error only s/arguments/parameters?

No, it's not the s, it's the terms. It is impossible to define arguments in the method signature, arguments are the actual values that come to the method from the outside. Only parameters are allowed to be defined in the method body.

I will allow myself one quote there:

The two terms are used interchangeably in conversation, but they mean different things. You pass arguments when calling a method. And you use parameters within the method body. As most if not all programming languages are copy-by-value, the two are equivalent, only differing in the context. The two terms exist to distinguish whether you are talking about a method definition or a method call. When you're calling a method, you pass in arguments. When you're actually in the method body, you are using parameters. Arguments get copied-by-value to parameters

Try to think of arguments as actually non-named values that are sent to the method, and of parameters as an integral part of a function or method, and you will no longer be able to say that "optional arguments have been defined in the method" :)

FYI https://phoenixnap.com/kb/sed-replace

What I meant was: was swaping the word arguments for the word parameters the only meaningful change in this PR. I understand why you did it, I just wanted to make sure I didn't miss anything more important.

mmalferov commented 2 days ago

Oh, yes, the sed, now everything is clear. And I also thought: why is the sentence so strangely composed :))