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

Classes and namespaces should be singular #12

Merged
merged 1 commit into from Nov 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Api/Carts.php → src/Api/Cart.php
Expand Up @@ -12,14 +12,14 @@
use FAPI\Sylius\Exception;
use FAPI\Sylius\Exception\Domain as DomainExceptions;
use FAPI\Sylius\Exception\InvalidArgumentException;
use FAPI\Sylius\Model\Cart\Cart;
use FAPI\Sylius\Model\Cart\Cart as Model;
use FAPI\Sylius\Model\Cart\CartItem;
use Psr\Http\Message\ResponseInterface;

/**
* @author Kasim Taskin <taskinkasim@gmail.com>
*/
final class Carts extends HttpApi
final class Cart extends HttpApi
{
/**
* @param int $id
Expand All @@ -45,7 +45,7 @@ public function get(int $id)
$this->handleErrors($response);
}

return $this->hydrator->hydrate($response, Cart::class);
return $this->hydrator->hydrate($response, Model::class);
}

/**
Expand Down Expand Up @@ -96,7 +96,7 @@ public function create(string $customer, string $channel, string $localeCode)
}
}

return $this->hydrator->hydrate($response, Cart::class);
return $this->hydrator->hydrate($response, Model::class);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Checkouts.php → src/Api/Checkout.php
Expand Up @@ -18,7 +18,7 @@
/**
* @author Kasim Taskin <taskinkasim@gmail.com>
*/
final class Checkouts extends HttpApi
final class Checkout extends HttpApi
{
const SHIPPING_ADDRESS_FIELDS = [
'firstName',
Expand Down
6 changes: 3 additions & 3 deletions src/Api/Customers.php → src/Api/Customer.php
Expand Up @@ -12,13 +12,13 @@
use FAPI\Sylius\Exception;
use FAPI\Sylius\Exception\Domain as DomainExceptions;
use FAPI\Sylius\Exception\InvalidArgumentException;
use FAPI\Sylius\Model\Customer\Customer;
use FAPI\Sylius\Model\Customer\Customer as Model;
use Psr\Http\Message\ResponseInterface;

/**
* @author Kasim Taskin <taskinkasim@gmail.com>
*/
final class Customers extends HttpApi
final class Customer extends HttpApi
{
/**
* @param string $message
Expand Down Expand Up @@ -73,6 +73,6 @@ public function create(string $email, string $firstName, string $lastName, strin
}
}

return $this->hydrator->hydrate($response, Customer::class);
return $this->hydrator->hydrate($response, Model::class);
}
}
6 changes: 3 additions & 3 deletions src/Api/Products.php → src/Api/Product.php
Expand Up @@ -12,13 +12,13 @@
use FAPI\Sylius\Exception;
use FAPI\Sylius\Model\Product\ProductCollection;
use FAPI\Sylius\Model\Product\VariantCollection;
use FAPI\Sylius\Model\Product\Product;
use FAPI\Sylius\Model\Product\Product as Model;
use Psr\Http\Message\ResponseInterface;

/**
* @author Kasim Taskin <taskinkasim@gmail.com>
*/
final class Products extends HttpApi
final class Product extends HttpApi
{
public function get(string $productCode)
{
Expand All @@ -33,7 +33,7 @@ public function get(string $productCode)
$this->handleErrors($response);
}

return $this->hydrator->hydrate($response, Product::class);
return $this->hydrator->hydrate($response, Model::class);
}

/**
Expand Down
16 changes: 8 additions & 8 deletions src/SyliusClient.php
Expand Up @@ -118,24 +118,24 @@ public function getAccessToken(): string
}


public function customers(): Api\Customers
public function customer(): Api\Customer
{
return new Api\Customers($this->getHttpClient(), $this->hydrator, $this->requestBuilder);
return new Api\Customer($this->getHttpClient(), $this->hydrator, $this->requestBuilder);
}

public function carts(): Api\Carts
public function cart(): Api\Cart
{
return new Api\Carts($this->getHttpClient(), $this->hydrator, $this->requestBuilder);
return new Api\Cart($this->getHttpClient(), $this->hydrator, $this->requestBuilder);
}

public function products(): Api\Products
public function product(): Api\Product
{
return new Api\Products($this->getHttpClient(), $this->hydrator, $this->requestBuilder);
return new Api\Product($this->getHttpClient(), $this->hydrator, $this->requestBuilder);
}

public function checkouts(): Api\Checkouts
public function checkout(): Api\Checkout
{
return new Api\Checkouts($this->getHttpClient(), $this->hydrator, $this->requestBuilder);
return new Api\Checkout($this->getHttpClient(), $this->hydrator, $this->requestBuilder);
}

private function getHttpClient(): HttpClient
Expand Down