From f7c452c866531d2bb6432989af477d0de2efa5f6 Mon Sep 17 00:00:00 2001 From: Samantha Nguyen Date: Tue, 11 Mar 2025 02:08:11 -0500 Subject: [PATCH] chore: cleanup --- .devcontainer/Dockerfile | 16 ---------- .devcontainer/devcontainer.json | 44 ---------------------------- .github/workflows/php.yml | 6 +++- .gitignore | 24 ++++++++++----- .phpcs.xml | 26 +++++----------- LICENSE | 2 +- README.md | 8 ++--- composer.json | 22 +++++--------- phpdoc.dist.xml | 2 +- phpunit.xml.dist | 21 ++++++------- tests/DataUrlParserExceptionTest.php | 2 +- tests/DataUrlParserTest.php | 2 +- 12 files changed, 56 insertions(+), 119 deletions(-) delete mode 100644 .devcontainer/Dockerfile delete mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index ec25cea..0000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/php/.devcontainer/base.Dockerfile - -# [Choice] PHP version (use -bullseye variants on local arm64/Apple Silicon): 8, 8.1, 8.0, 7, 7.4, 7.3, 8-bullseye, 8.1-bullseye, 8.0-bullseye, 7-bullseye, 7.4-bullseye, 7.3-bullseye, 8-buster, 8.1-buster, 8.0-buster, 7-buster, 7.4-buster -ARG VARIANT="8.1-apache-bullseye" -FROM mcr.microsoft.com/vscode/devcontainers/php:0-${VARIANT} - -# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10 -ARG NODE_VERSION="none" -RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi - -# [Optional] Uncomment this section to install additional OS packages. -# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ -# && apt-get -y install --no-install-recommends - -# [Optional] Uncomment this line to install global node packages. -# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index cf0664d..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,44 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/php -{ - "name": "PHP", - "build": { - "dockerfile": "Dockerfile", - "args": { - // Update VARIANT to pick a PHP version: 8, 8.1, 8.0, 7, 7.4 - // Append -bullseye or -buster to pin to an OS version. - // Use -bullseye variants on local on arm64/Apple Silicon. - "VARIANT": "8", - "NODE_VERSION": "16" - } - }, - - // Set *default* container specific settings.json values on container create. - "settings": { - "php.validate.executablePath": "/usr/local/bin/php" - }, - - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "aaron-bond.better-comments", - "bmewburn.vscode-intelephense-client", - "felixfbecker.php-debug", - "ikappas.composer", - "lextudio.restructuredtext", - "mrmlnc.vscode-apache", - "neilbrayfield.php-docblocker" - ], - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - "forwardPorts": [8080], - - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html" - - // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "vscode", - "features": { - "git": "latest", - "github-cli": "latest" - } -} diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 9d2ff32..a218ef1 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -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 @@ -44,4 +48,4 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} verbose: true - files: coverage.xml + files: .phpunit/coverage.xml diff --git a/.gitignore b/.gitignore index b5f71ec..b31e3c6 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/.phpcs.xml b/.phpcs.xml index ebe7ec1..f8cf718 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -1,23 +1,15 @@ - - - - 0 + + + + + + - - 0 - - - - 0 - - - 0 - - - + + /tests/* @@ -25,8 +17,6 @@ . - /tests/* - .history diff --git a/LICENSE b/LICENSE index 2e72e59..d3955d3 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Samantha +Copyright (c) 2021 Samantha Nguyen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 8efa810..ba78f43 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/composer.json b/composer.json index 0ff959b..84567dc 100644 --- a/composer.json +++ b/composer.json @@ -13,12 +13,6 @@ "data uri", "rfc 2397" ], - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/neoncitylights" - } - ], "autoload": { "psr-4": { "Neoncitylights\\DataUrl\\": "src/" @@ -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" diff --git a/phpdoc.dist.xml b/phpdoc.dist.xml index bb43e4f..97b8d54 100644 --- a/phpdoc.dist.xml +++ b/phpdoc.dist.xml @@ -3,7 +3,7 @@ configVersion="3" xmlns="https://www.phpdoc.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - neoncitylights/data-url + DataUrl docs/build docs/cache diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 71853fb..ff27b96 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,28 +1,29 @@ + + + ./src + + ./tests - - - ./src - - diff --git a/tests/DataUrlParserExceptionTest.php b/tests/DataUrlParserExceptionTest.php index 9324d8a..39bf096 100644 --- a/tests/DataUrlParserExceptionTest.php +++ b/tests/DataUrlParserExceptionTest.php @@ -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.', '' ); } } diff --git a/tests/DataUrlParserTest.php b/tests/DataUrlParserTest.php index 8e61738..19ae3f3 100644 --- a/tests/DataUrlParserTest.php +++ b/tests/DataUrlParserTest.php @@ -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" )]