Skip to content

Commit

Permalink
use strict checks for accessing service container through mc4wp() fun…
Browse files Browse the repository at this point in the history
…ction
  • Loading branch information
dannyvankooten committed Oct 3, 2023
1 parent 9bfc7fa commit 2b35151
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,18 @@
* @ignore
* @access private
*
* @param string $service (optional)
* @param null|string $service (optional)
* @return mixed
*
* @throws Exception when service is not found
*/
function mc4wp( $service = null ) {
static $mc4wp;

if ( ! $mc4wp ) {
static $mc4wp = null;
if ( null === $mc4wp ) {
$mc4wp = new MC4WP_Container();
}

if ( $service ) {
if ( null !== $service ) {
return $mc4wp->get( $service );
}

Expand Down

0 comments on commit 2b35151

Please sign in to comment.