Skip to content

TOURCMS-11047 Type methods parameters and returns, use consts and imp…#107

Open
palisis-armando wants to merge 8 commits intorelease/5.0.0from
feature/TOURCMS-11047
Open

TOURCMS-11047 Type methods parameters and returns, use consts and imp…#107
palisis-armando wants to merge 8 commits intorelease/5.0.0from
feature/TOURCMS-11047

Conversation

@palisis-armando
Copy link
Copy Markdown
Contributor

…rove code

Copy link
Copy Markdown
Contributor

@palisis-juanra palisis-juanra left a comment

Choose a reason for hiding this comment

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

@armando-palisis great job.
There are just a few issues, which should be resolved.
This is mainly because PR has been created and dev branch has not been updated against latest version surely

Comment thread src/TourCMS.php Outdated
Comment thread src/TourCMS.php Outdated
Comment thread src/TourCMS.php
Comment thread src/TourCMS.php
Comment thread src/TourCMS.php Outdated
Comment thread src/TourCMS.php Outdated
Comment thread src/TourCMS.php Outdated
Comment thread src/TourCMS.php Outdated
Comment thread src/TourCMS.php Outdated
* @author Francisco Martinez Ramos
* @return bool
*/
public function set_user_agent(string $user_agent, bool $prepend = true): bool
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
public function set_user_agent(string $user_agent, bool $prepend = true): bool
public function set_user_agent(string $userAgent, bool $prepend = true): bool

Comment thread src/TourCMS.php Outdated
}

public function search_tours($params = "", $channel = 0) {
public function update_tour($tour_data, int $channel): SimpleXMLElement|string
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
public function update_tour($tour_data, int $channel): SimpleXMLElement|string
public function update_tour(SimpleXMLElement $tour, int $channel): SimpleXMLElement|string

Comment thread src/TourCMS.php Outdated
public function search_tours($params = "", $channel = 0) {
public function update_tour($tour_data, int $channel): SimpleXMLElement|string
{
return $this->request(self::PATH_API_TOUR_UPDATE, $channel, self::HTTP_VERB_POST, $tour_data);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
return $this->request(self::PATH_API_TOUR_UPDATE, $channel, self::HTTP_VERB_POST, $tour_data);
return $this->request(self::PATH_API_TOUR_UPDATE, $channel, self::HTTP_VERB_POST, $tour);

Comment thread src/TourCMS.php Outdated
Comment on lines +977 to +980
public function create_channel(SimpleXMLElement|string $channel_info, int $channel): SimpleXMLElement|string
{
return $this->request(self::PATH_API_CHANNEL_CREATE, $channel, self::HTTP_VERB_POST, $channel_info);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
public function create_channel(SimpleXMLElement|string $channel_info, int $channel): SimpleXMLElement|string
{
return $this->request(self::PATH_API_CHANNEL_CREATE, $channel, self::HTTP_VERB_POST, $channel_info);
}
public function create_channel(SimpleXMLElement|string $newChannel, int $channel): SimpleXMLElement|string
{
return $this->request(self::PATH_API_CHANNEL_CREATE, $channel, self::HTTP_VERB_POST, $newChannel);
}

Comment thread src/TourCMS.php Outdated

public function search_voucher(SimpleXMLElement|string|null $voucherData = null, $channel = 0): SimpleXMLElement
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Extra line here

Comment thread src/TourCMS.php Outdated

public function add_note_to_booking(int $bookingId, int $channel, string $text, string $noteType): SimpleXMLElement
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Extra line here

Comment thread src/TourCMS.php Outdated
}

public function verify_customer(SimpleXMLElement|string $customer, int $channel): SimpleXMLElement
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
{
{

Comment thread src/TourCMS.php Outdated
public function verify_customer(SimpleXMLElement|string $customer, int $channel): SimpleXMLElement
{
return $this->request(self::PATH_API_CUSTOMER_VERIFICATION, $channel, self::HTTP_VERB_POST, $customer);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
}
}

Copy link
Copy Markdown
Contributor

@belen-palisis belen-palisis left a comment

Choose a reason for hiding this comment

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

Great job! Only a few linter issues.

Copy link
Copy Markdown
Contributor

@palisis-juanra palisis-juanra left a comment

Choose a reason for hiding this comment

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

great job @armando-palisis just a few tweaks to validate tour id ... and we are done.

Comment thread src/TourCMS.php
public function get_last_request_headers() {
return $this->last_request_headers;
}
if (!is_null($tourId)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

good to validate tour id if not null

Comment thread src/TourCMS.php
{
$params = $this->validateParams($params);

if (!is_null($tourId)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same

Comment thread src/TourCMS.php
return $this->request(self::PATH_API_C_TOURS_LOCATIONS . $params, $channel);
}

public function delete_tour(int $tourId, int $channel): SimpleXMLElement
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

good to validate tour id

Copy link
Copy Markdown

@palisis-manolo-ramos palisis-manolo-ramos left a comment

Choose a reason for hiding this comment

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

Looking fine to me 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

6 participants