Skip to content

Commit

Permalink
change namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Sysix committed Nov 25, 2023
1 parent d337ef5 commit f3241ad
Show file tree
Hide file tree
Showing 53 changed files with 213 additions and 207 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 CLICKSPORTS GmbH
Copyright (c) 2023 Sysix

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
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Lexoffice PHP API

![tests](https://github.com/clicksports/lexoffice-php-api/workflows/tests/badge.svg)
[![Latest Stable Version](https://poser.pugx.org/clicksports/lex-office-api/v)](//packagist.org/packages/clicksports/lex-office-api)
[![License](https://poser.pugx.org/clicksports/lex-office-api/license)](//packagist.org/packages/clicksports/lex-office-api)
![tests](https://github.com/sysix/lexoffice-php-api/workflows/tests/badge.svg)
[![Latest Stable Version](https://poser.pugx.org/sysix/lex-office-api/v)](//packagist.org/packages/sysix/lex-office-api)
[![License](https://poser.pugx.org/sysix/lex-office-api/license)](//packagist.org/packages/sysix/lex-office-api)

## Requirements

Expand All @@ -12,7 +12,7 @@ Extensions: [Composer](https://getcomposer.org/), [PHP-JSON](https://www.php.net
## Install

composer:
`composer require clicksports/lex-office-api`
`composer require sysix/lex-office-api`

## Usage

Expand All @@ -22,14 +22,14 @@ You need an [API Key](https://app.lexoffice.de/addons/public-api) for that.
### Basic
```php
$apiKey = getenv('LEX_OFFICE_API_KEY'); // store keys in .env file
$api = new \Clicksports\LexOffice\Api($apiKey);
$api = new \Sysix\LexOffice\Api($apiKey);
```

### Contact Endpoint
```php

// get a page
/** @var \Clicksports\LexOffice\Api $api */
/** @var \Sysix\LexOffice\Api $api */
$client = $api->contact();

$client->size = 100;
Expand Down Expand Up @@ -221,7 +221,7 @@ $json = $api->*()->getAsJson($response);
```php
try {
$api->*->*();
} catch(\Clicksports\LexOffice\Exceptions\LexOfficeApiException $exception) {
} catch(\Sysix\LexOffice\Exceptions\LexOfficeApiException $exception) {
$json = $api->*()->getAsJson($exception->getPrevious()->getResponse());
}
```
32 changes: 19 additions & 13 deletions UPDATE.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
# Update from Version 0.x to 1.0

## Functions Removed
## Namespace Changed

- `$api->setCacheInterface()`
- `$api->getCacheResponse()`
- `$api->setCacheResponse()`
All Classses with started with `\Clicksports\Lexoffice` are now under `\Sysix\Lexoffice`.

For settings a Cache Interface check out [guzzle-cache-middleware](https://github.com/Kevinrob/guzzle-cache-middleware).
And implement it with:
`$api = new \Clicksports\LexOffice\Api($apiKey, $guzzleClient);`
## Clients Namespace changed

## Exceptions Removed
In Version `0.x` all Clients had a separate folder/namespace. Now they will all use the namespace
`\Sysix\Lexoffice\Clients`

- `\Clicksports\Lexoffice\Exception\CacheException`
- `\Clicksports\Lexoffice\Exception\BadMethodException`
## Cache removed

For settings a Cache Interface check out [guzzle-cache-middleware](https://github.com/Kevinrob/guzzle-cache-middleware).
And implement it with:
`$api = new \Sysix\LexOffice\Api($apiKey, $guzzleClient);`

## Clients Method which will throw a BadMethodException

We implemented in the `0.x` Version some methods for the future of lexoffice API.
At the moment, it doesn't look like the endpoint will be added soon. So we will remove them.

## Clients Namespace changed
## Functions Removed

In Version `0.x` all Clients had a separate folder/namespace. Now they will all use the namespace
`\Clicksports\Lexoffice\Clients`
- `$api->setCacheInterface()`
- `$api->getCacheResponse()`
- `$api->setCacheResponse()`

## Exceptions Removed

- `\Sysix\Lexoffice\Exception\CacheException`
- `\Sysix\Lexoffice\Exception\BadMethodException`
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "clicksports/lex-office-api",
"name": "sysix/lex-office-api",
"type": "library",
"description": "Simple API Integration for Lex-Office",
"scripts": {
Expand Down Expand Up @@ -28,12 +28,12 @@
},
"autoload": {
"psr-4": {
"Clicksports\\LexOffice\\": "src/"
"Sysix\\LexOffice\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Clicksports\\LexOffice\\Tests\\": "tests/"
"Sysix\\LexOffice\\Tests\\": "tests/"
}
},
"minimum-stability": "dev",
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 19 additions & 19 deletions src/Api.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<?php declare(strict_types=1);

namespace Clicksports\LexOffice;

use Clicksports\LexOffice\Clients\Contact;
use Clicksports\LexOffice\Clients\Country;
use Clicksports\LexOffice\Clients\CreditNote;
use Clicksports\LexOffice\Clients\DownPaymentInvoice;
use Clicksports\LexOffice\Clients\Event;
use Clicksports\LexOffice\Clients\File;
use Clicksports\LexOffice\Clients\Invoice;
use Clicksports\LexOffice\Clients\OrderConfirmation;
use Clicksports\LexOffice\Clients\Payment;
use Clicksports\LexOffice\Clients\PaymentCondition;
use Clicksports\LexOffice\Clients\PostingCategory;
use Clicksports\LexOffice\Clients\Profile;
use Clicksports\LexOffice\Clients\Quotation;
use Clicksports\LexOffice\Clients\RecurringTemplate;
use Clicksports\LexOffice\Clients\Voucher;
use Clicksports\LexOffice\Clients\VoucherList;
use Clicksports\LexOffice\Exceptions\LexOfficeApiException;
namespace Sysix\LexOffice;

use Sysix\LexOffice\Clients\Contact;
use Sysix\LexOffice\Clients\Country;
use Sysix\LexOffice\Clients\CreditNote;
use Sysix\LexOffice\Clients\DownPaymentInvoice;
use Sysix\LexOffice\Clients\Event;
use Sysix\LexOffice\Clients\File;
use Sysix\LexOffice\Clients\Invoice;
use Sysix\LexOffice\Clients\OrderConfirmation;
use Sysix\LexOffice\Clients\Payment;
use Sysix\LexOffice\Clients\PaymentCondition;
use Sysix\LexOffice\Clients\PostingCategory;
use Sysix\LexOffice\Clients\Profile;
use Sysix\LexOffice\Clients\Quotation;
use Sysix\LexOffice\Clients\RecurringTemplate;
use Sysix\LexOffice\Clients\Voucher;
use Sysix\LexOffice\Clients\VoucherList;
use Sysix\LexOffice\Exceptions\LexOfficeApiException;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Exception\RequestException;
Expand Down
2 changes: 1 addition & 1 deletion src/BaseClient.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php declare(strict_types=1);


namespace Clicksports\LexOffice;
namespace Sysix\LexOffice;

use GuzzleHttp\Psr7\MultipartStream;
use Psr\Http\Message\ResponseInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/ClientInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

namespace Clicksports\LexOffice;
namespace Sysix\LexOffice;

interface ClientInterface
{
Expand Down
10 changes: 5 additions & 5 deletions src/Clients/Contact.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php declare(strict_types=1);

namespace Clicksports\LexOffice\Clients;
namespace Sysix\LexOffice\Clients;

use Clicksports\LexOffice\Clients\Traits\CreateTrait;
use Clicksports\LexOffice\Clients\Traits\GetTrait;
use Clicksports\LexOffice\Clients\Traits\UpdateTrait;
use Clicksports\LexOffice\PaginationClient;
use Sysix\LexOffice\Clients\Traits\CreateTrait;
use Sysix\LexOffice\Clients\Traits\GetTrait;
use Sysix\LexOffice\Clients\Traits\UpdateTrait;
use Sysix\LexOffice\PaginationClient;

class Contact extends PaginationClient
{
Expand Down
6 changes: 3 additions & 3 deletions src/Clients/Country.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php declare(strict_types=1);

namespace Clicksports\LexOffice\Clients;
namespace Sysix\LexOffice\Clients;

use Clicksports\LexOffice\BaseClient;
use Clicksports\LexOffice\Exceptions\LexOfficeApiException;
use Sysix\LexOffice\BaseClient;
use Sysix\LexOffice\Exceptions\LexOfficeApiException;
use Psr\Http\Message\ResponseInterface;

class Country extends BaseClient
Expand Down
12 changes: 6 additions & 6 deletions src/Clients/CreditNote.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php declare(strict_types=1);

namespace Clicksports\LexOffice\Clients;
namespace Sysix\LexOffice\Clients;

use Clicksports\LexOffice\BaseClient;
use Clicksports\LexOffice\Clients\Traits\CreateFinalizeTrait;
use Clicksports\LexOffice\Clients\Traits\DocumentClientTrait;
use Clicksports\LexOffice\Clients\Traits\GetTrait;
use Clicksports\LexOffice\Clients\Traits\VoucherListTrait;
use Sysix\LexOffice\BaseClient;
use Sysix\LexOffice\Clients\Traits\CreateFinalizeTrait;
use Sysix\LexOffice\Clients\Traits\DocumentClientTrait;
use Sysix\LexOffice\Clients\Traits\GetTrait;
use Sysix\LexOffice\Clients\Traits\VoucherListTrait;

class CreditNote extends BaseClient
{
Expand Down
10 changes: 5 additions & 5 deletions src/Clients/DownPaymentInvoice.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php declare(strict_types=1);

namespace Clicksports\LexOffice\Clients;
namespace Sysix\LexOffice\Clients;

use Clicksports\LexOffice\BaseClient;
use Clicksports\LexOffice\Clients\Traits\DocumentClientTrait;
use Clicksports\LexOffice\Clients\Traits\GetTrait;
use Clicksports\LexOffice\Clients\Traits\VoucherListTrait;
use Sysix\LexOffice\BaseClient;
use Sysix\LexOffice\Clients\Traits\DocumentClientTrait;
use Sysix\LexOffice\Clients\Traits\GetTrait;
use Sysix\LexOffice\Clients\Traits\VoucherListTrait;

class DownPaymentInvoice extends BaseClient
{
Expand Down
10 changes: 5 additions & 5 deletions src/Clients/Event.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php declare(strict_types=1);


namespace Clicksports\LexOffice\Clients;
namespace Sysix\LexOffice\Clients;

use Clicksports\LexOffice\BaseClient;
use Clicksports\LexOffice\Clients\Traits\CreateTrait;
use Clicksports\LexOffice\Clients\Traits\DeleteTrait;
use Clicksports\LexOffice\Exceptions\LexOfficeApiException;
use Sysix\LexOffice\BaseClient;
use Sysix\LexOffice\Clients\Traits\CreateTrait;
use Sysix\LexOffice\Clients\Traits\DeleteTrait;
use Sysix\LexOffice\Exceptions\LexOfficeApiException;
use Psr\Http\Message\ResponseInterface;

class Event extends BaseClient
Expand Down
8 changes: 4 additions & 4 deletions src/Clients/File.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php declare(strict_types=1);

namespace Clicksports\LexOffice\Clients;
namespace Sysix\LexOffice\Clients;

use Clicksports\LexOffice\BaseClient;
use Clicksports\LexOffice\Clients\Traits\GetTrait;
use Clicksports\LexOffice\Exceptions\LexOfficeApiException;
use Sysix\LexOffice\BaseClient;
use Sysix\LexOffice\Clients\Traits\GetTrait;
use Sysix\LexOffice\Exceptions\LexOfficeApiException;
use Psr\Http\Message\ResponseInterface;

class File extends BaseClient
Expand Down
12 changes: 6 additions & 6 deletions src/Clients/Invoice.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php declare(strict_types=1);

namespace Clicksports\LexOffice\Clients;
namespace Sysix\LexOffice\Clients;

use Clicksports\LexOffice\BaseClient;
use Clicksports\LexOffice\Clients\Traits\CreateFinalizeTrait;
use Clicksports\LexOffice\Clients\Traits\DocumentClientTrait;
use Clicksports\LexOffice\Clients\Traits\GetTrait;
use Clicksports\LexOffice\Clients\Traits\VoucherListTrait;
use Sysix\LexOffice\BaseClient;
use Sysix\LexOffice\Clients\Traits\CreateFinalizeTrait;
use Sysix\LexOffice\Clients\Traits\DocumentClientTrait;
use Sysix\LexOffice\Clients\Traits\GetTrait;
use Sysix\LexOffice\Clients\Traits\VoucherListTrait;

class Invoice extends BaseClient
{
Expand Down
12 changes: 6 additions & 6 deletions src/Clients/OrderConfirmation.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php declare(strict_types=1);

namespace Clicksports\LexOffice\Clients;
namespace Sysix\LexOffice\Clients;

use Clicksports\LexOffice\BaseClient;
use Clicksports\LexOffice\Clients\Traits\CreateTrait;
use Clicksports\LexOffice\Clients\Traits\DocumentClientTrait;
use Clicksports\LexOffice\Clients\Traits\GetTrait;
use Clicksports\LexOffice\Clients\Traits\VoucherListTrait;
use Sysix\LexOffice\BaseClient;
use Sysix\LexOffice\Clients\Traits\CreateTrait;
use Sysix\LexOffice\Clients\Traits\DocumentClientTrait;
use Sysix\LexOffice\Clients\Traits\GetTrait;
use Sysix\LexOffice\Clients\Traits\VoucherListTrait;

class OrderConfirmation extends BaseClient
{
Expand Down
8 changes: 4 additions & 4 deletions src/Clients/Payment.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php declare(strict_types=1);

namespace Clicksports\LexOffice\Clients;
namespace Sysix\LexOffice\Clients;

use Clicksports\LexOffice\BaseClient;
use Clicksports\LexOffice\Clients\Traits\GetTrait;
use Clicksports\LexOffice\Exceptions\BadMethodCallException;
use Sysix\LexOffice\BaseClient;
use Sysix\LexOffice\Clients\Traits\GetTrait;
use Sysix\LexOffice\Exceptions\BadMethodCallException;

class Payment extends BaseClient
{
Expand Down
6 changes: 3 additions & 3 deletions src/Clients/PaymentCondition.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php declare(strict_types=1);

namespace Clicksports\LexOffice\Clients;
namespace Sysix\LexOffice\Clients;

use Clicksports\LexOffice\BaseClient;
use Clicksports\LexOffice\Exceptions\LexOfficeApiException;
use Sysix\LexOffice\BaseClient;
use Sysix\LexOffice\Exceptions\LexOfficeApiException;
use Psr\Http\Message\ResponseInterface;

class PaymentCondition extends BaseClient
Expand Down
6 changes: 3 additions & 3 deletions src/Clients/PostingCategory.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php declare(strict_types=1);

namespace Clicksports\LexOffice\Clients;
namespace Sysix\LexOffice\Clients;

use Clicksports\LexOffice\BaseClient;
use Clicksports\LexOffice\Exceptions\LexOfficeApiException;
use Sysix\LexOffice\BaseClient;
use Sysix\LexOffice\Exceptions\LexOfficeApiException;
use Psr\Http\Message\ResponseInterface;

class PostingCategory extends BaseClient
Expand Down
6 changes: 3 additions & 3 deletions src/Clients/Profile.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php declare(strict_types=1);


namespace Clicksports\LexOffice\Clients;
namespace Sysix\LexOffice\Clients;

use Clicksports\LexOffice\BaseClient;
use Clicksports\LexOffice\Exceptions\LexOfficeApiException;
use Sysix\LexOffice\BaseClient;
use Sysix\LexOffice\Exceptions\LexOfficeApiException;
use Psr\Http\Message\ResponseInterface;

class Profile extends BaseClient
Expand Down
Loading

0 comments on commit f3241ad

Please sign in to comment.