Correction non fonctionelle
continuous-integration/drone/push Build is passing Details

issue_a
Paul LEVRAULT 1 year ago
parent ace879472c
commit 3e0d8f9def

@ -1,9 +1,9 @@
<?php
use Dotenv\Dotenv;
// use Dotenv\Dotenv;
$dotenv = Dotenv::createImmutable(__DIR__);
$dotenv->load();
// $dotenv = Dotenv::createImmutable(__DIR__);
// $dotenv->load();
// const DB_HOST = $_ENV['DB_HOST'] ?? 'localhost';
// const DB_DATABASE = $_ENV['DB_DATABASE'] ?? 'heartTrack';

@ -137,7 +137,7 @@ function addFriend(DataManager $model){
$userList = searchUsersByName($name);
$i=1;
foreach($u as $userList){
echo $u->getNom()." ".$u->getPrenom()." : ".$i++."<br>";
echo $u->getNom()." ".$u->getPrenom()." : ".$i++."\n";
}
echo "\nEntrez le numéro de la personne que vous voulez ajouter ou 0 pour annuler";
$choice = trim(fgets(STDIN));

@ -15,13 +15,13 @@ class UserManager
{
private IAuthService $authService;
private IFriendRequestService $friendService;
// private IFriendRequestService $friendService;
private User $currentUser;
private UserRepository $userRepo;
public function __construct(IAuthService $authService,IFriendRequestService $friendService)
public function __construct(IAuthService $authService)
{
$this->authService = $authService;
}
@ -32,6 +32,7 @@ class UserManager
if (!Validation::val_string($passwordUser) || !Validation::val_string($loginUser))
throw new \Exception(" some wrong with cred !!!!!");
if ($this->authService->login($loginUser, $passwordUser)) {
$this->currentUser = $this->userRepo->GetItemByName($loginUser,0,1);
return true;
}
return false;
@ -90,6 +91,7 @@ class UserManager
}
if ($this->authService->register($loginUser, $passwordUser, $data)) {
$this->currentUser = $this->userRepo->GetItemByName($loginUser,0,1);
return true;
}
return false;
@ -104,8 +106,8 @@ class UserManager
}
public function searchUsersByName(string $name) : array{
$list=array();
$friendsList=$this->currentUser->getFriendsList();
foreach($u as $friendsList){
$usersList=$this->currentUser->getItems();
foreach($u as $usersList){
if(strcasecmp($name,$u->getNom())==0 || strcasecmp($name,$u->getPrenom())==0){
array_push($list, $u);
}

@ -3,7 +3,7 @@
'name' => 'hearttrack/package',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'd4345678992503b9eb56ef4afd00ff13f5d7531a',
'reference' => 'ace879472ced43c6e67830f9e1f63dea3b313fec',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@ -31,7 +31,7 @@
'hearttrack/package' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'd4345678992503b9eb56ef4afd00ff13f5d7531a',
'reference' => 'ace879472ced43c6e67830f9e1f63dea3b313fec',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),

Loading…
Cancel
Save