dealroom / socials-helpers
Helper package used for the validation of social links
v3.69.0
2024-05-05 09:27 UTC
Requires
- php: >=8.1
- ext-mbstring: *
Requires (Dev)
- phpunit/phpunit: ^10.3
- dev-main
- v3.69.0
- v3.68.0
- v3.67.0
- v3.66.0
- v3.65.0
- v3.64.0
- v3.63.0
- v3.62.0
- v3.61.0
- v3.60.0
- v3.59.0
- v3.58.0
- v3.57.0
- v3.56.0
- v3.55.0
- v3.54.0
- v3.53.0
- v3.52.0
- v3.51.0
- v3.50.0
- v3.49.0
- v3.48.0
- v3.47.0
- v3.46.0
- v3.45.0
- v3.44.0
- v3.43.0
- v3.42.0
- v3.41.0
- v3.40.0
- v3.39.0
- v3.38.0
- v3.37.0
- v3.36.0
- v3.35.0
- v3.34.0
- v3.33.0
- v3.32.0
- v3.31.0
- v3.30.0
- v3.29.0
- v3.28.0
- v3.27.0
- v3.26.0
- v3.25.0
- v3.24.0
- v3.23.0
- v3.22.0
- v3.21.0
- v3.20.0
- v3.19.0
- v3.18.0
- v3.17.0
- v3.16.0
- v3.15.0
- v3.14.0
- v3.13.0
- v3.12.0
- v3.11.0
- v3.10.0
- v3.9.0
- v3.8.0
- v3.7.0
- v3.6.0
- v3.5.0
- v3.4.0
- v3.3.0
- v3.2.0
- v3.1.0
- v3.0.0
- v2.3.0
- v2.2.0
- v2.1.0
- v2.0.0
- v1.6.1
- v1.6.0
- v1.5.0
- v1.4.0
- v1.2.0
- v1.1.0
- v1.0.0
- dev-repo-sync/core-mothership/default
This package is auto-updated.
Last update: 2024-05-05 09:28:13 UTC
README
Socials Helpers
Helper package used for the validation of social links.
Requirements
This project requires PHP 8.1 or higher with the mbstring
extension installed.
Installation
Install via [composer], simply run:
composer require dealroom/socials-helpers
Usage
The Factory
class provides a simple wrapper for the validation functionality, for example to get normalized URL:
use Dealroom\SocialsHelpers\Factory; use Dealroom\SocialsHelpers\Parser; $data = Factory::parseUrl('http://twitter.com/Dealroom', [Parser::PLATFORM_TWITTER])->getNormalizedUrl(); echo $data; // "https://twitter.com/dealroom"
Or if you want to extract social network ID (handle):
use Dealroom\SocialsHelpers\Factory; use Dealroom\SocialsHelpers\Parser; $data = Factory::parseUrl('https://twitter.com/dealroom', [Parser::PLATFORM_TWITTER])->getId(); echo $data; // "dealroom"
Testing
PHPUnit is used for testing, just run:
./vendor/bin/phpunit
Releases and CI/CD
The release is done automatically using GitHub actions on every push to the main
branch.
After the release is done, a new tag is created and pushed to GitHub which triggers a new release in packagist.