Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated instances of count() that would cause a warning in 7.2 #1443

Closed
wants to merge 11 commits into from
Prev Previous commit
Updated count check to use symfony polyfill
  • Loading branch information
Ruben Bratsberg committed Oct 24, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit edb254d4cda223c667f91871714146189e5aa732
2 changes: 1 addition & 1 deletion kernel/classes/ezcontentobjecttreenode.php
Original file line number Diff line number Diff line change
@@ -4168,7 +4168,7 @@ function subtreeSoleNodeCount( $params = array() )

$nodePath = null;
$nodeDepth = 0;
if (((is_array($node) || $node instanceof Countable) && count($node) != 0) || $node != null) {
if ( is_countable( $node ) && count( $node ) != 0 ) {
$nodePath = $node->attribute( 'path_string' );
$nodeDepth = $node->attribute( 'depth' );
}
8 changes: 1 addition & 7 deletions kernel/common/ezobjectforwarder.php
Original file line number Diff line number Diff line change
@@ -321,13 +321,7 @@ function resourceAcquisitionTransformation( $functionName, &$node, $rule, $input
$matchCount = 0;
foreach ( $matchItem['custom_match'] as $customMatch )
{
$matchConditionCount = 0;

if ($customMatch['conditions'] instanceof Countable || is_array($customMatch['conditions'])) {
$matchConditionCount = count($customMatch['conditions']);
} else if ($customMatch['conditions'] != null) {
$matchConditionCount = 1;
}
$matchConditionCount = is_countable( $customMatch['conditions'] ) ? count( $customMatch['conditions'] ) : 0;
$code = '';
if ( $matchCount > 0 )
{
7 changes: 1 addition & 6 deletions kernel/common/eztemplatedesignresource.php
Original file line number Diff line number Diff line change
@@ -86,12 +86,7 @@ function templateNodeTransformation( $functionName, &$node,
$matchCount = 0;
foreach ( $customMatchList as $customMatch )
{
$matchConditionCount = 0;
if ($customMatch['conditions'] instanceof Countable || is_array($customMatch['conditions'])) {
$matchConditionCount = count($customMatch['conditions']);
} else if ($customMatch['conditions'] != null) {
$matchConditionCount = 1;
}
$matchConditionCount = is_countable( $customMatch['conditions'] ) ? count( $customMatch['conditions'] ) : 0;
$code = '';
if ( $matchCount > 0 )
{
2 changes: 1 addition & 1 deletion lib/ezutils/classes/ezsendmailtransport.php
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ function sendMail( eZMail $mail )
$sendmailOptions = '';
$emailFrom = $mail->sender();
$emailSender = isset( $emailFrom['email'] ) ? $emailFrom['email'] : false;
if ( !$emailSender || ( is_array($emailSender) || $emailSender instanceof Countable && count($emailSender) <= 0) || $emailSender == null )
if ( !$emailSender || ( is_countable( $emailSender ) && count( $emailSender) <= 0 ) )
$emailSender = $ini->variable( 'MailSettings', 'EmailSender' );
if ( !$emailSender )
$emailSender = $ini->variable( 'MailSettings', 'AdminEmail' );