Edit report at https://bugs.php.net/bug.php?id=80722&edit=1
ID: 80722
Updated by: requinix@php.net
Reported by: fakhar_anwar123 at hotmail dot com
Summary: Missing support for Dependency Inversion Principle
and for serving the purpose
-Status: Open
+Status: Not a bug
Type: Feature/Change Request
Package: *Extensibility Functions
Operating System: All
PHP Version: 8.0.2
Block user comment: N
Private report: N
New Comment:
Your description doesn't agree with the P13 and P15 examples in that link so I don't know
why you're linking to it.
There is nothing stopping you from implementing whatever design patterns you would like in PHP other
than an unnecessary insistence upon a particular syntax or code style.
Previous Comments:
------------------------------------------------------------------------
[2021-02-07 11:01:32] fakhar_anwar123 at hotmail dot com
Description:
------------
---
From manual page: https://php.net/language.oop5.interfaces
---
We do not have Interface variables in PHP, which means the client-side code (consumer) can not point
to abstraction. That means PHP does not adheres to A) Dependency Inversion Principle (DIP) and
B) it also does not serve the actual purpose behind Interface Segregation Principle ('I'
in S.O.L.I.D).
Those are two powerful techniques for extensibility with flexibility.
Can you please add support to that syntax like through a separate module in Swoole ?
As example please See P-13 and P-15 in that blog
https://www.codeproject.com/Articles/18743/Interfaces-in-C-For-Beginners
Test script:
---------------
N/A
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80722&edit=1