Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ spec/ export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.scrutinizer.yml export-ignore
.travis.yml export-ignore
CONTRIBUTING.md export-ignore
phpspec.yml.ci export-ignore
phpspec.yml.dist export-ignore
Comment on lines 5 to 6
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 5
- package-ecosystem: composer
directory: /
schedule:
interval: monthly
open-pull-requests-limit: 5
versioning-strategy: widen
60 changes: 60 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Checks

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

permissions:
contents: read

jobs:
test:
strategy:
fail-fast: false
matrix:
php-versions: [ '8.2', '8.3', '8.4', '8.5' ]

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
tools: composer:v2

- name: Validate Composer metadata
run: |
if [ -f composer.lock ]; then
composer validate --strict --no-interaction
else
composer validate --strict --no-check-lock --no-interaction
fi

- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"

- name: Cache Composer packages
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php-versions }}-${{ hashFiles('**/composer.json', '**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php-versions }}-

- name: Install dependencies
run: |
if [ -f composer.lock ]; then
composer install --prefer-dist --no-progress --no-interaction
else
composer update --prefer-dist --no-progress --no-interaction
fi

- name: Run phpspec
run: vendor/bin/phpspec run --config phpspec.yml.dist
7 changes: 0 additions & 7 deletions .scrutinizer.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

29 changes: 6 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,27 @@
# portphp/xml-adapter
# portphp/xml

[![Latest Version](https://img.shields.io/github/release/portphp/xml.svg?style=flat-square)](https://github.com/portphp/xml/releases)
[![Build Status](https://travis-ci.org/portphp/xml.svg)](https://travis-ci.org/portphp/xml)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/portphp/xml/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/portphp/xml/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/portphp/xml/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/portphp/xml/?branch=master)
[![CI](https://github.com/portphp/xml/actions/workflows/checks.yml/badge.svg?branch=master)](https://github.com/portphp/xml/actions/workflows/checks.yml)
[![PHP Version](https://img.shields.io/packagist/php-v/portphp/xml.svg?style=flat-square)](https://packagist.org/packages/portphp/xml)

**Requirements:** PHP ^8.2 (tested on 8.2–8.5). Requires `portphp/portphp` ^2.0.

XML writer for Port.

## Installation

Open a command console, enter your project directory and execute the
following command to download the latest stable version of this package:

```bash
$ composer require portphp/xml
```

This command requires you to have Composer installed globally, as explained
in the [installation chapter](https://getcomposer.org/doc/00-intro.md)
of the Composer documentation.

## Documentation

Documentation is available at https://docs.portphp.org.
Documentation is available at https://portphp.readthedocs.io.

## Issues and feature requests

Please report issues and request features at https://github.com/portphp/portphp/issues.

## Contributing

Contributions are very welcome. Please see [CONTRIBUTING.md](CONTRIBUTING.md) for
details. Thanks to [everyone who has contributed](https://github.com/portphp/xml/graphs/contributors)
already.

## Security

If you discover any security-related issues, please contact us at
security@portphp.org.sec

## License

This package is licensed under the [MIT license](LICENSE).
6 changes: 6 additions & 0 deletions UPGRADE-2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Upgrade from 1.x to 2.0

- Minimum PHP is **8.2** (`^8.2`).
- Requires `portphp/portphp` **^2.0**.
- Writer methods use `: void` return types from the core interfaces.
- CI is GitHub Actions (Travis/Scrutinizer removed).
15 changes: 7 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,26 @@
},
{
"name": "Community contributors",
"homepage": "https://github.com/portphp/xml-adapter/graphs/contributors"
"homepage": "https://github.com/portphp/xml/graphs/contributors"
}
],
"support": {
"issues": "https://github.com/portphp/portphp/issues",
"source": "https://github.com/portphp/xml-adapter",
"docs": "https://portphp.readthedocs.org"
"source": "https://github.com/portphp/xml",
"docs": "https://portphp.readthedocs.io"
},
"require": {
"php": ">=5.4.0",
"portphp/portphp": "^1.0.0",
"ext-xmlwriter": "*"
"php": "^8.2",
"ext-xmlwriter": "*",
"portphp/portphp": "^2.0"
},
"autoload": {
"psr-4": {
"Port\\Xml\\": "src/"
}
},
"require-dev": {
"phpspec/phpspec": "^2.2",
"henrikbjorn/phpspec-code-coverage" : "^1.0"
"phpspec/phpspec": "^8.0"
},
"extra": {
"branch-alias": {
Expand Down
10 changes: 0 additions & 10 deletions phpspec.yml.ci

This file was deleted.

6 changes: 3 additions & 3 deletions phpspec.yml.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
suites:
xml_suite:
namespace: Port\Xml
psr4_prefix: Port\Xml
default:
namespace: Port\Xml
psr4_prefix: Port\Xml
formatter.name: pretty
8 changes: 4 additions & 4 deletions src/XmlWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function __construct(
/**
* {@inheritdoc}
*/
public function prepare()
public function prepare(): void
{
$this->xmlWriter->openUri($this->file);
$this->xmlWriter->startDocument($this->version, $this->encoding);
Expand All @@ -74,7 +74,7 @@ public function prepare()
/**
* {@inheritdoc}
*/
public function writeItem(array $item)
public function writeItem(array $item): void
{
$this->xmlWriter->startElement($this->itemElement);

Expand All @@ -88,7 +88,7 @@ public function writeItem(array $item)
/**
* {@inheritdoc}
*/
public function finish()
public function finish(): void
{
$this->xmlWriter->endElement();
$this->xmlWriter->endDocument();
Expand All @@ -98,7 +98,7 @@ public function finish()
/**
* {@inheritdoc}
*/
public function flush()
public function flush(): void
{
$this->xmlWriter->flush();
}
Expand Down
Loading