In your use cases, are these traits generally *using* the interface methods, or
*implementing* them?
It is both. However "implementing" case is more problematic, since "using" can be quite reliably handled by adding `assert($this instanceof
LoggerInterface)` or type hints in trait methods -
Hi Internals,
Some time ago I wrote to the list asking if there are any objections to
removing support for libmysql from mysqli. As I haven't heard any
compelling arguments, I prepared a PR and RFC.
https://wiki.php.net/rfc/mysqli_support_for_libmysql
https://externals.io/message/116730
Regards
On 6 January 2022 19:51:46 GMT, Robert Korulczyk wrote:
>You're talking about classes that use traits, but I'm talking about traits
>themselves. If I open a class in editor, there is a straightforward way to
>check if specific method is implementation of an interface - check interfaces
>impleme
Your other points make sense, but I don't think this one does - there are no
implicit interfaces in PHP*, so all any tool cares about is:
1) Does the class declaration say that it implements an interface?
2) Does it actually contain the methods needed to do so, through any
combination of direct
On 6 January 2022 18:03:04 GMT, Chase Peeler wrote:
>I think most people see the tools as black boxes to make THEIR lives
>easier. They aren't concerned about whether it's added complexity to the
>tool itself.
Just to be clear, my comments were a response to an earlier message that
explicitly t
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512
PHP 8.1.2RC1 has just been released and can be downloaded from:
https://downloads.php.net/~carusogabriel/
Or use the git tag: php-8.1.2RC1
Windows binaries are available at https://windows.php.net/qa#php-8.1
Please test it carefully, and report a
On Thu, Jan 6, 2022 at 12:37 PM Alexandru Pătrănescu
wrote:
> On Thu, Jan 6, 2022 at 7:12 PM Rowan Tommins
> wrote:
>
> >
> > But some comments seem to be hinting at some *separate* advantage, to do
> > with "correct usage" of the trait, which I haven't grasped. It's possible
> > that the mentio
On 6 January 2022 17:36:41 GMT, "Alexandru Pătrănescu"
wrote:
>Yes, traits are a language construct that has in general more negative
>implications than positive so it's good to keep an eye on their usage.
>One of the okish usages is to define some implementation for an interface
>that classes ca
On Thu, Jan 6, 2022 at 7:12 PM Rowan Tommins
wrote:
>
> But some comments seem to be hinting at some *separate* advantage, to do
> with "correct usage" of the trait, which I haven't grasped. It's possible
> that the mention of static analysis relates to that in some way, and I'm
> just completely
On 6 January 2022 16:25:04 GMT, Chase Peeler wrote:
> I think the advantage would come within the trait. If I say the trait
>expects an interface with two methods, then the tool can act as if the
>interfaces methods exist in the trait even if they aren't explicitly
>defined. As others have pointed
On Thu, Jan 6, 2022 at 11:20 AM Rowan Tommins
wrote:
> On 6 January 2022 15:21:28 GMT, Robert Korulczyk
> wrote:
> > It should also make it easier for SCA tools to understand
> >the code since they no longer need to know the whole project to
> understand that method from trait is implementation
On 6 January 2022 15:21:28 GMT, Robert Korulczyk wrote:
> It should also make it easier for SCA tools to understand
>the code since they no longer need to know the whole project to understand
>that method from trait is implementation of method from interface (which is
>really tricky right now s
> For point 1, we already have that. It's called abstract methods in traits. This is a solved problem that requires no further resolution. At best
it would be a shorthand to copying a few methods from an interface into the trait and sticking "abstract" in front of them. I really don't see a ne
On Wed, Jan 5, 2022 at 6:05 PM Larry Garfield
wrote:
> On Wed, Jan 5, 2022, at 2:35 PM, Chase Peeler wrote:
>
> > First, I'm someone that mainly uses traits to implement the functionality
> > defined in an interface. I think that's one of the best uses for them.
> > However, I'm personally not a
PHP 8.0.15RC1 has just been released and can be downloaded from:
https://downloads.php.net/~carusogabriel/
Or use the git tag: php-8.0.15RC1
Windows binaries are available at https://windows.php.net/qa#php-8.0
Please test it carefully, and report any bugs to
http://github.com/php/php-src/issues
On 6 January 2022 07:29:58 GMT, James Titcumb wrote:
>Just thinking out loud, being able to identify an array type might be a way
>forward here (using "syntax" already in use by static analysis tools in
>docblocks, for familiarity), e.g.
>
>private array $property;
>
>This might "turn off" the aut
On Wed, 29 Dec 2021 at 17:42, Vincent Langlet
wrote:
> Hi,
>
> I recently discovered that an array was automatically casting
> numeric-string keys to int if it was possible. For instance, the following
> array:
>
> $a = ['01' => '01', '10' => '10'];
>
> Is not an array with the key '01' and '10'
17 matches
Mail list logo