Skip to content

Commit

Permalink
bunch of changes
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarnevarezleal committed Jan 16, 2024
1 parent 5381c49 commit 4b78ecb
Show file tree
Hide file tree
Showing 14 changed files with 6,424 additions and 7,276 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ fabric.properties
var
sample-apps
vendor
bin/.phpunit
bin/.phpunitdepot.json
1 change: 1 addition & 0 deletions .php-cs-fixer.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"php":"8.3.1","version":"3.47.0","indent":" ","lineEnding":"\n","rules":{"binary_operator_spaces":{"default":"at_least_single_space"},"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"blank_lines_before_namespace":true,"braces_position":{"allow_single_line_empty_anonymous_classes":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_type_declaration":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_parentheses":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"imports_order":["class","function","const"],"sort_algorithm":"none"},"return_type_declaration":true,"short_scalar_cast":true,"single_import_per_statement":{"group_to_single_imports":false},"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"unary_operator_spaces":{"only_dec_inc":true},"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"after_heredoc":true},"no_break_comment":true,"no_closing_tag":true,"no_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_line_after_imports":true,"spaces_inside_parentheses":true,"statement_indentation":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"clean_namespace":true,"no_unset_cast":true,"assign_null_coalescing_to_coalesce_equal":true,"normalize_index_brace":true,"no_whitespace_before_comma_in_array":{"after_heredoc":true},"trailing_comma_in_multiline":{"after_heredoc":true},"list_syntax":true,"ternary_to_null_coalescing":true,"array_syntax":true,"get_class_to_class_keyword":true,"modernize_strpos":true,"no_alias_functions":{"sets":["@all"]},"no_php4_constructor":true,"no_unneeded_final_method":true,"no_unreachable_default_argument_value":true,"implode_call":true,"use_arrow_functions":true,"void_return":true,"combine_nested_dirname":true,"declare_strict_types":true,"non_printable_character":true,"random_api_migration":{"replacements":{"mt_rand":"random_int","rand":"random_int"}},"pow_to_exponentiation":true},"hashes":{"\/var\/app\/app\/Providers\/AppServiceProvider.php":"1ec4db88d3552a5250b23a5730a20185","\/var\/app\/app\/Providers\/AuthServiceProvider.php":"4e6460e99cd0db16f34348272701e7b3","\/var\/app\/app\/Providers\/RouteServiceProvider.php":"9d496688bb7bcb485ab2eade71555b3f","\/var\/app\/app\/Providers\/BroadcastServiceProvider.php":"3216457878674093b197a955a623d3f3","\/var\/app\/app\/Providers\/EventServiceProvider.php":"b46c5ca9cef8dd7cb86250582c4dd6e0","\/var\/app\/app\/Models\/User.php":"3421857acc5766360d440f5cc7e823fc","\/var\/app\/app\/Exceptions\/Handler.php":"34812adf44ceb473944a616cd979b27a","\/var\/app\/app\/Http\/Middleware\/VerifyCsrfToken.php":"12ec6695ac861d055758cba10b802696","\/var\/app\/app\/Http\/Middleware\/RedirectIfAuthenticated.php":"7273a241ae69836103c3ea6e44594f82","\/var\/app\/app\/Http\/Middleware\/TrimStrings.php":"44c9e1418875c7e7754068d43b5f3c0c","\/var\/app\/app\/Http\/Middleware\/Authenticate.php":"3cc67c43eb11d307094524a227fe1777","\/var\/app\/app\/Http\/Middleware\/TrustProxies.php":"6ef300cb0fa4760b0b78eeed4b562487","\/var\/app\/app\/Http\/Middleware\/ValidateSignature.php":"bb10f8709eb198d53f502bed9ea3ac76","\/var\/app\/app\/Http\/Middleware\/PreventRequestsDuringMaintenance.php":"b1df55ae9f316dd6672af96c78a82d29","\/var\/app\/app\/Http\/Middleware\/EncryptCookies.php":"2733d7acf7c6b8842991ad34e1d28ee0","\/var\/app\/app\/Http\/Middleware\/TrustHosts.php":"296d5025e64924ad380db403db212e03","\/var\/app\/app\/Http\/Controllers\/Controller.php":"3cd28b4b4ae4d9fa3300376350c2751c","\/var\/app\/app\/Http\/Kernel.php":"0f02c42c30c7bfe84fb855723abd6a31","\/var\/app\/app\/Console\/Kernel.php":"534737680befcd9f116ed795d92a27e1","\/var\/app\/config\/sanctum.php":"b70ebcc6d67afe95d11b49ade10d1198","\/var\/app\/config\/hashing.php":"54b38958b9fea1b599b0fb619772c092","\/var\/app\/config\/auth.php":"096aa20ebc56c108fab794e7e3d05c39","\/var\/app\/config\/app.php":"b01f704f7e08d4e221bf9103e6c201cb","\/var\/app\/config\/mail.php":"26f26a2ffe85c50c3ec0691d6faf8091","\/var\/app\/config\/services.php":"001c6ed4e82bcd511bcafcf1258f457d","\/var\/app\/config\/database.php":"2afea4392d7f8c84d6b1bb272db5cb95","\/var\/app\/config\/cache.php":"4a08a7e1e96dd380e31f243b009e95bf","\/var\/app\/config\/session.php":"f0aa682473d5fbf474946cd8f70f2233","\/var\/app\/config\/queue.php":"f2e7216f3527f855aaa7b3a1cd4cb7d1","\/var\/app\/config\/broadcasting.php":"27765c4ac12c9664e0ff9e463cf7e01c","\/var\/app\/config\/view.php":"c2fd14344e55ae544e36aec9ec3b9402","\/var\/app\/config\/cors.php":"e47fe7533f273b7e63cbcb1bd28c3653","\/var\/app\/config\/logging.php":"c0e6dfea86490d407e39c769bebde596","\/var\/app\/config\/filesystems.php":"ee3c6b9a3e38ff055a08c6a6e411c5c6","\/var\/app\/database\/migrations\/2019_12_14_000001_create_personal_access_tokens_table.php":"96e7bcddf4e811f99983b6e71d83e5c0","\/var\/app\/database\/migrations\/2014_10_12_100000_create_password_reset_tokens_table.php":"835e4b75158693d14a028efc2ce5b757","\/var\/app\/database\/migrations\/2014_10_12_000000_create_users_table.php":"7296c9f3e0de9406f7b41e651784ad23","\/var\/app\/database\/migrations\/2019_08_19_000000_create_failed_jobs_table.php":"b11ac943fcdd6208bed232e2bcc252dc","\/var\/app\/database\/seeders\/DatabaseSeeder.php":"70818b6fddd0e73c6156dadd06eeef73","\/var\/app\/database\/factories\/UserFactory.php":"88a3a1fdbeae70ac138fe31c269f316a","\/var\/app\/routes\/channels.php":"4b320f4466958070c455b7f6abff439e","\/var\/app\/routes\/console.php":"016794969bb8c33eac153952d8680861","\/var\/app\/routes\/web.php":"772e0c7243afd7f5eb06d9aa9892adbb","\/var\/app\/routes\/api.php":"bddb141f992b1aafc2b4604554a278e3","\/var\/app\/tests\/Unit\/ExampleTest.php":"a97f257c38536229a7d5d83c175ea0a8","\/var\/app\/tests\/CreatesApplication.php":"7ccdd9c4a92b25b0322e5d62ccb22713","\/var\/app\/tests\/Feature\/ExampleTest.php":"bde0c82271da2524a0d03b21252cdb10","\/var\/app\/tests\/TestCase.php":"b9ad5821823c481100f73431178caa71"}}
32 changes: 32 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$project_path = getenv('LARAVEL_APP_DIR');
$finder = Finder::create()
->in([
$project_path . '/app',
$project_path . '/config',
$project_path . '/database',
$project_path . '/resources',
$project_path . '/routes',
$project_path . '/tests',
])
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

$config = new PhpCsFixer\Config();

$config->setRules(array_merge($config->getRules(), [
'@PHP80Migration' => true,
'@PHP80Migration:risky' => true,
'heredoc_indentation' => false,
]));

return $config
->setFinder($finder)
->setRiskyAllowed(true)
->setUsingCache(true);
146 changes: 0 additions & 146 deletions .php_cs.dist

This file was deleted.

60 changes: 6 additions & 54 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,65 +1,17 @@
FROM alpine:3.11
ARG PHP_VERSION=7.4
ARG USER_ID=1001
ARG GROUP_ID=1001
FROM composer:2.2

ENV LARASED_HOME=/var/laravel-sed
ENV LARAVEL_APP_DIR=/var/app
ENV APK_DEL="curl"

WORKDIR $LARASED_HOME

ADD . .

ADD https://dl.bintray.com/php-alpine/key/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub
RUN apk --update add ca-certificates && \
echo "https://dl.bintray.com/php-alpine/v3.11/php-${PHP_VERSION}" >> /etc/apk/repositories

RUN addgroup $USER_ID && \
adduser -G $USER_ID -s /bin/bash -D $USER_ID --home "/home/$USER_ID"

## install php and some extensions
RUN apk add \
php \
php-bz2 \
php-dom \
php-json \
php-phar \
php-mbstring \
php-iconv \
php-openssl \
php-curl \
php-session \
php-sodium \
php-zip \
php-zlib && \
ln -s /usr/bin/php7 /usr/bin/php
#
#RUN apk update && apk add bash < doesnt work
RUN apk add --update bash curl git && rm -rf /var/cache/apk/*

RUN curl -s -o composer-setup.php https://getcomposer.org/installer \
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer \
&& rm composer-setup.php \
&& curl -SsLo styleci.phar https://github.com/StyleCI/CLI/releases/download/v0.6.2/styleci.phar \
&& chmod +x styleci.phar \
&& mv styleci.phar /usr/local/bin/styleci \
&& curl -L https://cs.symfony.com/download/php-cs-fixer-v2.phar -o php-cs-fixer \
&& mv php-cs-fixer /usr/local/bin/php-cs-fixer

WORKDIR $LARASED_HOME

RUN composer install

RUN apk del ${APK_DEL} && \
rm -fR /var/cache/apk/*

RUN mkdir -p $LARAVEL_APP_DIR && \
chown -R $USER_ID:$USER_ID $LARAVEL_APP_DIR

RUN chmod g+rw $LARASED_HOME && \
chown -R $USER_ID:$USER_ID $LARASED_HOME

USER $USER_ID
RUN curl -SsLo styleci.phar https://github.com/StyleCI/CLI/releases/download/v1.5.1/styleci.phar \
&& chmod +x styleci.phar && mv styleci.phar /usr/local/bin/styleci \
&& curl -L https://cs.symfony.com/download/php-cs-fixer-v3.phar -o php-cs-fixer \
&& mv php-cs-fixer /usr/local/bin/php-cs-fixer

VOLUME $LARASED_HOME/scripts
VOLUME $LARAVEL_APP_DIR
Expand Down
8 changes: 8 additions & 0 deletions DockerfileGo
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM golang:1.20-alpine
ENV GOOS linux
ENV CGO_ENABLED 0
RUN apk add --no-cache ca-certificates git
RUN git clone https://github.com/charmbracelet/gum.git
WORKDIR /go/gum
RUN go build -o gum
ENTRYPOINT ["/go/gum/gum"]
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build-dev:
depot --platform="linux/amd64" build --pull --load -t insane/larased .
15 changes: 8 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"type": "library",
"description": "Larased CLI",
"version": "0.0.4",
"scripts": {
"check-cs": ["vendor/bin/ecs check --ansi"],
"fix-cs": ["vendor/bin/ecs check --fix --ansi"]
},
"keywords": [
"laraboot",
"larased"
Expand Down Expand Up @@ -35,9 +39,9 @@
"symfony/polyfill-php72": "*"
},
"require": {
"php": "^7.3|^8.0",
"php": "^8.0|^8.3",
"symfony/console": "^5.2.0",
"nikic/php-parser": "4.10.4"
"nikic/php-parser": "^5.0"
},
"require-dev": {
"rector/rector": "^0.11",
Expand All @@ -49,10 +53,7 @@
"symfony/dotenv": "^5.2.0",
"symfony/yaml": "^5.2",
"symfony/phpunit-bridge": "^5.2.0",
"symfony/form": "^5.2.0",
"symfony/workflow": "^5.2.0",
"symfony/debug-bundle": "^5.2",
"symfony/maker-bundle": "^1.11",
"symplify/easy-coding-standard": "^9.3"

"symplify/easy-coding-standard": "^12.1"
}
}
Loading

0 comments on commit 4b78ecb

Please sign in to comment.