Skip to content

Commit

Permalink
Prepare bundle for Symfony 7.x testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin1982 committed Dec 19, 2023
1 parent 9fd4837 commit 6e91338
Show file tree
Hide file tree
Showing 14 changed files with 229 additions and 120 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update-monday.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.3'
extensions: zip

- name: Validate composer.json and composer.lock
Expand Down
17 changes: 9 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"php": ">=8.0",
"php": ">=8.1",
"ext-fileinfo": "*",
"doctrine/doctrine-bundle": "^2.0",
"doctrine/orm": "^2.7",
Expand All @@ -19,13 +19,13 @@
"google/apiclient": "^2.7",
"psr/log": "^3.0",
"react/event-loop": "^1.1",
"symfony/console": "^5.4|^6.0",
"symfony/framework-bundle": "^5.4|^6.0",
"symfony/http-kernel": "^5.4|^6.0",
"symfony/console": "^6.4|^7.0",
"symfony/framework-bundle": "^6.4|^7.0",
"symfony/http-kernel": "^6.4|^7.0",
"symfony/monolog-bundle": "^3.5",
"symfony/validator": "^5.4|^6.0",
"symfony/yaml": "^5.4|^6.0",
"symfony/messenger": "^5.4|^6.0"
"symfony/validator": "^6.4|^7.0",
"symfony/yaml": "^6.4|^7.0",
"symfony/messenger": "^6.4|^7.0"
},
"require-dev": {
"roave/security-advisories": "dev-latest",
Expand All @@ -35,7 +35,8 @@
"guzzlehttp/guzzle": "^7.0",
"phpunit/phpunit": "^9.0|^10.0",
"squizlabs/php_codesniffer": "^3.5",
"phpmd/phpmd": "^2.12"
"phpmd/phpmd": "^2.12",
"rector/rector": "^0.18.12"
},
"suggest": {
"doctrine/doctrine-migrations-bundle": "Keep track of updated entities in your database"
Expand Down
131 changes: 125 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
use Rector\Doctrine\Set\DoctrineSetList;
use Rector\Symfony\Set\SymfonySetList;
use Rector\Symfony\Set\SensiolabsSetList;
use Rector\Config\RectorConfig;

return function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([
DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES,
SensiolabsSetList::ANNOTATIONS_TO_ATTRIBUTES,
]);
};
22 changes: 10 additions & 12 deletions src/Entity/Channel/AbstractChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,36 @@
/**
* Class AbstractChannel
*
* @ORM\Entity()
* @ORM\Table(name="channel", options={"collate"="utf8mb4_general_ci", "charset"="utf8mb4"})
* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="discr", type="string")
*
* @BroadcastAssert\CanStreamToChannel
*/
#[ORM\Table(name: 'channel', options: ['collate' => 'utf8mb4_general_ci', 'charset' => 'utf8mb4'])]
#[ORM\Entity]
#[ORM\InheritanceType('JOINED')]
#[ORM\DiscriminatorColumn(name: 'discr', type: 'string')]
abstract class AbstractChannel
{
/**
* @var int|null
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
protected ?int $channelId = null;

/**
* @var string|null
*
* @ORM\Column(name="name", type="string", length=128, nullable=false)
*
* @Assert\NotBlank
*/
#[ORM\Column(name: 'name', type: 'string', length: 128, nullable: false)]
#[Assert\NotBlank]
protected ?string $channelName = null;

/**
* @var bool
*
* @ORM\Column(name="is_healthy", type="boolean", options={"default": 0})
*/
#[ORM\Column(name: 'is_healthy', type: 'boolean', options: ['default' => 0])]
protected bool $isHealthy = false;

/**
Expand Down
13 changes: 6 additions & 7 deletions src/Entity/Channel/ChannelFacebook.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,27 @@

/**
* Class ChannelFacebook
*
* @ORM\Table(name="channel_facebook", options={"collate"="utf8mb4_general_ci", "charset"="utf8mb4"})
* @ORM\Entity()
*/
#[ORM\Table(name: 'channel_facebook', options: ['collate' => 'utf8mb4_general_ci', 'charset' => 'utf8mb4'])]
#[ORM\Entity]
class ChannelFacebook extends AbstractChannel implements PlannedChannelInterface
{
/**
* @var string|null
*
* @ORM\Column(name="access_token", type="string", length=255, nullable=false)
*
* @Assert\NotBlank
*/
#[ORM\Column(name: 'access_token', type: 'string', length: 255, nullable: false)]
#[Assert\NotBlank]
protected ?string $accessToken = null;

/**
* @var string|null
*
* @ORM\Column(name="fb_entity_id", type="string", length=128, nullable=false)
*
* @Assert\NotBlank
*/
#[ORM\Column(name: 'fb_entity_id', type: 'string', length: 128, nullable: false)]
#[Assert\NotBlank]
protected ?string $fbEntityId = null;

/**
Expand Down
13 changes: 6 additions & 7 deletions src/Entity/Channel/ChannelTwitch.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,27 @@

/**
* Class ChannelTwitch
*
* @ORM\Table(name="channel_twitch", options={"collate"="utf8mb4_general_ci", "charset"="utf8mb4"})
* @ORM\Entity()
*/
#[ORM\Table(name: 'channel_twitch', options: ['collate' => 'utf8mb4_general_ci', 'charset' => 'utf8mb4'])]
#[ORM\Entity]
class ChannelTwitch extends AbstractChannel
{
/**
* @var string|null
*
* @ORM\Column(name="stream_key", type="string", length=128, nullable=false)
*
* @Assert\NotBlank
*/
#[ORM\Column(name: 'stream_key', type: 'string', length: 128, nullable: false)]
#[Assert\NotBlank]
protected ?string $streamKey = null;

/**
* @var string|null
*
* @ORM\Column(name="stream_server", type="string", length=128, nullable=false)
*
* @Assert\NotBlank
*/
#[ORM\Column(name: 'stream_server', type: 'string', length: 128, nullable: false)]
#[Assert\NotBlank]
protected ?string $streamServer = 'live.twitch.tv';

/**
Expand Down
13 changes: 6 additions & 7 deletions src/Entity/Channel/ChannelYouTube.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,27 @@

/**
* Class ChannelYouTube
*
* @ORM\Table(name="channel_youtube", options={"collate"="utf8mb4_general_ci", "charset"="utf8mb4"})
* @ORM\Entity()
*/
#[ORM\Table(name: 'channel_youtube', options: ['collate' => 'utf8mb4_general_ci', 'charset' => 'utf8mb4'])]
#[ORM\Entity]
class ChannelYouTube extends AbstractChannel implements PlannedChannelInterface
{
/**
* @var string
*
* @ORM\Column(name="refresh_token", type="string", length=255, nullable=false)
*
* @Assert\NotBlank
*/
#[ORM\Column(name: 'refresh_token', type: 'string', length: 255, nullable: false)]
#[Assert\NotBlank]
protected string $refreshToken = '';

/**
* @var string
*
* @ORM\Column(name="youtube_channel_name", type="string", length=255, nullable=false)
*
* @Assert\NotBlank
*/
#[ORM\Column(name: 'youtube_channel_name', type: 'string', length: 255, nullable: false)]
#[Assert\NotBlank]
protected string $youTubeChannelName = '';

/**
Expand Down
Loading

0 comments on commit 6e91338

Please sign in to comment.