Skip to content

Commit

Permalink
Improve dev scripts output
Browse files Browse the repository at this point in the history
  • Loading branch information
webeweb committed Nov 10, 2021
1 parent 3e0adc6 commit 89c708d
Show file tree
Hide file tree
Showing 7 changed files with 495 additions and 484 deletions.
2 changes: 1 addition & 1 deletion dev/document-telechargement.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

require_once(__DIR__ . "/../vendor/autoload.php");
require_once __DIR__ . "/../vendor/autoload.php";

use WBW\Library\Pappers\Provider\APIv2Provider;
use WBW\Library\Pappers\Request\DocumentTelechargementRequest;
Expand Down
474 changes: 238 additions & 236 deletions dev/entreprise.php

Large diffs are not rendered by default.

88 changes: 45 additions & 43 deletions dev/recherche-dirigeants.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

require_once(__DIR__ . "/../vendor/autoload.php");
require_once __DIR__ . "/../vendor/autoload.php";

use WBW\Library\Pappers\Provider\APIv2Provider;
use WBW\Library\Pappers\Request\RechercheDirigeantsRequest;
Expand All @@ -25,53 +25,55 @@
$response = $provider->rechercheDirigeants($request);

// Handle the response.
echo "Page : " . $response->getPage() . "\n";
echo "Total : " . $response->getTotal() . "\n";
$format = "%-30s: %s\n";

echo "Dirigeants :\n";
echo sprintf($format, "Page", $response->getPage());
echo sprintf($format, "Total", $response->getTotal());

echo sprintf($format, "Dirigeants", "");
foreach ($response->getResultats() as $current) {

echo "Qualité : " . $current->getQualite() . "\n";
echo "Personne morale : " . $current->getPersonneMorale() . "\n";
echo "Date prise de poste : " . $current->getDatePrisePoste() . "\n";
echo "Actuel : " . $current->getActuel() . "\n";
echo "Dénomination : " . $current->getDenomination() . "\n";
echo "SIREN : " . $current->getSiren() . "\n";
echo "Nom complet : " . $current->getNomComplet() . "\n";
echo "Forme juridique : " . $current->getFormeJuridique() . "\n";
echo sprintf($format, "Qualite", $current->getQualite());
echo sprintf($format, "Personne morale", $current->getPersonneMorale());
echo sprintf($format, "Date prise de poste", $current->getDatePrisePoste());
echo sprintf($format, "Actuel", $current->getActuel());
echo sprintf($format, "Denomination", $current->getDenomination());
echo sprintf($format, "SIREN", $current->getSiren());
echo sprintf($format, "Nom complet", $current->getNomComplet());
echo sprintf($format, "Forme juridique", $current->getFormeJuridique());

echo "Entreprises :\n";
echo sprintf($format, "Entreprises", "");
foreach ($current->getEntreprises() as $e) {
echo "\tSIREN : " . $e->getSiren() . "\n";
echo "\tSIREN formaté : " . $e->getSirenFormate() . "\n";
echo "\tNom entreprise : " . $e->getNomEntreprise() . "\n";
echo "\tNom : " . $e->getNom() . "\n";
echo "\tPrénom : " . $e->getPrenom() . "\n";
echo "\tSexe : " . $e->getSexe() . "\n";
echo "\tSiège : [...]\n";
echo "\tVilles : " . implode(", ", $e->getVilles()) . "\n";
echo "\tCode NAF : " . $e->getCodeNaf() . "\n";
echo "\tLibellé code NAF : " . $e->getLibelleCodeNaf() . "\n";
echo "\tDomaine activité : " . $e->getDomaineActivite() . "\n";
echo "\tConventions collectives : [...]\n";
echo "\tDate création : " . $e->getDateCreation() . "\n";
echo "\tDate création formatée : " . $e->getDateCreationFormate() . "\n";
echo "\tEntreprise employeuse : " . $e->getEntrepriseEmployeuse() . "\n";
echo "\tEntreprise cessée : " . $e->getEntrepriseCessee() . "\n";
echo "\tDate cessation : " . $e->getDateCessation() . "\n";
echo "\tCatégorie juridique : " . $e->getCategorieJuridique() . "\n";
echo "\tForme juridique : " . $e->getFormeJuridique() . "\n";
echo "\tTranche effectif : " . $e->getTrancheEffectif() . "\n";
echo "\tEffectif : " . $e->getEffectif() . "\n";
echo "\tEffectif min. : " . $e->getEffectifMin() . "\n";
echo "\tEffectif max. : " . $e->getEffectifMax() . "\n";
echo "\tAnnée effectif : " . $e->getAnneeEffectif() . "\n";
echo "\tCapital : " . $e->getCapital() . "\n";
echo "\tChiffre affaires : " . $e->getChiffreAffaires() . "\n";
echo "\tRésultat : " . $e->getResultat() . "\n";
echo "\tEffectifs finances : " . $e->getEffectifsFinances() . "\n";
echo "\tAnnée finances : " . $e->getAnneeFinances() . "\n";
echo sprintf($format, " SIREN", $e->getSiren());
echo sprintf($format, " SIREN formate", $e->getSirenFormate());
echo sprintf($format, " Nom entreprise", $e->getNomEntreprise());
echo sprintf($format, " Nom", $e->getNom());
echo sprintf($format, " Prenom", $e->getPrenom());
echo sprintf($format, " Sexe", $e->getSexe());
echo sprintf($format, " Siege", "[...]");
echo sprintf($format, " Villes", implode(", ", $e->getVilles()));
echo sprintf($format, " Code NAF", $e->getCodeNaf());
echo sprintf($format, " Libelle code NAF", $e->getLibelleCodeNaf());
echo sprintf($format, " Domaine activite", $e->getDomaineActivite());
echo sprintf($format, " Conventions collectives", "[...]");
echo sprintf($format, " Date creation", $e->getDateCreation());
echo sprintf($format, " Date creation formatee", $e->getDateCreationFormate());
echo sprintf($format, " Entreprise employeuse", $e->getEntrepriseEmployeuse());
echo sprintf($format, " Entreprise cessee", $e->getEntrepriseCessee());
echo sprintf($format, " Date cessation", $e->getDateCessation());
echo sprintf($format, " Categorie juridique", $e->getCategorieJuridique());
echo sprintf($format, " Forme juridique", $e->getFormeJuridique());
echo sprintf($format, " Tranche effectif", $e->getTrancheEffectif());
echo sprintf($format, " Effectif", $e->getEffectif());
echo sprintf($format, " Effectif min.", $e->getEffectifMin());
echo sprintf($format, " Effectif max.", $e->getEffectifMax());
echo sprintf($format, " Annee effectif", $e->getAnneeEffectif());
echo sprintf($format, " Capital", $e->getCapital());
echo sprintf($format, " Chiffre affaires", $e->getChiffreAffaires());
echo sprintf($format, " Resultat", $e->getResultat());
echo sprintf($format, " Effectifs finances", $e->getEffectifsFinances());
echo sprintf($format, " Annee finances", $e->getAnneeFinances());
}

echo "Nb entreprises total : " . $current->getNbEntreprisesTotal() . "\n";
echo sprintf($format, "Nb entreprises total", $current->getNbEntreprisesTotal());
}
94 changes: 48 additions & 46 deletions dev/recherche-documents.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

require_once(__DIR__ . "/../vendor/autoload.php");
require_once __DIR__ . "/../vendor/autoload.php";

use WBW\Library\Pappers\Provider\APIv2Provider;
use WBW\Library\Pappers\Request\RechercheDocumentsRequest;
Expand All @@ -32,58 +32,60 @@
$response = $provider->rechercheDocuments($request);

// Handle the response.
echo "Page : " . $response->getPage() . "\n";
echo "Total : " . $response->getTotal() . "\n";
$format = "%-30s: %s\n";

echo "Documents :\n";
echo sprintf($format, "Page", $response->getPage());
echo sprintf($format, "Total", $response->getTotal());

echo sprintf($format, "Documents ", "");
foreach ($response->getResultats() as $current) {

echo "Titres :\n";
echo sprintf($format, "Titres", "");
foreach ($current->getTitres() as $t) {

echo "\t Décision : " . $t->getDecision() . "\n";
echo "\t Type : " . $t->getType() . "\n";
echo sprintf($format, " Decision", $t->getDecision());
echo sprintf($format, " Type", $t->getType());
}

echo "SIREN : " . $current->getSiren() . "\n";
echo "Num chrono : " . $current->getNumChrono() . "\n";
echo "Date dépôt : " . $current->getDateDepot() . "\n";
echo "Id fichier : " . $current->getIdFichier() . "\n";
echo "Type : " . $current->getType() . "\n";
echo "Mentions : " . implode(", ", $current->getMentions()) . "\n";
echo sprintf($format, "SIREN", $current->getSiren());
echo sprintf($format, "Num chrono", $current->getNumChrono());
echo sprintf($format, "Date depot", $current->getDateDepot());
echo sprintf($format, "Id fichier", $current->getIdFichier());
echo sprintf($format, "Type", $current->getType());
echo sprintf($format, "Mentions", implode(", ", $current->getMentions()));

echo "Entreprise :\n";
echo "\tSIREN : " . $current->getEntreprise()->getSiren() . "\n";
echo "\tSIREN formaté : " . $current->getEntreprise()->getSirenFormate() . "\n";
echo "\tNom entreprise : " . $current->getEntreprise()->getNomEntreprise() . "\n";
echo "\tPersonne morale : " . $current->getEntreprise()->getPersonneMorale() . "\n";
echo "\tDénomination : " . $current->getEntreprise()->getDenomination() . "\n";
echo "\tNom : " . $current->getEntreprise()->getNom() . "\n";
echo "\tPrénom : " . $current->getEntreprise()->getPrenom() . "\n";
echo "\tSexe : " . $current->getEntreprise()->getSexe() . "\n";
echo "\tSiège : [...]\n";
echo "\tVilles : " . implode(", ", $current->getEntreprise()->getVilles()) . "\n";
echo "\tCode NAF : " . $current->getEntreprise()->getCodeNaf() . "\n";
echo "\tLibellé code NAF : " . $current->getEntreprise()->getLibelleCodeNaf() . "\n";
echo "\tDomaine activité : " . $current->getEntreprise()->getDomaineActivite() . "\n";
echo "\tConventions collectives : [...]\n";
echo "\tDate création : " . $current->getEntreprise()->getDateCreation() . "\n";
echo "\tDate création formatée : " . $current->getEntreprise()->getDateCreationFormate() . "\n";
echo "\tEntreprise employeuse : " . $current->getEntreprise()->getEntrepriseEmployeuse() . "\n";
echo "\tEntreprise cessée : " . $current->getEntreprise()->getEntrepriseCessee() . "\n";
echo "\tDate cessation : " . $current->getEntreprise()->getDateCessation() . "\n";
echo "\tCatégorie juridique : " . $current->getEntreprise()->getCategorieJuridique() . "\n";
echo "\tForme juridique : " . $current->getEntreprise()->getFormeJuridique() . "\n";
echo "\tTranche effectif : " . $current->getEntreprise()->getTrancheEffectif() . "\n";
echo "\tEffectif : " . $current->getEntreprise()->getEffectif() . "\n";
echo "\tEffectif min. : " . $current->getEntreprise()->getEffectifMin() . "\n";
echo "\tEffectif max. : " . $current->getEntreprise()->getEffectifMax() . "\n";
echo "\tAnnée effectif : " . $current->getEntreprise()->getAnneeEffectif() . "\n";
echo "\tCapital : " . $current->getEntreprise()->getCapital() . "\n";
echo "\tChiffre affaires : " . $current->getEntreprise()->getChiffreAffaires() . "\n";
echo "\tRésultat : " . $current->getEntreprise()->getResultat() . "\n";
echo "\tEffectifs finances : " . $current->getEntreprise()->getEffectifsFinances() . "\n";
echo "\tAnnée finances : " . $current->getEntreprise()->getAnneeFinances() . "\n";
echo sprintf($format, "Entreprise", "");
echo sprintf($format, " SIREN", $current->getEntreprise()->getSiren());
echo sprintf($format, " SIREN formate", $current->getEntreprise()->getSirenFormate());
echo sprintf($format, " Nom entreprise", $current->getEntreprise()->getNomEntreprise());
echo sprintf($format, " Personne morale", $current->getEntreprise()->getPersonneMorale());
echo sprintf($format, " Denomination", $current->getEntreprise()->getDenomination());
echo sprintf($format, " Nom", $current->getEntreprise()->getNom());
echo sprintf($format, " Prenom", $current->getEntreprise()->getPrenom());
echo sprintf($format, " Sexe", $current->getEntreprise()->getSexe());
echo sprintf($format, " Siege", "[...]");
echo sprintf($format, " Villes", implode(", ", $current->getEntreprise()->getVilles()));
echo sprintf($format, " Code NAF", $current->getEntreprise()->getCodeNaf());
echo sprintf($format, " Libelle code NAF", $current->getEntreprise()->getLibelleCodeNaf());
echo sprintf($format, " Domaine activite", $current->getEntreprise()->getDomaineActivite());
echo sprintf($format," Conventions collectives", "[...]");
echo sprintf($format, " Date creation", $current->getEntreprise()->getDateCreation());
echo sprintf($format, " Date creation formatee", $current->getEntreprise()->getDateCreationFormate());
echo sprintf($format, " Entreprise employeuse", $current->getEntreprise()->getEntrepriseEmployeuse());
echo sprintf($format, " Entreprise cessee", $current->getEntreprise()->getEntrepriseCessee());
echo sprintf($format, " Date cessation", $current->getEntreprise()->getDateCessation());
echo sprintf($format, " Categorie juridique", $current->getEntreprise()->getCategorieJuridique());
echo sprintf($format, " Forme juridique", $current->getEntreprise()->getFormeJuridique());
echo sprintf($format, " Tranche effectif", $current->getEntreprise()->getTrancheEffectif());
echo sprintf($format, " Effectif", $current->getEntreprise()->getEffectif());
echo sprintf($format, " Effectif min.", $current->getEntreprise()->getEffectifMin());
echo sprintf($format, " Effectif max.", $current->getEntreprise()->getEffectifMax());
echo sprintf($format, " Annee effectif", $current->getEntreprise()->getAnneeEffectif());
echo sprintf($format, " Capital", $current->getEntreprise()->getCapital());
echo sprintf($format, " Chiffre affaires", $current->getEntreprise()->getChiffreAffaires());
echo sprintf($format, " Resultat", $current->getEntreprise()->getResultat());
echo sprintf($format, " Effectifs finances", $current->getEntreprise()->getEffectifsFinances());
echo sprintf($format, " Annee finances", $current->getEntreprise()->getAnneeFinances());

echo "Token : " . $current->getToken() . "\n";
echo sprintf($format, "Token", $current->getToken());
}
Loading

0 comments on commit 89c708d

Please sign in to comment.