mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-15 20:05:13 +02:00
refactor(dynamic): add recursive dependency resolution for SSA receivers, expand tests for Python and PHP
This commit is contained in:
parent
f49211d788
commit
baa9a36bc6
13 changed files with 329 additions and 76 deletions
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
// Benign control for recursive typed ClassMethod dependencies.
|
||||
|
||||
class Repository {
|
||||
private $dbConnection;
|
||||
|
||||
public function __construct($dbConnection) {
|
||||
$this->dbConnection = $dbConnection;
|
||||
}
|
||||
|
||||
public function run($payload) {
|
||||
return 'ok';
|
||||
}
|
||||
}
|
||||
|
||||
class Service {
|
||||
private Repository $repository;
|
||||
|
||||
public function __construct(Repository $repository) {
|
||||
$this->repository = $repository;
|
||||
}
|
||||
|
||||
public function run($payload) {
|
||||
return $this->repository->run($payload);
|
||||
}
|
||||
}
|
||||
|
||||
class UserController {
|
||||
private Service $service;
|
||||
|
||||
public function __construct(Service $service) {
|
||||
$this->service = $service;
|
||||
}
|
||||
|
||||
public function run($payload) {
|
||||
return $this->service->run($payload);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
// Class-method fixture with recursively constructed typed dependencies.
|
||||
|
||||
class Repository {
|
||||
private $dbConnection;
|
||||
|
||||
public function __construct($dbConnection) {
|
||||
$this->dbConnection = $dbConnection;
|
||||
}
|
||||
|
||||
public function run($payload) {
|
||||
return shell_exec('true ' . $payload);
|
||||
}
|
||||
}
|
||||
|
||||
class Service {
|
||||
private Repository $repository;
|
||||
|
||||
public function __construct(Repository $repository) {
|
||||
$this->repository = $repository;
|
||||
}
|
||||
|
||||
public function run($payload) {
|
||||
return $this->repository->run($payload);
|
||||
}
|
||||
}
|
||||
|
||||
class UserController {
|
||||
private Service $service;
|
||||
|
||||
public function __construct(Service $service) {
|
||||
$this->service = $service;
|
||||
}
|
||||
|
||||
public function run($payload) {
|
||||
return $this->service->run($payload);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue