Skip to content

Commit

Permalink
feature: [BC] use strict_types
Browse files Browse the repository at this point in the history
  • Loading branch information
Gemorroj committed Jan 4, 2024
1 parent a846c4a commit 91566ef
Show file tree
Hide file tree
Showing 30 changed files with 64 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ composer require gemorroj/m3u-parser

```php
<?php
declare(strict_types=1);

use M3uParser\M3uParser;

$m3uParser = new M3uParser();
Expand Down Expand Up @@ -131,6 +133,8 @@ foreach ($data as $entry) {

```php
<?php
declare(strict_types=1);

use M3uParser\M3uData;
use M3uParser\M3uEntry;
use M3uParser\Tag\ExtInf;
Expand Down
2 changes: 2 additions & 0 deletions src/Exception.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser;

class Exception extends \Exception
Expand Down
2 changes: 2 additions & 0 deletions src/M3uData.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser;

/** @extends \ArrayIterator<int, M3uEntry> */
Expand Down
2 changes: 2 additions & 0 deletions src/M3uEntry.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser;

use M3uParser\Tag\ExtTagInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/M3uParser.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser;

class M3uParser
Expand Down
2 changes: 2 additions & 0 deletions src/Tag/ExtAlbumArtUrl.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser\Tag;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Tag/ExtGrp.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser\Tag;

/**
Expand Down
6 changes: 4 additions & 2 deletions src/Tag/ExtInf.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser\Tag;

use M3uParser\TagAttributesTrait;
Expand Down Expand Up @@ -40,9 +42,9 @@ public function getTitle(): string
return $this->title;
}

public function setDuration(float $duration): self
public function setDuration(float|int $duration): self
{
$this->duration = $duration;
$this->duration = (float) $duration;

return $this;
}
Expand Down
2 changes: 2 additions & 0 deletions src/Tag/ExtLogo.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser\Tag;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Tag/ExtTagInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser\Tag;

interface ExtTagInterface extends \Stringable
Expand Down
2 changes: 2 additions & 0 deletions src/Tag/ExtTitle.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser\Tag;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Tag/ExtTv.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser\Tag;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Tag/ExtVlcOpt.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser\Tag;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Tag/Playlist.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser\Tag;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/TagAttributesTrait.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/TagsManagerTrait.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser;

use M3uParser\Tag\ExtAlbumArtUrl;
Expand Down
2 changes: 2 additions & 0 deletions tests/ExceptionTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser\Tests;

use M3uParser\Exception;
Expand Down
2 changes: 2 additions & 0 deletions tests/ExtCustomTag.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser\Tests;

use M3uParser\Tag\ExtTagInterface;
Expand Down
2 changes: 2 additions & 0 deletions tests/M3uDataTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser\Tests;

use M3uParser\M3uData;
Expand Down
2 changes: 2 additions & 0 deletions tests/M3uParserTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser\Tests;

use M3uParser\Exception as M3uParserException;
Expand Down
2 changes: 2 additions & 0 deletions tests/Tag/ExtAlbumArtUrlTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser\Tests\Tag;

use M3uParser\M3uData;
Expand Down
2 changes: 2 additions & 0 deletions tests/Tag/ExtGrpTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser\Tests\Tag;

use M3uParser\M3uData;
Expand Down
2 changes: 2 additions & 0 deletions tests/Tag/ExtInfTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser\Tests\Tag;

use M3uParser\M3uData;
Expand Down
2 changes: 2 additions & 0 deletions tests/Tag/ExtLogoTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser\Tests\Tag;

use M3uParser\M3uData;
Expand Down
2 changes: 2 additions & 0 deletions tests/Tag/ExtTitleTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser\Tests\Tag;

use M3uParser\M3uData;
Expand Down
2 changes: 2 additions & 0 deletions tests/Tag/ExtTvTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser\Tests\Tag;

use M3uParser\M3uData;
Expand Down
2 changes: 2 additions & 0 deletions tests/Tag/ExtVlcOptTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser\Tests\Tag;

use M3uParser\M3uData;
Expand Down
2 changes: 2 additions & 0 deletions tests/Tag/PlaylistTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser\Tests\Tag;

use M3uParser\M3uData;
Expand Down
2 changes: 2 additions & 0 deletions tests/TagAttributesTraitTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser\Tests;

use M3uParser\TagAttributesTrait;
Expand Down
2 changes: 2 additions & 0 deletions tests/TagsManagerTraitTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace M3uParser\Tests;

use M3uParser\Exception;
Expand Down

0 comments on commit 91566ef

Please sign in to comment.