Skip to content

Commit

Permalink
Merge branch 'release/v0.2.3' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
betterthanclay committed Sep 27, 2022
2 parents ca3e3a7 + 38090ad commit f486bce
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v0.2.3 (2022-09-27)
* Updated Veneer stub
* Updated composer check script

## v0.2.2 (2022-09-27)
* Updated Veneer dependency
* Updated CI environment
Expand Down
14 changes: 10 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"require": {
"php": "^8.0",

"decodelabs/veneer": "^0.10",
"decodelabs/exceptional": "^0.4"
"decodelabs/exceptional": "^0.4",
"decodelabs/veneer": "^0.10.7"
},
"require-dev": {
"phpunit/phpunit": "^9",
Expand All @@ -21,7 +21,9 @@
"php-parallel-lint/php-parallel-lint": "^1.3",
"symplify/easy-coding-standard": "^11",

"decodelabs/phpstan-decodelabs": "^0.6"
"decodelabs/phpstan-decodelabs": "^0.6",
"decodelabs/atlas": "^0.10.4",
"decodelabs/terminus": "^0.8.4"
},
"autoload": {
"psr-4": {
Expand All @@ -43,16 +45,20 @@
},
"scripts": {
"analyze": "phpstan analyze --no-progress",
"clear-phpstan": "phpstan clear-result-cache",
"ecs": "ecs check --no-progress-bar",
"ecs-fix": "ecs check --no-progress-bar --fix",
"lint": "parallel-lint src/ stubs/ ecs.php",
"eclint": "eclint check src/ stubs/ ecs.php",
"eclint-fix": "eclint fix src/ stubs/ ecs.php",
"non-ascii": "! LC_ALL=C.UTF-8 find src/ -type f -name \"*.php\" -print0 | xargs -0 -- grep -PHn \"[^ -~]\" | grep -v '// @ignore-non-ascii$'",
"veneer-stub": "vendor/bin/veneer-stub",
"check": [
"@composer update",
"@veneer-stub",
"@clear-phpstan",
"@analyze",
"@ecs",
"@ecs-fix",
"@lint",
"@eclint",
"@non-ascii"
Expand Down
27 changes: 24 additions & 3 deletions stubs/DecodeLabs/Typify.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,30 @@
* It should not be included in your projects.
*/
namespace DecodeLabs;

use DecodeLabs\Veneer\Proxy;
use DecodeLabs\Veneer\ProxyTrait;
use DecodeLabs\Typify\Detector as Inst;
class Typify implements Proxy { use ProxyTrait;
const VENEER = 'Typify';
const VENEER_TARGET = Inst::class;};

class Typify implements Proxy
{
use ProxyTrait;

const VENEER = 'DecodeLabs\Typify';
const VENEER_TARGET = Inst::class;

public static Inst $instance;

public static function detect(string $path, string $default = 'application/octet-stream'): string {
return static::$instance->detect(...func_get_args());
}
public static function getTypeFor(string $extension, ?string $default = NULL): ?string {
return static::$instance->getTypeFor(...func_get_args());
}
public static function getExtensionFor(string $type): ?string {
return static::$instance->getExtensionFor(...func_get_args());
}
public static function getExtensionsFor(string $type): array {
return static::$instance->getExtensionsFor(...func_get_args());
}
};

0 comments on commit f486bce

Please sign in to comment.