-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore / sync command, many improvements (#4)
* Add DI and commands for restoring and syncing * Remove the psalm direct dependency in favor of globally installing, fix dependencies to install on php 8 * Fix phpunit and psalm complaints * Github actions for quality (#3) * Test phpunit on 7.1 * Use different date format because of PHP support issue * Specify phpunit version * Keep trying to get 7.1 working * Better phpunit workflow * Try adding phpunit matcher * add PHPCS
- Loading branch information
1 parent
e090b57
commit 9957d56
Showing
114 changed files
with
7,389 additions
and
896 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!doctype html> | ||
<title>Site Maintenance</title> | ||
<style> | ||
html { overflow: hidden; background-color: #f1f1f1; } | ||
body { text-align: center; display: flex; flex-direction: column; justify-content: center; height: 100vh; } | ||
h1 { font-size: 50px; } | ||
body > article { font: 20px Helvetica, sans-serif; color: #333; height: 300px; } | ||
article { display: block; text-align: left; width: 650px; margin: 0 auto; } | ||
a { color: #dc8100; text-decoration: none; } | ||
a:hover { color: #333; text-decoration: none; } | ||
</style> | ||
|
||
<article> | ||
<h1>We’ll be back soon!</h1> | ||
<div> | ||
<p>We’re performing some maintenance at the moment, please check back soon</p> | ||
</div> | ||
</article> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Path-based git attributes | ||
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html | ||
|
||
# Ignore unneeded stuff "export-ignore". | ||
/.editorconfig export-ignore | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore | ||
/.phpstorm.meta.php export-ignore | ||
/.psalm export-ignore | ||
/.github export-ignore | ||
/ISSUE_TEMPLATE.md export-ignore | ||
/psalm.xml.dist export-ignore | ||
/phpunit.xml.dist export-ignore | ||
/tests export-ignore | ||
/docs export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: PHPCS | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
phpcs: | ||
name: PHPCS | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@releases/v2 | ||
with: | ||
php-version: 8.0 | ||
extensions: mbstring | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Install dependencies | ||
run: composer install --prefer-dist | ||
|
||
- name: Run PHPCS | ||
run: ./vendor/bin/phpcs --ignore=fixtures src tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: PHPUnit | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
phpunit: | ||
name: PHPUnit | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php: ['7.1', '8.0'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP with specific version of PECL extension | ||
uses: shivammathur/setup-php@releases/v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: mbstring | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Install dependencies | ||
run: composer install --prefer-dist | ||
|
||
- name: Configure matchers | ||
uses: mheap/phpunit-matcher-action@v1 | ||
|
||
- name: Run PHPUnit | ||
run: ./vendor/bin/phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Psalm | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
psalm: | ||
name: Psalm | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Psalm | ||
uses: docker://vimeo/psalm-github-actions | ||
with: | ||
security_analysis: true | ||
report_file: results.sarif | ||
|
||
- name: Upload Security Analysis results to GitHub | ||
uses: github/codeql-action/upload-sarif@v1 | ||
with: | ||
sarif_file: results.sarif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
.DS_Store | ||
.idea | ||
vendor | ||
vendor | ||
build | ||
composer.lock | ||
.phpunit.result.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
namespace PHPSTORM_META; | ||
|
||
use Concrete\Core\Application\Application; | ||
use Psr\Container\ContainerInterface; | ||
|
||
override(ContainerInterface::get(0), map([ | ||
'' => '@', | ||
])); | ||
override(Application::make(0), map([ | ||
'' => '@', | ||
])); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use PhpParser\Node\Expr; | ||
use PhpParser\Node\Expr\ClassConstFetch; | ||
use PhpParser\Node\Expr\MethodCall; | ||
use Psalm\Codebase; | ||
use Psalm\Context; | ||
use Psalm\Plugin\Hook\AfterMethodCallAnalysisInterface; | ||
use Psalm\StatementsSource; | ||
use Psalm\Type\Atomic\TNamedObject; | ||
use Psalm\Type\Union; | ||
use Psr\Container\ContainerInterface; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
final class PsrContainerChecker implements AfterMethodCallAnalysisInterface | ||
{ | ||
/** | ||
* @inheritDoc | ||
*/ | ||
public static function afterMethodCallAnalysis( | ||
Expr $expr, | ||
string $method_id, | ||
string $appearing_method_id, | ||
string $declaring_method_id, | ||
Context $context, | ||
StatementsSource $statements_source, | ||
Codebase $codebase, | ||
array &$file_replacements = [], | ||
?Union &$return_type_candidate = null | ||
): void { | ||
if (! $expr instanceof MethodCall || $return_type_candidate === null) { | ||
return; | ||
} | ||
|
||
[$className, $methodName] = explode('::', $declaring_method_id); | ||
|
||
if ($methodName !== 'get') { | ||
return; | ||
} | ||
|
||
if ( | ||
$className !== ContainerInterface::class | ||
&& ! $codebase->classImplements($className, ContainerInterface::class) | ||
) { | ||
return; | ||
} | ||
|
||
$arg = $expr->args[0] ?? null; | ||
if ($arg === null || ! $arg->value instanceof ClassConstFetch) { | ||
return; | ||
} | ||
|
||
$class = $arg->value->class; | ||
if (! $class->hasAttribute('resolvedName')) { | ||
return; | ||
} | ||
|
||
$return_type_candidate = new Union([ | ||
new TNamedObject( | ||
(string) $class->getAttribute('resolvedName') | ||
), | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<?php | ||
|
||
namespace Composer\Semver; | ||
|
||
use Composer\Semver\Constraint\Constraint; | ||
|
||
class Comparator | ||
{ | ||
/** | ||
* Evaluates the expression: $version1 > $version2. | ||
* | ||
* @param string $version1 | ||
* @param string $version2 | ||
* | ||
* @return bool | ||
* | ||
* @psalm-pure | ||
*/ | ||
public static function greaterThan($version1, $version2) | ||
{ | ||
} | ||
|
||
/** | ||
* Evaluates the expression: $version1 >= $version2. | ||
* | ||
* @param string $version1 | ||
* @param string $version2 | ||
* | ||
* @return bool | ||
* | ||
* @psalm-pure | ||
*/ | ||
public static function greaterThanOrEqualTo($version1, $version2) | ||
{ | ||
} | ||
|
||
/** | ||
* Evaluates the expression: $version1 < $version2. | ||
* | ||
* @param string $version1 | ||
* @param string $version2 | ||
* | ||
* @return bool | ||
* | ||
* @psalm-pure | ||
*/ | ||
public static function lessThan($version1, $version2) | ||
{ | ||
} | ||
|
||
/** | ||
* Evaluates the expression: $version1 <= $version2. | ||
* | ||
* @param string $version1 | ||
* @param string $version2 | ||
* | ||
* @return bool | ||
* | ||
* @psalm-pure | ||
*/ | ||
public static function lessThanOrEqualTo($version1, $version2) | ||
{ | ||
} | ||
|
||
/** | ||
* Evaluates the expression: $version1 == $version2. | ||
* | ||
* @param string $version1 | ||
* @param string $version2 | ||
* | ||
* @return bool | ||
* | ||
* @psalm-pure | ||
*/ | ||
public static function equalTo($version1, $version2) | ||
{ | ||
} | ||
|
||
/** | ||
* Evaluates the expression: $version1 != $version2. | ||
* | ||
* @param string $version1 | ||
* @param string $version2 | ||
* | ||
* @return bool | ||
* | ||
* @psalm-pure | ||
*/ | ||
public static function notEqualTo($version1, $version2) | ||
{ | ||
} | ||
|
||
/** | ||
* Evaluates the expression: $version1 $operator $version2. | ||
* | ||
* @param string $version1 | ||
* @param string $operator | ||
* @param string $version2 | ||
* | ||
* @return bool | ||
* | ||
* @psalm-pure | ||
*/ | ||
public static function compare($version1, $operator, $version2) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
|
||
/** | ||
* @method make(...$args): mixed | ||
*/ | ||
class Application {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
<cyan> ncreteconcreteconcreteconcreteconcre | ||
concreteconcreteconcreteconcreteconcrete | ||
<blue>|</blue> concreteconcr--econc teconcreteconcrete | ||
<blue>|</blue> concreteconc econ tecon.reteconcrete | ||
<blue>|</blue> concreteconc. econ teco :eteconcrete | ||
<blue>|</blue> concre- .oncr con tec. reteconcrete | ||
<blue>|</blue> concret :ncr con. tec 'reteconcrete | ||
<blue>|</blue> concret: ncr: conc .te. creteconcrete | ||
<blue>|</blue> concrete. :cret conc ete ncreteconcrete | ||
<blue>|</blue> concreteco re:. .:oncreteconcrete | ||
<blue>|</blue> concretecon . . . .ncre..concrete | ||
<blue>|</blue> concreteco .concreteconc. .oncrete | ||
<blue>|</blue> concretec econcreteco. econcrete | ||
<blue>|</blue> concretec: :concrete. :teconcrete | ||
<blue>|</blue> concreteco: .ncr. :reteconcrete | ||
<blue>|</blue> concreteconcr:. .oncreteconcrete | ||
<blue>|</blue> concreteconcreteconcreteconcreteconcrete | ||
<blue>\ </blue>oncreteconcreteconcreteconcreteconcre | ||
<blue>----------------------------------</blue></cyan> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
<fg=cyan> ncreteconcreteconcreteconcreteconcre | ||
concreteconcreteconcreteconcreteconcrete | ||
<fg=blue>|</> concreteconcr--econc teconcreteconcrete | ||
<fg=blue>|</> concreteconc econ tecon.reteconcrete | ||
<fg=blue>|</> concreteconc. econ teco :eteconcrete | ||
<fg=blue>|</> concre- .oncr con tec. reteconcrete | ||
<fg=blue>|</> concret :ncr con. tec 'reteconcrete | ||
<fg=blue>|</> concret: ncr: conc .te. creteconcrete | ||
<fg=blue>|</> concrete. :cret conc ete ncreteconcrete | ||
<fg=blue>|</> concreteco re:. .:oncreteconcrete | ||
<fg=blue>|</> concretecon . . . .ncre..concrete | ||
<fg=blue>|</> concreteco .concreteconc. .oncrete | ||
<fg=blue>|</> concretec econcreteco. econcrete | ||
<fg=blue>|</> concretec: :concrete. :teconcrete | ||
<fg=blue>|</> concreteco: .ncr. :reteconcrete | ||
<fg=blue>|</> concreteconcr:. .oncreteconcrete | ||
<fg=blue>|</> concreteconcreteconcreteconcreteconcrete | ||
<fg=blue>\ </>oncreteconcreteconcreteconcreteconcre | ||
<fg=blue>----------------------------------</></> |
Oops, something went wrong.