Skip to content

Conversation

@palisis-armando
Copy link
Contributor

…rove code

Copy link
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

src/TourCMS.php Outdated
* @author Francisco Martinez Ramos
* @return bool
*/
public function set_user_agent(string $user_agent, bool $prepend = true): bool
Copy link
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

src/TourCMS.php Outdated
}

public function search_tours($params = "", $channel = 0) {
public function update_tour($tour_data, int $channel): SimpleXMLElement|string
Copy link
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

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
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);

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
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);
}

src/TourCMS.php Outdated

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Extra line here

src/TourCMS.php Outdated

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Extra line here

src/TourCMS.php Outdated
}

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

Choose a reason for hiding this comment

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

Suggested change
{
{

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
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
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
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.

public function get_last_request_headers() {
return $this->last_request_headers;
}
if (!is_null($tourId)) {
Copy link
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

{
$params = $this->validateParams($params);

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

Choose a reason for hiding this comment

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

same

return $this->request(self::PATH_API_C_TOURS_LOCATIONS . $params, $channel);
}

public function delete_tour(int $tourId, int $channel): SimpleXMLElement
Copy link
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

@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.

7 participants