-
Notifications
You must be signed in to change notification settings - Fork 9
TOURCMS-11047 Type methods parameters and returns, use consts and imp… #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/5.0.0
Are you sure you want to change the base?
Conversation
palisis-juanra
left a comment
There was a problem hiding this 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
… 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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 | ||
| { | ||
|
|
There was a problem hiding this comment.
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 | ||
| { | ||
|
|
There was a problem hiding this comment.
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 | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| { | |
| { |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | |
| } |
belen-palisis
left a comment
There was a problem hiding this 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.
palisis-juanra
left a comment
There was a problem hiding this 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)) { |
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
palisis-manolo-ramos
left a comment
There was a problem hiding this 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 👍🏻
…rove code