Skip to content

Commit

Permalink
Merge pull request #119 from seboettg/feature/issue-111-php80-compati…
Browse files Browse the repository at this point in the history
…bility

Feature/issue 111 php80 compatibility
  • Loading branch information
seboettg authored May 6, 2022
2 parents afdfbfd + 6473008 commit 239e433
Show file tree
Hide file tree
Showing 380 changed files with 3,487 additions and 3,493 deletions.
11 changes: 4 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,17 @@
},
"require": {
"seboettg/collection": "^2.1",
"myclabs/php-enum": "^1.5",
"myclabs/php-enum": "^1.8",
"ext-simplexml": "*",
"ext-json": "*",
"php": ">=7.1"
"php": ">=7.3",
"ext-mbstring": "*"
},
"require-dev": {
"php-coveralls/php-coveralls": "^1",
"phpunit/phpunit": "^7.5",
"squizlabs/php_codesniffer": "^3.5",
"phpmd/phpmd": "^2.8"
"phpunit/phpunit": "^8.0"
},
"suggest": {
"ext-intl": "*",
"ext-mbstring": "*",
"symfony/polyfill-mbstring": "^1.10"
},
"scripts": {
Expand Down
1 change: 0 additions & 1 deletion src/Styles/AffixesTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ protected function initAffixesAttributes(SimpleXMLElement $node)
{
/** @var SimpleXMLElement $attribute */
foreach ($node->attributes() as $attribute) {
/** @var string $name */
$name = (string) $attribute->getName();
$value = (string) $attribute;

Expand Down
6 changes: 2 additions & 4 deletions src/Util/StringHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
namespace Seboettg\CiteProc\Util;

use Seboettg\CiteProc\CiteProc;
use Symfony\Polyfill\Mbstring\Mbstring;

/**
* Class StringHelper
Expand Down Expand Up @@ -53,7 +52,6 @@ class StringHelper
'ISO-8859-8',
'ISO-8859-9',
'ISO-8859-10',
'ISO-8859-11',
'ISO-8859-13',
'ISO-8859-14',
'ISO-8859-15',
Expand Down Expand Up @@ -138,9 +136,9 @@ public static function mb_ucfirst($string, $encoding = 'UTF-8')
$then = mb_substr($string, 1, $strlen - 1, $encoding);

/** @noinspection PhpInternalEntityUsedInspection */
$encoding = Mbstring::mb_detect_encoding($firstChar, self::ISO_ENCODINGS, true);
$encoding = mb_detect_encoding($firstChar, self::ISO_ENCODINGS, true);
return in_array($encoding, self::ISO_ENCODINGS) ?
Mbstring::mb_strtoupper($firstChar, $encoding).$then : $firstChar.$then;
mb_strtoupper($firstChar, $encoding).$then : $firstChar.$then;
}
// phpcs:disable
public static function mb_strrev($string)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,21 @@ citation
{
"author": [
{
"family": "Smith",
"family": "Smith",
"given": "John"
}
],
"id": "ITEM-1",
],
"id": "ITEM-1",
"issued": {
"date-parts": [
[
"2000",
"2",
"2000",
"2",
"15"
]
]
},
"title": "Book C",
},
"title": "Book C",
"type": "book"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,21 @@ John Doe. His Anonymous Life. 1965.
{
"author": [
{
"family": "Doe",
"family": "Doe",
"given": "John"
}
],
"id": "ITEM-1",
],
"id": "ITEM-1",
"issued": {
"date-parts": [
[
"1965",
"6",
"1965",
"6",
"1"
]
]
},
"title": "His Anonymous Life",
},
"title": "His Anonymous Life",
"type": "book"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,21 @@ citation
{
"author": [
{
"family": "Smith",
"family": "Smith",
"given": "John"
}
],
"id": "ITEM-1",
],
"id": "ITEM-1",
"issued": {
"date-parts": [
[
"2000",
"2",
"2000",
"2",
"15"
]
]
},
"title": "Book C",
},
"title": "Book C",
"type": "book"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,21 @@ citation
{
"author": [
{
"family": "Smith",
"family": "Smith",
"given": "John"
}
],
"id": "ITEM-1",
],
"id": "ITEM-1",
"issued": {
"date-parts": [
[
"2000",
"2",
"2000",
"2",
"15"
]
]
},
"title": "Book C",
},
"title": "Book C",
"type": "book"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ One. Two.
>>===== INPUT =====>>
[
{
"id": "ITEM-1",
"id": "ITEM-1",
"type": "book"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,91 +41,91 @@ Doe 1960; Roe 1970; Smith 1980; Brown 1990; Ichi 2000.
{
"author": [
{
"family": "Doe",
"family": "Doe",
"given": "John"
}
],
"id": "ITEM-1",
],
"id": "ITEM-1",
"issued": {
"date-parts": [
[
1960
]
]
},
"title": "Book A",
},
"title": "Book A",
"type": "book"
},
},
{
"author": [
{
"family": "Roe",
"family": "Roe",
"given": "Jane"
}
],
"id": "ITEM-2",
],
"id": "ITEM-2",
"issued": {
"date-parts": [
[
1970
]
]
},
"title": "Book B",
},
"title": "Book B",
"type": "book"
},
},
{
"author": [
{
"family": "Smith",
"family": "Smith",
"given": "John"
}
],
"id": "ITEM-3",
],
"id": "ITEM-3",
"issued": {
"date-parts": [
[
1980
]
]
},
"title": "Book C",
},
"title": "Book C",
"type": "book"
},
},
{
"author": [
{
"family": "Brown",
"family": "Brown",
"given": "Robert"
}
],
"id": "ITEM-4",
],
"id": "ITEM-4",
"issued": {
"date-parts": [
[
1990
]
]
},
"title": "Book D",
},
"title": "Book D",
"type": "book"
},
},
{
"author": [
{
"family": "Ichi",
"family": "Ichi",
"given": "Taro"
}
],
"id": "ITEM-5",
],
"id": "ITEM-5",
"issued": {
"date-parts": [
[
2000
]
]
},
"title": "Book E",
},
"title": "Book E",
"type": "book"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,33 +45,33 @@ Aalto+Blevins (editor); Colostomy (editor)+Dropsie (translator)
{
"author": [
{
"family": "Aalto",
"family": "Aalto",
"given": "Alan"
}
],
],
"editor": [
{
"family": "Blevins",
"family": "Blevins",
"given": "Butthead"
}
],
"id": "ITEM-1",
],
"id": "ITEM-1",
"type": "book"
},
},
{
"editor": [
{
"family": "Colostomy",
"family": "Colostomy",
"given": "Colin"
}
],
"id": "ITEM-2",
],
"id": "ITEM-2",
"translator": [
{
"family": "Dropsie",
"family": "Dropsie",
"given": "David"
}
],
],
"type": "book"
}
]
Expand Down
Loading

0 comments on commit 239e433

Please sign in to comment.