Permalink
Browse files

Merge branch '2017.12'

  • Loading branch information...
andrerom committed Aug 15, 2018
2 parents 49521c1 + 6321a92 commit 870ffa13c1c152bafa7680237751a05585810ce0
View
@@ -40,6 +40,7 @@
"ezsystems/ezprestapiprovider-ls": "~5.3",
"ezsystems/ezstarrating-ls-extension": "~5.3",
"ezsystems/ezwt-ls-extension": "~5.3",
"symfony/polyfill-php73": "^1.9",
"zetacomponents/archive": "~1.5",
"zetacomponents/authentication": "~1.4",
"zetacomponents/authentication-database-tiein": "~1.2",
@@ -173,7 +173,14 @@ function addOption( $newID, $OptionID, $optionValue, $optionAdditionalPrice )
*/
function sortMultiOptions()
{
usort( $this->Options, create_function( '$a, $b', 'if ( $a["priority"] == $b["priority"] ) { return 0; } return ( $a["priority"] < $b["priority"] ) ? -1 : 1;' ) );
usort( $this->Options, function( $a, $b ) {
if ( $a['priority'] == $b['priority'] )
{
return 0;
}
return ( $a['priority'] < $b['priority'] ) ? -1 : 1;
});
$this->changeMultiOptionID();
}
@@ -187,9 +187,7 @@ static function registeredDataTypes()
$GLOBALS["eZDataTypeObjects"][$dataTypeString] = new $className();
}
}
uasort( $GLOBALS["eZDataTypeObjects"],
create_function( '$a, $b',
'return strcmp( $a->Name, $b->Name);' ) );
uasort( $GLOBALS["eZDataTypeObjects"], function ( $a, $b ) { return strcmp( $a->Name, $b->Name); } );
return $GLOBALS["eZDataTypeObjects"];
}
return null;
@@ -202,11 +202,12 @@ static function getAttributeMappings( $rssSources )
// sort the array so nodes with deeper path are first
// for class attribute to RSS field mapping
usort( $attributeMappings,
create_function( '$a, $b',
'$a_cnt = count( $a[1]->attribute( \'path_array\' ) );' .
'$b_cnt = count( $b[1]->attribute( \'path_array\' ) );' .
'return ( $a_cnt == $b_cnt ) ? 0 : ( ( $a_cnt > $b_cnt ) ? 1 : -1 );' ) );
usort( $attributeMappings, function ( $a, $b ) {
$a_cnt = count( $a[1]->attribute( 'path_array' ) );
$b_cnt = count( $b[1]->attribute( 'path_array' ) );
return ( $a_cnt == $b_cnt ) ? 0 : ( ( $a_cnt > $b_cnt ) ? 1 : -1 );
});
}
return $attributeMappings;
@@ -405,7 +405,7 @@ static function checkObject( $module, $view, $object )
*/
// "flatten" the array
array_walk( $pathStringList, create_function( '&$a', '$a = $a[\'path_string\'];' ) );
array_walk( $pathStringList, function( &$a ) { $a = $a['path_string']; } );
}
else
{
@@ -728,7 +728,9 @@ function cleanupAfterRemoving( $attr = array() )
// $IDArray will contain IDs of "Excluded user groups"
$IDArray = explode( ',', $groupID[ 'data_text2' ] );
// $newIDArray will contain array without $contentObjectID
$newIDArray = array_filter( $IDArray, create_function( '$v', 'return ( $v != ' . $contentObjectID .' );' ) );
$newIDArray = array_filter( $IDArray, function ( $v ) use ( $contentObjectID ) {
return $v != $contentObjectID;
});
$newValues = $db->escapeString( implode( ',', $newIDArray ) );
$db->query( "UPDATE ezworkflow_event
SET data_text2 = '$newValues'
@@ -153,9 +153,17 @@ public function loadMetaData( $force = false )
if ( isset( $GLOBALS['eZClusterInfo'] ) &&
count( $GLOBALS['eZClusterInfo'] ) >= self::INFOCACHE_MAX )
{
usort( $GLOBALS['eZClusterInfo'],
create_function( '$a, $b',
'$a=$a["cnt"]; $b=$b["cnt"]; if ( $a > $b ) return -1; else if ( $a == $b ) return 0; else return 1;' ) );
usort( $GLOBALS['eZClusterInfo'], function ( $a, $b ) {
$a = $a['cnt'];
$b = $b['cnt'];
if ( $a == $b )
{
return 0;
}
return $a > $b ? -1 : 1;
});
array_pop( $GLOBALS['eZClusterInfo'] );
}
$GLOBALS['eZClusterInfo'][$this->filePath] = array( 'cnt' => 1,
@@ -158,8 +158,10 @@ function checkEnteredData( $country, $categories, $vatType, $productCategories,
// Modify chosen categories array
// so that it can be saved into the VAT rule.
$addID = create_function('$i', "return array( 'id' => \$i ) ;" );
$chosenCategories = array_map( $addID, $chosenCategories );
$chosenCategories = array_map(
function( $i ) { return array( 'id' => $i ); },
$chosenCategories
);
$vatRule->setAttribute( 'country_code', $chosenCountry );
$vatRule->setAttribute( 'product_categories', $chosenCategories );
@@ -1197,7 +1197,7 @@ static function processElementTransformationList( $tpl, &$node, $elements, &$pri
static function processElementTransformationChild( $useComments, $php, $tpl, &$node,
$elementTree, $elementList, &$resourceData )
{
$count = count( $elementList );
$count = is_countable( $elementList ) ? count( $elementList ) : 0;
$lastElement = null;
$newElementList = array();
for ( $i = 0; $i < $count; ++$i )
@@ -276,7 +276,7 @@ static function isVariableElement( $elements )
*/
static function isPHPVariableElement( $elements )
{
return count( $elements ) === 1 && isset( $elements[0][0] ) && $elements[0][0] == eZTemplate::TYPE_PHP_VARIABLE;
return is_countable( $elements ) && count( $elements ) === 1 && isset( $elements[0][0] ) && $elements[0][0] == eZTemplate::TYPE_PHP_VARIABLE;
}
/*!
@@ -565,7 +565,7 @@ function thisVariableText( $value, $column = 0, $iteration = 0, $maxIterations =
$column += strlen( $text );
$valueKeys = array_keys( $value );
$isIndexed = true;
for ( $i = 0; $i < count( $valueKeys ); ++$i )
for ( $i = 0, $count = count( $valueKeys ); $i < $count; ++$i )
{
if ( $i !== $valueKeys[$i] )
{
@@ -676,7 +676,7 @@ static function variableText( $value, $column = 0, $iteration = 0, $maxIteration
$column += strlen( $text );
$valueKeys = array_keys( $value );
$isIndexed = true;
for ( $i = 0; $i < count( $valueKeys ); ++$i )
for ( $i = 0, $count = count( $valueKeys ); $i < $count; ++$i )
{
if ( $i !== $valueKeys[$i] )
{
@@ -1282,7 +1282,9 @@ function writeVariableUnsetList( $element )
if ( isset( $parameters['spacing'] ) and $this->Spacing )
$spacing = $parameters['spacing'];
$text = 'unset( ';
array_walk( $variableNames, create_function( '&$variableName,$key', '$variableName = "\$" . $variableName;') );
array_walk( $variableNames, function ( &$variableName ) {
$variableName = "\$" . $variableName;
});
$text .= join( ', ', $variableNames );
$text .= " );\n";
$text = eZPHPCreator::prependSpacing( $text, $spacing );

0 comments on commit 870ffa1

Please sign in to comment.