Skip to content

Commit

Permalink
Merge pull request #271 from phil-davis/cs-fixer-3.49
Browse files Browse the repository at this point in the history
chore: use php-cs-fixer 3.49
  • Loading branch information
phil-davis authored Mar 4, 2024
2 parents e95b341 + c01b1e2 commit 43cea9f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
}
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.38",
"friendsofphp/php-cs-fixer": "^3.51",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit" : "^9.6"
},
Expand Down
4 changes: 2 additions & 2 deletions lib/Deserializer/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
*
* @phpstan-return array<string, mixed>
*/
function keyValue(Reader $reader, string $namespace = null): array
function keyValue(Reader $reader, ?string $namespace = null): array
{
// If there's no children, we don't do anything.
if ($reader->isEmptyElement) {
Expand Down Expand Up @@ -148,7 +148,7 @@ function keyValue(Reader $reader, string $namespace = null): array
*
* @phpstan-return list<string>
*/
function enum(Reader $reader, string $namespace = null): array
function enum(Reader $reader, ?string $namespace = null): array
{
// If there's no children, we don't do anything.
if ($reader->isEmptyElement) {
Expand Down
2 changes: 1 addition & 1 deletion lib/LibXMLException.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class LibXMLException extends ParseException
*
* @param \LibXMLError[] $errors
*/
public function __construct(array $errors, int $code = 0, \Throwable $previousException = null)
public function __construct(array $errors, int $code = 0, ?\Throwable $previousException = null)
{
$this->errors = $errors;
parent::__construct($errors[0]->message.' on line '.$errors[0]->line.', column '.$errors[0]->column, $code, $previousException);
Expand Down
4 changes: 2 additions & 2 deletions lib/Reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function parse(): array
*
* @return array<int,array<string, mixed>>
*/
public function parseGetElements(array $elementMap = null): array
public function parseGetElements(?array $elementMap = null): array
{
$result = $this->parseInnerTree($elementMap);
if (!is_array($result)) {
Expand All @@ -132,7 +132,7 @@ public function parseGetElements(array $elementMap = null): array
*
* @return array<int,array<string, mixed>>|string|null
*/
public function parseInnerTree(array $elementMap = null)
public function parseInnerTree(?array $elementMap = null)
{
$text = null;
$elements = [];
Expand Down
8 changes: 4 additions & 4 deletions lib/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function getWriter(): Writer
*
* @throws ParseException
*/
public function parse($input, string $contextUri = null, string &$rootElementName = null)
public function parse($input, ?string $contextUri = null, ?string &$rootElementName = null)
{
if (is_resource($input)) {
// Unfortunately the XMLReader doesn't support streams. When it
Expand Down Expand Up @@ -151,7 +151,7 @@ public function parse($input, string $contextUri = null, string &$rootElementNam
*
* @throws ParseException
*/
public function expect($rootElementName, $input, string $contextUri = null)
public function expect($rootElementName, $input, ?string $contextUri = null)
{
if (is_resource($input)) {
// Unfortunately the XMLReader doesn't support streams. When it
Expand Down Expand Up @@ -200,7 +200,7 @@ public function expect($rootElementName, $input, string $contextUri = null)
*
* @param string|array<int|string, mixed>|object|XmlSerializable $value
*/
public function write(string $rootElementName, $value, string $contextUri = null): string
public function write(string $rootElementName, $value, ?string $contextUri = null): string
{
$w = $this->getWriter();
$w->openMemory();
Expand Down Expand Up @@ -263,7 +263,7 @@ public function mapValueObject(string $elementName, string $className): void
*
* @throws \InvalidArgumentException
*/
public function writeValueObject(object $object, string $contextUri = null): string
public function writeValueObject(object $object, ?string $contextUri = null): string
{
if (!isset($this->valueObjectMap[get_class($object)])) {
throw new \InvalidArgumentException('"'.get_class($object).'" is not a registered value object class. Register your class with mapValueObject.');
Expand Down
2 changes: 1 addition & 1 deletion tests/Sabre/Xml/Element/XmlFragmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function xmlProvider(): array
/**
* @dataProvider xmlProvider
*/
public function testSerialize(string $expectedFallback, string $input, string $expected = null): void
public function testSerialize(string $expectedFallback, string $input, ?string $expected = null): void
{
if (is_null($expected)) {
$expected = $expectedFallback;
Expand Down

0 comments on commit 43cea9f

Please sign in to comment.