Skip to content

Commit

Permalink
major overhaul (read is ok)
Browse files Browse the repository at this point in the history
  • Loading branch information
ewilan-riviere committed Sep 30, 2024
1 parent 1f313ce commit 22d19fd
Show file tree
Hide file tree
Showing 45 changed files with 2,975 additions and 3,528 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/phpstan-php-code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: PHPStan PHP code issues

on: [push]

jobs:
build-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: php-actions/composer@v6
- uses: php-actions/phpstan@v3
with:
path: src/
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ psalm.xml
vendor
.php-cs-fixer.cache
.DS_Store
.phpunit.cache
version-draft.md
62 changes: 27 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,41 +413,33 @@ You want to add a format? [See FAQ](#faq)

`Audio::class` convert some properties to be more readable.

| ID3 type | Original | New property |
| :-------------: | :---------------------: | :------------------: |
| `id3v2` | `band` | `albumArtist` |
| `id3v2` | `track_number` | `trackNumber` |
| `id3v2` | `part_of_a_set` | `discNumber` |
| `id3v2` | `part_of_a_compilation` | `isCompilation` |
| `quicktime` | `track_number` | `trackNumber` |
| `quicktime` | `disc_number` | `discNumber` |
| `quicktime` | `compilation` | `isCompilation` |
| `quicktime` | `creation_date` | `creationDate` |
| `quicktime` | `album_artist` | `albumArtist` |
| `quicktime` | `encoded_by` | `encodingBy` |
| `quicktime` | `encoding_tool` | `encoding` |
| `quicktime` | `description_long` | `podcastDescription` |
| `asf` | `albumartist` | `albumArtist` |
| `asf` | `partofset` | `discNumber` |
| `asf` | `track_number` | `trackNumber` |
| `asf` | `encodingsettings` | `encoding` |
| `vorbiscomment` | `encoder` | `encoding` |
| `vorbiscomment` | `albumartist` | `albumArtist` |
| `vorbiscomment` | `discnumber` | `discNumber` |
| `vorbiscomment` | `compilation` | `isCompilation` |
| `vorbiscomment` | `tracknumber` | `trackNumber` |
| `matroska` | `album_artist` | `albumArtist` |
| `matroska` | `disc` | `discNumber` |
| `matroska` | `part_number` | `trackNumber` |
| `matroska` | `date` | `year` |
| `matroska` | `compilation` | `isCompilation` |
| `matroska` | `encoder` | `encoding` |
| `ape` | `album_artist` | `albumArtist` |
| `ape` | `disc` | `discNumber` |
| `ape` | `compilation` | `isCompilation` |
| `ape` | `track` | `trackNumber` |
| `ape` | `date` | `year` |
| `ape` | `encoder` | `encoding` |
| ID3 type | Original | New property |
| :-------------: | :---------------------: | :--------------: |
| `id3v2` | `band` | `album_artist` |
| `id3v2` | `part_of_a_set` | `disc_number` |
| `id3v2` | `part_of_a_compilation` | `is_compilation` |
| `quicktime` | `compilation` | `is_compilation` |
| `quicktime` | `encoded_by` | `encoding_by` |
| `quicktime` | `encoding_tool` | `encoding` |
| `quicktime` | `description_long` | `synopsis` |
| `asf` | `albumartist` | `album_artist` |
| `asf` | `partofset` | `disc_number` |
| `asf` | `encodingsettings` | `encoding` |
| `vorbiscomment` | `encoder` | `encoding` |
| `vorbiscomment` | `albumartist` | `album_artist` |
| `vorbiscomment` | `discnumber` | `disc_number` |
| `vorbiscomment` | `compilation` | `is_compilation` |
| `vorbiscomment` | `tracknumber` | `track_number` |
| `matroska` | `disc` | `disc_number` |
| `matroska` | `part_number` | `track_number` |
| `matroska` | `date` | `year` |
| `matroska` | `compilation` | `is_compilation` |
| `matroska` | `encoder` | `encoding` |
| `ape` | `disc` | `disc_number` |
| `ape` | `compilation` | `is_compilation` |
| `ape` | `track` | `track_number` |
| `ape` | `date` | `year` |
| `ape` | `encoder` | `encoding` |

## Testing

Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kiwilan/php-audio",
"description": "PHP package to parse and update audio files metadata, with `JamesHeinrich/getID3`.",
"version": "3.0.08",
"version": "4.0.0",
"keywords": [
"audio",
"php",
Expand Down Expand Up @@ -41,10 +41,11 @@
],
"require": {
"php": "^8.1",
"james-heinrich/getid3": "^1.9"
"james-heinrich/getid3": "^v1.9.22"
},
"require-dev": {
"pestphp/pest": "^1.20",
"pestphp/pest": "^2.0",
"phpstan/phpstan": "^1.12",
"laravel/pint": "^1.2",
"spatie/ray": "^1.28"
},
Expand Down
8 changes: 8 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
parameters:
tmpDir: public/build/.phpstan

paths:
- src

# The level 9 is the highest level
level: 5
27 changes: 13 additions & 14 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
executionOrder="random"
failOnWarning="true"
failOnRisky="true"
failOnEmptyTestSuite="true"
beStrictAboutOutputDuringTests="true"
verbose="true"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
>
<testsuites>
<testsuite name="Kiwilan Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage>
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/coverage" />
<text outputFile="build/coverage.txt" />
<clover outputFile="build/logs/clover.xml" />
</report>
</coverage>
<logging>
<junit outputFile="build/report.junit.xml"/>
<junit outputFile="build/report.junit.xml" />
</logging>
</phpunit>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
Loading

0 comments on commit 22d19fd

Please sign in to comment.