Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 0 additions & 16 deletions .devcontainer/Dockerfile

This file was deleted.

44 changes: 0 additions & 44 deletions .devcontainer/devcontainer.json

This file was deleted.

6 changes: 5 additions & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
pull_request:
branches: [ main ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -44,4 +48,4 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
files: coverage.xml
files: .phpunit/coverage.xml
24 changes: 16 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,31 @@ vendor/
# NPM
node_modules/

# Visual Studio Code extensions
# Local History (xyz.local-history): https://marketplace.visualstudio.com/items?itemName=xyz.local-history
.history

# user-configured files
# PHPUnit
.phpunit/
phpunit.xml
.phpunit.xml
.phpunit.cache
.phpunit.result.cache

## PHPUnit code coverage
coverage
coverage.*
clover.xml
crap4j.xml
html-coverage/
coverage.php
coverage.txt
xml-coverage/

# phpDocumentor
.phpdoc
phpdoc.xml
docs/build/
docs/cache/

# code coverage
coverage
coverage.*
# PHPStorm
.idea

# PHPActor LSP
.phpactor.json
26 changes: 8 additions & 18 deletions .phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@
<?xml version="1.0"?>
<ruleset>
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki" />
<!-- don't need to document typed return values -->
<rule ref="MediaWiki.Commenting.FunctionComment.MissingReturn">
<severity>0</severity>
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
<exclude name="MediaWiki.Commenting.MissingCovers.MissingCovers" />
<exclude name="MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPrivate" />
</rule>
<rule ref="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic">
<severity>0</severity>
</rule>
<!-- don't need to document private members -->
<rule ref="MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate">
<severity>0</severity>
</rule>
<rule ref="MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPrivate">
<severity>0</severity>
</rule>

<rule ref="Squiz.Commenting.FunctionComment.IncorrectTypeHint"/>
<rule ref="Squiz.Commenting.FunctionComment.IncorrectTypeHint" />
<rule ref="Generic.Files.LineLength">
<exclude-pattern>/tests/*</exclude-pattern>
<properties>
<!-- inherited line limit from MediaWiki is 100; make it at least 120 -->
<property name="lineLimit" value="120" />
</properties>
</rule>

<file>.</file>
<exclude-pattern>/tests/*</exclude-pattern>
<exclude-pattern>.history</exclude-pattern>
<arg name="bootstrap" value="./vendor/mediawiki/mediawiki-codesniffer/utils/bootstrap-ci.php" />
<arg name="extensions" value="php" />
<arg name="encoding" value="UTF-8" />
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Samantha
Copyright (c) 2021 Samantha Nguyen <contact@samanthanguyen.me>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
[packagist-url]: https://packagist.org/packages/neoncitylights/data-url
[license-badge]: https://img.shields.io/badge/License-MIT-blue?style=flat-square
[license-url]: #license
[ci-badge]: https://img.shields.io/github/actions/workflow/status/neoncitylights/php-data-url/.github/workflows/php.yml?style=flat-square
[ci-url]: https://github.com/neoncitylights/php-data-url/actions/workflows/php.yml
[codecov-badge]: https://img.shields.io/codecov/c/github/neoncitylights/php-data-url?style=flat-square
[codecov-url]: https://app.codecov.io/gh/neoncitylights/php-data-url
[ci-badge]: https://img.shields.io/github/actions/workflow/status/php-lights/php-data-url/.github/workflows/php.yml?style=flat-square
[ci-url]: https://github.com/php-lights/php-data-url/actions/workflows/php.yml
[codecov-badge]: https://img.shields.io/codecov/c/github/php-lights/data-url?style=flat-square
[codecov-url]: https://app.codecov.io/gh/php-lights/data-url

A small PHP library for dealing with data URLs, which contain a media type and an encoded base64 string.

Expand Down
22 changes: 8 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
"data uri",
"rfc 2397"
],
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/neoncitylights"
}
],
"autoload": {
"psr-4": {
"Neoncitylights\\DataUrl\\": "src/"
Expand All @@ -41,17 +35,17 @@
"phpunit/phpunit": "11.5.6"
},
"scripts": {
"lint": "parallel-lint . --exclude vendor --exclude node_modules",
"phpcs": "phpcs -p -s",
"test:phpunit-clover": "phpunit tests --coverage-clover coverage.xml",
"test:phpunit-xml": "phpunit tests --coverage-xml coverage",
"test:phpunit-html": "phpunit tests --coverage-html coverage",
"test": [
"@lint",
"@phpcs",
"@test:phpunit-clover",
"minus-x check ."
"@phpunit:xml",
"minus-x check .",
"@phpcs"
],
"lint": "parallel-lint . --exclude vendor --exclude node_modules",
"phpcs": "phpcs -p -s",
"phpunit": "phpunit tests",
"phpunit:xml": "@phpunit --coverage-clover .phpunit/coverage.xml",
"phpunit:html": "@phpunit --coverage-html .phpunit/html/",
"fix": [
"minus-x fix .",
"phpcbf"
Expand Down
2 changes: 1 addition & 1 deletion phpdoc.dist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
configVersion="3"
xmlns="https://www.phpdoc.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<title>neoncitylights/data-url</title>
<title>DataUrl</title>
<paths>
<output>docs/build</output>
<cache>docs/cache</cache>
Expand Down
21 changes: 11 additions & 10 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap="vendor/autoload.php"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheDirectory=".phpunit.cache"

cacheDirectory=".phpunit/cache/"
cacheResult="true"
colors="true"
executionOrder="depends,defects"
backupGlobals="false"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTestsThatDoNotTestAnything="true"
colors="true"
executionOrder="depends,defects"
failOnWarning="true"
stopOnFailure="false">
<php>
<ini name="memory_limit" value="512M" />
</php>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<source ignoreIndirectDeprecations="true" restrictNotices="true" restrictWarnings="true">
<include>
<directory>./src</directory>
</include>
</source>
</phpunit>
2 changes: 1 addition & 1 deletion tests/DataUrlParserExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ class DataUrlParserExceptionTest extends TestCase {
public function testConstructor(): void {
$this->expectException( DataUrlParserException::class );
throw new DataUrlParserException(
'A valid data URL must not be an empty string.', '');
'A valid data URL must not be an empty string.', '' );
}
}
2 changes: 1 addition & 1 deletion tests/DataUrlParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class DataUrlParserTest extends TestCase {
#[DataProvider( "provideInvalidDataUrls" )]
public function testParseOrNull( string $invalidDataUrl ): void {
$parser = new DataUrlParser( new MediaTypeParser() );
$this->assertNull($parser->parseOrNull($invalidDataUrl));
$this->assertNull( $parser->parseOrNull( $invalidDataUrl ) );
}

#[DataProvider( "provideValidTextBasedDataUrls" )]
Expand Down