The hexagonal architecture, also called Ports & Adapters, has two features when it is schematized: a hexagonal shape (hence its name) and a separation between the application, the exterior and a part containing adapters which allows the first two parties to communicate.
It was designed by Alistair Cockburn in the 2000s. Its purpose is to allow an application to be driven indiscriminately by users, programs, automated tests or scripts and to be developed and tested independently from execution context and databases.
On the internet there is a lot of documentation about this architecture pattern. Here are some articles in different languages that I found interesting:
English
English and PHP
French
Pérennisez votre métier avec l’architecture hexagonale !
Architecture Hexagonale : trois principes et un exemple d’implémentation

[…] To correctly apply the CQRS pattern, I had to inject in the service the Query and Command classes, and the interfaces that are implemented by the handlers (yes, because we also apply the concept of hexagonal architecture). […]