Skip to content

Conversation

phpawcom
Copy link

@phpawcom phpawcom commented Sep 9, 2024

Bitly::create('http://url.com/, 'title', 'domain.com');

public function getUrl(string $url, ?string $domain = null, ?string $group_guid = null, ?string $title = null, $requestUrl = 'https://api-ssl.bitly.com/v4/shorten'): string
{
$requestUrl = 'https://api-ssl.bitly.com/v4/shorten';
## $requestUrl = 'https://api-ssl.bitly.com/v4/shorten';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering, but why is the requestUrl now a function param?

Copy link
Author

@phpawcom phpawcom Sep 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To use it in the new method create():

 public function create(string $url, ?string $title = null, ?string $domain = null, ?string $group_guid = null){
        return $this->getUrl($url, $domain, $group_guid , $title, 'https://api-ssl.bitly.com/v4/bitlinks');
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants