From eb350e3ab67c5e4f3533fc53d65a8449201bbdf3 Mon Sep 17 00:00:00 2001
From: Guillaume Rousse <guillaume.rousse@renater.fr>
Date: Fri, 8 Dec 2017 15:58:33 +0100
Subject: [PATCH] cosmetics

---
 lib/AccountManager/Account.pm | 16 ++++++++--------
 lib/AccountManager/Service.pm | 11 +++++------
 lib/AccountManager/Token.pm   | 10 ++++++----
 3 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/lib/AccountManager/Account.pm b/lib/AccountManager/Account.pm
index 65896b6..7052eb8 100644
--- a/lib/AccountManager/Account.pm
+++ b/lib/AccountManager/Account.pm
@@ -114,14 +114,14 @@ sub print {
     $fd = \*STDOUT unless $fd;
 
     printf $fd
-"Account ID=%s; password_hash=%s; sp_entityid=%s; profile=%s; scope=%s; creation_date=%s; expiration_date=%s\n",
-      $self->id(),
-      $self->password_hash(),
-      $self->sp_entityid(),
-      $self->profile(),
-      $self->scope(),
-      $self->creation_date()->strftime('%Y:%m:%d'),
-      $self->expiration_date()->strftime('%Y:%m:%d');
+        "Account ID=%s; password_hash=%s; sp_entityid=%s; profile=%s; scope=%s; creation_date=%s; expiration_date=%s\n",
+        $self->id(),
+        $self->password_hash(),
+        $self->sp_entityid(),
+        $self->profile(),
+        $self->scope(),
+        $self->creation_date()->strftime('%Y:%m:%d'),
+        $self->expiration_date()->strftime('%Y:%m:%d');
 }
 
 sub internal_uid {
diff --git a/lib/AccountManager/Service.pm b/lib/AccountManager/Service.pm
index 2676f98..539df49 100644
--- a/lib/AccountManager/Service.pm
+++ b/lib/AccountManager/Service.pm
@@ -22,17 +22,16 @@ __PACKAGE__->meta->setup(
     unique_key => [ 'entityid' ],
 );
 
-## Print the content of a test account
 sub print {
     my ($self, $fd) = @_;
     $fd = \*STDOUT unless $fd;
 
     printf $fd
-      "ServiceProvider ID=%s; entityid=%s; displayname=%s; contacts=%s\n",
-      $self->id(),
-      $self->entityid(),
-      $self->displayname(),
-      join(',', $self->contacts());
+        "Service ID=%s; entityid=%s; displayname=%s; contacts=%s\n",
+        $self->id(),
+        $self->entityid(),
+        $self->displayname() || '',
+        join(',', $self->contacts());
 }
 
 ## Check if email address is a known contact
diff --git a/lib/AccountManager/Token.pm b/lib/AccountManager/Token.pm
index f749029..b71c1d9 100644
--- a/lib/AccountManager/Token.pm
+++ b/lib/AccountManager/Token.pm
@@ -29,10 +29,12 @@ sub print {
     $fd = \*STDOUT unless $fd;
 
     printf $fd
-"AuthenticationToken ID=%s; token=%s; email_address=%s; sp_entityid=%s; creation_date=%s\n",
-      $self->id(), $self->token(), $self->email_address(),
-      $self->sp_entityid(),
-      $self->creation_date()->strftime('%Y:%m:%d');
+        "Token ID=%s; token=%s; email_address=%s; sp_entityid=%s; creation_date=%s\n",
+        $self->id(),
+        $self->token(),
+        $self->email_address(),
+        $self->sp_entityid(),
+        $self->creation_date()->strftime('%Y:%m:%d');
 }
 
 1;
-- 
GitLab