Skip to content

Commit

Permalink
bump to php 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
alextartan committed Jan 20, 2020
1 parent 32a6ae9 commit 4ffddc1
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 47 deletions.
22 changes: 13 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,45 @@
sudo: false

language: php

cache:
directories:
- "$HOME/.composer/cache"

matrix:
include:
- php: 7.2
env:
- CS_CHECK=true
- TEST_COVERAGE=true
- PHPSTAN=true
- php: 7.3
env:
- CS_CHECK=false
- TEST_COVERAGE=false
- PHPSTAN=false
- php: nightly
- php: 7.4
env:
- CS_CHECK=false
- TEST_COVERAGE=false
- PHPSTAN=false
- CS_CHECK=true
- TEST_COVERAGE=true
- PHPSTAN=true

before_install:
- if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
- travis_retry composer self-update

install:
- travis_retry composer install --no-interaction --ignore-platform-reqs
- stty cols 120
- export COLUMNS=120
- composer show

script:
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage && composer test-infection ; else composer test ; fi
- if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi
- if [[ $PHPSTAN == 'true' ]]; then composer phpstan ; fi

after_script:
- if [[ $TEST_COVERAGE == 'true' ]]; then composer upload-coverage ; fi

notifications:
email: false

env:
global:
- secure: rDoDznHaf+wBuc2bk4su3iANgITVwZ/zC0qbOoS29fmIYWekCuvCg7vSFqMhVMUPzRhupeXv1ZuYlDvCx3cRUexmrYuYv3UpJq/UfWoVkoGwvdYYdFZWw/g9RHTTB4vAdhEDpIpivOfrLIIp4WP191Y0RZTVXYFE/ZnfdjFvj+X7PPbKtVLyaS3uIWqU9XrFMfhWU7xyv9Yhfky40GZqXoEgd0k56lsp2Nyo4LDCc9YGBuAqtIvtyBVk8Vzn+Xg14YpsH4yco6wrOoWe7rBjlK+zZCc9RCy4WStJOk3rXDuMHqwAPJ3DeoiaqlDKdJJT8mf2BGYhgFbwhTLL/PYYd4kw9IBj9FaXR/CFwD5FR6mTij1p84cgEoKCl8/+CDVtK0DKZnwy4gtIQWyjSCI7hkjvZcKMvTvH7HOjxpAEVerESzzm1MzPo7Lkv1j+NbjYQPCsiUKdvrN4Tsuvc1IKds79Hrvj6xrkppuoP5UaU6n6rRunkxaRfAAcQXYXiGdF4hq3MRVd0TcbtNh6Si0NeSd5JePL/4ogl14VlMyFHPcKabWcwa4Un32z0YpLH6CjSDz3fHWUzE9BhcKfZk4hb7+tmnjabMeX6f56Cfel1vgwbIdCYDz0jCbf+maCiKKvnKa+/7+W7ON7uoKhQY+jt1YhEJ8b7u0UiIydt0BlG7I=
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
],
"require": {
"php": ">=7.2",
"php": ">=7.4",
"ext-dom": "*",
"ext-libxml": "*"
},
Expand Down
6 changes: 2 additions & 4 deletions src/ArrayToXml/ArrayToXml.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@
*/
final class ArrayToXml
{
/** @var DOMDocument */
private $xml;
private DOMDocument $xml;

/** @var ArrayToXmlConfig */
private $config;
private ArrayToXmlConfig $config;

public function __construct(array $config = [])
{
Expand Down
18 changes: 6 additions & 12 deletions src/ArrayToXml/ArrayToXmlConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,17 @@ final class ArrayToXmlConfig
'formatOutput' => false,
];

/** @var string */
private $version;
private string $version;

/** @var string */
private $encoding;
private string $encoding;

/** @var string */
private $attributesKey;
private string $attributesKey;

/** @var string */
private $cdataKey;
private string $cdataKey;

/** @var string */
private $valueKey;
private string $valueKey;

/** @var bool */
private $formatOutput;
private bool $formatOutput;

private function __construct(
string $version,
Expand Down
12 changes: 5 additions & 7 deletions src/ArrayToXml/XmlToArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,12 @@ final class XmlToArray
/** The string that separates the namespace attribute from the prefix for the namespace*/
private const ATTRIBUTE_NAMESPACE_SEPARATOR = ':';

/** @var XmlToArrayConfig */
private $config;
private XmlToArrayConfig $config;

/** @var DOMDocument */
private $xml;
private DOMDocument $xml;

/** @var array The working list of XML namespaces */
private $namespaces = [];
/** @var string[] The working list of XML namespaces */
private array $namespaces = [];

public function __construct(array $config = [])
{
Expand Down Expand Up @@ -114,7 +112,7 @@ private function extractArray(): array

// Add namespace information to the root node
foreach ($this->namespaces as $uri => $prefix) {
if ((string)$prefix !== '') {
if ($prefix !== '') {
$prefix = self::ATTRIBUTE_NAMESPACE_SEPARATOR . $prefix;
}
$array[$docNodeName][$attributesKey][self::ATTRIBUTE_NAMESPACE . $prefix] = $uri;
Expand Down
21 changes: 7 additions & 14 deletions src/ArrayToXml/XmlToArrayConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,19 @@ final class XmlToArrayConfig
'forceOneElementArray' => false,
];

/** @var string */
private $version;
private string $version;

/** @var string */
private $encoding;
private string $encoding;

/** @var string */
private $attributesKey;
private string $attributesKey;

/** @var string */
private $cdataKey;
private string $cdataKey;

/** @var string */
private $valueKey;
private string $valueKey;

/** @var bool */
private $useNamespaces;
private bool $useNamespaces;

/** @var bool */
private $forceOneElementArray;
private bool $forceOneElementArray;

private function __construct(
string $version,
Expand Down

0 comments on commit 4ffddc1

Please sign in to comment.