Skip to content

Commit

Permalink
add ecs
Browse files Browse the repository at this point in the history
  • Loading branch information
mhor committed Dec 8, 2020
1 parent f84eaf9 commit d89bb8a
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 20 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/code_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,17 @@ jobs:
- run: composer install
- run: composer require --no-interaction --prefer-source symfony/process:~5.0 symfony/filesystem:~5.0
- run: vendor/bin/phpunit
ecs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
# see https://github.com/shivammathur/setup-php
- uses: shivammathur/setup-php@v1
with:
php-version: 7.3
coverage: none

- run: composer install --no-progress
- run: require symplify/easy-coding-standard --dev
- run: vendor/bin/ecs check --ansi
24 changes: 24 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

use PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer;
use PhpCsFixer\Fixer\Operator\ConcatSpaceFixer;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\EasyCodingStandard\ValueObject\Option;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

return static function (ContainerConfigurator $containerConfigurator): void {
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::PATHS, [__DIR__.'/src', __DIR__.'/test']);
$parameters->set(Option::SETS, [
SetList::PSR_12,
]);

$services = $containerConfigurator->services();
$services->set(ConcatSpaceFixer::class)->call('configure', [[
'spacing' => 'none',
]]);

$services->set(BinaryOperatorSpacesFixer::class)->call('configure', [[
'align_double_arrow' => true,
]]);
};
14 changes: 7 additions & 7 deletions src/Container/MediaInfoContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ class MediaInfoContainer implements \JsonSerializable
{
use DumpTrait;

const GENERAL_CLASS = 'Mhor\MediaInfo\Type\General';
const AUDIO_CLASS = 'Mhor\MediaInfo\Type\Audio';
const IMAGE_CLASS = 'Mhor\MediaInfo\Type\Image';
const VIDEO_CLASS = 'Mhor\MediaInfo\Type\Video';
const SUBTITLE_CLASS = 'Mhor\MediaInfo\Type\Subtitle';
const MENU_CLASS = 'Mhor\MediaInfo\Type\Menu';
const OTHER_CLASS = 'Mhor\MediaInfo\Type\Other';
public const GENERAL_CLASS = 'Mhor\MediaInfo\Type\General';
public const AUDIO_CLASS = 'Mhor\MediaInfo\Type\Audio';
public const IMAGE_CLASS = 'Mhor\MediaInfo\Type\Image';
public const VIDEO_CLASS = 'Mhor\MediaInfo\Type\Video';
public const SUBTITLE_CLASS = 'Mhor\MediaInfo\Type\Subtitle';
public const MENU_CLASS = 'Mhor\MediaInfo\Type\Menu';
public const OTHER_CLASS = 'Mhor\MediaInfo\Type\Other';

/**
* @var string
Expand Down
14 changes: 7 additions & 7 deletions src/Factory/TypeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

class TypeFactory
{
const AUDIO = 'Audio';
const IMAGE = 'Image';
const GENERAL = 'General';
const VIDEO = 'Video';
const SUBTITLE = 'Text';
const MENU = 'Menu';
const OTHER = 'Other';
public const AUDIO = 'Audio';
public const IMAGE = 'Image';
public const GENERAL = 'General';
public const VIDEO = 'Video';
public const SUBTITLE = 'Text';
public const MENU = 'Menu';
public const OTHER = 'Other';

/**
* @param string $type
Expand Down
12 changes: 6 additions & 6 deletions src/Runner/MediaInfoCommandRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

class MediaInfoCommandRunner
{
const MEDIAINFO_COMMAND = 'mediainfo';
const MEDIAINFO_OLDXML_OUTPUT_ARGUMENT = '--OUTPUT=OLDXML';
const MEDIAINFO_XML_OUTPUT_ARGUMENT = '--OUTPUT=XML';
const MEDIAINFO_FULL_DISPLAY_ARGUMENT = '-f';
const MEDIAINFO_URLENCODE = '--urlencode';
const MEDIAINFO_INCLUDE_COVER_DATA = '--Cover_Data=base64';
public const MEDIAINFO_COMMAND = 'mediainfo';
public const MEDIAINFO_OLDXML_OUTPUT_ARGUMENT = '--OUTPUT=OLDXML';
public const MEDIAINFO_XML_OUTPUT_ARGUMENT = '--OUTPUT=XML';
public const MEDIAINFO_FULL_DISPLAY_ARGUMENT = '-f';
public const MEDIAINFO_URLENCODE = '--urlencode';
public const MEDIAINFO_INCLUDE_COVER_DATA = '--Cover_Data=base64';

/**
* @var Process
Expand Down

0 comments on commit d89bb8a

Please sign in to comment.