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

Oro 6.0.x compatibility added #1

Open
wants to merge 1 commit into
base: develop
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
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"Integration"
],
"require": {
"php": ">=8.2",
"oro/platform": "5.1.*",
"oro/platform-serialised-fields": "5.1.*",
"oro/commerce": "5.1.*",
"php": "~8.3.0",
"oro/platform": "6.0.*",
"oro/platform-serialised-fields": "6.0.x-dev",
"oro/commerce": "6.0.*",
"ext-simplexml": "*"
},
"version": "1.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/Builder/ShippingPackagesBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function init(ShippingService $shippingService, int $websiteId): void
*
* @throws PackageException
*/
public function addLineItem(ShippingLineItemInterface $lineItem): bool
public function addLineItem(\Oro\Bundle\ShippingBundle\Context\ShippingLineItem $lineItem): bool
{
if (!$lineItem->getWeight()) {
$this->badItemException($lineItem, 'Unknown weight.');
Expand Down Expand Up @@ -140,7 +140,7 @@ private function getParcelMaxAmount(): ?int
*
* @throws PackageException
*/
private function badItemException(ShippingLineItemInterface $lineItem, ?string $message = ''): void
private function badItemException(\Oro\Bundle\ShippingBundle\Context\ShippingLineItem $lineItem, ?string $message = ''): void
{
throw new PackageException(
sprintf(
Expand Down
10 changes: 5 additions & 5 deletions src/Command/StationExportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @link https://www.dnd.fr/
*/
#[\Symfony\Component\Console\Attribute\AsCommand('dnd:dpd:station-export:test', 'Helps debugging station export by outputing the export data for a given order.')]
class StationExportCommand extends Command
{
protected ?ParameterBag $settings = null;
protected static $defaultName = 'dnd:dpd:station-export:test';
protected StationExportProcessor $stationExportProcessor;
/**
* @var DpdShippingPackageOptionsInterface[]|null $packages
Expand All @@ -58,7 +58,7 @@ public function __construct(
/** @noinspection PhpMissingParentCallCommonInspection */
protected function configure(): void
{
$this->setDescription('Helps debugging station export by outputing the export data for a given order.')
$this
->addArgument(
'id',
InputArgument::REQUIRED,
Expand Down Expand Up @@ -90,7 +90,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
if (!$order instanceof Order) {
$output->writeln('Could not find requested order');

return 0;
return \Symfony\Component\Console\Command\Command::SUCCESS;
}
$shippingService = $this->shippingServiceProvider->getServiceForMethodTypeIdentifier(
$order->getShippingMethodType()
Expand All @@ -106,7 +106,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$output->writeln('Something wrong happened with the order.');
$output->write($e->getMessage());

return 0;
return \Symfony\Component\Console\Command\Command::SUCCESS;
}

$output->writeln(
Expand All @@ -120,7 +120,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$table->setHeaders(['code', 'position', 'length', 'value'])->setRows($data);
$table->render();

return 0;
return \Symfony\Component\Console\Command\Command::SUCCESS;
}

/**
Expand Down
10 changes: 4 additions & 6 deletions src/Controller/Frontend/RelayController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,22 @@
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;

/**
* @author Agence Dn'D <[email protected]>
* @copyright 2004-present Agence Dn'D
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @link https://www.dnd.fr/
* @Route("/dpd_france")
*/
#[\Symfony\Component\Routing\Attribute\Route(path: '/dpd_france')]
class RelayController extends AbstractController
{
/**
* Returns a list of nearby pudos
*
* @Route("/relays", name="dpd_france_relay_list", methods={"GET", "POST"})
*/
#[\Symfony\Component\Routing\Attribute\Route(path: '/relays', name: 'dpd_france_relay_list', methods: ['GET', 'POST'])]
public function listAction(Request $request, PudoProvider $pudoProvider): JsonResponse
{
$checkoutId = $request->get('checkoutId');
Expand Down Expand Up @@ -59,9 +58,8 @@ public function listAction(Request $request, PudoProvider $pudoProvider): JsonRe

/**
* Returns all them details about a pudo
*
* @Route("/relay/{pudoId}", name="dpd_france_relay_details", methods={"GET"})
*/
#[\Symfony\Component\Routing\Attribute\Route(path: '/relay/{pudoId}', name: 'dpd_france_relay_details', methods: ['GET'])]
public function detailsAction(string $pudoId, PudoProvider $pudoProvider): JsonResponse
{
try {
Expand Down
2 changes: 1 addition & 1 deletion src/Factory/PackageFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(
* @throws PackageException
*/
public function create(
ShippingLineItemCollectionInterface $lineItemCollection,
\Doctrine\Common\Collections\Collection $lineItemCollection,
ShippingService $shippingService,
int $websiteId
): array {
Expand Down