-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
95 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
/.sensiolabs.yml export-ignore | ||
/.travis.yml export-ignore | ||
/phpunit.* export-ignore | ||
/CHANGELOG.md export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 1.1 # | ||
|
||
`Alo::ifundefined()` added |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
/** | ||
* Static common component container | ||
* @author Art <[email protected]> | ||
* @since 1.1 ifundefined() added | ||
*/ | ||
abstract class Alo { | ||
|
||
|
@@ -105,6 +106,20 @@ static function ifnull(&$var, $planB, $useNullget = false) { | |
return $v !== null ? $v : $planB; | ||
} | ||
|
||
/** | ||
* Returns the value of the constant with the name of $const if it's defined, $planB if it's not | ||
* @author Art <[email protected]> | ||
* | ||
* @param string $const Constant name | ||
* @param mixed $planB What to return if $const isn't defined | ||
* | ||
* @return mixed | ||
* @since 1.1 | ||
*/ | ||
static function ifundefined($const, $planB) { | ||
return defined($const) ? constant($const) : $planB; | ||
} | ||
|
||
/** | ||
* Checks if the request was made via AJAX | ||
* @author Art <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters