GithubHelp home page GithubHelp logo

amadeus4dev-examples / amadeus-php Goto Github PK

View Code? Open in Web Editor NEW
11.0 1.0 11.0 1.63 MB

PHP library for the Amadeus Self-Service APIs

Home Page: https://amadeus4dev-examples.github.io/amadeus-php/

License: MIT License

PHP 100.00%
amadeus api php sdk travel

amadeus-php's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

amadeus-php's Issues

Fix code smells - part one

Exception in Resource::toResourceObject()

While trying to read allowance weight for traveler, the infants has no weight information.
But when calling getIncludedCheckedBags() method it's throw an exception.

TypeError
Amadeus\Resources\Resource::toResourceObject(): Argument #1 ($object) must be of type object, null given, called in /Users/abdullahishtiwy/Sites/booking-core/vendor/amadeus4dev/amadeus-php/src/resources/FlightFareDetailsBySegment.php on line 98.

and there is no way to check if it has a data or not.

https://github.com/amadeus4dev/amadeus-php/blob/f7249b5659976ee838dee0222497e547937fba93/src/resources/FlightFareDetailsBySegment.php#L94

set up GitHub pages for this repo to make the documentation link work

@jabrena @tsolakoua @minjikarin hey, although I saw the warning that the Amadeus for Developers team will not support or maintain this SDK, however, since this repo has been transferred to another organization, which means the URL for the PHP documentation should be changed too. Thus, please set up GitHub pages for this repo to make the documentation link works again. (Cuz only the admin user of this organization can set up GitHub pages so I can't contribute to it, you can see more details here)

Amadeus has a large set of APIs, and our documentation is here to get you started. Head over to our [reference documentation](https://amadeus4dev.github.io/amadeus-php/) for in-depth information about every SDK method, its arguments and return types.

In addition, the link in the place shown below should also be changed.
image

Review code quality based on SonarCloud

Hello @jabrena @tsolakoua @minjikarin

The following is The SonarCloud analysis result after merging PR #80 #82 #84:

Code smells counts: from 65 to 41
Duplication: from 1.3% to 1.2%

image

However, there are still some code smells that I think we can resolve by choosing won't fix.

Thus, please review it (could have a preview from my repo, see details here) and it would be great if we can schedule a meeting to review it together :)

Fix code smells - part two

1. /tests/client/

HTTPClientTest.php
RequestTest.php
ResponseTest.php


2. /tests/exceptions/

ExceptionsTest.php

  • String literals should not be duplicated

3. /tests/.../ (Endpoints)

Response returning incomplete Data

Calling the getFlightOffers endpoint through

$flightOffers = $this->amadeus->getShopping()->getFlightOffers()->get($data);

Steps to Reproduce

  1. I have created a laravel project, added this package, created a route and associated a controller with it.
  2. Configured postman to call the route
  3. Received the response

Expected Behavior: Expecting Amadeus FlightOffers data according to the API specification

Actual Behavior: Receiving partial data.
{
"data": [
{
"lastTicketingDateTime": "2023-06-05"
},
{
"lastTicketingDateTime": "2023-05-31"
},
{
"lastTicketingDateTime": "2023-05-31"
}
]
}

Request payload:
originLocationCode:SYD
destinationLocationCode:BYK
departureDate:2023-06-05
adults:1
max:10

Stable Behavior? It is consistently generating the same result every time

Versions

PHP version: 7.4.16
Laravel version: 8.75
postman: v10.14

Checklist

amadeus-php version: 0.3.0

add Logging feature

the current SDK defaults to directly output the logs, which need to be reviewed and add a suitable + flexible + clear logging feature.

Besides, the logging feature should be reviewed in a Laravel/Symfony demo deployed in different environments, including

  • Local environment
  • Heroku
  • AWS

image

image

  • Google Cloud

redundant @covers annotations in tests

The current tests are using @covers effectively to filter the code coverage report to include only executed code from the referenced code parts. This is to ensure that code is only marked as covered if there are dedicated tests for it, but not if it is used indirectly by the tests for a different class, thus avoiding false positives for code coverage. ref

However, some of the tests which include an Amadeus object, need to cover all the namespaces inside the Amadeus, otherwise, there will be some risks in the coverage report.

Thus, the current tests need to be improved and decoupled for reducing the redundant @covers annotations.

complete the tests

  • City and Airport Search
  • Flight Offers Search
  • Flight Create Orders
  • Flight Offers Price
  • Hotel List
  • Hotel Search
  • Hotel Booking
  • Hotel Name Autocomplete

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.