forked from mapasculturais/mapasculturais
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae74a40
commit 06aaac4
Showing
18 changed files
with
388 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Migrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\Migrations\AbstractMigration; | ||
|
||
final class Version20240716230312 extends AbstractMigration | ||
{ | ||
public function getDescription(): string | ||
{ | ||
return 'Modify column auth_token to table user'; | ||
} | ||
|
||
public function preUp(Schema $schema): void | ||
{ | ||
$this->addSql('ALTER TABLE usr DROP COLUMN auth_token'); | ||
} | ||
|
||
public function up(Schema $schema): void | ||
{ | ||
$this->addSql('ALTER TABLE usr ADD COLUMN auth_token TEXT NULL;'); | ||
} | ||
|
||
public function down(Schema $schema): void | ||
{ | ||
$this->addSql('ALTER TABLE usr DROP COLUMN auth_token'); | ||
$this->addSql('ALTER TABLE usr ADD auth_token VARCHAR(255) NULL;'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Enum; | ||
|
||
enum SocialMediaEnum: string | ||
{ | ||
case FACEBOOK = 'facebook.com'; | ||
case INSTAGRAM = 'instagram.com'; | ||
case LINKEDIN = 'linkedin.com'; | ||
case PINTEREST = 'pinterest.com'; | ||
case SPOTIFY = 'spotify.com'; | ||
case X = 'x.com'; | ||
case VIMEO = 'vimeo.com'; | ||
case YOUTUBE = 'youtube.com'; | ||
case TIKTOK = 'tiktok.com'; | ||
|
||
public function getParsingRegex(): string | ||
{ | ||
return match ($this) { | ||
self::FACEBOOK, self::INSTAGRAM, self::PINTEREST, self::VIMEO => "/(?:{$this->value}\/(?:profile\.php\?id=)?|^)([\w\d\.]+)$/i", | ||
|
||
self::X, self::YOUTUBE, self::TIKTOK => "/(?:{$this->value}\/|^)(@?[\w\d\.]+)$/i", | ||
|
||
self::LINKEDIN => "/(?:{$this->value}\/in\/|^)([\w\d-]+)$/i", | ||
|
||
self::SPOTIFY => "/(?:open\.)?spotify\.com\/(?:intl-\w+\/)?(?:(user|artist)\/([\w\d]+))|^(user|artist)\/([\w\d]+)$/i", | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.