Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
set dotenv-load := false
set positional-arguments

export COLUMNS := '550'

default:
@just --list

php := "/usr/bin/php7.4"
composer := "/usr/bin/php7.4 composer"

cli *args='':
{{ php }} bin/console "$@"

phpstan *args='':
{{ php }} vendor/bin/phpstan "${@}"

watch-phpstan *args='':
find src/ test/ -name '*.php' | entr {{ php }} vendor/bin/phpstan "${@}"

phpunit *args='':
cd test && {{ php }} ../vendor/bin/phpunit "${@}"

composer *args='':
{{ composer }} "${@}"

units:
j phpunit --exclude-group=integration

prep:
j phpstan
j phpunit


8 changes: 5 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

"config": {
"platform": {
"php": "7.2"
"php": "7.4"
},
"allow-plugins": {
"composer/package-versions-deprecated": true
Expand All @@ -29,14 +29,16 @@
"require": {
"ext-json": "*",
"ext-curl": "*",
"php": ">=7.2"
"php": ">=7.4"
},
"require-dev": {
"phpunit/phpunit": "^8.5",
"phake/phake": "^4.5",
"hamcrest/hamcrest-php": "^2.0",
"phpdocumentor/reflection-docblock": "^5.3",
"phpdocumentor/type-resolver": "^1.6"
"phpdocumentor/type-resolver": "^1.6",
"phpstan/phpstan": "^2.0.0",
"phpstan/phpstan-phpunit": "^2.0"
},

"suggest": {
Expand Down
117 changes: 114 additions & 3 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions config/phpstan/Hamcrest/AnyOf.stub
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my next Project is then to type Hamcrest ;)

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

namespace Hamcrest\Core;

class AnyOf implements \Hamcrest\Matcher
{}
11 changes: 11 additions & 0 deletions config/phpstan/Hamcrest/Arrays/IsArrayContainingKey.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace Hamcrest\Arrays;

use Hamcrest\TypeSafeMatcher;

class IsArrayContainingKey extends TypeSafeMatcher
{}

class IsArrayWithSize extends \Hamcrest\FeatureMatcher
{}
8 changes: 8 additions & 0 deletions config/phpstan/Hamcrest/BaseMatcher.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Hamcrest;

abstract class BaseMatcher implements Matcher
{
public function describeMismatch(mixed $item, Description $description): void {}
}
6 changes: 6 additions & 0 deletions config/phpstan/Hamcrest/Description.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

namespace Hamcrest;

interface Description
{}
6 changes: 6 additions & 0 deletions config/phpstan/Hamcrest/FeatureMatcher.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

namespace Hamcrest;

abstract class FeatureMatcher extends TypeSafeDiagnosingMatcher
{}
8 changes: 8 additions & 0 deletions config/phpstan/Hamcrest/IsAnything.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Hamcrest\Core;

use Hamcrest\BaseMatcher;

class IsAnything extends BaseMatcher
{}
8 changes: 8 additions & 0 deletions config/phpstan/Hamcrest/IsEqual.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Hamcrest\Core;

use Hamcrest\BaseMatcher;

class IsEqual extends BaseMatcher
{}
6 changes: 6 additions & 0 deletions config/phpstan/Hamcrest/IsIdentical.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

namespace Hamcrest\Core;

class IsIdentical implements \Hamcrest\Matcher
{}
6 changes: 6 additions & 0 deletions config/phpstan/Hamcrest/IsInstanceOf.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

namespace Hamcrest\Core;

class IsInstanceOf implements \Hamcrest\Matcher
{}
8 changes: 8 additions & 0 deletions config/phpstan/Hamcrest/IsNonEmptyString.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Hamcrest\Text;

use Hamcrest\TypeSafeMatcher;

class IsNonEmptyString extends TypeSafeMatcher
{}
8 changes: 8 additions & 0 deletions config/phpstan/Hamcrest/IsNot.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Hamcrest\Core;

use Hamcrest\BaseMatcher;

class IsNot extends BaseMatcher
{}
8 changes: 8 additions & 0 deletions config/phpstan/Hamcrest/IsTypeOf.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Hamcrest\Core;

use Hamcrest\BaseMatcher;

class IsTypeOf extends BaseMatcher
{}
9 changes: 9 additions & 0 deletions config/phpstan/Hamcrest/Matcher.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace Hamcrest;

interface Matcher extends SelfDescribing
{
public function matches(mixed $item): bool;
public function describeMismatch(mixed $item, Description $description): void;
}
77 changes: 77 additions & 0 deletions config/phpstan/Hamcrest/Matchers.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php
namespace Hamcrest;

class Matchers
{
/**
* @return \Hamcrest\Core\IsEqual
*/
public static function equalTo(mixed $item)
{}

/**
* @return \Hamcrest\Core\AnyOf
*/
public static function anyOf(/* args... */)
{}

/**
* @return \Hamcrest\Core\IsTypeOf
*/
public static function typeOf(mixed $item)
{}

/**
* @return \Hamcrest\Core\IsIdentical
*/
public static function identicalTo(mixed $item)
{}

/**
* @return \Hamcrest\Arrays\IsArrayContainingKey
*/
public static function hasKeyInArray(mixed $keyMatcher)
{}

/**
* @return \Hamcrest\Core\IsAnything
*/
public static function anObject()
{}

/**
* @return \Hamcrest\Core\IsNot
*/
public static function not(mixed $matcher)
{}

/**
* @return \Hamcrest\Text\IsEmptyString
*/
public static function nonEmptyString()
{}

/**
* @return \Hamcrest\Text\StringContains
*/
public static function containsString(mixed $substring)
{}

/**
* @return \Hamcrest\Arrays\IsArrayWithSize
*/
public static function arrayWithSize(mixed $sizeMatcher)
{}

/**
* @return \Hamcrest\Text\IsEmptyString
*/
public static function isNonEmptyString()
{}

/**
* @return \Hamcrest\Core\IsInstanceOf
*/
public static function anInstanceOf(mixed $className)
{}
}
Loading