Skip to content
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

update #1

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: [ptondereau]
custom: https://www.paypal.me/ptondereau
58 changes: 58 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Tests

on:
push:
pull_request:

jobs:
tests:
name: PHP ${{ matrix.php }}; Laravel ${{ matrix.laravel }}
runs-on: ubuntu-20.04

strategy:
matrix:
php: [ '8.1', '8.2', '8.3' ]
laravel: [ '10', '11' ]
exclude:
- php: '8.1'
laravel: '11'

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none

- name: Setup Problem Matchers
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Select Laravel 10
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer require "laravel/framework:10.*" --no-update --no-interaction
if: "matrix.laravel == '10'"

- name: Select Laravel 11
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer require "laravel/framework:11.*" --no-update --no-interaction
if: "matrix.laravel == '11'"

- name: Install PHP Dependencies
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --no-interaction --no-progress

- name: Execute PHPUnit
run: vendor/bin/phpunit
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
vendor
composer.lock
composer.lock
.phpunit.result.cache
74 changes: 0 additions & 74 deletions .travis.yml

This file was deleted.

32 changes: 32 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# CONTRIBUTING

Contributions are welcome, and are accepted via pull requests. Please review these guidelines before submitting any pull requests.

## Guidelines

* Please follow the [PSR-12 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) and [PHP-FIG Naming Conventions](https://github.com/php-fig/fig-standards/blob/master/bylaws/002-psr-naming-conventions.md).
* Ensure that the current tests pass, and if you've added something new, add the tests where relevant.
* Remember that we follow [SemVer](http://semver.org). If you are changing the behaviour, or the public api, you may need to update the docs.
* Send a coherent commit history, making sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash](http://git-scm.com/book/en/Git-Tools-Rewriting-History) them before submitting.
* You may also need to [rebase](http://git-scm.com/book/en/Git-Branching-Rebasing) to avoid merge conflicts.


## Running Tests

You will need an install of [Composer](https://getcomposer.org) before continuing.

First, install the dependencies:

```bash
$ composer install
```

Then run phpunit:

```bash
$ vendor/bin/phpunit
```

If the test suite passes on your local machine you should be good to go.

When you make a pull request, the tests will automatically be run on multiple php versions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 Pierre Tondereau
Copyright (c) 2020 Pierre Tondereau

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
43 changes: 20 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
Laravel UPS Api
=================

## For Laravel 5.1+
## For Laravel 10 and 11

[![Build Status](https://travis-ci.org/ptondereau/Laravel-UPS-Api.svg?branch=master)](https://travis-ci.org/ptondereau/Laravel-UPS-Api)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ptondereau/Laravel-UPS-Api/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ptondereau/Laravel-UPS-Api/?branch=master)
[![Test Coverage](https://codeclimate.com/github/ptondereau/Laravel-UPS-Api/badges/coverage.svg)](https://codeclimate.com/github/ptondereau/Laravel-UPS-Api/coverage)
[![Code Climate](https://codeclimate.com/github/ptondereau/Laravel-UPS-Api/badges/gpa.svg)](https://codeclimate.com/github/ptondereau/Laravel-UPS-Api)
[![StyleCI](https://styleci.io/repos/54156171/shield)](https://styleci.io/repos/54156171)
[![Latest Stable Version](https://poser.pugx.org/ptondereau/laravel-ups-api/v/stable)](https://packagist.org/packages/Ptondereau/laravel-ups-api)
[![Latest Unstable Version](https://poser.pugx.org/ptondereau/laravel-ups-api/v/unstable)](https://packagist.org/packages/Ptondereau/laravel-ups-api)
[![License](https://poser.pugx.org/ptondereau/laravel-ups-api/license)](https://packagist.org/packages/Ptondereau/laravel-ups-api)
<p align="center">
<a href="https://github.com/ptondereau/Laravel-UPS-Api/actions?query=workflow%3ATests"><img src="https://img.shields.io/github/workflow/status/ptondereau/Laravel-UPS-Api/Tests?label=Tests&style=flat-square" alt="Build Status"/></a>
<a href="https://github.styleci.io/repos/54156171"><img src="https://github.styleci.io/repos/54156171/shield" alt="StyleCI Status"/></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-brightgreen?style=flat-square" alt="Software License"/></a>
<a href="https://packagist.org/packages/ptondereau/laravel-ups-api"><img src="https://img.shields.io/packagist/dt/ptondereau/laravel-ups-api?style=flat-square" alt="Packagist Downloads"/></a>
<a href="https://github.com/ptondereau/Laravel-UPS-Api/releases"><img src="https://img.shields.io/github/release/ptondereau/Laravel-UPS-Api?style=flat-square" alt="Latest Version"/></a>
</p>

Laravel UPS Api was created by, and is maintained by [Pierre Tondereau](https://github.com/ptondereau), and PHP UPS Api was created by, and is maintained by [Gabriel Bull](https://github.com/gabrielbull) at [PHP UPS API](https://github.com/gabrielbull/php-ups-api).

## Installation

Either [PHP](https://php.net) 5.5+ or [HHVM](http://hhvm.com) 3.6+ are required.

To get the latest version of Laravel UPS Api, simply require the project using [Composer](https://getcomposer.org):

```bash
Expand All @@ -33,21 +30,21 @@ Instead, you may of course manually update your require block and run `composer
}
}
```

Once Laravel UPS Api is installed, you need to register the service provider. Open up `config/app.php` and add the following to the `providers` key.
The `UpsApiServiceProvider` is auto-discovered and registered by default. If needed, you may register it manually by opening up `config/app.php` and adding the following to the `providers` key.

* `'Ptondereau\LaravelUpsApi\UpsApiServiceProvider'`

You can register the all or some Ups facade in the `aliases` key of your `config/app.php` file if you like.
You can register all or some of the Ups facades in the `aliases` key of your `config/app.php` file if you like.

* `'UPSAddressValidator' => 'Ptondereau\LaravelUpsApi\Facades\UpsAddressValidator'`
* `'UPSLocator' => 'Ptondereau\LaravelUpsApi\Facades\UpsLocator'`
* `'UPSQuantumView' => 'Ptondereau\LaravelUpsApi\Facades\UpsQuantumView'`
* `'UPSRate' => 'Ptondereau\LaravelUpsApi\Facades\UpsRate'`
* `'UPSTimeInTransit' => 'Ptondereau\LaravelUpsApi\Facades\UpsTimeInTransit'`
* `'UPSTracking' => 'Ptondereau\LaravelUpsApi\Facades\UpsTracking'`
* `'UPSTradeability' => 'Ptondereau\LaravelUpsApi\Facades\UpsTradeability'`
* `'UPSShipping' => 'Ptondereau\LaravelUpsApi\Facades\UpsShipping'`
* `'UpsAddressValidation' => 'Ptondereau\LaravelUpsApi\Facades\UpsAddressValidation'`
* `'UpsLocator' => 'Ptondereau\LaravelUpsApi\Facades\UpsLocator'`
* `'UpsQuantumView' => 'Ptondereau\LaravelUpsApi\Facades\UpsQuantumView'`
* `'UpsRate' => 'Ptondereau\LaravelUpsApi\Facades\UpsRate'`
* `'UpsTimeInTransit' => 'Ptondereau\LaravelUpsApi\Facades\UpsTimeInTransit'`
* `'UpsTracking' => 'Ptondereau\LaravelUpsApi\Facades\UpsTracking'`
* `'UpsTradeability' => 'Ptondereau\LaravelUpsApi\Facades\UpsTradeability'`
* `'UpsShipping' => 'Ptondereau\LaravelUpsApi\Facades\UpsShipping'`
* `'UpsRateInTransit' => 'Ptondereau\LaravelUpsApi\Facades\UpsRateInTransit'`



Expand Down Expand Up @@ -85,7 +82,7 @@ There are other classes in this package that are not documented here. This is be

## Security

If you discover a security vulnerability within this package, please send an e-mail to Pierre Tondereau at me@pierre-tondereau.com. All security vulnerabilities will be promptly addressed.
If you discover a security vulnerability within this package, please send an e-mail to Pierre Tondereau at pierre.tondereau@gmail.com. All security vulnerabilities will be promptly addressed.


## License
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"description": "A small Laravel's wrapper for the PHP UPS API library",
"keywords": ["laravel", "framework", "UPS", "Laravel UPS Api", "Laravel-Ups-Api", "Pierre Tondereau", "Ptondereau"],
"require": {
"php": ">=5.5.9",
"illuminate/contracts": "~5.1.0|~5.2.0|~5.3.0|~5.4.0|~5.5.0|~5.6.0|~5.7.0",
"illuminate/support": "~5.1.0|~5.2.0|~5.3.0|~5.4.0|~5.5.0|~5.6.0|~5.7.0",
"gabrielbull/ups-api": "^0.7.6"
"php": "^8.1 || ^8.2 || ^8.3",
"illuminate/contracts": "^8.0 || ^9.0 || ^10.0 || ^11.0",
"illuminate/support": "^8.0 || ^9.0 || ^10.0 || ^11.0",
"gabrielbull/ups-api": "^1.2.2 || ^2.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8|^5.0|^6.0|^7.0",
"graham-campbell/testbench": "^3.0|^4.0|^5.0",
"codeclimate/php-test-reporter": "^0.3.0"
"graham-campbell/analyzer": "^4.1",
"graham-campbell/testbench": "^6.1",
"phpunit/phpunit": "^10.5.20"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion config/ups.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
|--------------------------------------------------------------------------
|
| This option specifies the UPS credentials for your account.
| You can put it here but I strongly recommend to put thoses settings into your
| You can put it here but I strongly recommend to put those settings into your
| .env & .env.example file.
|
*/
Expand Down
28 changes: 0 additions & 28 deletions phpunit.xml

This file was deleted.

13 changes: 13 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" beStrictAboutTestsThatDoNotTestAnything="true" beStrictAboutOutputDuringTests="true" bootstrap="vendor/autoload.php" colors="true" failOnRisky="true" failOnWarning="true" processIsolation="false" stopOnError="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="Laravel UPS Api Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
7 changes: 1 addition & 6 deletions src/Facades/UpsAddressValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@
*/
class UpsAddressValidation extends Facade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor()
protected static function getFacadeAccessor(): string
{
return 'ups.address-validation';
}
Expand Down
7 changes: 1 addition & 6 deletions src/Facades/UpsLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@
*/
class UpsLocator extends Facade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor()
protected static function getFacadeAccessor(): string
{
return 'ups.locator';
}
Expand Down
7 changes: 1 addition & 6 deletions src/Facades/UpsQuantumView.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@
*/
class UpsQuantumView extends Facade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor()
protected static function getFacadeAccessor(): string
{
return 'ups.quantum-view';
}
Expand Down
7 changes: 1 addition & 6 deletions src/Facades/UpsRate.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@
*/
class UpsRate extends Facade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor()
protected static function getFacadeAccessor(): string
{
return 'ups.rate';
}
Expand Down
Loading