-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce breaking reader/writer PHP 8.4 changes and new stream funct…
…ions
- Loading branch information
Showing
26 changed files
with
943 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace VeeWee\Xml\Reader\Loader; | ||
|
||
use Closure; | ||
use XMLReader; | ||
use function VeeWee\Xml\ErrorHandling\disallow_issues; | ||
|
||
/** | ||
* @param resource $stream | ||
* @return Closure(): XMLReader | ||
*/ | ||
function xml_stream_loader(mixed $stream, ?string $encoding = null, int $flags = 0, ?string $documentUri = null): Closure | ||
{ | ||
return static fn (): XMLReader => disallow_issues( | ||
static fn (): XMLReader => XMLReader::fromStream($stream, $encoding, $flags, $documentUri) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace VeeWee\Xml\Writer\Applicative; | ||
|
||
use XMLWriter; | ||
|
||
interface Applicative | ||
{ | ||
public function __invoke(XMLWriter $writer): mixed; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace VeeWee\Xml\Writer\Applicative; | ||
|
||
use Closure; | ||
use XMLWriter; | ||
|
||
/** | ||
* @param bool $empty - Whether to empty the buffer or not. | ||
* | ||
* @return Closure(XMLWriter): mixed | ||
*/ | ||
function flush(bool $empty = true): Closure | ||
{ | ||
return static function (XMLWriter $writer) use ($empty): void { | ||
$writer->flush($empty); | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,5 @@ | |
|
||
interface Opener | ||
{ | ||
public function __invoke(XMLWriter $writer): bool; | ||
public function __invoke(): XMLWriter; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace VeeWee\Xml\Writer\Opener; | ||
|
||
use Closure; | ||
use XMLWriter; | ||
use function VeeWee\Xml\ErrorHandling\disallow_issues; | ||
|
||
/** | ||
* @param resource $stream | ||
* | ||
* @return Closure(): XMLWriter | ||
*/ | ||
function xml_stream_opener(mixed $stream): Closure | ||
{ | ||
return static fn (): XMLWriter => disallow_issues(static function () use ($stream) : XMLWriter { | ||
return XMLWriter::toStream($stream); | ||
}); | ||
} |
Oops, something went wrong.