only in patch2: unchanged: --- a/core/lib/Drupal/Core/Archiver/ArchiveTar.php +++ b/core/lib/Drupal/Core/Archiver/ArchiveTar.php @@ -369,7 +369,7 @@ public function extract($p_path = '', $p_preserve = false) */ public function listContent() { - $v_list_detail = array(); + $v_list_detail = []; if ($this->_openRead()) { if (!$this->_extractList('', $v_list_detail, "list", '', '')) { @@ -542,7 +542,7 @@ public function addModify($p_filelist, $p_add_dir, $p_remove_dir = '') * * @return true on success, false on error. */ - public function addString($p_filename, $p_string, $p_datetime = false, $p_params = array()) + public function addString($p_filename, $p_string, $p_datetime = false, $p_params = []) { $p_stamp = @$p_params["stamp"] ? $p_params["stamp"] : ($p_datetime ? $p_datetime : time()); $p_mode = @$p_params["mode"] ? $p_params["mode"] : 0600; @@ -609,7 +609,7 @@ public function addString($p_filename, $p_string, $p_datetime = false, $p_params public function extractModify($p_path, $p_remove_path, $p_preserve = false) { $v_result = true; - $v_list_detail = array(); + $v_list_detail = []; if ($v_result = $this->_openRead()) { $v_result = $this->_extractList( @@ -669,7 +669,7 @@ public function extractInString($p_filename) public function extractList($p_filelist, $p_path = '', $p_remove_path = '', $p_preserve = false) { $v_result = true; - $v_list_detail = array(); + $v_list_detail = []; if (is_array($p_filelist)) { $v_list = $p_filelist; @@ -771,7 +771,7 @@ public function setIgnoreRegexp($regexp) */ public function setIgnoreList($list) { - $regexp = str_replace(array('#', '.', '^', '$'), array('\#', '\.', '\^', '\$'), $list); + $regexp = str_replace(['#', '.', '^', '$'], ['\#', '\.', '\^', '\$'], $list); $regexp = '#/' . join('$|/', $list) . '#'; $this->setIgnoreRegexp($regexp); } @@ -1173,7 +1173,7 @@ public function _writeFooter() public function _addList($p_list, $p_add_dir, $p_remove_dir) { $v_result = true; - $v_header = array(); + $v_header = []; // ----- Remove potential windows directory separator $p_add_dir = $this->_translateWinPath($p_add_dir); @@ -1335,7 +1335,7 @@ public function _addFile($p_filename, &$p_header, $p_add_dir, $p_remove_dir, $v_ * @param array $p_params * @return bool */ - public function _addString($p_filename, $p_string, $p_datetime = false, $p_params = array()) + public function _addString($p_filename, $p_string, $p_datetime = false, $p_params = []) { $p_stamp = @$p_params["stamp"] ? $p_params["stamp"] : ($p_datetime ? $p_datetime : time()); $p_mode = @$p_params["mode"] ? $p_params["mode"] : 0600; @@ -1713,7 +1713,7 @@ public function _readHeader($v_binary_data, &$v_header) } if (!is_array($v_header)) { - $v_header = array(); + $v_header = []; } // ----- Calculate the checksum $v_checksum = 0; only in patch2: unchanged: --- a/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php +++ b/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php @@ -118,7 +118,7 @@ protected function callMethod($service, $call) { } } - call_user_func_array(array($service, $call[0]), $this->resolveServices($this->getParameterBag()->resolveValue($call[1]))); + call_user_func_array([$service, $call[0]], $this->resolveServices($this->getParameterBag()->resolveValue($call[1]))); } /** only in patch2: unchanged: --- a/core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php +++ b/core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php @@ -203,12 +203,12 @@ private function parseDefinition($id, $service, $file) if (is_string($service['factory'])) { if (strpos($service['factory'], ':') !== false && strpos($service['factory'], '::') === false) { $parts = explode(':', $service['factory']); - $definition->setFactory(array($this->resolveServices('@'.$parts[0]), $parts[1])); + $definition->setFactory([$this->resolveServices('@'.$parts[0]), $parts[1]]); } else { $definition->setFactory($service['factory']); } } else { - $definition->setFactory(array($this->resolveServices($service['factory'][0]), $service['factory'][1])); + $definition->setFactory([$this->resolveServices($service['factory'][0]), $service['factory'][1]]); } } @@ -240,7 +240,7 @@ private function parseDefinition($id, $service, $file) if (is_string($service['configurator'])) { $definition->setConfigurator($service['configurator']); } else { - $definition->setConfigurator(array($this->resolveServices($service['configurator'][0]), $service['configurator'][1])); + $definition->setConfigurator([$this->resolveServices($service['configurator'][0]), $service['configurator'][1]]); } } @@ -252,10 +252,10 @@ private function parseDefinition($id, $service, $file) foreach ($service['calls'] as $call) { if (isset($call['method'])) { $method = $call['method']; - $args = isset($call['arguments']) ? $this->resolveServices($call['arguments']) : array(); + $args = isset($call['arguments']) ? $this->resolveServices($call['arguments']) : []; } else { $method = $call[0]; - $args = isset($call[1]) ? $this->resolveServices($call[1]) : array(); + $args = isset($call[1]) ? $this->resolveServices($call[1]) : []; } $definition->addMethodCall($method, $args); @@ -364,7 +364,7 @@ private function validate($content, $file) throw new InvalidArgumentException(sprintf('The service file "%s" is not valid. It should contain an array. Check your YAML syntax.', $file)); } - if ($invalid_keys = array_diff_key($content, array('parameters' => 1, 'services' => 1))) { + if ($invalid_keys = array_diff_key($content, ['parameters' => 1, 'services' => 1])) { throw new InvalidArgumentException(sprintf('The service file "%s" is not valid: it contains invalid keys %s. Services have to be added under "services" and Parameters under "parameters".', $file, $invalid_keys)); } @@ -381,7 +381,7 @@ private function validate($content, $file) private function resolveServices($value) { if (is_array($value)) { - $value = array_map(array($this, 'resolveServices'), $value); + $value = array_map([$this, 'resolveServices'], $value); } elseif (is_string($value) && 0 === strpos($value, '@=')) { // Not supported. //return new Expression(substr($value, 2));