TOURCMS-11047 Type methods parameters and returns, use consts and imp…#107
TOURCMS-11047 Type methods parameters and returns, use consts and imp…#107palisis-armando wants to merge 8 commits intorelease/5.0.0from
Conversation
palisis-juanra
left a comment
There was a problem hiding this comment.
@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
… remove isXMLObject method
src/TourCMS.php
Outdated
| * @author Francisco Martinez Ramos | ||
| * @return bool | ||
| */ | ||
| public function set_user_agent(string $user_agent, bool $prepend = true): bool |
There was a problem hiding this comment.
| 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 |
There was a problem hiding this comment.
| 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); |
There was a problem hiding this comment.
| 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
| 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); | ||
| } |
There was a problem hiding this comment.
| 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); | |
| } |
…lidation of tourId
src/TourCMS.php
Outdated
|
|
||
| public function search_voucher(SimpleXMLElement|string|null $voucherData = null, $channel = 0): SimpleXMLElement | ||
| { | ||
|
|
src/TourCMS.php
Outdated
|
|
||
| public function add_note_to_booking(int $bookingId, int $channel, string $text, string $noteType): SimpleXMLElement | ||
| { | ||
|
|
src/TourCMS.php
Outdated
| } | ||
|
|
||
| public function verify_customer(SimpleXMLElement|string $customer, int $channel): SimpleXMLElement | ||
| { |
There was a problem hiding this comment.
| { | |
| { |
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); | ||
| } |
There was a problem hiding this comment.
| } | |
| } |
belen-palisis
left a comment
There was a problem hiding this comment.
Great job! Only a few linter issues.
palisis-juanra
left a comment
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
good to validate tour id if not null
| { | ||
| $params = $this->validateParams($params); | ||
|
|
||
| if (!is_null($tourId)) { |
| return $this->request(self::PATH_API_C_TOURS_LOCATIONS . $params, $channel); | ||
| } | ||
|
|
||
| public function delete_tour(int $tourId, int $channel): SimpleXMLElement |
There was a problem hiding this comment.
good to validate tour id
…rove code