Skip to content

Commit

Permalink
build: upd deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Gemorroj committed May 22, 2021
1 parent 0f413c1 commit f837dff
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ phpstan.neon
phpunit.xml
.phpunit.result.cache

.php_cs
.php_cs.cache
/.php-cs-fixer.php
/.php-cs-fixer.cache
10 changes: 4 additions & 6 deletions .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,21 @@
->exclude('fixtures')
->in(['src', 'tests']);

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setRules([
'@Symfony' => true,
'@PHP73Migration' => true,
'array_syntax' => ['syntax' => 'short'],

'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'compact_nullable_typehint' => true,
'linebreak_after_opening_tag' => true,
'list_syntax' => ['syntax' => 'short'],
// 'mb_str_functions' => true,
'native_function_invocation' => true,
'native_function_invocation' => ['scope' => 'all', 'include' => ['@all']],
'native_constant_invocation' => true,
'no_null_property_initialization' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'phpdoc_order' => true,
'strict_comparison' => true,
'combine_nested_dirname' => true,
Expand Down
23 changes: 3 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ implement `ExtTagInterface` interface
use M3uParser\M3uParser;
use M3uParser\Tag\ExtTagInterface;

// create custom tag
class ExtCustomTag implements ExtTagInterface
{
/**
Expand All @@ -174,7 +175,6 @@ class ExtCustomTag implements ExtTagInterface

/**
* #EXTCUSTOMTAG:data
* @param string $lineStr
*/
public function __construct(?string $lineStr = null)
{
Expand All @@ -183,9 +183,6 @@ class ExtCustomTag implements ExtTagInterface
}
}

/**
* @param string $lineStr
*/
protected function makeData(string $lineStr): void
{
/*
Expand All @@ -200,45 +197,31 @@ example:
$this->setData(\trim($data));
}

/**
* @return string
*/
public function getData(): string
{
return $this->data;
}

/**
* @param string $data
* @return $this
*/
public function setData(string $data): self
{
$this->data = $data;
return $this;
}

/**
* @return string
*/
public function __toString(): string
{
return '#EXTCUSTOMTAG: ' . $this->getData();
}

/**
* @param string $lineStr
* @return bool
*/
public static function isMatch(string $lineStr): bool
{
return 0 === \stripos($lineStr, '#EXTCUSTOMTAG:');
}
}

// use custom tag
$m3uParser = new M3uParser();
// add custom tag
$m3uParser->addTag(ExtCustomTag::class);
$m3uParser->addTag(ExtCustomTag::class); // add custom tag
$data = $m3uParser->parseFile('path_to_file.m3u');

print_r($data);
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"friendsofphp/php-cs-fixer": "^2.19",
"friendsofphp/php-cs-fixer": "^3.0",
"phpstan/phpstan": "^0.12"
},
"autoload": {
Expand Down

0 comments on commit f837dff

Please sign in to comment.