Commit f44a1ecd authored by Jacob Priddy's avatar Jacob Priddy 👌

Updates:

update to php 8
laravel apidoc genrator -> scribe
Stop using xdebug cause its not working in phpstorm+docker :(
laravel 8
parent 68d972b3
Pipeline #13190 passed with stages
in 2 minutes and 45 seconds
FROM php:7.4-fpm-alpine
FROM php:8.0-fpm-alpine
ENV PROJECT_DIR /var/www
......@@ -20,10 +20,10 @@ RUN apk update && apk add --no-cache \
coreutils \
rsync \
npm\
&& apk add --no-cache $PHPIZE_DEPS \
&& npm install -g @vue/cli \
&& pecl install xdebug \
&& docker-php-ext-enable xdebug
&& apk add --no-cache $PHPIZE_DEPS
# && npm install -g @vue/cli \
# && pecl install xdebug \
# && docker-php-ext-enable xdebug
# Install PHP Extensions
RUN docker-php-ext-install pdo \
......
error_reporting = E_ALL
display_startup_errors = On
display_errors = On
xdebug.remote_enable=1
xdebug.remote_connect_back=1
xdebug.idekey="PHPSTORM"
xdebug.remote_port=9000
xdebug.remote_autostart=1
# DockerNAT gateway IP
xdebug.remote.host=host.docker.internal
xdebug.remote.mode=req
xdebug.remote.handler=dbgp
;xdebug.mode=debug
;xdebug.start_with_request=yes
;xdebug.idekey="PHPSTORM"
; DockerNAT gateway IP
;xdebug.client_host=host.docker.internal
date.timezone = "America/Los_Angeles"
memory_limit = 256M
FROM php:7.4-fpm-alpine
FROM php:8.0-fpm-alpine
ENV PROJECT_DIR /var/www
......
......@@ -4,24 +4,24 @@
namespace App\Documentation\Strategies;
use ReflectionClass;
use ReflectionMethod;
use Illuminate\Routing\Route;
use Mpociot\ApiDoc\Tools\DocumentationConfig;
use Mpociot\ApiDoc\Extracting\Strategies\Strategy;
use ReflectionFunctionAbstract;
use Knuckles\Scribe\Tools\DocumentationConfig;
use Knuckles\Scribe\Extracting\Strategies\Strategy;
class ApplicationRepositoryResetStrategy extends Strategy
{
public function __construct(string $stage, DocumentationConfig $config)
public function __construct(DocumentationConfig $config)
{
// Set the config to use in memory implementations
config(['app.env', 'memory']);
parent::__construct($stage, $config);
parent::__construct($config);
}
/**
* @inheritDoc
*/
public function __invoke(Route $route, ReflectionClass $controller, ReflectionMethod $method, array $routeRules, array $context = [])
public function __invoke(Route $route, ReflectionClass $controller, ReflectionFunctionAbstract $method, array $routeRules, array $alreadyExtractedData = [])
{
return null;
}
......
......@@ -4,22 +4,22 @@
namespace App\Documentation\Strategies;
use ReflectionClass;
use ReflectionMethod;
use Illuminate\Routing\Route;
use Mpociot\ApiDoc\Extracting\Strategies\Strategy;
use ReflectionFunctionAbstract;
use Knuckles\Scribe\Extracting\Strategies\Strategy;
class BodyAuthenticationStrategy extends Strategy
{
/**
* @inheritDoc
*/
public function __invoke(Route $route, ReflectionClass $controller, ReflectionMethod $method, array $routeRules, array $context = [])
public function __invoke(Route $route, ReflectionClass $controller, ReflectionFunctionAbstract $method, array $routeRules, array $alreadyExtractedData = [])
{
if (in_array('GET', $route->methods(), true)) {
return null;
}
if (!$context['metadata']['authenticated']) {
if (!$alreadyExtractedData['metadata']['authenticated']) {
return null;
}
......
......@@ -4,22 +4,22 @@
namespace App\Documentation\Strategies;
use ReflectionClass;
use ReflectionMethod;
use Illuminate\Routing\Route;
use Mpociot\ApiDoc\Extracting\Strategies\Strategy;
use ReflectionFunctionAbstract;
use Knuckles\Scribe\Extracting\Strategies\Strategy;
class GetAuthenticationStrategy extends Strategy
{
/**
* @inheritDoc
*/
public function __invoke(Route $route, ReflectionClass $controller, ReflectionMethod $method, array $routeRules, array $context = [])
public function __invoke(Route $route, ReflectionClass $controller, ReflectionFunctionAbstract $method, array $routeRules, array $alreadyExtractedData = [])
{
if (!in_array('GET', $route->methods(), true)) {
return null;
}
if (!$context['metadata']['authenticated']) {
if (!$alreadyExtractedData['metadata']['authenticated']) {
return null;
}
......
......@@ -4,10 +4,10 @@
namespace App\Documentation\Strategies;
use ReflectionClass;
use ReflectionMethod;
use RuntimeException;
use Illuminate\Routing\Route;
use Mpociot\ApiDoc\Extracting\Strategies\Strategy;
use ReflectionFunctionAbstract;
use Knuckles\Scribe\Extracting\Strategies\Strategy;
class GoodResponseValidationStrategy extends Strategy
{
......@@ -22,13 +22,13 @@ class GoodResponseValidationStrategy extends Strategy
/**
* @inheritDoc
*/
public function __invoke(Route $route, ReflectionClass $controller, ReflectionMethod $method, array $routeRules, array $context = [])
public function __invoke(Route $route, ReflectionClass $controller, ReflectionFunctionAbstract $method, array $routeRules, array $alreadyExtractedData = [])
{
if (in_array($route->getName(), self::EXCLUDED, true)) {
return null;
}
foreach ($context['responses'] as $response) {
foreach ($alreadyExtractedData['responses'] as $response) {
$status = $response['status'] ?? 0;
if ($status < 300 && $status >= 200) {
return null;
......
......@@ -4,16 +4,16 @@
namespace App\Documentation\Strategies;
use ReflectionClass;
use ReflectionMethod;
use Illuminate\Routing\Route;
use Mpociot\ApiDoc\Extracting\Strategies\Strategy;
use ReflectionFunctionAbstract;
use Knuckles\Scribe\Extracting\Strategies\Strategy;
class PaginationStrategy extends Strategy
{
/**
* @inheritDoc
*/
public function __invoke(Route $route, ReflectionClass $controller, ReflectionMethod $method, array $routeRules, array $context = [])
public function __invoke(Route $route, ReflectionClass $controller, ReflectionFunctionAbstract $method, array $routeRules, array $alreadyExtractedData = [])
{
if (!in_array('GET', $route->methods(), true)) {
return null;
......
......@@ -4,18 +4,18 @@
namespace App\Documentation\Strategies;
use ReflectionClass;
use ReflectionMethod;
use Illuminate\Routing\Route;
use Mpociot\ApiDoc\Extracting\Strategies\Strategy;
use ReflectionFunctionAbstract;
use Knuckles\Scribe\Extracting\Strategies\Strategy;
class UnauthenticatedResponseStrategy extends Strategy
{
/**
* @inheritDoc
*/
public function __invoke(Route $route, ReflectionClass $controller, ReflectionMethod $method, array $routeRules, array $context = [])
public function __invoke(Route $route, ReflectionClass $controller, ReflectionFunctionAbstract $method, array $routeRules, array $alreadyExtractedData = [])
{
if (!$context['metadata']['authenticated']) {
if (!$alreadyExtractedData['metadata']['authenticated']) {
return null;
}
......
......@@ -2,6 +2,7 @@
namespace App\Providers;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
......@@ -23,6 +24,6 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
//
Paginator::useBootstrap();
}
}
......@@ -12,21 +12,21 @@
"devmarketer/easynav": "^1.0",
"fideloper/proxy": "^4.0",
"fruitcake/laravel-cors": "^1.0",
"laravel/framework": "^7.0",
"laravel/framework": "^8.0",
"laravel/tinker": "^2.0",
"laravel/ui": "^2.0",
"laravel/ui": "^3.0",
"rlanvin/php-rrule": "^2.2",
"ext-json": "*"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.4",
"facade/ignition": "^2.0",
"facade/ignition": "^2.3.6",
"friendsofphp/php-cs-fixer": "^2.16",
"fzaninotto/faker": "^1.4",
"knuckleswtf/scribe": "^1.0.0",
"mockery/mockery": "^1.0",
"mpociot/laravel-apidoc-generator": "^4.8",
"nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.5",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.5",
"roave/security-advisories": "dev-master"
},
"config": {
......
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
<testsuite name="Database">
<directory suffix="Test.php">./tests/Database</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./app</directory>
<directory suffix=".php">./src</directory>
<exclude>
<directory suffix=".php">./app/Console</directory>
<directory suffix="ServiceProvider.php">./src</directory>
<directory prefix="Local" suffix="Repository.php">./src</directory>
<directory suffix=".php">./app/Documentation/Strategies</directory>
</exclude>
</whitelist>
</filter>
<php>
<server name="APP_ENV" value="testing"/>
<server name="BCRYPT_ROUNDS" value="4"/>
<server name="CACHE_DRIVER" value="array"/>
<server name="SESSION_DRIVER" value="array"/>
</php>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" backupGlobals="false" backupStaticAttributes="false" bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./app</directory>
<directory suffix=".php">./src</directory>
</include>
<exclude>
<directory suffix=".php">./app/Console</directory>
<directory suffix="ServiceProvider.php">./src</directory>
<directory prefix="Local" suffix="Repository.php">./src</directory>
<directory suffix=".php">./app/Documentation/Strategies</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
<testsuite name="Database">
<directory suffix="Test.php">./tests/Database</directory>
</testsuite>
</testsuites>
<php>
<server name="APP_ENV" value="testing"/>
<server name="BCRYPT_ROUNDS" value="4"/>
<server name="CACHE_DRIVER" value="array"/>
<server name="SESSION_DRIVER" value="array"/>
</php>
</phpunit>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment