From 89c708d42d70fe35b92fac7e5a840c54fbaa191b Mon Sep 17 00:00:00 2001 From: webeweb Date: Wed, 10 Nov 2021 09:41:01 +0100 Subject: [PATCH] Improve dev scripts output --- dev/document-telechargement.php | 2 +- dev/entreprise.php | 474 ++++++++++++++++---------------- dev/recherche-dirigeants.php | 88 +++--- dev/recherche-documents.php | 94 +++---- dev/recherche-publications.php | 82 +++--- dev/recherche.php | 134 ++++----- dev/suggestions.php | 105 +++---- 7 files changed, 495 insertions(+), 484 deletions(-) diff --git a/dev/document-telechargement.php b/dev/document-telechargement.php index 747a63d..81ccabe 100644 --- a/dev/document-telechargement.php +++ b/dev/document-telechargement.php @@ -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; diff --git a/dev/entreprise.php b/dev/entreprise.php index b344185..41e9910 100644 --- a/dev/entreprise.php +++ b/dev/entreprise.php @@ -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\EntrepriseRequest; @@ -25,276 +25,278 @@ $response = $provider->entreprise($request); // Handle the response. -echo "SIREN : " . $response->getEntreprise()->getSiren() . "\n"; -echo "SIREN formaté : " . $response->getEntreprise()->getSirenFormate() . "\n"; -echo "Diffusable : " . $response->getEntreprise()->getDiffusable() . "\n"; -echo "Nom entreprise : " . $response->getEntreprise()->getNomEntreprise() . "\n"; -echo "Personne morale : " . $response->getEntreprise()->getPersonneMorale() . "\n"; -echo "Dénomination : " . $response->getEntreprise()->getDenomination() . "\n"; -echo "Sigle : " . $response->getEntreprise()->getSigle() . "\n"; -echo "Nom : " . $response->getEntreprise()->getNom() . "\n"; -echo "Prénom : " . $response->getEntreprise()->getPrenom() . "\n"; -echo "Sexe : " . $response->getEntreprise()->getSexe() . "\n"; -echo "Siège :\n"; -echo "\tSIRET : " . $response->getEntreprise()->getSiege()->getSiret() . "\n"; -echo "\tSIRET formaté : " . $response->getEntreprise()->getSiege()->getSiretFormate() . "\n"; -echo "\tNIC : " . $response->getEntreprise()->getSiege()->getNic() . "\n"; -echo "\tNuméro voie : " . $response->getEntreprise()->getSiege()->getNumeroVoie() . "\n"; -echo "\tIndice répétition : " . $response->getEntreprise()->getSiege()->getIndiceRepetition() . "\n"; -echo "\tType voie : " . $response->getEntreprise()->getSiege()->getTypeVoie() . "\n"; -echo "\tLibellé voie : " . $response->getEntreprise()->getSiege()->getLibelleVoie() . "\n"; -echo "\tComplément adresse : " . $response->getEntreprise()->getSiege()->getComplementAdresse() . "\n"; -echo "\tAdresse ligne 1 : " . $response->getEntreprise()->getSiege()->getAdresseLigne1() . "\n"; -echo "\tAdresse ligne 2 : " . $response->getEntreprise()->getSiege()->getAdresseLigne2() . "\n"; -echo "\tCode postal : " . $response->getEntreprise()->getSiege()->getCodePostal() . "\n"; -echo "\tVille : " . $response->getEntreprise()->getSiege()->getVille() . "\n"; -echo "\tPays : " . $response->getEntreprise()->getSiege()->getPays() . "\n"; -echo "\tLatitude : " . $response->getEntreprise()->getSiege()->getLatitude() . "\n"; -echo "\tLongitude : " . $response->getEntreprise()->getSiege()->getLongitude() . "\n"; -echo "\tCode NAF : " . $response->getEntreprise()->getSiege()->getCodeNaf() . "\n"; -echo "\tLibellé code NAF : " . $response->getEntreprise()->getSiege()->getLibelleCodeNaf() . "\n"; -echo "\tDate création : " . $response->getEntreprise()->getSiege()->getDateCreation() . "\n"; -echo "\tEtablissement employeur : " . $response->getEntreprise()->getSiege()->getEtablissementEmployeur() . "\n"; -echo "\tEffectif : " . $response->getEntreprise()->getSiege()->getEffectif() . "\n"; -echo "\tEffectif min. : " . $response->getEntreprise()->getSiege()->getEffectifMin() . "\n"; -echo "\tEffectif max. : " . $response->getEntreprise()->getSiege()->getEffectifMax() . "\n"; -echo "\tTranche effectif : " . $response->getEntreprise()->getSiege()->getTrancheEffectif() . "\n"; -echo "\tAnnée effectif : " . $response->getEntreprise()->getSiege()->getAnneeEffectif() . "\n"; -echo "\tEtablissement cessé : " . $response->getEntreprise()->getSiege()->getEtablissementCesse() . "\n"; -echo "\tDate cessation : " . $response->getEntreprise()->getSiege()->getDateCessation() . "\n"; -echo "\tDomiciliation : " . $response->getEntreprise()->getSiege()->getDomiciliation() . "\n"; -echo "\tSiège : " . $response->getEntreprise()->getSiege()->getSiege() . "\n"; -echo "R.N.M. : " . $response->getEntreprise()->getRnm() . "\n"; -echo "Code NAF : " . $response->getEntreprise()->getCodeNaf() . "\n"; -echo "Libellé code NAF : " . $response->getEntreprise()->getLibelleCodeNaf() . "\n"; -echo "Domaine activité : " . $response->getEntreprise()->getDomaineActivite() . "\n"; -echo "Objet social : " . $response->getEntreprise()->getObjetSocial() . "\n"; +$format = "%-30s: %s\n"; -echo "Convention collective :\n"; +echo sprintf($format, "SIREN", $response->getEntreprise()->getSiren()); +echo sprintf($format, "SIREN formate", $response->getEntreprise()->getSirenFormate()); +echo sprintf($format, "Diffusable", $response->getEntreprise()->getDiffusable()); +echo sprintf($format, "Nom entreprise", $response->getEntreprise()->getNomEntreprise()); +echo sprintf($format, "Personne morale", $response->getEntreprise()->getPersonneMorale()); +echo sprintf($format, "Denomination", $response->getEntreprise()->getDenomination()); +echo sprintf($format, "Sigle", $response->getEntreprise()->getSigle()); +echo sprintf($format, "Nom", $response->getEntreprise()->getNom()); +echo sprintf($format, "Prenom", $response->getEntreprise()->getPrenom()); +echo sprintf($format, "Sexe", $response->getEntreprise()->getSexe()); +echo sprintf($format, "Siege", ""); +echo sprintf($format, " SIRET", $response->getEntreprise()->getSiege()->getSiret()); +echo sprintf($format, " SIRET formate", $response->getEntreprise()->getSiege()->getSiretFormate()); +echo sprintf($format, " NIC", $response->getEntreprise()->getSiege()->getNic()); +echo sprintf($format, " Numero voie", $response->getEntreprise()->getSiege()->getNumeroVoie()); +echo sprintf($format, " Indice repetition", $response->getEntreprise()->getSiege()->getIndiceRepetition()); +echo sprintf($format, " Type voie", $response->getEntreprise()->getSiege()->getTypeVoie()); +echo sprintf($format, " Libelle voie", $response->getEntreprise()->getSiege()->getLibelleVoie()); +echo sprintf($format, " Complement adresse", $response->getEntreprise()->getSiege()->getComplementAdresse()); +echo sprintf($format, " Adresse ligne 1", $response->getEntreprise()->getSiege()->getAdresseLigne1()); +echo sprintf($format, " Adresse ligne 2", $response->getEntreprise()->getSiege()->getAdresseLigne2()); +echo sprintf($format, " Code postal", $response->getEntreprise()->getSiege()->getCodePostal()); +echo sprintf($format, " Ville", $response->getEntreprise()->getSiege()->getVille()); +echo sprintf($format, " Pays", $response->getEntreprise()->getSiege()->getPays()); +echo sprintf($format, " Latitude", $response->getEntreprise()->getSiege()->getLatitude()); +echo sprintf($format, " Longitude", $response->getEntreprise()->getSiege()->getLongitude()); +echo sprintf($format, " Code NAF", $response->getEntreprise()->getSiege()->getCodeNaf()); +echo sprintf($format, " Libelle code NAF", $response->getEntreprise()->getSiege()->getLibelleCodeNaf()); +echo sprintf($format, " Date creation", $response->getEntreprise()->getSiege()->getDateCreation()); +echo sprintf($format, " Etablissement employeur", $response->getEntreprise()->getSiege()->getEtablissementEmployeur()); +echo sprintf($format, " Effectif", $response->getEntreprise()->getSiege()->getEffectif()); +echo sprintf($format, " Effectif min.", $response->getEntreprise()->getSiege()->getEffectifMin()); +echo sprintf($format, " Effectif max.", $response->getEntreprise()->getSiege()->getEffectifMax()); +echo sprintf($format, " Tranche effectif", $response->getEntreprise()->getSiege()->getTrancheEffectif()); +echo sprintf($format, " Annee effectif", $response->getEntreprise()->getSiege()->getAnneeEffectif()); +echo sprintf($format, " Etablissement cesse", $response->getEntreprise()->getSiege()->getEtablissementCesse()); +echo sprintf($format, " Date cessation", $response->getEntreprise()->getSiege()->getDateCessation()); +echo sprintf($format, " Domiciliation", $response->getEntreprise()->getSiege()->getDomiciliation()); +echo sprintf($format, " Siege", $response->getEntreprise()->getSiege()->getSiege()); +echo sprintf($format, "R.N.M.", $response->getEntreprise()->getRnm()); +echo sprintf($format, "Code NAF", $response->getEntreprise()->getCodeNaf()); +echo sprintf($format, "Libelle code NAF", $response->getEntreprise()->getLibelleCodeNaf()); +echo sprintf($format, "Domaine activite", $response->getEntreprise()->getDomaineActivite()); +echo sprintf($format, "Objet social", $response->getEntreprise()->getObjetSocial()); + +echo sprintf($format, "Convention collective", ""); foreach ($response->getEntreprise()->getConventionCollectives() as $current) { - echo "\tNom : " . $current->getNom() . "\n"; - echo "\tIDCC : " . $current->getIdcc() . "\n"; - echo "\tConfirmée : " . $current->getConfirmee() . "\n"; + echo sprintf($format, " Nom", $current->getNom()); + echo sprintf($format, " IDCC", $current->getIdcc()); + echo sprintf($format, " Confirmee", $current->getConfirmee()); } -echo "Date création : " . $response->getEntreprise()->getDateCreation() . "\n"; -echo "Date création formatée : " . $response->getEntreprise()->getDateCreationFormate() . "\n"; -echo "Entreprise cessée : " . $response->getEntreprise()->getEntrepriseCessee() . "\n"; -echo "Date cessation : " . $response->getEntreprise()->getDateCessation() . "\n"; -echo "Date cessation formatée : " . $response->getEntreprise()->getDateCessationFormatee() . "\n"; -echo "Associé unique : " . $response->getEntreprise()->getAssocieUnique() . "\n"; -echo "Catégorie juridique : " . $response->getEntreprise()->getCategorieJuridique() . "\n"; -echo "Forme juridique : " . $response->getEntreprise()->getFormeJuridique() . "\n"; -echo "Entreprise employeuse : " . $response->getEntreprise()->getEntrepriseEmployeuse() . "\n"; -echo "Effectif : " . $response->getEntreprise()->getEffectif() . "\n"; -echo "Effectif min. : " . $response->getEntreprise()->getEffectifMin() . "\n"; -echo "Effectif max. : " . $response->getEntreprise()->getEffectifMax() . "\n"; -echo "Tranche effectif : " . $response->getEntreprise()->getTrancheEffectif() . "\n"; -echo "Année effectif : " . $response->getEntreprise()->getAnneeEffectif() . "\n"; -echo "Capital : " . $response->getEntreprise()->getCapital() . "\n"; -echo "Capital formaté : " . $response->getEntreprise()->getCapitalFormate() . "\n"; -echo "Capital actuel si variable : " . $response->getEntreprise()->getCapitalActuelVariable() . "\n"; -echo "Devise capital : " . $response->getEntreprise()->getDeviseCapital() . "\n"; -echo "Date clôture exercice : " . $response->getEntreprise()->getDateClotureExercice() . "\n"; -echo "Date clôture exercice exceptionnelle : " . $response->getEntreprise()->getDateClotureExerciceExceptionnelle() . "\n"; -echo "Prochaine date clôture exercice : " . $response->getEntreprise()->getProchaineDateClotureExercice() . "\n"; -echo "Prochaine date clôture exercice formatée : " . $response->getEntreprise()->getProchaineDateClotureExerciceFormate() . "\n"; -echo "Economie sociale solidaire : " . $response->getEntreprise()->getEconomieSocialeSolidaire() . "\n"; -echo "Durée personne moral : " . $response->getEntreprise()->getDureePersonneMorale() . "\n"; -echo "Dernière mise à jour SIRENE : " . $response->getEntreprise()->getDerniereMiseJourSirene() . "\n"; -echo "Dernière mise à jour R.C.S. : " . $response->getEntreprise()->getDerniereMiseJourRcs() . "\n"; -echo "Dernier traitement : " . $response->getEntreprise()->getDernierTraitement() . "\n"; -echo "Statut R.C.S. : " . $response->getEntreprise()->getStatutRcs() . "\n"; -echo "Greffe : " . $response->getEntreprise()->getGreffe() . "\n"; -echo "Numéro R.C.S. : " . $response->getEntreprise()->getNumeroRcs() . "\n"; -echo "Date immatriculation R.C.S. : " . $response->getEntreprise()->getDateImmatriculationRcs() . "\n"; -echo "Date première immatriculation R.C.S. : " . $response->getEntreprise()->getDatePremiereImmatriculationRcs() . "\n"; -echo "Date radiation R.C.S. : " . $response->getEntreprise()->getDateRadiationRcs() . "\n"; -echo "Numéro T.V.A. intracommunautaire : " . $response->getEntreprise()->getNumeroTvaIntracommunautaire() . "\n"; +echo sprintf($format, "Date creation", $response->getEntreprise()->getDateCreation()); +echo sprintf($format, "Date creation formatee", $response->getEntreprise()->getDateCreationFormate()); +echo sprintf($format, "Entreprise cessee", $response->getEntreprise()->getEntrepriseCessee()); +echo sprintf($format, "Date cessation", $response->getEntreprise()->getDateCessation()); +echo sprintf($format, "Date cessation formatee", $response->getEntreprise()->getDateCessationFormatee()); +echo sprintf($format, "Associe unique", $response->getEntreprise()->getAssocieUnique()); +echo sprintf($format, "Categorie juridique", $response->getEntreprise()->getCategorieJuridique()); +echo sprintf($format, "Forme juridique", $response->getEntreprise()->getFormeJuridique()); +echo sprintf($format, "Entreprise employeuse", $response->getEntreprise()->getEntrepriseEmployeuse()); +echo sprintf($format, "Effectif", $response->getEntreprise()->getEffectif()); +echo sprintf($format, "Effectif min.", $response->getEntreprise()->getEffectifMin()); +echo sprintf($format, "Effectif max.", $response->getEntreprise()->getEffectifMax()); +echo sprintf($format, "Tranche effectif", $response->getEntreprise()->getTrancheEffectif()); +echo sprintf($format, "Annee effectif", $response->getEntreprise()->getAnneeEffectif()); +echo sprintf($format, "Capital", $response->getEntreprise()->getCapital()); +echo sprintf($format, "Capital formate", $response->getEntreprise()->getCapitalFormate()); +echo sprintf($format, "Capital actuel si variable", $response->getEntreprise()->getCapitalActuelVariable()); +echo sprintf($format, "Devise capital", $response->getEntreprise()->getDeviseCapital()); +echo sprintf($format, "Date cloture exercice", $response->getEntreprise()->getDateClotureExercice()); +echo sprintf($format, "Date cloture exercice exceptionnelle", $response->getEntreprise()->getDateClotureExerciceExceptionnelle()); +echo sprintf($format, "Prochaine date cloture exercice", $response->getEntreprise()->getProchaineDateClotureExercice()); +echo sprintf($format, "Prochaine date cloture exercice formatee", $response->getEntreprise()->getProchaineDateClotureExerciceFormate()); +echo sprintf($format, "Economie sociale solidaire", $response->getEntreprise()->getEconomieSocialeSolidaire()); +echo sprintf($format, "Duree personne moral", $response->getEntreprise()->getDureePersonneMorale()); +echo sprintf($format, "Derniere mise à jour SIRENE", $response->getEntreprise()->getDerniereMiseJourSirene()); +echo sprintf($format, "Derniere mise à jour R.C.S.", $response->getEntreprise()->getDerniereMiseJourRcs()); +echo sprintf($format, "Dernier traitement", $response->getEntreprise()->getDernierTraitement()); +echo sprintf($format, "Statut R.C.S.", $response->getEntreprise()->getStatutRcs()); +echo sprintf($format, "Greffe", $response->getEntreprise()->getGreffe()); +echo sprintf($format, "Numero R.C.S.", $response->getEntreprise()->getNumeroRcs()); +echo sprintf($format, "Date immatriculation R.C.S.", $response->getEntreprise()->getDateImmatriculationRcs()); +echo sprintf($format, "Date premiere immatriculation R.C.S.", $response->getEntreprise()->getDatePremiereImmatriculationRcs()); +echo sprintf($format, "Date radiation R.C.S.", $response->getEntreprise()->getDateRadiationRcs()); +echo sprintf($format, "Numero T.V.A. intracommunautaire", $response->getEntreprise()->getNumeroTvaIntracommunautaire()); -echo "Etablissements :\n"; +echo sprintf($format, "Etablissements", ""); foreach ($response->getEntreprise()->getEtablissements() as $current) { - echo "\tSIRET : " . $current->getSiret() . "\n"; - echo "\tSIRET formaté : " . $current->getSiretFormate() . "\n"; - echo "\tNIC : " . $current->getNic() . "\n"; - echo "\tNuméro voie : " . $current->getNumeroVoie() . "\n"; - echo "\tIndice répétition : " . $current->getIndiceRepetition() . "\n"; - echo "\tType voie : " . $current->getTypeVoie() . "\n"; - echo "\tLibellé voie : " . $current->getLibelleVoie() . "\n"; - echo "\tComplément adresse : " . $current->getComplementAdresse() . "\n"; - echo "\tAdresse ligne 1 : " . $current->getAdresseLigne1() . "\n"; - echo "\tAdresse ligne 2 : " . $current->getAdresseLigne2() . "\n"; - echo "\tCode postal : " . $current->getCodePostal() . "\n"; - echo "\tVille : " . $current->getVille() . "\n"; - echo "\tPays : " . $current->getPays() . "\n"; - echo "\tLatitude : " . $current->getLatitude() . "\n"; - echo "\tLongitude : " . $current->getLongitude() . "\n"; - echo "\tCode NAF : " . $current->getCodeNaf() . "\n"; - echo "\tLibellé code NAF : " . $current->getLibelleCodeNaf() . "\n"; - echo "\tEtablissement employeur : " . $current->getEtablissementEmployeur() . "\n"; - echo "\tEffectif : " . $current->getEffectif() . "\n"; - echo "\tEffectif min. : " . $current->getEffectifMin() . "\n"; - echo "\tEffectif max. : " . $current->getEffectifMax() . "\n"; - echo "\tTranche effectif : " . $current->getTrancheEffectif() . "\n"; - echo "\tAnnée effectif : " . $current->getAnneeEffectif() . "\n"; - echo "\tDate création : " . $current->getDateCreation() . "\n"; - echo "\tEtablissement cessé : " . $current->getEtablissementCesse() . "\n"; - echo "\tDate cessation : " . $current->getDateCessation() . "\n"; - echo "\tDomiciliation : " . $current->getDomiciliation() . "\n"; - echo "\tSiège : " . $current->getSiege() . "\n"; + echo sprintf($format, " SIRET", $current->getSiret()); + echo sprintf($format, " SIRET formate", $current->getSiretFormate()); + echo sprintf($format, " NIC", $current->getNic()); + echo sprintf($format, " Numero voie", $current->getNumeroVoie()); + echo sprintf($format, " Indice repetition", $current->getIndiceRepetition()); + echo sprintf($format, " Type voie", $current->getTypeVoie()); + echo sprintf($format, " Libelle voie", $current->getLibelleVoie()); + echo sprintf($format, " Complement adresse", $current->getComplementAdresse()); + echo sprintf($format, " Adresse ligne 1", $current->getAdresseLigne1()); + echo sprintf($format, " Adresse ligne 2", $current->getAdresseLigne2()); + echo sprintf($format, " Code postal", $current->getCodePostal()); + echo sprintf($format, " Ville", $current->getVille()); + echo sprintf($format, " Pays", $current->getPays()); + echo sprintf($format, " Latitude", $current->getLatitude()); + echo sprintf($format, " Longitude", $current->getLongitude()); + echo sprintf($format, " Code NAF", $current->getCodeNaf()); + echo sprintf($format, " Libelle code NAF", $current->getLibelleCodeNaf()); + echo sprintf($format, " Etablissement employeur", $current->getEtablissementEmployeur()); + echo sprintf($format, " Effectif", $current->getEffectif()); + echo sprintf($format, " Effectif min.", $current->getEffectifMin()); + echo sprintf($format, " Effectif max.", $current->getEffectifMax()); + echo sprintf($format, " Tranche effectif", $current->getTrancheEffectif()); + echo sprintf($format, " Annee effectif", $current->getAnneeEffectif()); + echo sprintf($format, " Date creation", $current->getDateCreation()); + echo sprintf($format, " Etablissement cesse", $current->getEtablissementCesse()); + echo sprintf($format, " Date cessation", $current->getDateCessation()); + echo sprintf($format, " Domiciliation", $current->getDomiciliation()); + echo sprintf($format, " Siege", $current->getSiege()); } -echo "Finances :\n"; +echo sprintf($format, "Finances", ""); foreach ($response->getEntreprise()->getFinances() as $current) { - echo "\tAnnée : " . $current->getAnnee() . "\n"; - echo "\tDate clôture exercice : " . $current->getDateClotureExercice() . "\n"; - echo "\tDurée exercice : " . $current->getDureeExercice() . "\n"; - echo "\tChiffre d'affaires : " . $current->getChiffreAffaires() . "\n"; - echo "\tRésultat : " . $current->getResultat() . "\n"; - echo "\tEffectif : " . $current->getEffectif() . "\n"; + echo sprintf($format, " Annee", $current->getAnnee()); + echo sprintf($format, " Date cloture exercice", $current->getDateClotureExercice()); + echo sprintf($format, " Duree exercice", $current->getDureeExercice()); + echo sprintf($format, " Chiffre d'affaires", $current->getChiffreAffaires()); + echo sprintf($format, " Resultat", $current->getResultat()); + echo sprintf($format, " Effectif", $current->getEffectif()); } -echo "Représentants :\n"; +echo sprintf($format, "Representants", ""); foreach ($response->getEntreprise()->getRepresentants() as $current) { - echo "\tQualité : " . $current->getQualite() . "\n"; - echo "\tPersonne morale : " . $current->getPersonneMorale() . "\n"; - echo "\tDate prise de poste : " . $current->getDatePrisePoste() . "\n"; - echo "\tNom : " . $current->getNom() . "\n"; - echo "\tPrénom : " . $current->getPrenom() . "\n"; - echo "\tNom complet : " . $current->getNomComplet() . "\n"; - echo "\tDate naissance : " . $current->getDateNaissance() . "\n"; - echo "\tDate naissance formatée : " . $current->getDateNaissanceFormatee() . "\n"; - echo "\tAge : " . $current->getAge() . "\n"; - echo "\tNationalité : " . $current->getNationalite() . "\n"; - echo "\tVille naissance : " . $current->getVilleNaissance() . "\n"; - echo "\tPays naissance : " . $current->getPaysNaissance() . "\n"; - echo "\tAdresse ligne 1 : " . $current->getAdresseLigne1() . "\n"; - echo "\tAdresse ligne 2 : " . $current->getAdresseLigne2() . "\n"; - echo "\tAdresse ligne 3 : " . $current->getAdresseLigne3() . "\n"; - echo "\tCode postal : " . $current->getCodePostal() . "\n"; - echo "\tVille : " . $current->getVille() . "\n"; - echo "\tPays : " . $current->getPays() . "\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, " Nom", $current->getNom()); + echo sprintf($format, " Prenom", $current->getPrenom()); + echo sprintf($format, " Nom complet", $current->getNomComplet()); + echo sprintf($format, " Date naissance", $current->getDateNaissance()); + echo sprintf($format, " Date naissance formatee", $current->getDateNaissanceFormatee()); + echo sprintf($format, " Age", $current->getAge()); + echo sprintf($format, " Nationalite", $current->getNationalite()); + echo sprintf($format, " Ville naissance", $current->getVilleNaissance()); + echo sprintf($format, " Pays naissance", $current->getPaysNaissance()); + echo sprintf($format, " Adresse ligne 1", $current->getAdresseLigne1()); + echo sprintf($format, " Adresse ligne 2", $current->getAdresseLigne2()); + echo sprintf($format, " Adresse ligne 3", $current->getAdresseLigne3()); + echo sprintf($format, " Code postal", $current->getCodePostal()); + echo sprintf($format, " Ville", $current->getVille()); + echo sprintf($format, " Pays", $current->getPays()); } -echo "Bénéficiaires effectifs :\n"; +echo sprintf($format, "Beneficiaires effectifs", ""); foreach ($response->getEntreprise()->getBeneficiairesEffectifs() as $current) { - echo "\tDate greffe : " . $current->getDateGreffe() . "\n"; - echo "\tType : " . $current->getType() . "\n"; - echo "\tNom : " . $current->getNom() . "\n"; - echo "\tNom usage : " . $current->getNomUsage() . "\n"; - echo "\tPrénom : " . $current->getPrenom() . "\n"; - echo "\tPseudonyme : " . $current->getPseudonyme() . "\n"; - echo "\tNationalité : " . $current->getNationalite() . "\n"; - echo "\tDate naissance formatée : " . $current->getDateNaissanceFormatee() . "\n"; - echo "\tDate naissance complète formatée : " . $current->getDateNaissanceCompleteFormatee() . "\n"; - echo "\tVille naissance : " . $current->getVilleNaissance() . "\n"; - echo "\tPays naissance : " . $current->getPaysNaissance() . "\n"; - echo "\tAdresse ligne 1 : " . $current->getAdresseLigne1() . "\n"; - echo "\tAdresse ligne 2 : " . $current->getAdresseLigne2() . "\n"; - echo "\tAdresse ligne 3 : " . $current->getAdresseLigne3() . "\n"; - echo "\tCode postal : " . $current->getCodePostal() . "\n"; - echo "\tVille : " . $current->getVille() . "\n"; - echo "\tPays : " . $current->getPays() . "\n"; - echo "\tPourcentage parts : " . $current->getPourcentageParts() . "\n"; - echo "\tPourcentage parts directes : " . $current->getPourcentagePartsDirectes() . "\n"; - echo "\tPourcentage parts indirectes : " . $current->getPourcentagePartsIndirectes() . "\n"; - echo "\tPourcentage parts vocation titulaire : " . $current->getPourcentagePartsVocationTitulaire() . "\n"; - echo "\tDétails parts directes : [...]\n"; - echo "\tDétails parts indirectes : [...]\n"; - echo "\tDétails parts vocation titulaire : [...]\n"; - echo "\tPourcentage votes : " . $current->getPourcentageVotes() . "\n"; - echo "\tPourcentage votes directs : " . $current->getPourcentageVotesDirects() . "\n"; - echo "\tPourcentage votes indirects : " . $current->getPourcentageVotesIndirects() . "\n"; - echo "\tDétails votes directes : [...]\n"; - echo "\tDétails votes indirectes : [...]\n"; - echo "\tDétails société gestion : [...]\n"; - echo "\tDétention pouvoir A.G. : " . $current->getDetentionPouvoirDecisionAg() . "\n"; - echo "\tDétention pouvoir nom membre conseil administration : " . $current->getDetentionPouvoirNomMembreConseilAdministration() . "\n"; - echo "\tDétention autres moyens contrôle : " . $current->getDetentionAutresMoyensControle() . "\n"; - echo "\tBénéficiaire représentant légal : " . $current->getBeneficiaireRepresentantLegal() . "\n"; - echo "\tReprésentant légal placement sans gestion délégation : " . $current->getRepresentantLegalPlacementSansGestionDelegation() . "\n"; + echo sprintf($format, " Date greffe", $current->getDateGreffe()); + echo sprintf($format, " Type", $current->getType()); + echo sprintf($format, " Nom", $current->getNom()); + echo sprintf($format, " Nom usage", $current->getNomUsage()); + echo sprintf($format, " Prenom", $current->getPrenom()); + echo sprintf($format, " Pseudonyme", $current->getPseudonyme()); + echo sprintf($format, " Nationalite", $current->getNationalite()); + echo sprintf($format, " Date naissance formatee", $current->getDateNaissanceFormatee()); + echo sprintf($format, " Date naissance complete formatee", $current->getDateNaissanceCompleteFormatee()); + echo sprintf($format, " Ville naissance", $current->getVilleNaissance()); + echo sprintf($format, " Pays naissance", $current->getPaysNaissance()); + echo sprintf($format, " Adresse ligne 1", $current->getAdresseLigne1()); + echo sprintf($format, " Adresse ligne 2", $current->getAdresseLigne2()); + echo sprintf($format, " Adresse ligne 3", $current->getAdresseLigne3()); + echo sprintf($format, " Code postal", $current->getCodePostal()); + echo sprintf($format, " Ville", $current->getVille()); + echo sprintf($format, " Pays", $current->getPays()); + echo sprintf($format, " Pourcentage parts", $current->getPourcentageParts()); + echo sprintf($format, " Pourcentage parts directes", $current->getPourcentagePartsDirectes()); + echo sprintf($format, " Pourcentage parts indirectes", $current->getPourcentagePartsIndirectes()); + echo sprintf($format, " Pourcentage parts vocation titulaire", $current->getPourcentagePartsVocationTitulaire()); + echo sprintf($format, " Details parts directes", "[...]"); + echo sprintf($format, " Details parts indirectes", "[...]"); + echo sprintf($format, " Details parts vocation titulaire", "[...]"); + echo sprintf($format, " Pourcentage votes", $current->getPourcentageVotes()); + echo sprintf($format, " Pourcentage votes directs", $current->getPourcentageVotesDirects()); + echo sprintf($format, " Pourcentage votes indirects", $current->getPourcentageVotesIndirects()); + echo sprintf($format, " Details votes directes", "[...]"); + echo sprintf($format, " Details votes indirectes", "[...]"); + echo sprintf($format, " Details societe gestion", "[...]"); + echo sprintf($format, " Detention pouvoir A.G.", $current->getDetentionPouvoirDecisionAg()); + echo sprintf($format, " Detention pouvoir nom membre conseil administration", $current->getDetentionPouvoirNomMembreConseilAdministration()); + echo sprintf($format, " Detention autres moyens controle", $current->getDetentionAutresMoyensControle()); + echo sprintf($format, " Beneficiaire representant legal", $current->getBeneficiaireRepresentantLegal()); + echo sprintf($format, " Representant legal placement sans gestion delegation", $current->getRepresentantLegalPlacementSansGestionDelegation()); } -echo "Dépôts actes :\n"; +echo sprintf($format, "Depots actes", ""); foreach ($response->getEntreprise()->getDepotsActes() as $current) { - echo "\tDate dépôt : " . $current->getDateDepot() . "\n"; - echo "\tDate dépôt formaté : " . $current->getDateDepotFormatee() . "\n"; - echo "\tDisponible : " . $current->getDisponible() . "\n"; - echo "\tNom fichier : " . $current->getNomFichierPdf() . "\n"; - echo "\tToken : " . $current->getToken() . "\n"; - echo "\tActes : [...]\n"; + echo sprintf($format, " Date depot", $current->getDateDepot()); + echo sprintf($format, " Date depot formate", $current->getDateDepotFormatee()); + echo sprintf($format, " Disponible", $current->getDisponible()); + echo sprintf($format, " Nom fichier", $current->getNomFichierPdf()); + echo sprintf($format, " Token", $current->getToken()); + echo sprintf($format, " Actes", "[...]"); } -echo "Comptes :\n"; +echo sprintf($format, "Comptes", ""); foreach ($response->getEntreprise()->getComptes() as $current) { - echo "\tDate dépôt : " . $current->getDateDepot() . "\n"; - echo "\tDate dépôt formaté : " . $current->getDateDepotFormatee() . "\n"; - echo "\tDate clôture : " . $current->getDateCloture() . "\n"; - echo "\tAnnée clôture : " . $current->getAnneeCloture() . "\n"; - echo "\tType comptes : " . $current->getTypeComptes() . "\n"; - echo "\tConfidentialité : " . $current->getConfidentialite() . "\n"; - echo "\tConfidentialité compte résultat : " . $current->getConfidentialiteCompteResultat() . "\n"; - echo "\tDisponible : " . $current->getDisponible() . "\n"; - echo "\tNom fichier PDF : " . $current->getNomFichierPdf() . "\n"; - echo "\tToken : " . $current->getToken() . "\n"; + echo sprintf($format, " Date depot", $current->getDateDepot()); + echo sprintf($format, " Date depot formate", $current->getDateDepotFormatee()); + echo sprintf($format, " Date cloture", $current->getDateCloture()); + echo sprintf($format, " Annee cloture", $current->getAnneeCloture()); + echo sprintf($format, " Type comptes", $current->getTypeComptes()); + echo sprintf($format, " Confidentialite", $current->getConfidentialite()); + echo sprintf($format, " Confidentialite compte resultat", $current->getConfidentialiteCompteResultat()); + echo sprintf($format, " Disponible", $current->getDisponible()); + echo sprintf($format, " Nom fichier PDF", $current->getNomFichierPdf()); + echo sprintf($format, " Token", $current->getToken()); } -echo "Publications BODACC :\n"; +echo sprintf($format, "Publications BODACC", ""); foreach ($response->getEntreprise()->getPublicationsBodacc() as $current) { - echo "\tNuméro parution : " . $current->getNumeroParution() . "\n"; - echo "\tDate : " . $current->getDate() . "\n"; - echo "\tNuméro annonce : " . $current->getNumeroAnnonce() . "\n"; - echo "\tAnnonvce rectificative : " . $current->getAnnonceRectificative() . "\n"; - echo "\tBODACC : " . $current->getBodacc() . "\n"; - echo "\tType : " . $current->getType() . "\n"; - echo "\tR.C.S. : " . $current->getRcs() . "\n"; - echo "\tNom entreprise : " . $current->getNomEntreprise() . "\n"; - echo "\tPersonne morale : " . $current->getPersonneMorale() . "\n"; - echo "\tSigle : " . $current->getSigle() . "\n"; - echo "\tDénomination : " . $current->getDenomination() . "\n"; - echo "\tNom commercial : " . $current->getNomCommercial() . "\n"; - echo "\tForme juridique : " . $current->getFormeJuridique() . "\n"; - echo "\tNom : " . $current->getNom() . "\n"; - echo "\tPrénom : " . $current->getPrenom() . "\n"; - echo "\tAdministration : " . $current->getAdministration() . "\n"; - echo "\tPseudonyme : " . $current->getPseudonyme() . "\n"; - echo "\tNationalité : " . $current->getNationalite() . "\n"; - echo "\tAdresse : " . $current->getAdresse() . "\n"; - echo "\tCapital : " . $current->getCapital() . "\n"; - echo "\tDevise capital : " . $current->getDeviseCapital() . "\n"; - echo "\tActivité : " . $current->getActivite() . "\n"; - echo "\tDate début activité : " . $current->getDateDebutActivite() . "\n"; - echo "\tDescription : " . $current->getDescription() . "\n"; + echo sprintf($format, " Numero parution", $current->getNumeroParution()); + echo sprintf($format, " Date", $current->getDate()); + echo sprintf($format, " Numero annonce", $current->getNumeroAnnonce()); + echo sprintf($format, " Annonvce rectificative", $current->getAnnonceRectificative()); + echo sprintf($format, " BODACC", $current->getBodacc()); + echo sprintf($format, " Type", $current->getType()); + echo sprintf($format, " R.C.S.", $current->getRcs()); + echo sprintf($format, " Nom entreprise", $current->getNomEntreprise()); + echo sprintf($format, " Personne morale", $current->getPersonneMorale()); + echo sprintf($format, " Sigle", $current->getSigle()); + echo sprintf($format, " Denomination", $current->getDenomination()); + echo sprintf($format, " Nom commercial", $current->getNomCommercial()); + echo sprintf($format, " Forme juridique", $current->getFormeJuridique()); + echo sprintf($format, " Nom", $current->getNom()); + echo sprintf($format, " Prenom", $current->getPrenom()); + echo sprintf($format, " Administration", $current->getAdministration()); + echo sprintf($format, " Pseudonyme", $current->getPseudonyme()); + echo sprintf($format, " Nationalite", $current->getNationalite()); + echo sprintf($format, " Adresse", $current->getAdresse()); + echo sprintf($format, " Capital", $current->getCapital()); + echo sprintf($format, " Devise capital", $current->getDeviseCapital()); + echo sprintf($format, " Activite", $current->getActivite()); + echo sprintf($format, " Date debut activite", $current->getDateDebutActivite()); + echo sprintf($format, " Description", $current->getDescription()); } -echo "Procédures collectives :\n"; +echo sprintf($format, "Procedures collectives", ""); foreach ($response->getEntreprise()->getProceduresCollectives() as $current) { - echo "\tType : " . $current->getType() . "\n"; - echo "\tDate début : " . $current->getDateDebut() . "\n"; - echo "\tDate fin : " . $current->getDateFin() . "\n"; - echo "\tPublications BODACC : [...]\n"; + echo sprintf($format, " Type", $current->getType()); + echo sprintf($format, " Date debut", $current->getDateDebut()); + echo sprintf($format, " Date fin", $current->getDateFin()); + echo sprintf($format, " Publications BODACC", "[...]"); } -echo "Procédure collective existe : " . $response->getEntreprise()->getProcedureCollectiveExiste() . "\n"; -echo "Procédure collective en cours : " . $response->getEntreprise()->getProcedureCollectiveEnCours() . "\n"; -echo "Derniers statuts :\n"; -echo "\tDate dépôt : " . $response->getEntreprise()->getDerniersStatuts()->getDateDepot() . "\n"; -echo "\tDate dépôt formatée : " . $response->getEntreprise()->getDerniersStatuts()->getDateDepotFormatee() . "\n"; -echo "\tDisponible : " . $response->getEntreprise()->getDerniersStatuts()->getDisponible() . "\n"; -echo "\tNom fichier PDF : " . $response->getEntreprise()->getDerniersStatuts()->getNomFichierPdf() . "\n"; -echo "\tToken : " . $response->getEntreprise()->getDerniersStatuts()->getToken() . "\n"; -echo "\tType : " . $response->getEntreprise()->getDerniersStatuts()->getType() . "\n"; -echo "\tDécision : " . $response->getEntreprise()->getDerniersStatuts()->getDecision() . "\n"; -echo "\tDate acte : " . $response->getEntreprise()->getDerniersStatuts()->getDateActe() . "\n"; -echo "\tDate acte formaté : " . $response->getEntreprise()->getDerniersStatuts()->getDateActeFormatee() . "\n"; -echo "Extrait immatriculation :\n"; -echo "\tToken : " . $response->getEntreprise()->getExtraitImmatriculation()->getToken() . "\n"; +echo sprintf($format, "Procedure collective existe", $response->getEntreprise()->getProcedureCollectiveExiste()); +echo sprintf($format, "Procedure collective en cours", $response->getEntreprise()->getProcedureCollectiveEnCours()); +echo sprintf($format, "Derniers statuts", ""); +echo sprintf($format, " Date depot", $response->getEntreprise()->getDerniersStatuts()->getDateDepot()); +echo sprintf($format, " Date depot formatee", $response->getEntreprise()->getDerniersStatuts()->getDateDepotFormatee()); +echo sprintf($format, " Disponible", $response->getEntreprise()->getDerniersStatuts()->getDisponible()); +echo sprintf($format, " Nom fichier PDF", $response->getEntreprise()->getDerniersStatuts()->getNomFichierPdf()); +echo sprintf($format, " Token", $response->getEntreprise()->getDerniersStatuts()->getToken()); +echo sprintf($format, " Type", $response->getEntreprise()->getDerniersStatuts()->getType()); +echo sprintf($format, " Decision", $response->getEntreprise()->getDerniersStatuts()->getDecision()); +echo sprintf($format, " Date acte", $response->getEntreprise()->getDerniersStatuts()->getDateActe()); +echo sprintf($format, " Date acte formate", $response->getEntreprise()->getDerniersStatuts()->getDateActeFormatee()); +echo sprintf($format, "Extrait immatriculation", ""); +echo sprintf($format, " Token", $response->getEntreprise()->getExtraitImmatriculation()->getToken()); diff --git a/dev/recherche-dirigeants.php b/dev/recherche-dirigeants.php index 5534ecb..ff6d6e2 100644 --- a/dev/recherche-dirigeants.php +++ b/dev/recherche-dirigeants.php @@ -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; @@ -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()); } diff --git a/dev/recherche-documents.php b/dev/recherche-documents.php index 1f6a5d5..8c6489c 100644 --- a/dev/recherche-documents.php +++ b/dev/recherche-documents.php @@ -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; @@ -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()); } diff --git a/dev/recherche-publications.php b/dev/recherche-publications.php index 97fcfce..659efce 100644 --- a/dev/recherche-publications.php +++ b/dev/recherche-publications.php @@ -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\RecherchePublicationsRequest; @@ -32,47 +32,49 @@ $response = $provider->recherchePublications($request); // Handle the response. -echo "Page : " . $response->getPage() . "\n"; -echo "Total : " . $response->getTotal() . "\n"; +$format = "%-30s: %s\n"; -echo "Publications :\n"; +echo sprintf($format, "Page", $response->getPage()); +echo sprintf($format, "Total", $response->getTotal()); + +echo sprintf($format, "Publications ", ""); foreach ($response->getResultats() as $current) { - echo "Date : " . $current->getDate() . "\n"; - echo "SIREN : " . $current->getSiren() . "\n"; - echo "Type : " . $current->getType() . "\n"; - echo "Contenu : " . $current->getContenu() . "\n"; + echo sprintf($format, "Date", $current->getDate()); + echo sprintf($format, "SIREN", $current->getSiren()); + echo sprintf($format, "Type", $current->getType()); + echo sprintf($format, "Contenu", str_replace("\n", "\n" . str_repeat(" ", 32), $current->getContenu())); - 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()); } diff --git a/dev/recherche.php b/dev/recherche.php index eaaf91c..85b355c 100644 --- a/dev/recherche.php +++ b/dev/recherche.php @@ -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\RechercheRequest; @@ -25,92 +25,94 @@ $response = $provider->recherche($request); // Handle the response. -echo "Page : " . $response->getPage() . "\n"; -echo "Total : " . $response->getTotal() . "\n"; +$format = "%-30s: %s\n"; -echo "Entreprises :\n"; +echo sprintf($format, "Page", $response->getPage()); +echo sprintf($format, "Total", $response->getTotal()); + +echo sprintf($format, "Entreprises", ""); foreach ($response->getResultats() as $current) { - echo "SIREN : " . $current->getSiren() . "\n"; - echo "SIREN formaté : " . $current->getSirenFormate() . "\n"; - echo "Nom entreprise : " . $current->getNomEntreprise() . "\n"; - echo "Personne morale : " . $current->getPersonneMorale() . "\n"; - echo "Dénomination : " . $current->getDenomination() . "\n"; - echo "Nom : " . $current->getNom() . "\n"; - echo "Prénom : " . $current->getPrenom() . "\n"; - echo "Sexe : " . $current->getSexe() . "\n"; - echo "Siège :\n"; - echo "\tSIRET : " . $current->getSiege()->getSiret() . "\n"; - echo "\tSIRET formaté : " . $current->getSiege()->getSiretFormate() . "\n"; - echo "\tNIC : " . $current->getSiege()->getNic() . "\n"; - echo "\tNuméro voie : " . $current->getSiege()->getNumeroVoie() . "\n"; - echo "\tIndice répétition : " . $current->getSiege()->getIndiceRepetition() . "\n"; - echo "\tType voie : " . $current->getSiege()->getTypeVoie() . "\n"; - echo "\tLibellé voie : " . $current->getSiege()->getLibelleVoie() . "\n"; - echo "\tComplément adresse : " . $current->getSiege()->getComplementAdresse() . "\n"; - echo "\tAdresse ligne 1 : " . $current->getSiege()->getAdresseLigne1() . "\n"; - echo "\tAdresse ligne 2 : " . $current->getSiege()->getAdresseLigne2() . "\n"; - echo "\tCode postal : " . $current->getSiege()->getCodePostal() . "\n"; - echo "\tVille : " . $current->getSiege()->getVille() . "\n"; - echo "\tPays : " . $current->getSiege()->getPays() . "\n"; - echo "\tLatitude : " . $current->getSiege()->getLatitude() . "\n"; - echo "\tLongitude : " . $current->getSiege()->getLongitude() . "\n"; - echo "\tVilles : " . implode(", ", $current->getVilles()) . "\n"; - echo "Code NAF : " . $current->getCodeNaf() . "\n"; - echo "Libellé code NAF : " . $current->getLibelleCodeNaf() . "\n"; - echo "Domaine activité : " . $current->getDomaineActivite() . "\n"; - echo "Objet social : " . $current->getObjetSocial() . "\n"; - - echo "Convention collective :\n"; + echo sprintf($format, "SIREN", $current->getSiren()); + echo sprintf($format, "SIREN formate", $current->getSirenFormate()); + echo sprintf($format, "Nom entreprise", $current->getNomEntreprise()); + echo sprintf($format, "Personne morale", $current->getPersonneMorale()); + echo sprintf($format, "Denomination", $current->getDenomination()); + echo sprintf($format, "Nom", $current->getNom()); + echo sprintf($format, "Prenom", $current->getPrenom()); + echo sprintf($format, "Sexe", $current->getSexe()); + echo sprintf($format, "Siege", ""); + echo sprintf($format, " SIRET", $current->getSiege()->getSiret()); + echo sprintf($format, " SIRET formate", $current->getSiege()->getSiretFormate()); + echo sprintf($format, " NIC", $current->getSiege()->getNic()); + echo sprintf($format, " Numero voie", $current->getSiege()->getNumeroVoie()); + echo sprintf($format, " Indice repetition", $current->getSiege()->getIndiceRepetition()); + echo sprintf($format, " Type voie", $current->getSiege()->getTypeVoie()); + echo sprintf($format, " Libelle voie", $current->getSiege()->getLibelleVoie()); + echo sprintf($format, " Complement adresse", $current->getSiege()->getComplementAdresse()); + echo sprintf($format, " Adresse ligne 1", $current->getSiege()->getAdresseLigne1()); + echo sprintf($format, " Adresse ligne 2", $current->getSiege()->getAdresseLigne2()); + echo sprintf($format, " Code postal", $current->getSiege()->getCodePostal()); + echo sprintf($format, " Ville", $current->getSiege()->getVille()); + echo sprintf($format, " Pays", $current->getSiege()->getPays()); + echo sprintf($format, " Latitude", $current->getSiege()->getLatitude()); + echo sprintf($format, " Longitude", $current->getSiege()->getLongitude()); + echo sprintf($format, " Villes", implode(", ", $current->getVilles())); + echo sprintf($format, "Code NAF", $current->getCodeNaf()); + echo sprintf($format, "Libelle code NAF", $current->getLibelleCodeNaf()); + echo sprintf($format, "Domaine activite", $current->getDomaineActivite()); + echo sprintf($format, "Objet social", $current->getObjetSocial()); + + echo sprintf($format, "Convention collective", ""); foreach ($current->getConventionCollectives() as $c) { - echo "\tNom : " . $c->getNom() . "\n"; - echo "\tIDCC : " . $c->getIdcc() . "\n"; - echo "\tConfirmée : " . $c->getConfirmee() . "\n"; + echo sprintf($format, " Nom", $c->getNom()); + echo sprintf($format, " IDCC", $c->getIdcc()); + echo sprintf($format, " Confirmee", $c->getConfirmee()); } - echo "Date création : " . $current->getDateCreation() . "\n"; - echo "Date création formatée : " . $current->getDateCreationFormate() . "\n"; - echo "Entreprise employeuse : " . $current->getEntrepriseEmployeuse() . "\n"; - echo "Entreprise cessée : " . $current->getEntrepriseCessee() . "\n"; - echo "Date cessation : " . $current->getDateCessation() . "\n"; - echo "Catégorie juridique : " . $current->getCategorieJuridique() . "\n"; - echo "Forme juridique : " . $current->getFormeJuridique() . "\n"; - echo "Tranche effectif : " . $current->getTrancheEffectif() . "\n"; - echo "Effectif : " . $current->getEffectif() . "\n"; - echo "Effectif min. : " . $current->getEffectifMin() . "\n"; - echo "Effectif max. : " . $current->getEffectifMax() . "\n"; - echo "Année effectif : " . $current->getAnneeEffectif() . "\n"; - echo "Capital : " . $current->getCapital() . "\n"; - echo "Chiffre affaires : " . $current->getChiffreAffaires() . "\n"; - echo "Résultat : " . $current->getResultat() . "\n"; - echo "Effectifs finances : " . $current->getEffectifsFinances() . "\n"; - echo "Année finances : " . $current->getAnneeFinances() . "\n"; - - echo "Dirigeants :\n"; + echo sprintf($format, "Date creation", $current->getDateCreation()); + echo sprintf($format, "Date creation formatee", $current->getDateCreationFormate()); + echo sprintf($format, "Entreprise employeuse", $current->getEntrepriseEmployeuse()); + echo sprintf($format, "Entreprise cessee", $current->getEntrepriseCessee()); + echo sprintf($format, "Date cessation", $current->getDateCessation()); + echo sprintf($format, "Categorie juridique", $current->getCategorieJuridique()); + echo sprintf($format, "Forme juridique", $current->getFormeJuridique()); + echo sprintf($format, "Tranche effectif", $current->getTrancheEffectif()); + echo sprintf($format, "Effectif", $current->getEffectif()); + echo sprintf($format, "Effectif min.", $current->getEffectifMin()); + echo sprintf($format, "Effectif max.", $current->getEffectifMax()); + echo sprintf($format, "Annee effectif", $current->getAnneeEffectif()); + echo sprintf($format, "Capital", $current->getCapital()); + echo sprintf($format, "Chiffre affaires", $current->getChiffreAffaires()); + echo sprintf($format, "Resultat", $current->getResultat()); + echo sprintf($format, "Effectifs finances", $current->getEffectifsFinances()); + echo sprintf($format, "Annee finances", $current->getAnneeFinances()); + + echo sprintf($format, "Dirigeants", ""); foreach ($current->getRepresentants() as $d) { } - echo "Bénéficiaires :\n"; + echo sprintf($format, "Beneficiaires", ""); foreach ($current->getBeneficiairesEffectifs() as $b) { } - echo "Documents :\n"; + echo sprintf($format, "Documents", ""); foreach ($current->getDocuments() as $d) { } - echo "Publications :\n"; + echo sprintf($format, "Publications", ""); foreach ($current->getPublicationsBodacc() as $p) { } - echo "Nb dirigeants total : " . $current->getNbDirigeantsTotal() . "\n"; - echo "Nb bénéficiaires total : " . $current->getNbBeneficiairesTotal() . "\n"; - echo "Nb documents avec mentions : " . $current->getNbDocumentsAvecMentions() . "\n"; - echo "Nb documents total : " . $current->getNbDocumentsTotal() . "\n"; - echo "Nb publications avec mentions : " . $current->getNbPublicationsAvecMentions() . "\n"; - echo "Nb publications total : " . $current->getNbPublicationsTotal() . "\n"; + echo sprintf($format, "Nb dirigeants total", $current->getNbDirigeantsTotal()); + echo sprintf($format, "Nb beneficiaires total", $current->getNbBeneficiairesTotal()); + echo sprintf($format, "Nb documents avec mentions", $current->getNbDocumentsAvecMentions()); + echo sprintf($format, "Nb documents total", $current->getNbDocumentsTotal()); + echo sprintf($format, "Nb publications avec mentions", $current->getNbPublicationsAvecMentions()); + echo sprintf($format, "Nb publications total", $current->getNbPublicationsTotal()); } diff --git a/dev/suggestions.php b/dev/suggestions.php index c4ddeec..5c969dc 100644 --- a/dev/suggestions.php +++ b/dev/suggestions.php @@ -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\SuggestionsRequest; @@ -25,63 +25,64 @@ $response = $provider->suggestions($request); // Handle the response. +$format = "%-30s: %s\n"; -echo "Entreprises :\n"; +echo sprintf($format, "Entreprises", ""); foreach ($response->getResultatsNomEntreprise() as $current) { - echo "SIREN : " . $current->getSiren() . "\n"; - echo "SIREN formaté : " . $current->getSirenFormate() . "\n"; - echo "Nom entreprise : " . $current->getNomEntreprise() . "\n"; - echo "Personne morale : " . $current->getPersonneMorale() . "\n"; - echo "Dénomination : " . $current->getDenomination() . "\n"; - echo "Nom : " . $current->getNom() . "\n"; - echo "Prénom : " . $current->getPrenom() . "\n"; - echo "Sexe : " . $current->getSexe() . "\n"; - echo "Siège :\n"; - echo "\tSIRET : " . $current->getSiege()->getSiret() . "\n"; - echo "\tSIRET formaté : " . $current->getSiege()->getSiretFormate() . "\n"; - echo "\tNIC : " . $current->getSiege()->getNic() . "\n"; - echo "\tNuméro voie : " . $current->getSiege()->getNumeroVoie() . "\n"; - echo "\tIndice répétition : " . $current->getSiege()->getIndiceRepetition() . "\n"; - echo "\tType voie : " . $current->getSiege()->getTypeVoie() . "\n"; - echo "\tLibellé voie : " . $current->getSiege()->getLibelleVoie() . "\n"; - echo "\tComplément adresse : " . $current->getSiege()->getComplementAdresse() . "\n"; - echo "\tAdresse ligne 1 : " . $current->getSiege()->getAdresseLigne1() . "\n"; - echo "\tAdresse ligne 2 : " . $current->getSiege()->getAdresseLigne2() . "\n"; - echo "\tCode postal : " . $current->getSiege()->getCodePostal() . "\n"; - echo "\tVille : " . $current->getSiege()->getVille() . "\n"; - echo "\tPays : " . $current->getSiege()->getPays() . "\n"; - echo "\tLatitude : " . $current->getSiege()->getLatitude() . "\n"; - echo "\tLongitude : " . $current->getSiege()->getLongitude() . "\n"; - echo "\tVilles : " . implode(", ", $current->getVilles()) . "\n"; - echo "Code NAF : " . $current->getCodeNaf() . "\n"; - echo "Libellé code NAF : " . $current->getLibelleCodeNaf() . "\n"; - echo "Domaine activité : " . $current->getDomaineActivite() . "\n"; - echo "Objet social : " . $current->getObjetSocial() . "\n"; + echo sprintf($format, "SIREN", $current->getSiren()); + echo sprintf($format, "SIREN formate", $current->getSirenFormate()); + echo sprintf($format, "Nom entreprise", $current->getNomEntreprise()); + echo sprintf($format, "Personne morale", $current->getPersonneMorale()); + echo sprintf($format, "Denomination", $current->getDenomination()); + echo sprintf($format, "Nom", $current->getNom()); + echo sprintf($format, "Prenom", $current->getPrenom()); + echo sprintf($format, "Sexe", $current->getSexe()); + echo sprintf($format, "Siege", ""); + echo sprintf($format, " SIRET", $current->getSiege()->getSiret()); + echo sprintf($format, " SIRET formate", $current->getSiege()->getSiretFormate()); + echo sprintf($format, " NIC", $current->getSiege()->getNic()); + echo sprintf($format, " Numero voie", $current->getSiege()->getNumeroVoie()); + echo sprintf($format, " Indice repetition", $current->getSiege()->getIndiceRepetition()); + echo sprintf($format, " Type voie", $current->getSiege()->getTypeVoie()); + echo sprintf($format, " Libelle voie", $current->getSiege()->getLibelleVoie()); + echo sprintf($format, " Complement adresse", $current->getSiege()->getComplementAdresse()); + echo sprintf($format, " Adresse ligne 1", $current->getSiege()->getAdresseLigne1()); + echo sprintf($format, " Adresse ligne 2", $current->getSiege()->getAdresseLigne2()); + echo sprintf($format, " Code postal", $current->getSiege()->getCodePostal()); + echo sprintf($format, " Ville", $current->getSiege()->getVille()); + echo sprintf($format, " Pays", $current->getSiege()->getPays()); + echo sprintf($format, " Latitude", $current->getSiege()->getLatitude()); + echo sprintf($format, " Longitude", $current->getSiege()->getLongitude()); + echo sprintf($format, " Villes", implode(", ", $current->getVilles())); + echo sprintf($format, "Code NAF", $current->getCodeNaf()); + echo sprintf($format, "Libelle code NAF", $current->getLibelleCodeNaf()); + echo sprintf($format, "Domaine activite", $current->getDomaineActivite()); + echo sprintf($format, "Objet social", $current->getObjetSocial()); - echo "Convention collective :\n"; + echo sprintf($format, "Convention collective", ""); foreach ($current->getConventionCollectives() as $c) { - echo "\tNom : " . $c->getNom() . "\n"; - echo "\tIDCC : " . $c->getIdcc() . "\n"; - echo "\tConfirmée : " . $c->getConfirmee() . "\n"; + echo sprintf($format, " Nom", $c->getNom()); + echo sprintf($format, " IDCC", $c->getIdcc()); + echo sprintf($format, " Confirmee", $c->getConfirmee()); } - echo "Date création : " . $current->getDateCreation() . "\n"; - echo "Date création formatée : " . $current->getDateCreationFormate() . "\n"; - echo "Entreprise employeuse : " . $current->getEntrepriseEmployeuse() . "\n"; - echo "Entreprise cessée : " . $current->getEntrepriseCessee() . "\n"; - echo "Date cessation : " . $current->getDateCessation() . "\n"; - echo "Catégorie juridique : " . $current->getCategorieJuridique() . "\n"; - echo "Forme juridique : " . $current->getFormeJuridique() . "\n"; - echo "Tranche effectif : " . $current->getTrancheEffectif() . "\n"; - echo "Effectif : " . $current->getEffectif() . "\n"; - echo "Effectif min. : " . $current->getEffectifMin() . "\n"; - echo "Effectif max. : " . $current->getEffectifMax() . "\n"; - echo "Année effectif : " . $current->getAnneeEffectif() . "\n"; - echo "Capital : " . $current->getCapital() . "\n"; - echo "Chiffre affaires : " . $current->getChiffreAffaires() . "\n"; - echo "Résultat : " . $current->getResultat() . "\n"; - echo "Effectifs finances : " . $current->getEffectifsFinances() . "\n"; - echo "Année finances : " . $current->getAnneeFinances() . "\n"; + echo sprintf($format, "Date creation", $current->getDateCreation()); + echo sprintf($format, "Date creation formatee", $current->getDateCreationFormate()); + echo sprintf($format, "Entreprise employeuse", $current->getEntrepriseEmployeuse()); + echo sprintf($format, "Entreprise cessee", $current->getEntrepriseCessee()); + echo sprintf($format, "Date cessation", $current->getDateCessation()); + echo sprintf($format, "Categorie juridique", $current->getCategorieJuridique()); + echo sprintf($format, "Forme juridique", $current->getFormeJuridique()); + echo sprintf($format, "Tranche effectif", $current->getTrancheEffectif()); + echo sprintf($format, "Effectif", $current->getEffectif()); + echo sprintf($format, "Effectif min.", $current->getEffectifMin()); + echo sprintf($format, "Effectif max.", $current->getEffectifMax()); + echo sprintf($format, "Annee effectif", $current->getAnneeEffectif()); + echo sprintf($format, "Capital", $current->getCapital()); + echo sprintf($format, "Chiffre affaires", $current->getChiffreAffaires()); + echo sprintf($format, "Resultat", $current->getResultat()); + echo sprintf($format, "Effectifs finances", $current->getEffectifsFinances()); + echo sprintf($format, "Annee finances", $current->getAnneeFinances()); } \ No newline at end of file