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
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
7 changes: 3 additions & 4 deletions .phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<?xml version="1.0"?>
<ruleset>
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
<exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
<exclude name="MediaWiki.Commenting.PropertyDocumentation.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="Squiz.Commenting.FunctionComment.IncorrectTypeHint" />
<rule ref="Generic.Files.LineLength">
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) 2020 Samantha Nguyen
Copyright (c) 2020 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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

[packagist-badge]: https://img.shields.io/packagist/v/neoncitylights/media-type?style=flat-square
[packagist-url]: https://packagist.org/packages/neoncitylights/media-type
[license-badge]: https://img.shields.io/github/license/neoncitylights/php-media-type?style=flat-square
[license-badge]: https://img.shields.io/badge/License-MIT-blue?style=flat-square
[license-url]: #license
[build-badge]: https://img.shields.io/github/actions/workflow/status/neoncitylights/php-media-type/.github%2Fworkflows%2Fphp.yml?style=flat-square
[build-url]: https://github.com/neoncitylights/php-media-type/actions/workflows/php.yml
[codecov-badge]: https://img.shields.io/codecov/c/github/neoncitylights/php-media-type?style=flat-square
[codecov-url]: https://codecov.io/gh/neoncitylights/php-media-type
[build-badge]: https://img.shields.io/github/actions/workflow/status/php-lights/media-type/.github%2Fworkflows%2Fphp.yml?style=flat-square
[build-url]: https://github.com/php-lights/media-type/actions/workflows/php.yml
[codecov-badge]: https://img.shields.io/codecov/c/github/php-lights/media-type?style=flat-square
[codecov-url]: https://codecov.io/gh/php-lights/media-type

**MediaType** is a PHP library for parsing and serializing MIME types, also known as IANA media types.

Expand Down
35 changes: 18 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@
"name": "neoncitylights/media-type",
"authors": [
{
"name": "Samantha Nguyen"
"name": "Samantha Nguyen",
"email": "contact@samanthanguyen.me"
}
],
"license": "MIT",
"description": "Allows working with IANA media types as entities in PHP",
"keywords": [
"iana",
"media type",
"mime type",
"rfc 2397"
],
"autoload": {
"psr-4": {
"Neoncitylights\\MediaType\\": "src/"
Expand All @@ -17,12 +24,6 @@
"Neoncitylights\\MediaType\\Tests\\": "tests/"
}
},
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/neoncitylights"
}
],
"require": {
"php": ">=8.2",
"wikimedia/assert": "^0.5.1",
Expand All @@ -36,26 +37,26 @@
"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"
],
"docs": "phpdoc",
"migrate": "phpunit --migrate-configuration"
"docs": "phpdoc"
},
"config": {
"allow-plugins": {
"composer/package-versions-deprecated": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
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/media-type</title>
<title>MediaType</title>
<paths>
<output>docs/build</output>
<cache>docs/cache</cache>
Expand Down
31 changes: 16 additions & 15 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
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="vendor/autoload.php"
colors="true"
executionOrder="depends,defects"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd"

cacheDirectory=".phpunit/cache/"
cacheResult="true"
backupGlobals="false"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTestsThatDoNotTestAnything="true"
colors="true"
executionOrder="depends,defects"
failOnWarning="true"
stopOnFailure="false"
cacheDirectory=".phpunit.cache"
requireCoverageMetadata="true">
stopOnFailure="false">
<php>
<ini name="memory_limit" value="512M"/>
<ini name="memory_limit" value="512M" />
</php>
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./src</directory>
<directory suffix=".php">./src</directory>
</include>
</source>
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
</phpunit>