Skip to content

Commit 83ad27a

Browse files
authored
v1.0.3 (#4)
* chore: Add compatibility with Acorn v2.0.0 * chore(ci): Move to GitHub actions * chore(git): Update .gitignore and .gitattributes * chore(deps): Bump dependencies
1 parent 7045801 commit 83ad27a

File tree

9 files changed

+112
-66
lines changed

9 files changed

+112
-66
lines changed

.circleci/config.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
/.gitattributes export-ignore
22
/.github export-ignore
3-
/.circleci export-ignore

.github/workflows/main.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Main
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
php:
13+
name: PHP ${{ matrix.php }}
14+
runs-on: ubuntu-latest
15+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
16+
strategy:
17+
matrix:
18+
php: ["7.3"]
19+
20+
steps:
21+
- name: Checkout the project
22+
uses: actions/checkout@v2
23+
24+
- name: Setup the PHP ${{ matrix.php }} environment on ${{ runner.os }}
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php }}
28+
coverage: xdebug
29+
env:
30+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Restore the Composer cache directory
33+
id: composercache
34+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
35+
36+
- uses: actions/cache@v2
37+
with:
38+
path: ${{ steps.composercache.outputs.dir }}
39+
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
40+
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-
41+
42+
- name: Install Composer dependencies
43+
run: composer install --no-progress --prefer-dist --optimize-autoloader --no-suggest
44+
45+
- name: Execute the PHP lint script
46+
run: composer run-script lint

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
vendor
1+
/vendor

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Brandon Nifong
3+
Copyright (c) Brandon Nifong
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Sage HTML Forms
22

33
![Latest Stable Version](https://img.shields.io/packagist/v/log1x/sage-html-forms?style=flat-square)
4-
![Build Status](https://img.shields.io/circleci/build/github/Log1x/sage-html-forms?style=flat-square)
54
![Total Downloads](https://img.shields.io/packagist/dt/log1x/sage-html-forms?style=flat-square)
5+
![Build Status](https://img.shields.io/github/workflow/status/log1x/sage-html-forms/Main?style=flat-square)
66

77
This is a simple package for the [HTML Forms](https://github.com/ibericode/html-forms) plugin that allows you to easily render forms using a corresponding Blade view (if one is present) with Sage 10.
88

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
}
2525
},
2626
"require": {
27-
"php": ">=7.2"
27+
"php": "^7.3|^8.0"
2828
},
2929
"require-dev": {
30-
"squizlabs/php_codesniffer": "^3.4"
30+
"squizlabs/php_codesniffer": "^3.5"
3131
},
3232
"extra": {
3333
"acorn": {

composer.lock

Lines changed: 13 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Console/FormMakeCommand.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,54 @@ protected function summary()
122122
$this->line(" ⮑ <fg=blue>{$this->shortenPath($this->getView(), 4)}</>");
123123
}
124124

125+
/**
126+
* Clear the current line in console output.
127+
*
128+
* @return Command
129+
*/
130+
public function clearLine()
131+
{
132+
if (! $this->output->isDecorated()) {
133+
$this->output->writeln('');
134+
135+
return $this;
136+
}
137+
138+
$this->output->write("\x0D");
139+
$this->output->write("\x1B[2K");
140+
141+
return $this;
142+
}
143+
144+
/**
145+
* Run a task in the console.
146+
*
147+
* @param string $title
148+
* @param callable|null $task
149+
* @param string $status
150+
* @return mixed
151+
*/
152+
protected function task($title, $task = null, $status = '...')
153+
{
154+
$title = Str::start($title, '<fg=blue;options=bold>➡</> ');
155+
156+
if (! $task) {
157+
return $this->output->write("{$title}: <info>✔</info>");
158+
}
159+
160+
$this->output->write("{$title}: <comment>{$status}</comment>");
161+
162+
try {
163+
$status = $task() !== false;
164+
} catch (\Exception $e) {
165+
$this->clearLine()->line("{$title}: <fg=red;options=bold>x</>");
166+
167+
throw $e;
168+
}
169+
170+
$this->clearLine()->line("{$title}: " . ($status ? '<info>✔</info>' : '<fg=red;options=bold>x</>'));
171+
}
172+
125173
/**
126174
* Returns a shortened path.
127175
*

0 commit comments

Comments
 (0)