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 driver for PS 8.1.7 & Valet 4.5.0 #2

Open
wants to merge 1 commit 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
10 changes: 7 additions & 3 deletions PrestashopValetDriver.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php

namespace Valet\Drivers\Custom;

use Valet\Drivers\ValetDriver;

class PrestaShopValetDriver extends ValetDriver
{
/**
Expand All @@ -11,7 +15,7 @@ class PrestaShopValetDriver extends ValetDriver
*
* @return bool
*/
public function serves($sitePath, $siteName, $uri)
public function serves(string $sitePath, string $siteName, string $uri) :bool
{
return file_exists($sitePath . '/classes/PrestaShopAutoload.php');
}
Expand All @@ -25,7 +29,7 @@ public function serves($sitePath, $siteName, $uri)
*
* @return string|false
*/
public function isStaticFile($sitePath, $siteName, $uri)
public function isStaticFile(string $sitePath, string $siteName, string $uri) :string
{
// Basic static file
if (is_file($staticFilePath = "{$sitePath}/{$uri}")) {
Expand Down Expand Up @@ -114,7 +118,7 @@ public function isStaticFile($sitePath, $siteName, $uri)
*
* @return string
*/
public function frontControllerPath($sitePath, $siteName, $uri)
public function frontControllerPath(string $sitePath, string $siteName, string $uri) :string
{
//Legacy URls
$parts = explode('/', $uri);
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Prestashop Valet Driver

Last tested with:
Prestashop 1.7.4
Last tested versions:
* Prestashop 8.1.7
* Laravel Valet 4.5.0

## Instructions:
Copy `PrestashopValetDriver.php` to your `~/.config/valet/Drivers` folder.