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

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