Skip to content
This repository was archived by the owner on Sep 19, 2022. It is now read-only.

Commit a04acd4

Browse files
Merge pull request #28 from melanger/patch-2
remove unnecessary is_null
2 parents d59bdce + 96e632b commit a04acd4

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
All notable changes to this project will be documented in this file.
33

44
## [Unreleased]
5+
#### Changed
6+
- Remove unnecessary is_null()
7+
58
#### Fixed
69
- Log info message about successful authentication only after successful authentication to SP
710

lib/Auth/Process/DatabaseCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static function insertLogin(&$request, &$date)
4343
$month = $date->format('m');
4444
$day = $date->format('d');
4545

46-
if (is_null($idpEntityID) || empty($idpEntityID) || is_null($spEntityId) || empty($spEntityId)) {
46+
if (empty($idpEntityID) || empty($spEntityId)) {
4747
Logger::error(
4848
"Some from attribute: 'idpEntityId', 'idpName', 'spEntityId' and 'spName'" .
4949
" is null or empty and login log wasn't inserted into the database."
@@ -58,7 +58,7 @@ public static function insertLogin(&$request, &$date)
5858
Logger::error("The login log wasn't inserted into table: " . $statisticsTableName . ".");
5959
}
6060

61-
if (!is_null($idpName) && !empty($idpName)) {
61+
if (!empty($idpName)) {
6262
$stmt->prepare(
6363
"INSERT INTO " . $identityProvidersMapTableName .
6464
"(entityId, name) VALUES (?, ?) ON DUPLICATE KEY UPDATE name = ?"
@@ -67,7 +67,7 @@ public static function insertLogin(&$request, &$date)
6767
$stmt->execute();
6868
}
6969

70-
if (!is_null($spName) && !empty($spName)) {
70+
if (!empty($spName)) {
7171
$stmt->prepare(
7272
"INSERT INTO " . $serviceProvidersMapTableName .
7373
"(identifier, name) VALUES (?, ?) ON DUPLICATE KEY UPDATE name = ?"

templates/idpDetail-tpl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
$idpName = DatabaseCommand::getIdPNameByEntityId($idpEntityId);
3838

39-
if (!is_null($idpName) && !empty($idpName)) {
39+
if (!empty($idpName)) {
4040
$this->data['header'] = $this->t('{proxystatistics:Proxystatistics:templates/idpDetail_header_name}') . $idpName;
4141
} else {
4242
$this->data['header'] = $this->t('{proxystatistics:Proxystatistics:templates/idpDetail_header_entityId}') .

templates/spDetail-tpl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
$spName = DatabaseCommand::getSpNameBySpIdentifier($spIdentifier);
3737

38-
if (!is_null($spName) && !empty($spName)) {
38+
if (!empty($spName)) {
3939
$this->data['header'] = $this->t('{proxystatistics:Proxystatistics:templates/spDetail_header_name}') .
4040
$spName;
4141
} else {

0 commit comments

Comments
 (0)